@keystrokehq/platform 0.1.2 → 0.1.3

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.
Files changed (310) hide show
  1. package/dist/{awk2-LA3USKJP-Ddh1vPYe.cjs → awk2-LA3USKJP-BE8esz9o.cjs} +40 -40
  2. package/dist/{awk2-LA3USKJP-Ddh1vPYe.cjs.map → awk2-LA3USKJP-BE8esz9o.cjs.map} +1 -1
  3. package/dist/{awk2-LA3USKJP-C4BD4eVg.mjs → awk2-LA3USKJP-CU79F18c.mjs} +2 -2
  4. package/dist/{awk2-LA3USKJP-C4BD4eVg.mjs.map → awk2-LA3USKJP-CU79F18c.mjs.map} +1 -1
  5. package/dist/{base64-C2AIWVNC-BaiY8WTm.cjs → base64-C2AIWVNC-CGFeI4Fm.cjs} +2 -2
  6. package/dist/{base64-C2AIWVNC-BaiY8WTm.cjs.map → base64-C2AIWVNC-CGFeI4Fm.cjs.map} +1 -1
  7. package/dist/{base64-C2AIWVNC-ChQw62cb.mjs → base64-C2AIWVNC-ESsdavRZ.mjs} +2 -2
  8. package/dist/{base64-C2AIWVNC-ChQw62cb.mjs.map → base64-C2AIWVNC-ESsdavRZ.mjs.map} +1 -1
  9. package/dist/{bash-YZ33HQZQ-Y0B3uk-_.mjs → bash-YZ33HQZQ-Tqw_IzZM.mjs} +2 -2
  10. package/dist/{bash-YZ33HQZQ-Y0B3uk-_.mjs.map → bash-YZ33HQZQ-Tqw_IzZM.mjs.map} +1 -1
  11. package/dist/{bash-YZ33HQZQ-CSOYNHWg.cjs → bash-YZ33HQZQ-Z8YFnXLG.cjs} +5 -5
  12. package/dist/{bash-YZ33HQZQ-CSOYNHWg.cjs.map → bash-YZ33HQZQ-Z8YFnXLG.cjs.map} +1 -1
  13. package/dist/{cat-TSFMZVYS-DA84HtAp.cjs → cat-TSFMZVYS-3tq36V6U.cjs} +3 -3
  14. package/dist/{cat-TSFMZVYS-DA84HtAp.cjs.map → cat-TSFMZVYS-3tq36V6U.cjs.map} +1 -1
  15. package/dist/{cat-TSFMZVYS-xDkdXP7N.mjs → cat-TSFMZVYS-B-Qi4MIN.mjs} +3 -3
  16. package/dist/{cat-TSFMZVYS-xDkdXP7N.mjs.map → cat-TSFMZVYS-B-Qi4MIN.mjs.map} +1 -1
  17. package/dist/{chunk-5H5SCKJM-CH5cUv3d.cjs → chunk-5H5SCKJM-DG2zdmBl.cjs} +32 -32
  18. package/dist/{chunk-5H5SCKJM-CH5cUv3d.cjs.map → chunk-5H5SCKJM-DG2zdmBl.cjs.map} +1 -1
  19. package/dist/{chunk-5H5SCKJM-CS7KORUE.mjs → chunk-5H5SCKJM-jzOek3RA.mjs} +2 -2
  20. package/dist/{chunk-5H5SCKJM-CS7KORUE.mjs.map → chunk-5H5SCKJM-jzOek3RA.mjs.map} +1 -1
  21. package/dist/{chunk-AQ6FYS2X-CmF-1vT3.mjs → chunk-AQ6FYS2X-Bz4Sl0he.mjs} +2 -2
  22. package/dist/{chunk-AQ6FYS2X-CmF-1vT3.mjs.map → chunk-AQ6FYS2X-Bz4Sl0he.mjs.map} +1 -1
  23. package/dist/{chunk-AQ6FYS2X-BHfS6zKK.cjs → chunk-AQ6FYS2X-CWRY3oXA.cjs} +3 -3
  24. package/dist/{chunk-AQ6FYS2X-BHfS6zKK.cjs.map → chunk-AQ6FYS2X-CWRY3oXA.cjs.map} +1 -1
  25. package/dist/{chunk-CHFEPBH4-BeM01F0F.cjs → chunk-CHFEPBH4-BjRBtKoa.cjs} +3 -3
  26. package/dist/{chunk-CHFEPBH4-BeM01F0F.cjs.map → chunk-CHFEPBH4-BjRBtKoa.cjs.map} +1 -1
  27. package/dist/{chunk-CHFEPBH4-C7eTbJVK.mjs → chunk-CHFEPBH4-Cg_Ca4ca.mjs} +2 -2
  28. package/dist/{chunk-CHFEPBH4-C7eTbJVK.mjs.map → chunk-CHFEPBH4-Cg_Ca4ca.mjs.map} +1 -1
  29. package/dist/{chunk-EBAPSGAO-BZyQwwNU.mjs → chunk-EBAPSGAO-BAjudTzg.mjs} +2 -2
  30. package/dist/{chunk-EBAPSGAO-BZyQwwNU.mjs.map → chunk-EBAPSGAO-BAjudTzg.mjs.map} +1 -1
  31. package/dist/{chunk-EBAPSGAO-fp1lOUs3.cjs → chunk-EBAPSGAO-TuSvdjDg.cjs} +3 -3
  32. package/dist/{chunk-EBAPSGAO-fp1lOUs3.cjs.map → chunk-EBAPSGAO-TuSvdjDg.cjs.map} +1 -1
  33. package/dist/{chunk-LEKBROJD-DgEXP_ty.mjs → chunk-LEKBROJD-B7WoDbJJ.mjs} +2 -2
  34. package/dist/{chunk-LEKBROJD-DgEXP_ty.mjs.map → chunk-LEKBROJD-B7WoDbJJ.mjs.map} +1 -1
  35. package/dist/{chunk-LEKBROJD-CC4SPOIA.cjs → chunk-LEKBROJD-VngQ-bGK.cjs} +17 -17
  36. package/dist/{chunk-LEKBROJD-CC4SPOIA.cjs.map → chunk-LEKBROJD-VngQ-bGK.cjs.map} +1 -1
  37. package/dist/{chunk-VPADYNBD-DypZmvfB.mjs → chunk-VPADYNBD-B7JoVwJq.mjs} +2 -2
  38. package/dist/{chunk-VPADYNBD-DypZmvfB.mjs.map → chunk-VPADYNBD-B7JoVwJq.mjs.map} +1 -1
  39. package/dist/{chunk-VPADYNBD-CuU1_5VT.cjs → chunk-VPADYNBD-Ju6wgxLY.cjs} +3 -3
  40. package/dist/{chunk-VPADYNBD-CuU1_5VT.cjs.map → chunk-VPADYNBD-Ju6wgxLY.cjs.map} +1 -1
  41. package/dist/{chunk-YCLFEX4T-D4AWfbT8.cjs → chunk-YCLFEX4T-81Ii8Wlf.cjs} +3 -3
  42. package/dist/{chunk-YCLFEX4T-D4AWfbT8.cjs.map → chunk-YCLFEX4T-81Ii8Wlf.cjs.map} +1 -1
  43. package/dist/{chunk-YCLFEX4T-B5a3ihBC.mjs → chunk-YCLFEX4T-BoIwWBSQ.mjs} +2 -2
  44. package/dist/{chunk-YCLFEX4T-B5a3ihBC.mjs.map → chunk-YCLFEX4T-BoIwWBSQ.mjs.map} +1 -1
  45. package/dist/{column-XT6UFXNQ-B3nI2VCJ.mjs → column-XT6UFXNQ-B8RfIkpb.mjs} +2 -2
  46. package/dist/{column-XT6UFXNQ-B3nI2VCJ.mjs.map → column-XT6UFXNQ-B8RfIkpb.mjs.map} +1 -1
  47. package/dist/{column-XT6UFXNQ-D-31htgy.cjs → column-XT6UFXNQ-ieIKmRkh.cjs} +4 -4
  48. package/dist/{column-XT6UFXNQ-D-31htgy.cjs.map → column-XT6UFXNQ-ieIKmRkh.cjs.map} +1 -1
  49. package/dist/{comm-VV2LDX2J-CSfuzlYr.cjs → comm-VV2LDX2J-CdE-OYeG.cjs} +3 -3
  50. package/dist/{comm-VV2LDX2J-CSfuzlYr.cjs.map → comm-VV2LDX2J-CdE-OYeG.cjs.map} +1 -1
  51. package/dist/{comm-VV2LDX2J-DpNYwHST.mjs → comm-VV2LDX2J-DEKxgGlr.mjs} +2 -2
  52. package/dist/{comm-VV2LDX2J-DpNYwHST.mjs.map → comm-VV2LDX2J-DEKxgGlr.mjs.map} +1 -1
  53. package/dist/{config-PWJeAlTn.d.cts → config-C78TqlE1.d.cts} +3 -2
  54. package/dist/{config-Ck1BY0Ga.d.mts → config-CXBff_fs.d.mts} +3 -2
  55. package/dist/config.cjs +3 -2
  56. package/dist/config.cjs.map +1 -1
  57. package/dist/config.d.cts +1 -1
  58. package/dist/config.d.mts +1 -1
  59. package/dist/config.mjs +3 -2
  60. package/dist/config.mjs.map +1 -1
  61. package/dist/{cp-BISAAS7A-CPlXYVs4.cjs → cp-BISAAS7A-C1ygPb-h.cjs} +3 -3
  62. package/dist/{cp-BISAAS7A-CPlXYVs4.cjs.map → cp-BISAAS7A-C1ygPb-h.cjs.map} +1 -1
  63. package/dist/{cp-BISAAS7A-BHfTBk1S.mjs → cp-BISAAS7A-CMVh32j_.mjs} +2 -2
  64. package/dist/{cp-BISAAS7A-BHfTBk1S.mjs.map → cp-BISAAS7A-CMVh32j_.mjs.map} +1 -1
  65. package/dist/{cut-OKARJCCV-CgfLOcVz.mjs → cut-OKARJCCV-CluNzLiu.mjs} +3 -3
  66. package/dist/{cut-OKARJCCV-CgfLOcVz.mjs.map → cut-OKARJCCV-CluNzLiu.mjs.map} +1 -1
  67. package/dist/{cut-OKARJCCV-Ci0PtEgB.cjs → cut-OKARJCCV-S-g4hG3d.cjs} +4 -4
  68. package/dist/{cut-OKARJCCV-Ci0PtEgB.cjs.map → cut-OKARJCCV-S-g4hG3d.cjs.map} +1 -1
  69. package/dist/{diff-MWJFIG7X-CJdAnnog.mjs → diff-MWJFIG7X-CuSut3C1.mjs} +2 -2
  70. package/dist/{diff-MWJFIG7X-CJdAnnog.mjs.map → diff-MWJFIG7X-CuSut3C1.mjs.map} +1 -1
  71. package/dist/{diff-MWJFIG7X-F82OACp-.cjs → diff-MWJFIG7X-Xtqp7FtF.cjs} +4 -4
  72. package/dist/{diff-MWJFIG7X-F82OACp-.cjs.map → diff-MWJFIG7X-Xtqp7FtF.cjs.map} +1 -1
  73. package/dist/{start-DmsuxtBI.mjs → dist-70NUfApd.mjs} +3193 -7428
  74. package/dist/dist-70NUfApd.mjs.map +1 -0
  75. package/dist/{start-Cm1hxyF_.cjs → dist-D1Iv7_7S.cjs} +4161 -7622
  76. package/dist/dist-D1Iv7_7S.cjs.map +1 -0
  77. package/dist/{du-572XNP42-D6bH6wn1.mjs → du-572XNP42-BTLDH4CK.mjs} +2 -2
  78. package/dist/{du-572XNP42-D6bH6wn1.mjs.map → du-572XNP42-BTLDH4CK.mjs.map} +1 -1
  79. package/dist/{du-572XNP42-BnHmg4U2.cjs → du-572XNP42-f68GOB47.cjs} +2 -2
  80. package/dist/{du-572XNP42-BnHmg4U2.cjs.map → du-572XNP42-f68GOB47.cjs.map} +1 -1
  81. package/dist/{env-36M5BO7M-a702Fh7w.mjs → env-36M5BO7M-CjuGiDaW.mjs} +2 -2
  82. package/dist/{env-36M5BO7M-a702Fh7w.mjs.map → env-36M5BO7M-CjuGiDaW.mjs.map} +1 -1
  83. package/dist/{env-36M5BO7M-BxusWRsf.cjs → env-36M5BO7M-DHcnOUrA.cjs} +3 -3
  84. package/dist/{env-36M5BO7M-BxusWRsf.cjs.map → env-36M5BO7M-DHcnOUrA.cjs.map} +1 -1
  85. package/dist/{expand-JSPG6VOP-DjHywCfM.cjs → expand-JSPG6VOP-BAEvLz6y.cjs} +3 -3
  86. package/dist/{expand-JSPG6VOP-DjHywCfM.cjs.map → expand-JSPG6VOP-BAEvLz6y.cjs.map} +1 -1
  87. package/dist/{expand-JSPG6VOP-BbtpP_uq.mjs → expand-JSPG6VOP-Cmm7S480.mjs} +2 -2
  88. package/dist/{expand-JSPG6VOP-BbtpP_uq.mjs.map → expand-JSPG6VOP-Cmm7S480.mjs.map} +1 -1
  89. package/dist/{expr-5JAACS4X-Df3xFZ4w.cjs → expr-5JAACS4X-BFLtaqNy.cjs} +5 -5
  90. package/dist/{expr-5JAACS4X-Df3xFZ4w.cjs.map → expr-5JAACS4X-BFLtaqNy.cjs.map} +1 -1
  91. package/dist/{expr-5JAACS4X-Cp_dIjlS.mjs → expr-5JAACS4X-C3PXSs0i.mjs} +2 -2
  92. package/dist/{expr-5JAACS4X-Cp_dIjlS.mjs.map → expr-5JAACS4X-C3PXSs0i.mjs.map} +1 -1
  93. package/dist/{find-INTH3OLC-B5hj2iWq.cjs → find-INTH3OLC-Bf3-4Zi2.cjs} +7 -7
  94. package/dist/{find-INTH3OLC-B5hj2iWq.cjs.map → find-INTH3OLC-Bf3-4Zi2.cjs.map} +1 -1
  95. package/dist/{find-INTH3OLC-DorC8D7k.mjs → find-INTH3OLC-D6wBmhsd.mjs} +3 -3
  96. package/dist/{find-INTH3OLC-DorC8D7k.mjs.map → find-INTH3OLC-D6wBmhsd.mjs.map} +1 -1
  97. package/dist/{fold-4TQNYMSW-DU7ysgn3.cjs → fold-4TQNYMSW-BIl_iV0S.cjs} +3 -3
  98. package/dist/{fold-4TQNYMSW-DU7ysgn3.cjs.map → fold-4TQNYMSW-BIl_iV0S.cjs.map} +1 -1
  99. package/dist/{fold-4TQNYMSW-DOzlyQla.mjs → fold-4TQNYMSW-BVCyD8C0.mjs} +2 -2
  100. package/dist/{fold-4TQNYMSW-DOzlyQla.mjs.map → fold-4TQNYMSW-BVCyD8C0.mjs.map} +1 -1
  101. package/dist/{grep-V3LQVMRQ-C7va-nQQ.mjs → grep-V3LQVMRQ-BLwElJ9a.mjs} +4 -4
  102. package/dist/{grep-V3LQVMRQ-C7va-nQQ.mjs.map → grep-V3LQVMRQ-BLwElJ9a.mjs.map} +1 -1
  103. package/dist/{grep-V3LQVMRQ-CnT0y0-P.cjs → grep-V3LQVMRQ-BcfmH0yO.cjs} +5 -5
  104. package/dist/{grep-V3LQVMRQ-CnT0y0-P.cjs.map → grep-V3LQVMRQ-BcfmH0yO.cjs.map} +1 -1
  105. package/dist/{gzip-O5ASJAFY-Dwnbh7Hd.cjs → gzip-O5ASJAFY-B9ermjPq.cjs} +2 -2
  106. package/dist/{gzip-O5ASJAFY-Dwnbh7Hd.cjs.map → gzip-O5ASJAFY-B9ermjPq.cjs.map} +1 -1
  107. package/dist/{gzip-O5ASJAFY-D25F69KM.mjs → gzip-O5ASJAFY-BjVFU42g.mjs} +2 -2
  108. package/dist/{gzip-O5ASJAFY-D25F69KM.mjs.map → gzip-O5ASJAFY-BjVFU42g.mjs.map} +1 -1
  109. package/dist/{head-442HYESI-W6FegHpm.mjs → head-442HYESI-BGRcjEMI.mjs} +2 -2
  110. package/dist/{head-442HYESI-W6FegHpm.mjs.map → head-442HYESI-BGRcjEMI.mjs.map} +1 -1
  111. package/dist/{head-442HYESI-Dh7Qcjzs.cjs → head-442HYESI-_RXn0SBi.cjs} +2 -2
  112. package/dist/{head-442HYESI-Dh7Qcjzs.cjs.map → head-442HYESI-_RXn0SBi.cjs.map} +1 -1
  113. package/dist/{help-HZ6M2CKN-B2mT_z-L.mjs → help-HZ6M2CKN-BCHt7Yu_.mjs} +2 -2
  114. package/dist/{help-HZ6M2CKN-B2mT_z-L.mjs.map → help-HZ6M2CKN-BCHt7Yu_.mjs.map} +1 -1
  115. package/dist/{help-HZ6M2CKN-pRM3zbwR.cjs → help-HZ6M2CKN-DJP0l3xk.cjs} +3 -3
  116. package/dist/{help-HZ6M2CKN-pRM3zbwR.cjs.map → help-HZ6M2CKN-DJP0l3xk.cjs.map} +1 -1
  117. package/dist/{html-to-markdown-JW4MSQZO-VzjAEp3C.mjs → html-to-markdown-JW4MSQZO-Dq7eYKW0.mjs} +2 -2
  118. package/dist/{html-to-markdown-JW4MSQZO-VzjAEp3C.mjs.map → html-to-markdown-JW4MSQZO-Dq7eYKW0.mjs.map} +1 -1
  119. package/dist/{html-to-markdown-JW4MSQZO-CD4oQKoL.cjs → html-to-markdown-JW4MSQZO-yoaOs45E.cjs} +3 -4
  120. package/dist/{html-to-markdown-JW4MSQZO-CD4oQKoL.cjs.map → html-to-markdown-JW4MSQZO-yoaOs45E.cjs.map} +1 -1
  121. package/dist/{join-TBRGI3LQ-DR2e5mf6.cjs → join-TBRGI3LQ-BOS3zpbh.cjs} +4 -4
  122. package/dist/{join-TBRGI3LQ-DR2e5mf6.cjs.map → join-TBRGI3LQ-BOS3zpbh.cjs.map} +1 -1
  123. package/dist/{join-TBRGI3LQ-CC2R6oH8.mjs → join-TBRGI3LQ-BU7FYSK3.mjs} +2 -2
  124. package/dist/{join-TBRGI3LQ-CC2R6oH8.mjs.map → join-TBRGI3LQ-BU7FYSK3.mjs.map} +1 -1
  125. package/dist/{jq-4XLYLOS5-CKdOTiVR.cjs → jq-4XLYLOS5-C-4KbpIO.cjs} +13 -13
  126. package/dist/{jq-4XLYLOS5-CKdOTiVR.cjs.map → jq-4XLYLOS5-C-4KbpIO.cjs.map} +1 -1
  127. package/dist/{jq-4XLYLOS5-QOU61AvR.mjs → jq-4XLYLOS5-tfCBGz19.mjs} +4 -4
  128. package/dist/{jq-4XLYLOS5-QOU61AvR.mjs.map → jq-4XLYLOS5-tfCBGz19.mjs.map} +1 -1
  129. package/dist/{js-exec-N5KEZBH7-8xgWmlL7.cjs → js-exec-N5KEZBH7--5grqRpb.cjs} +13 -13
  130. package/dist/{js-exec-N5KEZBH7-8xgWmlL7.cjs.map → js-exec-N5KEZBH7--5grqRpb.cjs.map} +1 -1
  131. package/dist/{js-exec-N5KEZBH7-CrHAJDpT.mjs → js-exec-N5KEZBH7-C5C01q6k.mjs} +3 -3
  132. package/dist/{js-exec-N5KEZBH7-CrHAJDpT.mjs.map → js-exec-N5KEZBH7-C5C01q6k.mjs.map} +1 -1
  133. package/dist/{lib-DecFXHrv.mjs → lib-CNke9ACR.mjs} +2 -2
  134. package/dist/{lib-DecFXHrv.mjs.map → lib-CNke9ACR.mjs.map} +1 -1
  135. package/dist/{lib-DLRZ2u6t.cjs → lib-CW0fuh-i.cjs} +2 -2
  136. package/dist/{lib-DLRZ2u6t.cjs.map → lib-CW0fuh-i.cjs.map} +1 -1
  137. package/dist/{ln-4LGSXXGD-DxTw2TAq.cjs → ln-4LGSXXGD-B0nikKzZ.cjs} +3 -3
  138. package/dist/{ln-4LGSXXGD-DxTw2TAq.cjs.map → ln-4LGSXXGD-B0nikKzZ.cjs.map} +1 -1
  139. package/dist/{ln-4LGSXXGD-Or1qYweN.mjs → ln-4LGSXXGD-Cy8gNPMC.mjs} +2 -2
  140. package/dist/{ln-4LGSXXGD-Or1qYweN.mjs.map → ln-4LGSXXGD-Cy8gNPMC.mjs.map} +1 -1
  141. package/dist/{ls-ZJGQER7M-CynOwieQ.cjs → ls-ZJGQER7M-CaSRbmLC.cjs} +2 -2
  142. package/dist/{ls-ZJGQER7M-CynOwieQ.cjs.map → ls-ZJGQER7M-CaSRbmLC.cjs.map} +1 -1
  143. package/dist/{ls-ZJGQER7M-BnKqqleV.mjs → ls-ZJGQER7M-DMYpsOhX.mjs} +2 -2
  144. package/dist/{ls-ZJGQER7M-BnKqqleV.mjs.map → ls-ZJGQER7M-DMYpsOhX.mjs.map} +1 -1
  145. package/dist/{lzma-DzpZapy8.mjs → lzma-BpK0w-SI.mjs} +3 -3
  146. package/dist/{lzma-DzpZapy8.mjs.map → lzma-BpK0w-SI.mjs.map} +1 -1
  147. package/dist/{lzma-YuGttxCP.cjs → lzma-L8nnN88o.cjs} +4 -4
  148. package/dist/{lzma-YuGttxCP.cjs.map → lzma-L8nnN88o.cjs.map} +1 -1
  149. package/dist/{md5sum-SPU24VSG-BusAHdrK.mjs → md5sum-SPU24VSG-DDehVi3L.mjs} +3 -3
  150. package/dist/{md5sum-SPU24VSG-BusAHdrK.mjs.map → md5sum-SPU24VSG-DDehVi3L.mjs.map} +1 -1
  151. package/dist/{md5sum-SPU24VSG-8_h79vAu.cjs → md5sum-SPU24VSG-wjaqw6M5.cjs} +3 -3
  152. package/dist/{md5sum-SPU24VSG-8_h79vAu.cjs.map → md5sum-SPU24VSG-wjaqw6M5.cjs.map} +1 -1
  153. package/dist/{mkdir-MEPGZOB6-BnYYgVxv.mjs → mkdir-MEPGZOB6-BoeUbSt6.mjs} +2 -2
  154. package/dist/{mkdir-MEPGZOB6-BnYYgVxv.mjs.map → mkdir-MEPGZOB6-BoeUbSt6.mjs.map} +1 -1
  155. package/dist/{mkdir-MEPGZOB6-Z0WHNFtR.cjs → mkdir-MEPGZOB6-D6EapQqG.cjs} +4 -4
  156. package/dist/{mkdir-MEPGZOB6-Z0WHNFtR.cjs.map → mkdir-MEPGZOB6-D6EapQqG.cjs.map} +1 -1
  157. package/dist/{mv-W5BIQ646-tAPnueJb.cjs → mv-W5BIQ646-Cl3grRdX.cjs} +3 -3
  158. package/dist/{mv-W5BIQ646-tAPnueJb.cjs.map → mv-W5BIQ646-Cl3grRdX.cjs.map} +1 -1
  159. package/dist/{mv-W5BIQ646-CDQ60965.mjs → mv-W5BIQ646-ee9iH5gF.mjs} +2 -2
  160. package/dist/{mv-W5BIQ646-CDQ60965.mjs.map → mv-W5BIQ646-ee9iH5gF.mjs.map} +1 -1
  161. package/dist/{nl-WSDW7I4O-BfBF-iiF.cjs → nl-WSDW7I4O-DttNn_cO.cjs} +3 -3
  162. package/dist/{nl-WSDW7I4O-BfBF-iiF.cjs.map → nl-WSDW7I4O-DttNn_cO.cjs.map} +1 -1
  163. package/dist/{nl-WSDW7I4O-C8m5GQ1G.mjs → nl-WSDW7I4O-DveMZ08l.mjs} +2 -2
  164. package/dist/{nl-WSDW7I4O-C8m5GQ1G.mjs.map → nl-WSDW7I4O-DveMZ08l.mjs.map} +1 -1
  165. package/dist/{od-WOKFDJTP-CHXPdcv9.cjs → od-WOKFDJTP-BJWjPFho.cjs} +3 -3
  166. package/dist/{od-WOKFDJTP-CHXPdcv9.cjs.map → od-WOKFDJTP-BJWjPFho.cjs.map} +1 -1
  167. package/dist/{od-WOKFDJTP-KIq-UMwl.mjs → od-WOKFDJTP-DCy3_AZ5.mjs} +2 -2
  168. package/dist/{od-WOKFDJTP-KIq-UMwl.mjs.map → od-WOKFDJTP-DCy3_AZ5.mjs.map} +1 -1
  169. package/dist/{paste-7JC6S4DX-Bs8ByIXb.cjs → paste-7JC6S4DX-DEoyg9Vv.cjs} +3 -3
  170. package/dist/{paste-7JC6S4DX-Bs8ByIXb.cjs.map → paste-7JC6S4DX-DEoyg9Vv.cjs.map} +1 -1
  171. package/dist/{paste-7JC6S4DX-u6xdoWS3.mjs → paste-7JC6S4DX-DL9UawIf.mjs} +2 -2
  172. package/dist/{paste-7JC6S4DX-u6xdoWS3.mjs.map → paste-7JC6S4DX-DL9UawIf.mjs.map} +1 -1
  173. package/dist/{printf-TWGXF445-B0tOxQT6.cjs → printf-TWGXF445-B1fsJl2X.cjs} +5 -6
  174. package/dist/{printf-TWGXF445-B0tOxQT6.cjs.map → printf-TWGXF445-B1fsJl2X.cjs.map} +1 -1
  175. package/dist/{printf-TWGXF445-CtvDPfv-.mjs → printf-TWGXF445-BlwG6dD2.mjs} +2 -2
  176. package/dist/{printf-TWGXF445-CtvDPfv-.mjs.map → printf-TWGXF445-BlwG6dD2.mjs.map} +1 -1
  177. package/dist/{python3-POMOR4OA-DYjQ3ccZ.cjs → python3-POMOR4OA-B8aVGk7h.cjs} +22 -22
  178. package/dist/{python3-POMOR4OA-DYjQ3ccZ.cjs.map → python3-POMOR4OA-B8aVGk7h.cjs.map} +1 -1
  179. package/dist/{python3-POMOR4OA-CYRVTFwe.mjs → python3-POMOR4OA-qY8EzVSe.mjs} +3 -3
  180. package/dist/{python3-POMOR4OA-CYRVTFwe.mjs.map → python3-POMOR4OA-qY8EzVSe.mjs.map} +1 -1
  181. package/dist/{rev-5EHFX4EJ-Cgya-Fo0.cjs → rev-5EHFX4EJ-B27blDxm.cjs} +4 -4
  182. package/dist/{rev-5EHFX4EJ-Cgya-Fo0.cjs.map → rev-5EHFX4EJ-B27blDxm.cjs.map} +1 -1
  183. package/dist/{rev-5EHFX4EJ-C41ieMgj.mjs → rev-5EHFX4EJ-Dxay6iFE.mjs} +2 -2
  184. package/dist/{rev-5EHFX4EJ-C41ieMgj.mjs.map → rev-5EHFX4EJ-Dxay6iFE.mjs.map} +1 -1
  185. package/dist/{rg-S4FXYXWB-ByK2CLxu.cjs → rg-S4FXYXWB-BL_fs0a0.cjs} +10 -10
  186. package/dist/{rg-S4FXYXWB-ByK2CLxu.cjs.map → rg-S4FXYXWB-BL_fs0a0.cjs.map} +1 -1
  187. package/dist/{rg-S4FXYXWB-DixtanJa.mjs → rg-S4FXYXWB-b3jjC2M6.mjs} +3 -3
  188. package/dist/{rg-S4FXYXWB-DixtanJa.mjs.map → rg-S4FXYXWB-b3jjC2M6.mjs.map} +1 -1
  189. package/dist/{rm-SSGETQVQ-BSLrKStW.cjs → rm-SSGETQVQ-CskLcJOp.cjs} +4 -4
  190. package/dist/{rm-SSGETQVQ-BSLrKStW.cjs.map → rm-SSGETQVQ-CskLcJOp.cjs.map} +1 -1
  191. package/dist/{rm-SSGETQVQ-CkwXZzCb.mjs → rm-SSGETQVQ-D0Grjo65.mjs} +2 -2
  192. package/dist/{rm-SSGETQVQ-CkwXZzCb.mjs.map → rm-SSGETQVQ-D0Grjo65.mjs.map} +1 -1
  193. package/dist/{rmdir-OC4ZLPYA-DmK6bDKx.mjs → rmdir-OC4ZLPYA-BZ86Q3Wr.mjs} +2 -2
  194. package/dist/{rmdir-OC4ZLPYA-DmK6bDKx.mjs.map → rmdir-OC4ZLPYA-BZ86Q3Wr.mjs.map} +1 -1
  195. package/dist/{rmdir-OC4ZLPYA-DrF3bZoQ.cjs → rmdir-OC4ZLPYA-Br6jTWJO.cjs} +3 -3
  196. package/dist/{rmdir-OC4ZLPYA-DrF3bZoQ.cjs.map → rmdir-OC4ZLPYA-Br6jTWJO.cjs.map} +1 -1
  197. package/dist/run.cjs +1 -1
  198. package/dist/run.mjs +1 -1
  199. package/dist/{sed-S5UIK574-tnYwSWkL.mjs → sed-S5UIK574-C0ikpRUI.mjs} +2 -2
  200. package/dist/{sed-S5UIK574-tnYwSWkL.mjs.map → sed-S5UIK574-C0ikpRUI.mjs.map} +1 -1
  201. package/dist/{sed-S5UIK574-B3Klx8N4.cjs → sed-S5UIK574-OUlTmK0x.cjs} +27 -27
  202. package/dist/{sed-S5UIK574-B3Klx8N4.cjs.map → sed-S5UIK574-OUlTmK0x.cjs.map} +1 -1
  203. package/dist/{sha1sum-2PTOAFR6-Bl7iC2ql.cjs → sha1sum-2PTOAFR6-B_DU8HD8.cjs} +3 -3
  204. package/dist/{sha1sum-2PTOAFR6-Bl7iC2ql.cjs.map → sha1sum-2PTOAFR6-B_DU8HD8.cjs.map} +1 -1
  205. package/dist/{sha1sum-2PTOAFR6-BP6dQ8V1.mjs → sha1sum-2PTOAFR6-hLKNluNQ.mjs} +3 -3
  206. package/dist/{sha1sum-2PTOAFR6-BP6dQ8V1.mjs.map → sha1sum-2PTOAFR6-hLKNluNQ.mjs.map} +1 -1
  207. package/dist/{sha256sum-NS7D3IXX-DdD-z8yU.cjs → sha256sum-NS7D3IXX-YzzSU71d.cjs} +3 -3
  208. package/dist/{sha256sum-NS7D3IXX-DdD-z8yU.cjs.map → sha256sum-NS7D3IXX-YzzSU71d.cjs.map} +1 -1
  209. package/dist/{sha256sum-NS7D3IXX-BJzrJC0M.mjs → sha256sum-NS7D3IXX-c6RHEh31.mjs} +3 -3
  210. package/dist/{sha256sum-NS7D3IXX-BJzrJC0M.mjs.map → sha256sum-NS7D3IXX-c6RHEh31.mjs.map} +1 -1
  211. package/dist/{sleep-X22JJINO-UJvessts.cjs → sleep-X22JJINO-DFWLmtic.cjs} +5 -5
  212. package/dist/{sleep-X22JJINO-UJvessts.cjs.map → sleep-X22JJINO-DFWLmtic.cjs.map} +1 -1
  213. package/dist/{sleep-X22JJINO-D3SDAJt4.mjs → sleep-X22JJINO-lQ5Wi1rP.mjs} +2 -2
  214. package/dist/{sleep-X22JJINO-D3SDAJt4.mjs.map → sleep-X22JJINO-lQ5Wi1rP.mjs.map} +1 -1
  215. package/dist/{sort-SW2YEO5B-DIDExLis.cjs → sort-SW2YEO5B-BlJCEbS7.cjs} +4 -4
  216. package/dist/{sort-SW2YEO5B-DIDExLis.cjs.map → sort-SW2YEO5B-BlJCEbS7.cjs.map} +1 -1
  217. package/dist/{sort-SW2YEO5B-CFc2Uu_A.mjs → sort-SW2YEO5B-Njc26SUn.mjs} +3 -3
  218. package/dist/{sort-SW2YEO5B-CFc2Uu_A.mjs.map → sort-SW2YEO5B-Njc26SUn.mjs.map} +1 -1
  219. package/dist/{split-4KKZZXXE-DMjoEV89.mjs → split-4KKZZXXE-C97QsnxB.mjs} +2 -2
  220. package/dist/{split-4KKZZXXE-DMjoEV89.mjs.map → split-4KKZZXXE-C97QsnxB.mjs.map} +1 -1
  221. package/dist/{split-4KKZZXXE-CSVvRIzD.cjs → split-4KKZZXXE-DGFsDrFE.cjs} +3 -3
  222. package/dist/{split-4KKZZXXE-CSVvRIzD.cjs.map → split-4KKZZXXE-DGFsDrFE.cjs.map} +1 -1
  223. package/dist/{sqlite3-CGOEFJAO-DTNqDMXu.cjs → sqlite3-CGOEFJAO-D78UkTyw.cjs} +24 -25
  224. package/dist/sqlite3-CGOEFJAO-D78UkTyw.cjs.map +1 -0
  225. package/dist/{sqlite3-CGOEFJAO-BXYj3z3Q.mjs → sqlite3-CGOEFJAO-HGqCZYuu.mjs} +3 -3
  226. package/dist/{sqlite3-CGOEFJAO-BXYj3z3Q.mjs.map → sqlite3-CGOEFJAO-HGqCZYuu.mjs.map} +1 -1
  227. package/dist/start-BX-bkX9K.cjs +2733 -0
  228. package/dist/start-BX-bkX9K.cjs.map +1 -0
  229. package/dist/start-DAlaZ5zj.mjs +2727 -0
  230. package/dist/start-DAlaZ5zj.mjs.map +1 -0
  231. package/dist/start.cjs +1 -1
  232. package/dist/start.d.cts +3 -997
  233. package/dist/start.d.mts +2 -998
  234. package/dist/start.mjs +1 -1
  235. package/dist/{strings-6WDHLGMX-D2bfJpyh.cjs → strings-6WDHLGMX-CeJiCt-u.cjs} +2 -2
  236. package/dist/{strings-6WDHLGMX-D2bfJpyh.cjs.map → strings-6WDHLGMX-CeJiCt-u.cjs.map} +1 -1
  237. package/dist/{strings-6WDHLGMX-Cs9B6z8x.mjs → strings-6WDHLGMX-Dix-GFiu.mjs} +2 -2
  238. package/dist/{strings-6WDHLGMX-Cs9B6z8x.mjs.map → strings-6WDHLGMX-Dix-GFiu.mjs.map} +1 -1
  239. package/dist/{tac-2STMMJYW-ceGFflzJ.mjs → tac-2STMMJYW-Bm0D_YqQ.mjs} +2 -2
  240. package/dist/{tac-2STMMJYW-ceGFflzJ.mjs.map → tac-2STMMJYW-Bm0D_YqQ.mjs.map} +1 -1
  241. package/dist/{tac-2STMMJYW-D0fFvjly.cjs → tac-2STMMJYW-DlI5binK.cjs} +2 -2
  242. package/dist/{tac-2STMMJYW-D0fFvjly.cjs.map → tac-2STMMJYW-DlI5binK.cjs.map} +1 -1
  243. package/dist/{tail-R4PCA2C4-BopvFWyi.mjs → tail-R4PCA2C4-7wsnh20i.mjs} +2 -2
  244. package/dist/{tail-R4PCA2C4-BopvFWyi.mjs.map → tail-R4PCA2C4-7wsnh20i.mjs.map} +1 -1
  245. package/dist/{tail-R4PCA2C4-CLtu5GPs.cjs → tail-R4PCA2C4-TH4AUhAb.cjs} +2 -2
  246. package/dist/{tail-R4PCA2C4-CLtu5GPs.cjs.map → tail-R4PCA2C4-TH4AUhAb.cjs.map} +1 -1
  247. package/dist/{tar-STHHZTZ6-Bxk0yG7D.cjs → tar-STHHZTZ6-DELlRab1.cjs} +6 -7
  248. package/dist/{tar-STHHZTZ6-Bxk0yG7D.cjs.map → tar-STHHZTZ6-DELlRab1.cjs.map} +1 -1
  249. package/dist/{tar-STHHZTZ6-QbV1N_D9.mjs → tar-STHHZTZ6-gShA0vQ1.mjs} +4 -4
  250. package/dist/{tar-STHHZTZ6-QbV1N_D9.mjs.map → tar-STHHZTZ6-gShA0vQ1.mjs.map} +1 -1
  251. package/dist/{tee-YUZ2FKCJ-DiFGWp4G.mjs → tee-YUZ2FKCJ-6jGvzLuO.mjs} +2 -2
  252. package/dist/{tee-YUZ2FKCJ-DiFGWp4G.mjs.map → tee-YUZ2FKCJ-6jGvzLuO.mjs.map} +1 -1
  253. package/dist/{tee-YUZ2FKCJ-BbxSWxw6.cjs → tee-YUZ2FKCJ-D_BE3AiF.cjs} +2 -2
  254. package/dist/{tee-YUZ2FKCJ-BbxSWxw6.cjs.map → tee-YUZ2FKCJ-D_BE3AiF.cjs.map} +1 -1
  255. package/dist/{time-D4LNBSWX-CTjUJUms.mjs → time-D4LNBSWX-D7RWA_NU.mjs} +2 -2
  256. package/dist/{time-D4LNBSWX-CTjUJUms.mjs.map → time-D4LNBSWX-D7RWA_NU.mjs.map} +1 -1
  257. package/dist/{time-D4LNBSWX-BQSWzFeK.cjs → time-D4LNBSWX-zKxg-wM1.cjs} +8 -8
  258. package/dist/{time-D4LNBSWX-BQSWzFeK.cjs.map → time-D4LNBSWX-zKxg-wM1.cjs.map} +1 -1
  259. package/dist/{timeout-YDCRSLPQ-DC-fdp1t.mjs → timeout-YDCRSLPQ-D42ruxso.mjs} +2 -2
  260. package/dist/{timeout-YDCRSLPQ-DC-fdp1t.mjs.map → timeout-YDCRSLPQ-D42ruxso.mjs.map} +1 -1
  261. package/dist/{timeout-YDCRSLPQ-DEPvQ6Ih.cjs → timeout-YDCRSLPQ-DWs-ACr6.cjs} +5 -5
  262. package/dist/{timeout-YDCRSLPQ-DEPvQ6Ih.cjs.map → timeout-YDCRSLPQ-DWs-ACr6.cjs.map} +1 -1
  263. package/dist/{touch-UA33VN3N-DIda6f8u.cjs → touch-UA33VN3N-BALmWXCe.cjs} +3 -3
  264. package/dist/{touch-UA33VN3N-DIda6f8u.cjs.map → touch-UA33VN3N-BALmWXCe.cjs.map} +1 -1
  265. package/dist/{touch-UA33VN3N-BMhGO9VC.mjs → touch-UA33VN3N-OcSMUASX.mjs} +2 -2
  266. package/dist/{touch-UA33VN3N-BMhGO9VC.mjs.map → touch-UA33VN3N-OcSMUASX.mjs.map} +1 -1
  267. package/dist/{tr-36LHWFRQ-DjY4IsPF.mjs → tr-36LHWFRQ-BHhoJAPK.mjs} +2 -2
  268. package/dist/{tr-36LHWFRQ-DjY4IsPF.mjs.map → tr-36LHWFRQ-BHhoJAPK.mjs.map} +1 -1
  269. package/dist/{tr-36LHWFRQ-COkRmY_6.cjs → tr-36LHWFRQ-DDHiAg_m.cjs} +4 -4
  270. package/dist/{tr-36LHWFRQ-COkRmY_6.cjs.map → tr-36LHWFRQ-DDHiAg_m.cjs.map} +1 -1
  271. package/dist/{tree-YLD52CNT-kZ9vPZ-R.cjs → tree-YLD52CNT-BqqLx-tM.cjs} +2 -2
  272. package/dist/{tree-YLD52CNT-kZ9vPZ-R.cjs.map → tree-YLD52CNT-BqqLx-tM.cjs.map} +1 -1
  273. package/dist/{tree-YLD52CNT-N-vPBfJO.mjs → tree-YLD52CNT-CuJMHpsw.mjs} +2 -2
  274. package/dist/{tree-YLD52CNT-N-vPBfJO.mjs.map → tree-YLD52CNT-CuJMHpsw.mjs.map} +1 -1
  275. package/dist/{unexpand-CADSA4VO-DekKk-hg.cjs → unexpand-CADSA4VO-BORtdsy_.cjs} +3 -3
  276. package/dist/{unexpand-CADSA4VO-DekKk-hg.cjs.map → unexpand-CADSA4VO-BORtdsy_.cjs.map} +1 -1
  277. package/dist/{unexpand-CADSA4VO-Byi4s0o8.mjs → unexpand-CADSA4VO-CHiw_MI4.mjs} +2 -2
  278. package/dist/{unexpand-CADSA4VO-Byi4s0o8.mjs.map → unexpand-CADSA4VO-CHiw_MI4.mjs.map} +1 -1
  279. package/dist/{uniq-XSIZR6PB-D0HICyAj.mjs → uniq-XSIZR6PB-Byah97Ij.mjs} +3 -3
  280. package/dist/{uniq-XSIZR6PB-D0HICyAj.mjs.map → uniq-XSIZR6PB-Byah97Ij.mjs.map} +1 -1
  281. package/dist/{uniq-XSIZR6PB-BhdgA9iI.cjs → uniq-XSIZR6PB-CyA5DoCP.cjs} +4 -4
  282. package/dist/{uniq-XSIZR6PB-BhdgA9iI.cjs.map → uniq-XSIZR6PB-CyA5DoCP.cjs.map} +1 -1
  283. package/dist/{wc-LF7NU4LA-CnEel3wT.mjs → wc-LF7NU4LA-CPMTeSun.mjs} +3 -3
  284. package/dist/{wc-LF7NU4LA-CnEel3wT.mjs.map → wc-LF7NU4LA-CPMTeSun.mjs.map} +1 -1
  285. package/dist/{wc-LF7NU4LA-Ci3_hJug.cjs → wc-LF7NU4LA-DUBYnutH.cjs} +4 -4
  286. package/dist/{wc-LF7NU4LA-Ci3_hJug.cjs.map → wc-LF7NU4LA-DUBYnutH.cjs.map} +1 -1
  287. package/dist/{xan-Y6WF3IRG-BEGK5ruS.mjs → xan-Y6WF3IRG-CLfddWd-.mjs} +6 -6
  288. package/dist/{xan-Y6WF3IRG-BEGK5ruS.mjs.map → xan-Y6WF3IRG-CLfddWd-.mjs.map} +1 -1
  289. package/dist/{xan-Y6WF3IRG-EnrntEIM.cjs → xan-Y6WF3IRG-W4Yr19gE.cjs} +11 -11
  290. package/dist/{xan-Y6WF3IRG-EnrntEIM.cjs.map → xan-Y6WF3IRG-W4Yr19gE.cjs.map} +1 -1
  291. package/dist/{xan-view-HDVKHFC2-CvEDnphU.mjs → xan-view-HDVKHFC2-B_Xy-tdc.mjs} +3 -3
  292. package/dist/{xan-view-HDVKHFC2-CvEDnphU.mjs.map → xan-view-HDVKHFC2-B_Xy-tdc.mjs.map} +1 -1
  293. package/dist/{xan-view-HDVKHFC2-c1gcVO0A.cjs → xan-view-HDVKHFC2-CWkN0IJ1.cjs} +3 -3
  294. package/dist/{xan-view-HDVKHFC2-c1gcVO0A.cjs.map → xan-view-HDVKHFC2-CWkN0IJ1.cjs.map} +1 -1
  295. package/dist/{xargs-MGZPH7AX-DNyBXxK4.cjs → xargs-MGZPH7AX-B_Ocy3BY.cjs} +4 -4
  296. package/dist/{xargs-MGZPH7AX-DNyBXxK4.cjs.map → xargs-MGZPH7AX-B_Ocy3BY.cjs.map} +1 -1
  297. package/dist/{xargs-MGZPH7AX-BvI6LK8I.mjs → xargs-MGZPH7AX-DDoz_2hL.mjs} +2 -2
  298. package/dist/{xargs-MGZPH7AX-BvI6LK8I.mjs.map → xargs-MGZPH7AX-DDoz_2hL.mjs.map} +1 -1
  299. package/dist/{yq-4QJW3EQG-9kH_HlxF.cjs → yq-4QJW3EQG-BPBhjinw.cjs} +10 -10
  300. package/dist/{yq-4QJW3EQG-9kH_HlxF.cjs.map → yq-4QJW3EQG-BPBhjinw.cjs.map} +1 -1
  301. package/dist/{yq-4QJW3EQG-CYt1C3ZB.mjs → yq-4QJW3EQG-mUhWBJBJ.mjs} +3 -3
  302. package/dist/{yq-4QJW3EQG-CYt1C3ZB.mjs.map → yq-4QJW3EQG-mUhWBJBJ.mjs.map} +1 -1
  303. package/package.json +1 -1
  304. package/dist/dist-B1hOOWjl.mjs +0 -3044
  305. package/dist/dist-B1hOOWjl.mjs.map +0 -1
  306. package/dist/dist-DvjFaP47.cjs +0 -3799
  307. package/dist/dist-DvjFaP47.cjs.map +0 -1
  308. package/dist/sqlite3-CGOEFJAO-DTNqDMXu.cjs.map +0 -1
  309. package/dist/start-Cm1hxyF_.cjs.map +0 -1
  310. package/dist/start-DmsuxtBI.mjs.map +0 -1
@@ -1,3799 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
- get: ((k) => from[k]).bind(null, key),
14
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
- });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
- value: mod,
21
- enumerable: true
22
- }) : target, mod));
23
- //#endregion
24
- let dockerode = require("dockerode");
25
- dockerode = __toESM(dockerode, 1);
26
- let node_fs = require("node:fs");
27
- let node_path = require("node:path");
28
- let node_child_process = require("node:child_process");
29
- let node_os = require("node:os");
30
- let zod = require("zod");
31
- let _aws_sdk_client_s3 = require("@aws-sdk/client-s3");
32
- let _aws_sdk_s3_request_presigner = require("@aws-sdk/s3-request-presigner");
33
- //#region ../../packages/hosting/dist/index.mjs
34
- const PROJECT_SERVER_PORT = 3e3;
35
- const PROJECT_SERVER_ROOT = "/app";
36
- const PROJECT_SERVER_FRAMEWORK_NODE_MODULES = `/opt/keystroke/node_modules`;
37
- const PROJECT_SERVER_HEALTH = {
38
- path: "/health",
39
- port: PROJECT_SERVER_PORT
40
- };
41
- const RUNTIME_ENV_KEYS = [
42
- "BETTER_AUTH_SECRET",
43
- "PUBLIC_SERVER_URL",
44
- "PUBLIC_WEB_URL",
45
- "POSTGRES_SSL",
46
- "KEYSTROKE_SCHEDULER_MODULE",
47
- "UPSTASH_REDIS_URL",
48
- "REDIS_URL",
49
- "KEYSTROKE_QUEUE_PREFIX"
50
- ];
51
- /** Provider and gateway env forwarded from the platform into project servers. */
52
- const PROVIDER_ENV_KEYS = [
53
- "ANTHROPIC_API_KEY",
54
- "OPENAI_API_KEY",
55
- "AI_GATEWAY_API_KEY",
56
- "AI_GATEWAY_BASE_URL"
57
- ];
58
- /** Shared dev token when `PLATFORM_WORKER_TOKEN` is unset (non-production only). */
59
- const DEV_PLATFORM_WORKER_TOKEN = "dev-platform-worker-token";
60
- /** Per-project postgres env injected into every project server container/machine. */
61
- function projectDatabaseRuntimeEnv(database) {
62
- return {
63
- POSTGRES_HOST: rewriteLoopbackHost(database.host),
64
- POSTGRES_PORT: String(database.port),
65
- POSTGRES_DB: database.database,
66
- POSTGRES_USER: database.user,
67
- POSTGRES_PASSWORD: database.password,
68
- DATABASE_SEARCH_PATH: database.searchPath
69
- };
70
- }
71
- /**
72
- * Builds the launch spec for a single project server. `artifactStorageKey` is the
73
- * object key for that deploy's built `dist` tarball in the org bucket — there is
74
- * no base image, so it is required.
75
- */
76
- function resolveRuntimeLaunch(options, artifactStorageKey, database, extraEnv) {
77
- if (!artifactStorageKey) throw new Error("Cannot start a project server without an artifact storage key");
78
- const env = options.env ?? process.env;
79
- return {
80
- image: resolveProjectServerImage(env, options.image),
81
- env: buildRuntimeEnv(env, artifactStorageKey, database, extraEnv),
82
- port: PROJECT_SERVER_PORT,
83
- health: PROJECT_SERVER_HEALTH
84
- };
85
- }
86
- /** Env vars passed into the project server container/machine. */
87
- function buildRuntimeEnv(source, artifactStorageKey, database, extraEnv) {
88
- const entries = new Map([
89
- ["PORT", String(PROJECT_SERVER_PORT)],
90
- ["KEYSTROKE_ROOT", PROJECT_SERVER_ROOT],
91
- ["KEYSTROKE_RUNTIME_NODE_MODULES", PROJECT_SERVER_FRAMEWORK_NODE_MODULES],
92
- ["ARTIFACT_STORAGE_KEY", artifactStorageKey],
93
- ["PROJECT_ID", database.projectId],
94
- ["ORGANIZATION_ID", database.organizationId],
95
- ["TENANT_ID", database.organizationId]
96
- ]);
97
- for (const key of RUNTIME_ENV_KEYS) {
98
- const value = source[key]?.trim();
99
- if (!value) {
100
- if (key === "POSTGRES_SSL") throw new Error("POSTGRES_SSL is required");
101
- continue;
102
- }
103
- entries.set(key, value);
104
- }
105
- if (!extraEnv) for (const key of PROVIDER_ENV_KEYS) {
106
- const value = source[key]?.trim();
107
- if (value) entries.set(key, value);
108
- }
109
- const worker = resolveWorkerRuntimeConfig(source);
110
- entries.set("PLATFORM_URL", worker.platformUrl);
111
- entries.set("WORKER_INTERNAL_TOKEN", worker.workerToken);
112
- for (const [key, value] of Object.entries(projectDatabaseRuntimeEnv(database))) entries.set(key, value);
113
- if (extraEnv) for (const [key, value] of Object.entries(extraEnv)) entries.set(key, value);
114
- return Object.fromEntries(entries);
115
- }
116
- function resolvePlatformWorkerToken(source = process.env) {
117
- const explicit = source.PLATFORM_WORKER_TOKEN?.trim() ?? source.WORKER_INTERNAL_TOKEN?.trim();
118
- if (explicit) return explicit;
119
- if (source.NODE_ENV === "production") return;
120
- return DEV_PLATFORM_WORKER_TOKEN;
121
- }
122
- /** Platform API URL reachable from a project-server container. */
123
- const DEV_PLATFORM_URL = "http://localhost:3002";
124
- function resolveWorkerPlatformUrl(source = process.env) {
125
- const raw = source.PLATFORM_URL?.trim() ?? source.PUBLIC_PLATFORM_URL?.trim() ?? (source.NODE_ENV === "production" ? void 0 : DEV_PLATFORM_URL);
126
- if (!raw) return;
127
- return rewriteLoopbackUrl(raw);
128
- }
129
- /** Rewrite loopback hosts so containers can reach Postgres and other host services. */
130
- function rewriteLoopbackHost(host) {
131
- if (host === "localhost" || host === "127.0.0.1") return "host.docker.internal";
132
- return host;
133
- }
134
- function rewriteLoopbackUrl(url) {
135
- try {
136
- const parsed = new URL(url);
137
- parsed.hostname = rewriteLoopbackHost(parsed.hostname);
138
- return parsed.toString().replace(/\/$/, "");
139
- } catch {
140
- return url;
141
- }
142
- }
143
- /** dockerode expects `KEY=value` strings. */
144
- function formatDockerEnv(env) {
145
- return Object.entries(env).map(([key, value]) => `${key}=${value}`);
146
- }
147
- function resolveProjectServerImage(env = process.env, override) {
148
- return override ?? env.PROJECT_DOCKER_IMAGE ?? env.TENANT_DOCKER_IMAGE ?? "keystroke/project-server:local";
149
- }
150
- var WorkerRuntimeConfigError = class extends Error {
151
- missing;
152
- constructor(missing) {
153
- super(`Worker runtime config incomplete (missing: ${missing.join(", ")}). In production set PLATFORM_WORKER_TOKEN and PUBLIC_PLATFORM_URL (or PLATFORM_URL).`);
154
- this.name = "WorkerRuntimeConfigError";
155
- this.missing = missing;
156
- }
157
- };
158
- /** Fail fast when the platform cannot start worker-mode project servers. */
159
- function resolveWorkerRuntimeConfig(source = process.env) {
160
- const platformUrl = resolveWorkerPlatformUrl(source);
161
- const workerToken = resolvePlatformWorkerToken(source);
162
- const missing = [];
163
- if (!platformUrl) missing.push("PUBLIC_PLATFORM_URL or PLATFORM_URL");
164
- if (!workerToken) missing.push("PLATFORM_WORKER_TOKEN");
165
- if (missing.length > 0) throw new WorkerRuntimeConfigError(missing);
166
- return {
167
- platformUrl,
168
- workerToken
169
- };
170
- }
171
- const DEFAULT_TIMEOUT_MS = 12e4;
172
- const DEFAULT_INTERVAL_MS = 500;
173
- async function waitForHealth(baseUrl, options = {}) {
174
- const fetchImpl = options.fetchImpl ?? fetch;
175
- const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
176
- const intervalMs = options.intervalMs ?? DEFAULT_INTERVAL_MS;
177
- const deadline = Date.now() + timeoutMs;
178
- const url = new URL(PROJECT_SERVER_HEALTH.path, baseUrl);
179
- while (Date.now() < deadline) {
180
- try {
181
- if ((await fetchImpl(url, { signal: AbortSignal.timeout(2e3) })).ok) return;
182
- } catch {}
183
- await sleep(intervalMs);
184
- }
185
- throw new Error(`Project server health check timed out after ${timeoutMs}ms (${url})`);
186
- }
187
- function sleep(ms) {
188
- return new Promise((resolve) => {
189
- setTimeout(resolve, ms);
190
- });
191
- }
192
- const MINIO_DOCKER_NETWORK = process.env.MINIO_DOCKER_NETWORK ?? "keystroke";
193
- function createDockerRuntime(options = {}) {
194
- const docker = options.docker ?? new dockerode.default();
195
- return { async start(input) {
196
- const launch = resolveRuntimeLaunch(options, input.artifactStorageKey, input.database, input.env);
197
- await ensureImage(docker, launch.image);
198
- await removeExistingContainer(docker, input.projectId);
199
- const container = await docker.createContainer({
200
- Image: launch.image,
201
- name: containerName(input.projectId),
202
- Labels: {
203
- "keystroke.project.id": input.projectId,
204
- "keystroke.project.name": input.name
205
- },
206
- ExposedPorts: { [`${launch.port}/tcp`]: {} },
207
- HostConfig: {
208
- ExtraHosts: ["host.docker.internal:host-gateway"],
209
- PortBindings: { [`${launch.port}/tcp`]: [{ HostPort: "0" }] }
210
- },
211
- NetworkingConfig: { EndpointsConfig: { [MINIO_DOCKER_NETWORK]: {} } },
212
- Env: formatDockerEnv(launch.env)
213
- });
214
- await container.start();
215
- const inspect = await container.inspect();
216
- const binding = inspect.NetworkSettings.Ports?.[`${launch.port}/tcp`]?.[0];
217
- if (!binding?.HostPort) throw new Error("Failed to resolve project container host port");
218
- const baseUrl = `http://127.0.0.1:${binding.HostPort}`;
219
- await waitForHealth(baseUrl, {
220
- fetchImpl: options.fetchImpl,
221
- timeoutMs: options.healthTimeoutMs
222
- });
223
- return {
224
- runtimeId: inspect.Id,
225
- baseUrl
226
- };
227
- } };
228
- }
229
- function containerName(projectId) {
230
- return `keystroke-project-${projectId}`;
231
- }
232
- async function removeExistingContainer(docker, projectId) {
233
- try {
234
- const existing = docker.getContainer(containerName(projectId));
235
- await existing.stop({ t: 5 }).catch(() => void 0);
236
- await existing.remove({ force: true });
237
- } catch {}
238
- }
239
- async function ensureImage(docker, image) {
240
- try {
241
- await docker.getImage(image).inspect();
242
- return;
243
- } catch {}
244
- await new Promise((resolvePromise, reject) => {
245
- docker.pull(image, (error, stream) => {
246
- if (error) {
247
- reject(error);
248
- return;
249
- }
250
- if (!stream) {
251
- reject(/* @__PURE__ */ new Error(`Failed to pull image ${image}`));
252
- return;
253
- }
254
- docker.modem.followProgress(stream, (progressError) => {
255
- if (progressError) {
256
- reject(progressError);
257
- return;
258
- }
259
- resolvePromise();
260
- });
261
- });
262
- });
263
- }
264
- function dockerPlugin(options = {}) {
265
- const env = options.env ?? process.env;
266
- return {
267
- name: "docker",
268
- workerRuntime: resolveWorkerRuntimeConfig(env),
269
- createRuntime: () => createDockerRuntime({
270
- ...options,
271
- env
272
- })
273
- };
274
- }
275
- /** Local Docker hosting — default for platform and dev. */
276
- function defaultHostingPlugin(options = {}) {
277
- return dockerPlugin(options);
278
- }
279
- async function pingProject(baseUrl, options = {}) {
280
- const timeoutMs = options.timeoutMs ?? 15e3;
281
- const headers = options.plugin?.pingRequestHeaders?.(options.runtimeId ?? null) ?? {};
282
- try {
283
- return (await (options.fetchImpl ?? fetch)(new URL(PROJECT_SERVER_HEALTH.path, baseUrl), {
284
- signal: AbortSignal.timeout(timeoutMs),
285
- headers
286
- })).ok;
287
- } catch {
288
- return false;
289
- }
290
- }
291
- function canPingProjectTarget(target, plugin) {
292
- if (plugin?.canPingTarget) return plugin.canPingTarget(target);
293
- return !!target.baseUrl;
294
- }
295
- async function pingProjectTarget(target, options = {}) {
296
- if (!canPingProjectTarget(target, options.plugin)) return false;
297
- return pingProject(target.baseUrl, {
298
- ...options,
299
- runtimeId: target.runtimeId
300
- });
301
- }
302
- //#endregion
303
- //#region ../../packages/shared/dist/index.mjs
304
- const ACTIVE_ORG_HEADER = "x-keystroke-org-id";
305
- /** Auth, session, and account-entry URL segments. */
306
- const AUTH_ACCOUNT_SLUGS = [
307
- "2fa",
308
- "accept-invite",
309
- "auth",
310
- "authorize",
311
- "callback",
312
- "callbacks",
313
- "confirm-email",
314
- "confirmation",
315
- "connect",
316
- "device",
317
- "email-verification",
318
- "forgot-password",
319
- "invite",
320
- "invites",
321
- "login",
322
- "logout",
323
- "magic-link",
324
- "mfa",
325
- "oauth",
326
- "onboarding",
327
- "password",
328
- "recovery",
329
- "register",
330
- "reset-password",
331
- "saml",
332
- "session",
333
- "sessions",
334
- "sign-in",
335
- "sign-up",
336
- "signin",
337
- "signout",
338
- "signup",
339
- "sso",
340
- "token",
341
- "tokens",
342
- "unlink",
343
- "verify",
344
- "verify-email"
345
- ];
346
- /** Org, workspace, billing, and account-management URL segments. */
347
- const ORG_ACCOUNT_SLUGS = [
348
- "account",
349
- "accounts",
350
- "billing",
351
- "console",
352
- "invoice",
353
- "invoices",
354
- "member",
355
- "members",
356
- "me",
357
- "org",
358
- "organization",
359
- "organizations",
360
- "orgs",
361
- "payment",
362
- "payments",
363
- "plan",
364
- "plans",
365
- "portal",
366
- "preferences",
367
- "profile",
368
- "settings",
369
- "subscription",
370
- "subscriptions",
371
- "team",
372
- "teams",
373
- "upgrade",
374
- "usage",
375
- "user",
376
- "users",
377
- "workspace",
378
- "workspaces"
379
- ];
380
- /** Product surfaces, resource types, and in-app navigation segments. */
381
- const PRODUCT_SLUGS = [
382
- "action",
383
- "actions",
384
- "activity",
385
- "agent",
386
- "agents",
387
- "analytics",
388
- "app",
389
- "apps",
390
- "artifact",
391
- "artifacts",
392
- "assistant",
393
- "assistants",
394
- "audit",
395
- "audit-log",
396
- "automation",
397
- "automations",
398
- "branch",
399
- "branches",
400
- "canvas",
401
- "chat",
402
- "chats",
403
- "connection",
404
- "connections",
405
- "create",
406
- "credential",
407
- "credentials",
408
- "dashboard",
409
- "deployment",
410
- "deployments",
411
- "examples",
412
- "execute",
413
- "execution",
414
- "executions",
415
- "explore",
416
- "get-started",
417
- "history",
418
- "inbox",
419
- "inspector",
420
- "integration",
421
- "integrations",
422
- "library",
423
- "logs",
424
- "marketplace",
425
- "mcp",
426
- "mcps",
427
- "new",
428
- "notifications",
429
- "observe",
430
- "plugin",
431
- "plugins",
432
- "primitive",
433
- "primitives",
434
- "project",
435
- "projects",
436
- "recents",
437
- "registry",
438
- "reports",
439
- "run",
440
- "runs",
441
- "runtime",
442
- "runtimes",
443
- "sandbox",
444
- "sandboxes",
445
- "search",
446
- "skill",
447
- "skills",
448
- "templates",
449
- "thread",
450
- "threads",
451
- "trigger",
452
- "triggers",
453
- "version",
454
- "versions",
455
- "workflow",
456
- "workflows"
457
- ];
458
- /** Marketing, docs, company, and go-to-market URL segments. */
459
- const MARKETING_SITE_SLUGS = [
460
- "about",
461
- "affiliates",
462
- "ai",
463
- "announcements",
464
- "anthropic",
465
- "blog",
466
- "book-demo",
467
- "brand",
468
- "campaigns",
469
- "career",
470
- "careers",
471
- "case-studies",
472
- "casestudies",
473
- "changelog",
474
- "chatgpt",
475
- "chrome-extension",
476
- "claude",
477
- "codex",
478
- "community",
479
- "company",
480
- "compare",
481
- "contact",
482
- "contribute",
483
- "creators",
484
- "customers",
485
- "demo",
486
- "demos",
487
- "discord",
488
- "docs",
489
- "documentation",
490
- "download",
491
- "downloads",
492
- "dust",
493
- "emerging-talent",
494
- "engineering-blog",
495
- "enterprise",
496
- "events",
497
- "experts",
498
- "extension",
499
- "faq",
500
- "faqs",
501
- "features",
502
- "forum",
503
- "glean",
504
- "grok",
505
- "guide",
506
- "guides",
507
- "gumloop",
508
- "handbook",
509
- "help",
510
- "help-center",
511
- "home",
512
- "how-it-works",
513
- "howitworks",
514
- "inspo",
515
- "intern",
516
- "investors",
517
- "jobs",
518
- "legal",
519
- "lindy",
520
- "llm",
521
- "llms",
522
- "love",
523
- "make",
524
- "manifesto",
525
- "media",
526
- "merch",
527
- "mission",
528
- "mobile",
529
- "models",
530
- "n8n",
531
- "news",
532
- "newsroom",
533
- "open",
534
- "open-claw",
535
- "open-source",
536
- "openai",
537
- "our-story",
538
- "overview",
539
- "partners",
540
- "pi",
541
- "pipedream",
542
- "platform",
543
- "press",
544
- "press-kit",
545
- "pricing",
546
- "privacy",
547
- "product",
548
- "products",
549
- "provider",
550
- "providers",
551
- "quick-start",
552
- "quickstart",
553
- "refer",
554
- "relay",
555
- "relay-app",
556
- "reporting",
557
- "request-demo",
558
- "resources",
559
- "roadmap",
560
- "schedule-demo",
561
- "security",
562
- "solutions",
563
- "stack-ai",
564
- "stackai",
565
- "startup",
566
- "startups",
567
- "status",
568
- "stories",
569
- "story",
570
- "students",
571
- "support",
572
- "swag",
573
- "switch",
574
- "talent",
575
- "terms",
576
- "testimonials",
577
- "thesis",
578
- "tines",
579
- "trust",
580
- "tutorials",
581
- "university",
582
- "use-case",
583
- "use-cases",
584
- "usecases",
585
- "versus",
586
- "vellum",
587
- "vs",
588
- "webinars",
589
- "workato",
590
- "xai",
591
- "yc",
592
- "zapier"
593
- ];
594
- /** Integrations, competitors, and partner brand slugs (marketing / integration pages). */
595
- const INTEGRATION_BRAND_SLUGS = [
596
- "airtable",
597
- "asana",
598
- "aws",
599
- "azure",
600
- "bun",
601
- "confluence",
602
- "copilot",
603
- "cursor",
604
- "databricks",
605
- "figma",
606
- "firebase",
607
- "fly",
608
- "gcp",
609
- "gemini",
610
- "github",
611
- "gitlab",
612
- "gmail",
613
- "heroku",
614
- "hubspot",
615
- "huggingface",
616
- "jira",
617
- "linear",
618
- "mailchimp",
619
- "meta",
620
- "mistral",
621
- "mixmax",
622
- "monday",
623
- "netlify",
624
- "neon",
625
- "notion",
626
- "npm",
627
- "outlook",
628
- "outreach",
629
- "perplexity",
630
- "planetscale",
631
- "pnpm",
632
- "postmark",
633
- "ramp",
634
- "railway",
635
- "render",
636
- "resend",
637
- "salesforce",
638
- "segment",
639
- "sendgrid",
640
- "shopify",
641
- "slack",
642
- "snowflake",
643
- "stripe",
644
- "supabase",
645
- "terraform",
646
- "trello",
647
- "turso",
648
- "twilio",
649
- "typeform",
650
- "vercel",
651
- "vscode",
652
- "windsurf",
653
- "yarn"
654
- ];
655
- /** Company, team, and department landing-page segments. */
656
- const COMPANY_TEAM_SLUGS = [
657
- "engineers",
658
- "engineering",
659
- "executives",
660
- "hc",
661
- "intern",
662
- "it",
663
- "leadership",
664
- "marketing",
665
- "ops",
666
- "revops",
667
- "sales",
668
- "services",
669
- "tech"
670
- ];
671
- /** Legal, trust, compliance, and policy URL segments. */
672
- const LEGAL_TRUST_SLUGS = [
673
- "accessibility",
674
- "agreement",
675
- "a11y",
676
- "bug-bounty",
677
- "compliance",
678
- "cookie-policy",
679
- "cookies",
680
- "disclose",
681
- "dpa",
682
- "eula",
683
- "gdpr",
684
- "hipaa",
685
- "iso",
686
- "msa",
687
- "pci",
688
- "responsible-disclosure",
689
- "sla",
690
- "soc2",
691
- "tos",
692
- "trust-center",
693
- "trustcenter",
694
- "vulnerability"
695
- ];
696
- /** Developer, API, CLI, and technical URL segments. */
697
- const DEVELOPER_TECH_SLUGS = [
698
- "api",
699
- "api-docs",
700
- "cli",
701
- "code",
702
- "config",
703
- "developer",
704
- "developer-tools",
705
- "developers",
706
- "dev-tools",
707
- "devtools",
708
- "dev",
709
- "dev-states",
710
- "graphql",
711
- "graphql-playground",
712
- "mcp-server",
713
- "mcp-servers",
714
- "openapi",
715
- "sdk",
716
- "swagger"
717
- ];
718
- /** Infra, ops, static assets, and system URL segments. */
719
- const INFRA_SYSTEM_SLUGS = [
720
- "acme-challenge",
721
- "admin",
722
- "apple-app-site-association",
723
- "assets",
724
- "batch",
725
- "cache",
726
- "cdn",
727
- "cron",
728
- "debug",
729
- "error",
730
- "errors",
731
- "favicon",
732
- "feed",
733
- "files",
734
- "health",
735
- "healthcheck",
736
- "healthz",
737
- "hooks",
738
- "internal",
739
- "item",
740
- "manifest",
741
- "metrics",
742
- "null",
743
- "ping",
744
- "prod",
745
- "public",
746
- "redirect",
747
- "robots",
748
- "rpc",
749
- "rss",
750
- "sharer",
751
- "sitemap",
752
- "staging",
753
- "static",
754
- "storage",
755
- "test",
756
- "undefined",
757
- "universal",
758
- "webhooks",
759
- "well-known",
760
- "www"
761
- ];
762
- /** Reserved slugs that are valid org names in theory but blocked for routing safety. */
763
- const ROUTING_SAFETY_SLUGS = [
764
- "alpha",
765
- "anonymous",
766
- "archive",
767
- "archived",
768
- "beta",
769
- "clone",
770
- "copy",
771
- "default",
772
- "deleted",
773
- "demo-org",
774
- "draft",
775
- "drafts",
776
- "duplicate",
777
- "early-access",
778
- "embed",
779
- "embedded",
780
- "export",
781
- "fork",
782
- "free",
783
- "guest",
784
- "import",
785
- "index",
786
- "list",
787
- "manage",
788
- "moderator",
789
- "newsletter",
790
- "owner",
791
- "preview",
792
- "previews",
793
- "private",
794
- "pro",
795
- "public-api",
796
- "publish",
797
- "published",
798
- "queue",
799
- "remove",
800
- "root",
801
- "sample",
802
- "samples",
803
- "selection",
804
- "share",
805
- "shared",
806
- "sponsor",
807
- "sponsors",
808
- "sponsorship",
809
- "subscribe",
810
- "super",
811
- "superuser",
812
- "system",
813
- "sys",
814
- "test-org",
815
- "trash",
816
- "unpublish",
817
- "unsubscribe",
818
- "upload",
819
- "uploads",
820
- "waitlist",
821
- "widget",
822
- "widgets",
823
- "worker",
824
- "workers"
825
- ];
826
- /**
827
- * URL segments reserved for global (non-org) routes — cannot be used as an org slug.
828
- * Prefer adding new entries to the category arrays above; the Set is the enforcement surface.
829
- */
830
- const RESERVED_ORGANIZATION_SLUGS = new Set([
831
- ...AUTH_ACCOUNT_SLUGS,
832
- ...ORG_ACCOUNT_SLUGS,
833
- ...PRODUCT_SLUGS,
834
- ...MARKETING_SITE_SLUGS,
835
- ...INTEGRATION_BRAND_SLUGS,
836
- ...COMPANY_TEAM_SLUGS,
837
- ...LEGAL_TRUST_SLUGS,
838
- ...DEVELOPER_TECH_SLUGS,
839
- ...INFRA_SYSTEM_SLUGS,
840
- ...ROUTING_SAFETY_SLUGS
841
- ]);
842
- /**
843
- * Base slug format: lowercase, 2-64 chars, alphanumeric + dashes.
844
- *
845
- * IMPORTANT: this is the schema for *reading* slugs (persisted rows, API
846
- * responses). It intentionally does NOT enforce the reserved-name list — an org
847
- * created before a name became reserved must still parse on read. Use
848
- * `ClaimableOrganizationSlugSchema` to validate slugs a user is trying to claim.
849
- */
850
- const OrganizationSlugSchema = zod.z.string().trim().toLowerCase().min(2, "Slug must be at least 2 characters").max(64, "Slug must be at most 64 characters").regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "Use lowercase letters, numbers, and dashes only");
851
- /**
852
- * Slug validation for *claiming* a slug (organization create/rename). Adds the
853
- * reserved-name check on top of the base format. Never use this to parse
854
- * existing org data, or pre-existing orgs whose slug later became reserved would
855
- * fail to load.
856
- */
857
- const ClaimableOrganizationSlugSchema = OrganizationSlugSchema.refine((slug) => !RESERVED_ORGANIZATION_SLUGS.has(slug), "This slug is reserved");
858
- /** Same format as organization slugs — org-scoped, no global reserved list. */
859
- const ProjectSlugSchema = OrganizationSlugSchema;
860
- /** TCP port to bind for a local server, derived from a public URL. */
861
- function listenPortFromUrl(url, fallback) {
862
- const parsed = new URL(url);
863
- if (parsed.port) {
864
- const port = Number(parsed.port);
865
- if (Number.isFinite(port) && port > 0) return port;
866
- }
867
- if (parsed.protocol === "https:") return 443;
868
- if (parsed.protocol === "http:") return 80;
869
- return fallback;
870
- }
871
- /** Shorthand: listen port from `PUBLIC_*_URL` or fallback. */
872
- function listenPortFromPublicUrl(value, fallback) {
873
- const trimmed = value?.trim();
874
- if (!trimmed) return fallback;
875
- try {
876
- return listenPortFromUrl(trimmed, fallback);
877
- } catch {
878
- return fallback;
879
- }
880
- }
881
- /** On-disk path under the project root (packed in deploy artifacts when present). */
882
- const ROUTE_MANIFEST_REL_PATH = "dist/.keystroke/route-manifest.json";
883
- const StoredRouteManifestSkillSchema = zod.z.object({
884
- slug: zod.z.string(),
885
- name: zod.z.string().optional(),
886
- description: zod.z.string().optional(),
887
- moduleFile: zod.z.string()
888
- });
889
- const serializedRouteManifestEntrySchema = zod.z.discriminatedUnion("kind", [
890
- zod.z.object({
891
- kind: zod.z.literal("health"),
892
- method: zod.z.literal("GET"),
893
- path: zod.z.literal("/health")
894
- }),
895
- zod.z.object({
896
- kind: zod.z.literal("agent"),
897
- method: zod.z.literal("POST"),
898
- path: zod.z.string(),
899
- agentSlug: zod.z.string(),
900
- moduleFile: zod.z.string(),
901
- name: zod.z.string().optional(),
902
- description: zod.z.string().optional(),
903
- model: zod.z.string(),
904
- systemPrompt: zod.z.string(),
905
- toolCount: zod.z.number().int().nonnegative(),
906
- credentialCount: zod.z.number().int().nonnegative(),
907
- requestSchema: zod.z.record(zod.z.string(), zod.z.unknown()),
908
- responseSchema: zod.z.record(zod.z.string(), zod.z.unknown())
909
- }),
910
- zod.z.object({
911
- kind: zod.z.literal("agent-sessions-list"),
912
- method: zod.z.literal("GET"),
913
- path: zod.z.string(),
914
- agentSlug: zod.z.string(),
915
- moduleFile: zod.z.string()
916
- }),
917
- zod.z.object({
918
- kind: zod.z.literal("agent-session-detail"),
919
- method: zod.z.literal("GET"),
920
- path: zod.z.string(),
921
- agentSlug: zod.z.string(),
922
- moduleFile: zod.z.string()
923
- }),
924
- zod.z.object({
925
- kind: zod.z.literal("workflow"),
926
- method: zod.z.literal("POST"),
927
- path: zod.z.string(),
928
- workflowSlug: zod.z.string(),
929
- workflowName: zod.z.string().optional(),
930
- description: zod.z.string().optional(),
931
- subscribable: zod.z.boolean(),
932
- moduleFile: zod.z.string(),
933
- requestSchema: zod.z.record(zod.z.string(), zod.z.unknown()),
934
- responseSchema: zod.z.record(zod.z.string(), zod.z.unknown())
935
- }),
936
- zod.z.object({
937
- kind: zod.z.literal("workflow-runs-list"),
938
- method: zod.z.literal("GET"),
939
- path: zod.z.string(),
940
- workflowSlug: zod.z.string(),
941
- workflowName: zod.z.string().optional(),
942
- moduleFile: zod.z.string()
943
- }),
944
- zod.z.object({
945
- kind: zod.z.literal("workflow-run-detail"),
946
- method: zod.z.literal("GET"),
947
- path: zod.z.string(),
948
- workflowSlug: zod.z.string(),
949
- workflowName: zod.z.string().optional(),
950
- moduleFile: zod.z.string()
951
- }),
952
- zod.z.object({
953
- kind: zod.z.literal("trigger-webhook"),
954
- method: zod.z.literal("POST"),
955
- path: zod.z.string(),
956
- attachmentIds: zod.z.array(zod.z.string()),
957
- moduleFile: zod.z.string(),
958
- requestSchema: zod.z.record(zod.z.string(), zod.z.unknown()),
959
- attachmentSchemas: zod.z.record(zod.z.string(), zod.z.object({
960
- requestSchema: zod.z.record(zod.z.string(), zod.z.unknown()),
961
- filterSchema: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
962
- })),
963
- responseSchema: zod.z.record(zod.z.string(), zod.z.unknown())
964
- }),
965
- zod.z.object({
966
- kind: zod.z.literal("trigger-poll"),
967
- method: zod.z.literal("POST"),
968
- path: zod.z.string(),
969
- attachmentId: zod.z.string(),
970
- moduleFile: zod.z.string(),
971
- schedule: zod.z.string(),
972
- responseSchema: zod.z.record(zod.z.string(), zod.z.unknown())
973
- }),
974
- zod.z.object({
975
- kind: zod.z.literal("trigger-poll-group"),
976
- method: zod.z.literal("POST"),
977
- path: zod.z.string(),
978
- pollId: zod.z.string(),
979
- attachmentIds: zod.z.array(zod.z.string()),
980
- moduleFile: zod.z.string(),
981
- schedule: zod.z.string(),
982
- responseSchema: zod.z.record(zod.z.string(), zod.z.unknown())
983
- }),
984
- zod.z.object({
985
- kind: zod.z.literal("trigger-runs-list"),
986
- method: zod.z.literal("GET"),
987
- path: zod.z.string(),
988
- attachmentId: zod.z.string(),
989
- moduleFile: zod.z.string()
990
- }),
991
- zod.z.object({
992
- kind: zod.z.literal("trigger-run-detail"),
993
- method: zod.z.literal("GET"),
994
- path: zod.z.string(),
995
- attachmentId: zod.z.string(),
996
- moduleFile: zod.z.string()
997
- }),
998
- zod.z.object({
999
- kind: zod.z.literal("cron-schedule"),
1000
- attachmentId: zod.z.string(),
1001
- moduleFile: zod.z.string(),
1002
- schedule: zod.z.string()
1003
- }),
1004
- zod.z.object({
1005
- kind: zod.z.literal("plugin"),
1006
- method: zod.z.enum([
1007
- "GET",
1008
- "POST",
1009
- "PUT",
1010
- "PATCH",
1011
- "DELETE"
1012
- ]),
1013
- path: zod.z.string(),
1014
- plugin: zod.z.string()
1015
- })
1016
- ]);
1017
- const StoredRouteManifestSchema = zod.z.object({
1018
- version: zod.z.literal(1),
1019
- entries: zod.z.array(serializedRouteManifestEntrySchema),
1020
- skills: zod.z.array(StoredRouteManifestSkillSchema).default([]),
1021
- integrations: zod.z.array(zod.z.string()).optional()
1022
- });
1023
- function parseStoredRouteManifest(value) {
1024
- return StoredRouteManifestSchema.parse(value);
1025
- }
1026
- /** Messaging platforms that support agent gateway bindings. */
1027
- const ChannelPlatformKeySchema = zod.z.enum(["slack"]);
1028
- const ChannelReactionSupportSchema = zod.z.enum([
1029
- "full",
1030
- "read-only",
1031
- "none"
1032
- ]);
1033
- const ChannelCardSupportSchema = zod.z.enum([
1034
- "full",
1035
- "partial",
1036
- "none"
1037
- ]);
1038
- const ChannelStreamingSupportSchema = zod.z.enum([
1039
- "native",
1040
- "post-edit",
1041
- "buffered",
1042
- "drafts",
1043
- "none"
1044
- ]);
1045
- const ChannelCapabilitiesSchema = zod.z.object({
1046
- mentions: zod.z.boolean(),
1047
- reactions: ChannelReactionSupportSchema,
1048
- cards: ChannelCardSupportSchema,
1049
- modals: zod.z.boolean(),
1050
- streaming: ChannelStreamingSupportSchema,
1051
- dms: zod.z.boolean()
1052
- });
1053
- const ChannelListenModeSchema = zod.z.enum([
1054
- "mention",
1055
- "all",
1056
- "dm"
1057
- ]);
1058
- const ChannelBindingKindSchema = zod.z.enum([
1059
- "public",
1060
- "private",
1061
- "dm",
1062
- "group",
1063
- "space"
1064
- ]);
1065
- const AppGatewaySchema = zod.z.object({
1066
- capabilities: ChannelCapabilitiesSchema,
1067
- supportedModes: zod.z.array(ChannelListenModeSchema).min(1),
1068
- resourceNoun: zod.z.object({
1069
- singular: zod.z.string().min(1),
1070
- plural: zod.z.string().min(1)
1071
- }),
1072
- supportsChannelDirectory: zod.z.boolean(),
1073
- webhookPathHint: zod.z.string().min(1),
1074
- docsUrl: zod.z.string().url().optional(),
1075
- tagline: zod.z.string().min(1).optional()
1076
- });
1077
- zod.z.object({
1078
- key: ChannelPlatformKeySchema,
1079
- name: zod.z.string().min(1),
1080
- appLogoId: zod.z.string().min(1),
1081
- fallbackDomain: zod.z.string().min(1),
1082
- description: zod.z.string().min(1),
1083
- tagline: zod.z.string().min(1),
1084
- authKind: zod.z.enum(["oauth", "api_key"]),
1085
- credentialFields: zod.z.array(zod.z.object({
1086
- key: zod.z.string().min(1),
1087
- label: zod.z.string().min(1),
1088
- placeholder: zod.z.string().optional(),
1089
- helpText: zod.z.string().optional(),
1090
- type: zod.z.enum([
1091
- "text",
1092
- "password",
1093
- "textarea"
1094
- ]),
1095
- required: zod.z.boolean(),
1096
- prefix: zod.z.string().optional()
1097
- })),
1098
- capabilities: ChannelCapabilitiesSchema,
1099
- supportedModes: zod.z.array(ChannelListenModeSchema).min(1),
1100
- resourceNoun: zod.z.object({
1101
- singular: zod.z.string().min(1),
1102
- plural: zod.z.string().min(1)
1103
- }),
1104
- webhookPathHint: zod.z.string().min(1),
1105
- supportsChannelDirectory: zod.z.boolean(),
1106
- docsUrl: zod.z.string().url().optional()
1107
- });
1108
- const ChannelBindingSchema = zod.z.object({
1109
- id: zod.z.string().min(1),
1110
- channelId: zod.z.string().min(1),
1111
- channelName: zod.z.string().min(1),
1112
- channelKind: ChannelBindingKindSchema,
1113
- mode: ChannelListenModeSchema,
1114
- subscribeOnMention: zod.z.boolean(),
1115
- createdAt: zod.z.string(),
1116
- updatedAt: zod.z.string()
1117
- });
1118
- const ChannelConnectionSchema = zod.z.object({
1119
- id: zod.z.string().min(1),
1120
- platform: ChannelPlatformKeySchema,
1121
- agentId: zod.z.string().min(1),
1122
- accountLabel: zod.z.string().min(1),
1123
- accountId: zod.z.string().min(1),
1124
- connectedAt: zod.z.string(),
1125
- bindings: zod.z.array(ChannelBindingSchema)
1126
- });
1127
- const ChannelDirectoryEntrySchema = zod.z.object({
1128
- id: zod.z.string().min(1),
1129
- name: zod.z.string().min(1),
1130
- kind: ChannelBindingKindSchema,
1131
- memberCount: zod.z.number().int().nonnegative().optional(),
1132
- isArchived: zod.z.boolean().optional()
1133
- });
1134
- zod.z.object({ connections: zod.z.array(ChannelConnectionSchema) });
1135
- zod.z.object({ channels: zod.z.array(ChannelDirectoryEntrySchema) });
1136
- zod.z.object({ teamName: zod.z.string().min(1).optional() });
1137
- /** OAuth workspace available for channel bindings (e.g. Slack team). */
1138
- const ChannelAccountSchema = zod.z.object({
1139
- id: zod.z.string().min(1),
1140
- platform: ChannelPlatformKeySchema,
1141
- label: zod.z.string().min(1),
1142
- connectedAt: zod.z.string()
1143
- });
1144
- zod.z.object({ accounts: zod.z.array(ChannelAccountSchema) });
1145
- const NewChannelBindingInputSchema = zod.z.object({
1146
- channelId: zod.z.string().min(1),
1147
- channelName: zod.z.string().min(1),
1148
- channelKind: ChannelBindingKindSchema.optional(),
1149
- mode: ChannelListenModeSchema.optional(),
1150
- subscribeOnMention: zod.z.boolean().optional()
1151
- });
1152
- zod.z.object({
1153
- platform: ChannelPlatformKeySchema,
1154
- accountId: zod.z.string().min(1),
1155
- binding: NewChannelBindingInputSchema
1156
- });
1157
- zod.z.object({ patch: zod.z.object({
1158
- mode: ChannelListenModeSchema.optional(),
1159
- subscribeOnMention: zod.z.boolean().optional()
1160
- }) });
1161
- /** A single OAuth scope an app can request, with human copy for connect UI. */
1162
- const OAuthScopeOptionSchema = zod.z.object({
1163
- name: zod.z.string().min(1),
1164
- description: zod.z.string().min(1),
1165
- defaultSelected: zod.z.boolean().optional(),
1166
- required: zod.z.boolean().optional()
1167
- });
1168
- /** How an app authenticates when connecting credentials. */
1169
- const AppAuthKindSchema = zod.z.enum([
1170
- "oauth",
1171
- "api_key",
1172
- "keystroke"
1173
- ]);
1174
- /**
1175
- * Where app metadata and execution are sourced (e.g. native, composio, pipedream, custom).
1176
- * Opaque string — cloud/hosted entrypoints choose values; keystroke stays provider-agnostic.
1177
- */
1178
- const AppSourceSchema = zod.z.string().trim().min(1);
1179
- zod.z.object({
1180
- slug: zod.z.string().trim().min(1),
1181
- name: zod.z.string().min(1),
1182
- description: zod.z.string().min(1),
1183
- category: zod.z.string().min(1),
1184
- logo: zod.z.string().url().optional(),
1185
- authKind: AppAuthKindSchema,
1186
- oauthScopes: zod.z.array(OAuthScopeOptionSchema)
1187
- }).extend({ source: AppSourceSchema });
1188
- zod.z.object({
1189
- id: zod.z.string().min(1),
1190
- organizationId: zod.z.string().min(1).nullable(),
1191
- slug: zod.z.string().min(1),
1192
- name: zod.z.string().min(1),
1193
- description: zod.z.string().min(1),
1194
- category: zod.z.string().min(1),
1195
- logo: zod.z.string().url().nullable(),
1196
- authKind: AppAuthKindSchema,
1197
- oauthScopes: zod.z.array(OAuthScopeOptionSchema),
1198
- source: AppSourceSchema,
1199
- createdAt: zod.z.string().min(1),
1200
- updatedAt: zod.z.string().min(1)
1201
- });
1202
- /**
1203
- * A connectable integration shown in the "Connect an app" picker. An "app" is
1204
- * an integration / credential set — connected state is whether a credential exists.
1205
- */
1206
- const AppCatalogEntrySchema = zod.z.object({
1207
- id: zod.z.string().min(1),
1208
- name: zod.z.string().min(1),
1209
- description: zod.z.string().min(1),
1210
- category: zod.z.string().min(1),
1211
- integrationDescription: zod.z.string().min(1),
1212
- logo: zod.z.string().url().nullable().optional(),
1213
- authKind: AppAuthKindSchema,
1214
- oauthScopes: zod.z.array(OAuthScopeOptionSchema),
1215
- /** When present, the app supports agent gateway bindings (external channels). */
1216
- gateway: AppGatewaySchema.optional()
1217
- });
1218
- const ListAppsResponseSchema = zod.z.object({ apps: zod.z.array(AppCatalogEntrySchema) });
1219
- /** How a credential instance is stored (`credential_instances.auth_kind`). */
1220
- const CredentialAuthKindSchema = zod.z.enum([
1221
- "api_key",
1222
- "oauth_managed",
1223
- "keystroke"
1224
- ]);
1225
- /**
1226
- * Where a credential instance is stored (`credential_instances.scope_type`), and the only thing an
1227
- * action/tool can pin via `.scope(...)`. There is no resolution chain: when no scope is pinned, the
1228
- * resolver tries the project default, then the org default, then throws.
1229
- */
1230
- const CredentialScopeTypeSchema = zod.z.enum([
1231
- "organization",
1232
- "project",
1233
- "user"
1234
- ]);
1235
- CredentialAuthKindSchema.options;
1236
- CredentialScopeTypeSchema.options;
1237
- /** Human-readable app name from a credential slug (e.g. `google-drive` → `Google Drive`). */
1238
- function displayCredentialAppName(appId) {
1239
- return appId.split(/[-_]+/).filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
1240
- }
1241
- function buildCredentialInstanceLabel(options) {
1242
- const appName = options.appName.trim();
1243
- switch (options.scopeType) {
1244
- case "organization": return `Organization ${appName}`;
1245
- case "user": return `Personal ${appName}`;
1246
- case "project": return `${appName} (${options.projectName?.trim() || "Project"})`;
1247
- default: return options.scopeType;
1248
- }
1249
- }
1250
- /** Pick a label that is unused within a credential scope, suffixing when needed. */
1251
- function resolveUniqueCredentialInstanceLabel(options) {
1252
- const taken = new Set([...options.takenLabels].map((label) => label ?? null));
1253
- if (!taken.has(options.baseLabel)) return options.baseLabel;
1254
- const disambiguator = options.disambiguator?.trim();
1255
- if (disambiguator) {
1256
- const withDisambiguator = `${options.baseLabel} (${disambiguator})`;
1257
- if (!taken.has(withDisambiguator)) return withDisambiguator;
1258
- }
1259
- let suffix = 2;
1260
- while (taken.has(`${options.baseLabel} (${suffix})`)) suffix += 1;
1261
- return `${options.baseLabel} (${suffix})`;
1262
- }
1263
- /** Scope of a platform app credential (maps to `credential_instances.scope_type`). */
1264
- const AppCredentialScopeSchema = zod.z.enum([
1265
- "user",
1266
- "project",
1267
- "organization"
1268
- ]);
1269
- /** How the credential was connected (OAuth vs manual api-key entry). */
1270
- const AppCredentialConnectionKindSchema = zod.z.enum(["oauth", "manual"]);
1271
- /** Connect-dialog permission preset for OAuth scope selection. */
1272
- const OAuthPermissionModeSchema = zod.z.enum(["default", "restricted"]);
1273
- const optionalTimestamp$1 = zod.z.string().optional();
1274
- const nullableOptionalTimestamp = zod.z.string().nullable().optional();
1275
- /**
1276
- * Summary row for the apps/credentials table and credential detail page.
1277
- * Plaintext secrets are never returned — only masked `keyPreviews`.
1278
- */
1279
- const AppCredentialSummarySchema = zod.z.object({
1280
- id: zod.z.string().min(1),
1281
- appId: zod.z.string().min(1),
1282
- label: zod.z.string().min(1),
1283
- scope: AppCredentialScopeSchema,
1284
- lastRefreshedAt: zod.z.string().nullable(),
1285
- appName: zod.z.string().min(1).optional(),
1286
- projectId: zod.z.string().min(1).optional(),
1287
- projectName: zod.z.string().min(1).optional(),
1288
- status: zod.z.string().optional(),
1289
- createdAt: optionalTimestamp$1,
1290
- lastUsedAt: nullableOptionalTimestamp,
1291
- isDefault: zod.z.boolean().optional(),
1292
- connectionKind: AppCredentialConnectionKindSchema.optional(),
1293
- ownerUserId: zod.z.string().min(1).optional(),
1294
- ownerName: zod.z.string().min(1).optional(),
1295
- ownerAvatarUrl: zod.z.string().url().optional(),
1296
- grantedScopes: zod.z.array(zod.z.string().min(1)).optional(),
1297
- credentialKeys: zod.z.array(zod.z.string().min(1)).optional(),
1298
- keyPreviews: zod.z.record(zod.z.string(), zod.z.string()).optional(),
1299
- expiresAt: optionalTimestamp$1
1300
- });
1301
- const credentialSecretValueSchema = zod.z.record(zod.z.string(), zod.z.unknown()).refine((value) => Object.keys(value).length > 0, { message: "value must be a non-empty object" });
1302
- function hasCredentialTarget(input) {
1303
- return input.projects.length > 0 || input.createOrganizationCredential || input.createUserProvidedCredential;
1304
- }
1305
- function addMissingCredentialTargetIssue(ctx, path = ["projects"]) {
1306
- ctx.addIssue({
1307
- code: "custom",
1308
- message: "At least one credential target is required",
1309
- path
1310
- });
1311
- }
1312
- /** Target fields shared by create and OAuth start flows. */
1313
- const CredentialTargetsFieldsSchema = zod.z.object({
1314
- projects: zod.z.array(zod.z.string().min(1)).default([]),
1315
- createOrganizationCredential: zod.z.boolean().default(false),
1316
- createUserProvidedCredential: zod.z.boolean().default(false)
1317
- });
1318
- CredentialTargetsFieldsSchema.extend({
1319
- appId: zod.z.string().min(1),
1320
- scopes: zod.z.array(zod.z.string().min(1)),
1321
- permissionMode: OAuthPermissionModeSchema
1322
- });
1323
- zod.z.object({
1324
- status: zod.z.enum(["connected", "redirecting"]),
1325
- authorizeUrl: zod.z.string().url().nullable()
1326
- });
1327
- /** Request body for `POST /api/credentials` (manual api-key fan-out). */
1328
- const CreateCredentialsRequestSchema = CredentialTargetsFieldsSchema.extend({
1329
- appId: zod.z.string().min(1),
1330
- connectionKind: AppCredentialConnectionKindSchema,
1331
- value: credentialSecretValueSchema.optional(),
1332
- scopes: zod.z.array(zod.z.string().min(1)).optional()
1333
- }).superRefine((input, ctx) => {
1334
- if (!hasCredentialTarget(input)) addMissingCredentialTargetIssue(ctx);
1335
- if (input.connectionKind === "manual" && !input.value) ctx.addIssue({
1336
- code: "custom",
1337
- message: "value is required for manual connections",
1338
- path: ["value"]
1339
- });
1340
- if (input.connectionKind === "oauth") ctx.addIssue({
1341
- code: "custom",
1342
- message: "OAuth credentials are created via the OAuth callback",
1343
- path: ["connectionKind"]
1344
- });
1345
- });
1346
- /** Request body for `PATCH /api/credentials/:id`. */
1347
- const UpdateCredentialRequestSchema = zod.z.object({
1348
- label: zod.z.string().trim().min(1).optional(),
1349
- isDefault: zod.z.boolean().optional(),
1350
- value: credentialSecretValueSchema.optional()
1351
- }).refine((input) => input.label !== void 0 || input.isDefault !== void 0 || input.value !== void 0, { message: "At least one field is required" });
1352
- const ListCredentialsResponseSchema = zod.z.object({ credentials: zod.z.array(AppCredentialSummarySchema) });
1353
- const GetCredentialResponseSchema = zod.z.object({ credential: AppCredentialSummarySchema });
1354
- const CreateCredentialsResponseSchema = zod.z.object({ credentials: zod.z.array(AppCredentialSummarySchema) });
1355
- const McpConnectionStatusSchema = zod.z.enum([
1356
- "INITIATED",
1357
- "ACTIVE",
1358
- "EXPIRED",
1359
- "FAILED",
1360
- "INACTIVE",
1361
- "REVOKED"
1362
- ]);
1363
- const McpAppSchema = zod.z.object({
1364
- slug: zod.z.string(),
1365
- name: zod.z.string(),
1366
- connected: zod.z.boolean(),
1367
- connectionId: zod.z.string().optional(),
1368
- status: McpConnectionStatusSchema.optional()
1369
- });
1370
- zod.z.object({ apps: zod.z.array(McpAppSchema) });
1371
- zod.z.object({
1372
- connectionId: zod.z.string(),
1373
- entityId: zod.z.string(),
1374
- instanceId: zod.z.string()
1375
- });
1376
- zod.z.object({
1377
- app: zod.z.string().trim().min(1),
1378
- tool: zod.z.string().trim().min(1),
1379
- arguments: zod.z.record(zod.z.string(), zod.z.unknown()).default({}),
1380
- /**
1381
- * Resolved credential instance to execute against. When set, the platform executes that exact
1382
- * connection (scoped to the caller's org); when omitted it resolves the app's instance by scope.
1383
- */
1384
- instanceId: zod.z.string().trim().min(1).optional(),
1385
- /** Pinned provider toolkit version, sourced from the app definition; forwarded to the provider. */
1386
- version: zod.z.string().trim().min(1)
1387
- });
1388
- const TeamRequestTypeSchema = zod.z.enum([
1389
- "org-deletion",
1390
- "contact",
1391
- "enterprise-upgrade"
1392
- ]);
1393
- const SubmitTeamRequestRequestSchema = zod.z.object({
1394
- type: TeamRequestTypeSchema,
1395
- message: zod.z.string().trim().max(5e3).optional()
1396
- });
1397
- const SubmitTeamRequestResponseSchema = zod.z.object({ ok: zod.z.literal(true) });
1398
- function isCredentialInput(value) {
1399
- if (typeof value !== "object" || value === null) return false;
1400
- const candidate = value;
1401
- return typeof candidate.key === "string" && CredentialAuthKindSchema.safeParse(candidate.kind).success && candidate.schema instanceof zod.z.ZodType;
1402
- }
1403
- const credentialInputSchema = zod.z.custom((value) => isCredentialInput(value), "must be a credential requirement");
1404
- const PROJECT_SLUG_TAKEN_MESSAGE = "That slug is already taken.";
1405
- const OrganizationSlugErrorCodeSchema = zod.z.enum([
1406
- "slug_taken",
1407
- "slug_reserved",
1408
- "slug_invalid"
1409
- ]);
1410
- const SlugAvailabilityReasonSchema = zod.z.enum([
1411
- "taken",
1412
- "reserved",
1413
- "invalid"
1414
- ]);
1415
- const SlugAvailabilityResponseSchema = zod.z.object({
1416
- slug: zod.z.string(),
1417
- available: zod.z.boolean(),
1418
- reason: SlugAvailabilityReasonSchema.optional(),
1419
- suggestion: OrganizationSlugSchema.optional()
1420
- });
1421
- const SlugAvailabilityQuerySchema = zod.z.object({
1422
- slug: zod.z.string().trim().min(1),
1423
- excludeOrganizationId: zod.z.string().min(1).optional()
1424
- });
1425
- const ProjectSlugAvailabilityReasonSchema = zod.z.enum(["taken", "invalid"]);
1426
- const ProjectSlugAvailabilityResponseSchema = zod.z.object({
1427
- slug: zod.z.string(),
1428
- available: zod.z.boolean(),
1429
- reason: ProjectSlugAvailabilityReasonSchema.optional(),
1430
- suggestion: ProjectSlugSchema.optional()
1431
- });
1432
- const ProjectSlugAvailabilityQuerySchema = zod.z.object({
1433
- slug: zod.z.string().trim().min(1),
1434
- excludeProjectId: zod.z.string().min(1).optional()
1435
- });
1436
- function organizationSlugErrorCodeFromMessage(message) {
1437
- if (message === "That slug is already taken." || /already taken/i.test(message)) return "slug_taken";
1438
- if (/reserved/i.test(message)) return "slug_reserved";
1439
- return "slug_invalid";
1440
- }
1441
- const ProjectStatusSchema = zod.z.enum([
1442
- "inactive",
1443
- "starting",
1444
- "active",
1445
- "failed"
1446
- ]);
1447
- const OrganizationUserRoleSchema = zod.z.enum([
1448
- "owner",
1449
- "admin",
1450
- "builder"
1451
- ]);
1452
- const isoDateTime$5 = zod.z.string().datetime();
1453
- const OrganizationSchema = zod.z.object({
1454
- id: zod.z.string(),
1455
- name: zod.z.string(),
1456
- slug: OrganizationSlugSchema,
1457
- createdAt: isoDateTime$5,
1458
- updatedAt: isoDateTime$5
1459
- });
1460
- const ProjectSchema = zod.z.object({
1461
- id: zod.z.string(),
1462
- organizationId: zod.z.string(),
1463
- name: zod.z.string(),
1464
- slug: ProjectSlugSchema,
1465
- description: zod.z.string().nullable(),
1466
- status: ProjectStatusSchema,
1467
- baseUrl: zod.z.string().nullable(),
1468
- runtimeId: zod.z.string().nullable(),
1469
- lastError: zod.z.string().nullable(),
1470
- createdAt: isoDateTime$5,
1471
- updatedAt: isoDateTime$5
1472
- });
1473
- const UserOrganizationSchema = zod.z.object({
1474
- organization: OrganizationSchema,
1475
- role: OrganizationUserRoleSchema
1476
- });
1477
- const ActiveOrganizationResponseSchema = zod.z.object({ organization: UserOrganizationSchema.nullable() });
1478
- const ListOrganizationsResponseSchema = zod.z.object({ organizations: zod.z.array(UserOrganizationSchema) });
1479
- const CreateOrganizationRequestSchema = zod.z.object({
1480
- name: zod.z.string().trim().min(1),
1481
- /** Format-only at the wire boundary; reserved-name checks run in platform-database. */
1482
- slug: OrganizationSlugSchema.optional()
1483
- });
1484
- const UpdateOrganizationRequestSchema = zod.z.object({
1485
- name: zod.z.string().trim().min(1).optional(),
1486
- slug: ClaimableOrganizationSlugSchema.optional()
1487
- }).refine((data) => data.name !== void 0 || data.slug !== void 0, { message: "At least one field is required" });
1488
- const CreateOrganizationResponseSchema = zod.z.object({ organization: UserOrganizationSchema });
1489
- const ListProjectsResponseSchema = zod.z.object({ projects: zod.z.array(ProjectSchema) });
1490
- const ProjectListMetricsSchema = zod.z.object({
1491
- agentCount: zod.z.number(),
1492
- workflowCount: zod.z.number(),
1493
- skillCount: zod.z.number(),
1494
- credentialCount: zod.z.number(),
1495
- lastDeploymentAt: isoDateTime$5.nullable()
1496
- });
1497
- const ListProjectMetricsResponseSchema = zod.z.object({ metrics: zod.z.record(zod.z.string(), ProjectListMetricsSchema) });
1498
- const CreateProjectRequestSchema = zod.z.object({
1499
- name: zod.z.string().trim().min(1),
1500
- description: zod.z.string().trim().min(1).optional()
1501
- });
1502
- const UpdateProjectRequestSchema = zod.z.object({
1503
- name: zod.z.string().trim().min(1).optional(),
1504
- description: zod.z.string().trim().optional(),
1505
- slug: ProjectSlugSchema.optional()
1506
- }).refine((data) => data.name !== void 0 || data.description !== void 0 || data.slug !== void 0, { message: "At least one field is required" });
1507
- const CreateProjectResponseSchema = zod.z.object({ project: ProjectSchema });
1508
- const ProjectResponseSchema = zod.z.object({ project: ProjectSchema });
1509
- const ProjectReachabilityResponseSchema = zod.z.object({ reachable: zod.z.boolean() });
1510
- const ValidationErrorDetailSchema = zod.z.object({
1511
- path: zod.z.string(),
1512
- message: zod.z.string()
1513
- });
1514
- /** Machine-readable codes returned in standard API error bodies. */
1515
- const ErrorResponseCodeSchema = OrganizationSlugErrorCodeSchema.or(zod.z.enum(["needs_org_selection"]));
1516
- /** Standard JSON error body returned by the HTTP API. */
1517
- const ErrorResponseSchema = zod.z.object({
1518
- error: zod.z.string(),
1519
- code: ErrorResponseCodeSchema.optional(),
1520
- message: zod.z.string().optional(),
1521
- details: zod.z.array(ValidationErrorDetailSchema).optional()
1522
- });
1523
- /** Build the JSON body for HTTP 400 validation failures. */
1524
- function validationErrorResponse(error, summary) {
1525
- return {
1526
- error: summary,
1527
- details: error.issues.map((issue) => ({
1528
- path: issue.path.join("."),
1529
- message: issue.message
1530
- }))
1531
- };
1532
- }
1533
- zod.z.object({ message: zod.z.string() });
1534
- const CredentialRunContextSchema = zod.z.object({
1535
- orgId: zod.z.string().min(1).optional(),
1536
- projectId: zod.z.string().min(1).optional(),
1537
- userId: zod.z.string().min(1).optional(),
1538
- userIds: zod.z.record(zod.z.string(), zod.z.string()).optional(),
1539
- selection: zod.z.record(zod.z.string(), zod.z.string()).optional()
1540
- });
1541
- const ThinkingLevelSchema = zod.z.enum([
1542
- "off",
1543
- "minimal",
1544
- "low",
1545
- "medium",
1546
- "high",
1547
- "xhigh"
1548
- ]);
1549
- zod.z.object({
1550
- message: zod.z.string().min(1),
1551
- sessionId: zod.z.string().min(1).optional(),
1552
- subscriptionId: zod.z.string().min(1).optional(),
1553
- context: CredentialRunContextSchema.optional(),
1554
- thinkingLevel: ThinkingLevelSchema.optional()
1555
- });
1556
- zod.z.object({
1557
- sessionId: zod.z.string(),
1558
- messages: zod.z.array(zod.z.record(zod.z.string(), zod.z.unknown())),
1559
- error: zod.z.string().nullable()
1560
- });
1561
- const SkipResponseSchema = zod.z.object({
1562
- ok: zod.z.literal(true),
1563
- skipped: zod.z.literal(true)
1564
- });
1565
- zod.z.object({ ok: zod.z.literal(true) });
1566
- zod.z.object({ service: zod.z.string() });
1567
- const ConnectProviderSchema = zod.z.object({
1568
- key: zod.z.string(),
1569
- mode: zod.z.enum(["authorize-url", "browser-redirect"]),
1570
- path: zod.z.string(),
1571
- requiresAuth: zod.z.boolean()
1572
- });
1573
- zod.z.object({ providers: zod.z.array(ConnectProviderSchema) });
1574
- zod.z.object({ url: zod.z.string() });
1575
- zod.z.object({ runId: zod.z.string() });
1576
- zod.z.object({ sessionId: zod.z.string() });
1577
- zod.z.object({
1578
- workflows: zod.z.array(zod.z.string().min(1)).optional(),
1579
- attachments: zod.z.array(zod.z.string().min(1)).optional()
1580
- });
1581
- const PollAttachmentResultSchema = zod.z.object({
1582
- attachmentKey: zod.z.string(),
1583
- workflowKey: zod.z.string(),
1584
- runId: zod.z.string().optional(),
1585
- body: zod.z.unknown().optional(),
1586
- queued: zod.z.boolean(),
1587
- skipped: zod.z.boolean().optional()
1588
- });
1589
- const PollRunMultiResponseSchema = zod.z.object({ results: zod.z.array(PollAttachmentResultSchema) });
1590
- zod.z.union([
1591
- zod.z.record(zod.z.string(), zod.z.unknown()),
1592
- PollRunMultiResponseSchema,
1593
- SkipResponseSchema,
1594
- zod.z.object({ runId: zod.z.string() })
1595
- ]);
1596
- const RunSourceKindSchema = zod.z.enum([
1597
- "api",
1598
- "trigger",
1599
- "gateway",
1600
- "workflow",
1601
- "agent"
1602
- ]);
1603
- zod.z.object({
1604
- kind: RunSourceKindSchema,
1605
- id: zod.z.string().nullable()
1606
- });
1607
- const WorkflowRunStatusSchema = zod.z.enum([
1608
- "pending",
1609
- "running",
1610
- "sleeping",
1611
- "waiting_hook",
1612
- "completed",
1613
- "failed",
1614
- "canceled"
1615
- ]);
1616
- const WorkflowRunTriggerSchema = zod.z.enum([
1617
- "api",
1618
- "cron",
1619
- "webhook",
1620
- "poll",
1621
- "retry"
1622
- ]);
1623
- zod.z.enum([
1624
- "run_started",
1625
- "step_completed",
1626
- "step_failed",
1627
- "step_retrying",
1628
- "sleep_scheduled",
1629
- "sleep_completed",
1630
- "hook_created",
1631
- "hook_resumed",
1632
- "run_completed",
1633
- "run_failed",
1634
- "run_canceled"
1635
- ]);
1636
- const WorkflowRunSummarySchema = zod.z.object({
1637
- id: zod.z.string(),
1638
- status: WorkflowRunStatusSchema,
1639
- trigger: WorkflowRunTriggerSchema,
1640
- triggeredAt: zod.z.string(),
1641
- startedAt: zod.z.string().nullable(),
1642
- finishedAt: zod.z.string().nullable(),
1643
- sourceKind: RunSourceKindSchema,
1644
- sourceId: zod.z.string().nullable(),
1645
- triggerRunId: zod.z.string().nullable(),
1646
- attachmentId: zod.z.string().nullable()
1647
- });
1648
- const WorkflowRunRecordSchema = zod.z.object({
1649
- id: zod.z.string(),
1650
- workflowSlug: zod.z.string(),
1651
- status: WorkflowRunStatusSchema,
1652
- trigger: WorkflowRunTriggerSchema,
1653
- triggeredAt: zod.z.string(),
1654
- startedAt: zod.z.string().nullable(),
1655
- finishedAt: zod.z.string().nullable(),
1656
- sourceKind: RunSourceKindSchema,
1657
- sourceId: zod.z.string().nullable(),
1658
- triggerRunId: zod.z.string().nullable(),
1659
- attachmentId: zod.z.string().nullable(),
1660
- parentWorkflowRunId: zod.z.string().nullable(),
1661
- parentSpanId: zod.z.string().nullable(),
1662
- input: zod.z.unknown().nullable(),
1663
- output: zod.z.unknown().nullable(),
1664
- error: zod.z.unknown().nullable()
1665
- });
1666
- zod.z.object({
1667
- limit: zod.z.coerce.number().int().min(1).max(100).optional().default(20),
1668
- cursor: zod.z.string().min(1).optional(),
1669
- status: WorkflowRunStatusSchema.optional(),
1670
- trigger: WorkflowRunTriggerSchema.optional()
1671
- });
1672
- zod.z.object({
1673
- items: zod.z.array(WorkflowRunSummarySchema),
1674
- nextCursor: zod.z.string().nullable()
1675
- });
1676
- zod.z.enum([
1677
- "trigger",
1678
- "steps",
1679
- "trace"
1680
- ]);
1681
- zod.z.object({ include: zod.z.string().optional() });
1682
- const TriggerRunDetailSchema = zod.z.object({
1683
- id: zod.z.string(),
1684
- attachmentId: zod.z.string(),
1685
- attachmentSlug: zod.z.string().nullable(),
1686
- triggerType: zod.z.enum([
1687
- "cron",
1688
- "webhook",
1689
- "poll"
1690
- ]),
1691
- sourcePath: zod.z.string().nullable(),
1692
- payload: zod.z.unknown().nullable(),
1693
- triggeredAt: zod.z.string()
1694
- });
1695
- const WorkflowStepRunSchema = zod.z.object({
1696
- id: zod.z.string(),
1697
- actionKey: zod.z.string(),
1698
- output: zod.z.unknown(),
1699
- completedAt: zod.z.string()
1700
- });
1701
- const TraceTriggerSummarySchema = zod.z.object({
1702
- triggerType: zod.z.string(),
1703
- triggerRunId: zod.z.string(),
1704
- workflowSlug: zod.z.string().optional(),
1705
- agentSlug: zod.z.string().optional(),
1706
- attachmentId: zod.z.string().nullable().optional(),
1707
- attachmentSlug: zod.z.string().nullable().optional(),
1708
- route: zod.z.string().optional(),
1709
- sourcePath: zod.z.string().nullable().optional()
1710
- }).nullable();
1711
- const TraceGatewaySummarySchema = zod.z.object({
1712
- gatewayAttachmentId: zod.z.string(),
1713
- gatewayAttachmentKey: zod.z.string(),
1714
- threadId: zod.z.string().optional(),
1715
- channelId: zod.z.string().optional(),
1716
- mode: zod.z.string().optional()
1717
- }).nullable();
1718
- const TraceSpanSchema = zod.z.object({
1719
- id: zod.z.string(),
1720
- traceId: zod.z.string(),
1721
- parentSpanId: zod.z.string().nullable(),
1722
- kind: zod.z.string(),
1723
- refId: zod.z.string(),
1724
- name: zod.z.string(),
1725
- status: zod.z.string(),
1726
- startedAt: zod.z.string(),
1727
- finishedAt: zod.z.string().nullable(),
1728
- metadata: zod.z.unknown().nullable(),
1729
- error: zod.z.unknown().nullable()
1730
- });
1731
- const TraceLogSchema = zod.z.object({
1732
- id: zod.z.string(),
1733
- traceId: zod.z.string(),
1734
- spanId: zod.z.string(),
1735
- seq: zod.z.number(),
1736
- level: zod.z.string(),
1737
- message: zod.z.string(),
1738
- data: zod.z.unknown().nullable(),
1739
- source: zod.z.string(),
1740
- createdAt: zod.z.string()
1741
- });
1742
- const TraceResponseSchema = zod.z.object({
1743
- traceId: zod.z.string(),
1744
- trigger: TraceTriggerSummarySchema,
1745
- gateway: TraceGatewaySummarySchema,
1746
- spans: zod.z.array(TraceSpanSchema),
1747
- logs: zod.z.array(TraceLogSchema)
1748
- });
1749
- zod.z.object({
1750
- run: WorkflowRunRecordSchema,
1751
- trigger: TriggerRunDetailSchema.nullable(),
1752
- steps: zod.z.array(WorkflowStepRunSchema),
1753
- trace: TraceResponseSchema.nullable()
1754
- });
1755
- const AgentSessionStatusSchema = zod.z.enum([
1756
- "running",
1757
- "completed",
1758
- "failed",
1759
- "canceled"
1760
- ]);
1761
- const AgentSessionSummarySchema = zod.z.object({
1762
- id: zod.z.string(),
1763
- status: AgentSessionStatusSchema,
1764
- source: RunSourceKindSchema,
1765
- sourceId: zod.z.string().nullable(),
1766
- createdAt: zod.z.string(),
1767
- updatedAt: zod.z.string(),
1768
- messageCount: zod.z.number()
1769
- });
1770
- const AgentSessionRecordSchema = zod.z.object({
1771
- id: zod.z.string(),
1772
- agentSlug: zod.z.string(),
1773
- status: AgentSessionStatusSchema,
1774
- source: RunSourceKindSchema,
1775
- sourceId: zod.z.string().nullable(),
1776
- createdAt: zod.z.string(),
1777
- updatedAt: zod.z.string(),
1778
- parentSpanId: zod.z.string().nullable(),
1779
- messageCount: zod.z.number(),
1780
- error: zod.z.unknown().nullable()
1781
- });
1782
- zod.z.object({
1783
- limit: zod.z.coerce.number().int().min(1).max(100).optional().default(20),
1784
- cursor: zod.z.string().min(1).optional(),
1785
- status: AgentSessionStatusSchema.optional(),
1786
- source: RunSourceKindSchema.optional()
1787
- });
1788
- zod.z.object({
1789
- items: zod.z.array(AgentSessionSummarySchema),
1790
- nextCursor: zod.z.string().nullable()
1791
- });
1792
- zod.z.enum([
1793
- "gateway",
1794
- "messages",
1795
- "events",
1796
- "trace"
1797
- ]);
1798
- zod.z.object({ include: zod.z.string().optional() });
1799
- const GatewaySessionDetailSchema = zod.z.object({
1800
- threadId: zod.z.string(),
1801
- attachmentId: zod.z.string(),
1802
- attachmentSlug: zod.z.string().nullable()
1803
- });
1804
- const AgentEventSchema = zod.z.object({
1805
- id: zod.z.string(),
1806
- sessionId: zod.z.string(),
1807
- seq: zod.z.number(),
1808
- eventType: zod.z.string(),
1809
- payload: zod.z.unknown(),
1810
- createdAt: zod.z.string()
1811
- });
1812
- zod.z.object({
1813
- session: AgentSessionRecordSchema,
1814
- gateway: GatewaySessionDetailSchema.nullable(),
1815
- messages: zod.z.array(zod.z.record(zod.z.string(), zod.z.unknown())),
1816
- events: zod.z.array(AgentEventSchema),
1817
- trace: TraceResponseSchema.nullable()
1818
- });
1819
- const SlackGatewayModeSchema = zod.z.enum([
1820
- "mention",
1821
- "channel",
1822
- "dm"
1823
- ]);
1824
- const GatewayAttachmentSourceSchema = zod.z.object({
1825
- kind: zod.z.literal("slack"),
1826
- mode: SlackGatewayModeSchema,
1827
- credentialKey: zod.z.string(),
1828
- channelIds: zod.z.array(zod.z.string()).optional(),
1829
- subscribeOnMention: zod.z.boolean()
1830
- });
1831
- const GatewayAttachmentRecordSchema = zod.z.object({
1832
- id: zod.z.string(),
1833
- key: zod.z.string(),
1834
- agentKey: zod.z.string(),
1835
- channelId: zod.z.string(),
1836
- teamId: zod.z.string().nullable().optional(),
1837
- platform: zod.z.string(),
1838
- source: GatewayAttachmentSourceSchema,
1839
- registeredAt: zod.z.string(),
1840
- updatedAt: zod.z.string()
1841
- });
1842
- zod.z.object({ attachments: zod.z.array(GatewayAttachmentRecordSchema) });
1843
- zod.z.object({
1844
- agentKey: zod.z.string().min(1),
1845
- teamId: zod.z.string().min(1).optional(),
1846
- mode: SlackGatewayModeSchema.optional(),
1847
- subscribeOnMention: zod.z.boolean().optional()
1848
- });
1849
- const AgentListItemSchema = zod.z.object({
1850
- key: zod.z.string(),
1851
- name: zod.z.string().optional(),
1852
- route: zod.z.string()
1853
- });
1854
- zod.z.object({ agents: zod.z.array(AgentListItemSchema) });
1855
- const HistoryRunKindSchema = zod.z.enum(["workflow", "agent"]);
1856
- const HistoryRunStatusSchema = zod.z.enum([
1857
- "pending",
1858
- "running",
1859
- "sleeping",
1860
- "waiting_hook",
1861
- "completed",
1862
- "failed",
1863
- "canceled"
1864
- ]);
1865
- const HistoryRunActorSchema = zod.z.object({
1866
- userId: zod.z.string(),
1867
- name: zod.z.string(),
1868
- avatarUrl: zod.z.string().nullable().optional()
1869
- });
1870
- const HistoryRunUsageLineItemSchema = zod.z.object({
1871
- id: zod.z.string(),
1872
- label: zod.z.string(),
1873
- amountUsd: zod.z.number()
1874
- });
1875
- const HistoryRunUsageSchema = zod.z.object({
1876
- runDurationMs: zod.z.number().nullable(),
1877
- lineItems: zod.z.array(HistoryRunUsageLineItemSchema),
1878
- totalExcludingDurationUsd: zod.z.number().nullable()
1879
- });
1880
- const HistoryRunSchema = zod.z.object({
1881
- id: zod.z.string(),
1882
- kind: HistoryRunKindSchema,
1883
- traceId: zod.z.string().nullable(),
1884
- projectId: zod.z.string(),
1885
- projectName: zod.z.string(),
1886
- resourceKey: zod.z.string(),
1887
- resourceId: zod.z.string(),
1888
- resourceName: zod.z.string(),
1889
- status: HistoryRunStatusSchema,
1890
- triggeredAt: zod.z.string(),
1891
- timeInQueueMs: zod.z.number().nullable(),
1892
- startedAt: zod.z.string(),
1893
- finishedAt: zod.z.string().nullable(),
1894
- durationMs: zod.z.number().nullable(),
1895
- triggerLabel: zod.z.string(),
1896
- triggerRaw: zod.z.string(),
1897
- ranAs: HistoryRunActorSchema.nullable(),
1898
- modelsUsed: zod.z.array(zod.z.string()),
1899
- otherServicesUsed: zod.z.array(zod.z.string()),
1900
- totalCostUsd: zod.z.number().nullable(),
1901
- messageCount: zod.z.number().optional(),
1902
- stepCount: zod.z.number().optional()
1903
- });
1904
- const HistoryTraceSpanSchema = zod.z.object({
1905
- id: zod.z.string(),
1906
- traceId: zod.z.string(),
1907
- parentSpanId: zod.z.string().nullable(),
1908
- kind: zod.z.string(),
1909
- refId: zod.z.string(),
1910
- name: zod.z.string(),
1911
- status: zod.z.string(),
1912
- startedAt: zod.z.string(),
1913
- finishedAt: zod.z.string().nullable(),
1914
- metadata: zod.z.unknown().nullable(),
1915
- error: zod.z.unknown().nullable()
1916
- });
1917
- const HistoryTraceLogSchema = zod.z.object({
1918
- id: zod.z.string(),
1919
- traceId: zod.z.string(),
1920
- spanId: zod.z.string(),
1921
- seq: zod.z.number(),
1922
- level: zod.z.string(),
1923
- message: zod.z.string(),
1924
- data: zod.z.unknown().nullable(),
1925
- source: zod.z.string(),
1926
- createdAt: zod.z.string()
1927
- });
1928
- const HistoryTraceTriggerSchema = zod.z.object({
1929
- triggerType: zod.z.string(),
1930
- triggerRunId: zod.z.string(),
1931
- workflowKey: zod.z.string().optional(),
1932
- agentKey: zod.z.string().optional(),
1933
- attachmentId: zod.z.string().nullable().optional(),
1934
- attachmentKey: zod.z.string().nullable().optional(),
1935
- route: zod.z.string().optional(),
1936
- sourcePath: zod.z.string().nullable().optional()
1937
- }).nullable();
1938
- const HistoryTraceGatewaySchema = zod.z.object({
1939
- gatewayAttachmentId: zod.z.string(),
1940
- gatewayAttachmentKey: zod.z.string(),
1941
- threadId: zod.z.string().optional(),
1942
- channelId: zod.z.string().optional(),
1943
- mode: zod.z.string().optional()
1944
- }).nullable();
1945
- const HistoryTraceSchema = zod.z.object({
1946
- traceId: zod.z.string(),
1947
- trigger: HistoryTraceTriggerSchema,
1948
- gateway: HistoryTraceGatewaySchema,
1949
- spans: zod.z.array(HistoryTraceSpanSchema),
1950
- logs: zod.z.array(HistoryTraceLogSchema)
1951
- });
1952
- const HistoryWorkflowStepSchema = zod.z.object({
1953
- id: zod.z.string(),
1954
- actionKey: zod.z.string(),
1955
- output: zod.z.unknown(),
1956
- completedAt: zod.z.string()
1957
- });
1958
- const HistoryWorkflowRunDetailSchema = zod.z.object({
1959
- kind: zod.z.literal("workflow"),
1960
- run: zod.z.object({
1961
- id: zod.z.string(),
1962
- workflowKey: zod.z.string(),
1963
- status: HistoryRunStatusSchema,
1964
- trigger: zod.z.string(),
1965
- triggeredAt: zod.z.string(),
1966
- startedAt: zod.z.string().nullable(),
1967
- finishedAt: zod.z.string().nullable(),
1968
- input: zod.z.unknown().nullable(),
1969
- output: zod.z.unknown().nullable(),
1970
- error: zod.z.unknown().nullable()
1971
- }),
1972
- trigger: zod.z.object({
1973
- id: zod.z.string(),
1974
- attachmentKey: zod.z.string().nullable(),
1975
- triggerType: zod.z.string(),
1976
- sourcePath: zod.z.string().nullable(),
1977
- payload: zod.z.unknown().nullable(),
1978
- triggeredAt: zod.z.string()
1979
- }).nullable(),
1980
- steps: zod.z.array(HistoryWorkflowStepSchema),
1981
- trace: HistoryTraceSchema.nullable(),
1982
- ranAs: HistoryRunActorSchema.nullable().optional(),
1983
- usage: HistoryRunUsageSchema.nullable().optional()
1984
- });
1985
- const HistoryAgentSessionDetailSchema = zod.z.object({
1986
- kind: zod.z.literal("agent"),
1987
- runId: zod.z.string(),
1988
- session: zod.z.object({
1989
- id: zod.z.string(),
1990
- agentKey: zod.z.string(),
1991
- status: HistoryRunStatusSchema,
1992
- source: zod.z.enum([
1993
- "api",
1994
- "gateway",
1995
- "trigger",
1996
- "workflow",
1997
- "agent"
1998
- ]),
1999
- sourceId: zod.z.string().nullable(),
2000
- createdAt: zod.z.string(),
2001
- updatedAt: zod.z.string(),
2002
- messageCount: zod.z.number(),
2003
- error: zod.z.unknown().nullable()
2004
- }),
2005
- gateway: zod.z.object({
2006
- threadId: zod.z.string(),
2007
- attachmentKey: zod.z.string().nullable()
2008
- }).nullable(),
2009
- messages: zod.z.array(zod.z.record(zod.z.string(), zod.z.unknown())),
2010
- trace: HistoryTraceSchema.nullable(),
2011
- ranAs: HistoryRunActorSchema.nullable().optional(),
2012
- usage: HistoryRunUsageSchema.nullable().optional()
2013
- });
2014
- const HistoryRunDetailSchema = zod.z.discriminatedUnion("kind", [HistoryWorkflowRunDetailSchema, HistoryAgentSessionDetailSchema]);
2015
- const HistoryRunListQuerySchema = zod.z.object({
2016
- project: zod.z.string().min(1).optional(),
2017
- status: HistoryRunStatusSchema.optional(),
2018
- kind: HistoryRunKindSchema.optional()
2019
- });
2020
- const HistoryRunListResponseSchema = zod.z.array(HistoryRunSchema);
2021
- const HistoryRunDetailResponseSchema = HistoryRunDetailSchema.nullable();
2022
- const HistoryRunCancelResponseSchema = HistoryRunSchema.nullable();
2023
- const WorkflowSubscriptionRecordSchema = zod.z.object({
2024
- id: zod.z.string(),
2025
- workflowKey: zod.z.string(),
2026
- userId: zod.z.string(),
2027
- enabled: zod.z.boolean(),
2028
- createdAt: zod.z.string(),
2029
- updatedAt: zod.z.string()
2030
- });
2031
- zod.z.object({ subscriptions: zod.z.array(WorkflowSubscriptionRecordSchema) });
2032
- zod.z.object({
2033
- userId: zod.z.string().min(1).optional(),
2034
- enabled: zod.z.boolean().optional()
2035
- });
2036
- const CredentialInstanceRecordSchema = zod.z.object({
2037
- id: zod.z.string(),
2038
- key: zod.z.string(),
2039
- scopeType: CredentialScopeTypeSchema,
2040
- scopeId: zod.z.string().nullable(),
2041
- label: zod.z.string().nullable(),
2042
- isDefault: zod.z.boolean(),
2043
- authKind: CredentialAuthKindSchema
2044
- });
2045
- zod.z.object({ instances: zod.z.array(CredentialInstanceRecordSchema) });
2046
- zod.z.object({
2047
- key: zod.z.string().min(1),
2048
- scopeType: CredentialScopeTypeSchema,
2049
- scopeId: zod.z.string().nullable().optional(),
2050
- label: zod.z.string().nullable().optional(),
2051
- isDefault: zod.z.boolean().optional(),
2052
- value: zod.z.record(zod.z.string(), zod.z.unknown()).refine((value) => Object.keys(value).length > 0, { message: "value must be a non-empty object" })
2053
- });
2054
- zod.z.object({
2055
- label: zod.z.string().nullable().optional(),
2056
- isDefault: zod.z.boolean().optional(),
2057
- value: zod.z.record(zod.z.string(), zod.z.unknown()).refine((value) => Object.keys(value).length > 0, { message: "value must be a non-empty object" }).optional()
2058
- });
2059
- const TriggerRunTypeSchema = zod.z.enum([
2060
- "cron",
2061
- "webhook",
2062
- "poll"
2063
- ]);
2064
- const TriggerRunWorkflowSummarySchema = zod.z.object({
2065
- id: zod.z.string(),
2066
- status: WorkflowRunStatusSchema,
2067
- workflowSlug: zod.z.string()
2068
- });
2069
- const TriggerRunAgentSessionSummarySchema = zod.z.object({
2070
- id: zod.z.string(),
2071
- agentSlug: zod.z.string()
2072
- });
2073
- const TriggerRunSummarySchema = zod.z.object({
2074
- id: zod.z.string(),
2075
- triggerType: TriggerRunTypeSchema,
2076
- triggeredAt: zod.z.string(),
2077
- sourcePath: zod.z.string().nullable(),
2078
- workflowRun: TriggerRunWorkflowSummarySchema.nullable(),
2079
- agentSession: TriggerRunAgentSessionSummarySchema.nullable()
2080
- });
2081
- const TriggerRunRecordSchema = zod.z.object({
2082
- id: zod.z.string(),
2083
- attachmentId: zod.z.string(),
2084
- attachmentSlug: zod.z.string(),
2085
- triggerType: TriggerRunTypeSchema,
2086
- sourcePath: zod.z.string().nullable(),
2087
- payload: zod.z.unknown().nullable(),
2088
- triggeredAt: zod.z.string()
2089
- });
2090
- zod.z.object({
2091
- limit: zod.z.coerce.number().int().min(1).max(100).optional().default(20),
2092
- cursor: zod.z.string().min(1).optional(),
2093
- triggerType: TriggerRunTypeSchema.optional()
2094
- });
2095
- zod.z.object({
2096
- items: zod.z.array(TriggerRunSummarySchema),
2097
- nextCursor: zod.z.string().nullable()
2098
- });
2099
- zod.z.enum([
2100
- "workflows",
2101
- "agents",
2102
- "trace"
2103
- ]);
2104
- zod.z.object({ include: zod.z.string().optional() });
2105
- const TriggerRunAgentSessionDetailSchema = zod.z.object({
2106
- id: zod.z.string(),
2107
- agentSlug: zod.z.string()
2108
- });
2109
- zod.z.object({
2110
- run: TriggerRunRecordSchema,
2111
- workflowRuns: zod.z.array(WorkflowRunSummarySchema),
2112
- agentSessions: zod.z.array(TriggerRunAgentSessionDetailSchema),
2113
- trace: TraceResponseSchema.nullable()
2114
- });
2115
- const TriggerTypeSchema = zod.z.enum([
2116
- "webhook",
2117
- "poll",
2118
- "cron"
2119
- ]);
2120
- const TriggerTargetKindSchema = zod.z.enum(["workflow", "agent"]);
2121
- const TriggerListItemSchema = zod.z.object({
2122
- key: zod.z.string(),
2123
- type: TriggerTypeSchema,
2124
- route: zod.z.string().optional(),
2125
- webhookUrl: zod.z.string().url().optional(),
2126
- targetKind: TriggerTargetKindSchema,
2127
- workflowKey: zod.z.string().optional(),
2128
- agentKey: zod.z.string().optional()
2129
- });
2130
- zod.z.object({ triggers: zod.z.array(TriggerListItemSchema) });
2131
- zod.z.object({ endpoint: zod.z.string().min(1).optional() });
2132
- const OrganizationMemberRoleSchema = zod.z.enum([
2133
- "owner",
2134
- "admin",
2135
- "builder"
2136
- ]);
2137
- const OrganizationMemberStatusSchema = zod.z.enum([
2138
- "invited",
2139
- "active",
2140
- "rejected",
2141
- "suspended"
2142
- ]);
2143
- const InvitableOrganizationMemberRoleSchema = zod.z.enum(["admin", "builder"]);
2144
- const isoDateTime$4 = zod.z.string().datetime();
2145
- const OrganizationMemberSchema = zod.z.object({
2146
- id: zod.z.string(),
2147
- name: zod.z.string(),
2148
- email: zod.z.string().email(),
2149
- role: OrganizationMemberRoleSchema,
2150
- status: OrganizationMemberStatusSchema,
2151
- avatarUrl: zod.z.string().optional(),
2152
- joinedAt: isoDateTime$4.optional(),
2153
- lastActiveAt: isoDateTime$4.nullable().optional()
2154
- });
2155
- const ListOrganizationMembersResponseSchema = zod.z.object({ members: zod.z.array(OrganizationMemberSchema) });
2156
- const InviteOrganizationMembersRequestSchema = zod.z.object({
2157
- emails: zod.z.array(zod.z.string().trim().email()).min(1),
2158
- role: InvitableOrganizationMemberRoleSchema
2159
- });
2160
- const InviteOrganizationMemberResultStatusSchema = zod.z.enum([
2161
- "sent",
2162
- "already_member",
2163
- "pending",
2164
- "invalid"
2165
- ]);
2166
- const InviteOrganizationMemberResultSchema = zod.z.object({
2167
- email: zod.z.string(),
2168
- status: InviteOrganizationMemberResultStatusSchema,
2169
- invitationId: zod.z.string().optional()
2170
- });
2171
- const InviteOrganizationMembersResponseSchema = zod.z.object({ results: zod.z.array(InviteOrganizationMemberResultSchema) });
2172
- const UpdateOrganizationMemberRequestSchema = zod.z.object({ role: InvitableOrganizationMemberRoleSchema });
2173
- const UpdateOrganizationMemberResponseSchema = zod.z.object({ member: OrganizationMemberSchema });
2174
- const OrganizationInvitationSchema = zod.z.object({
2175
- id: zod.z.string(),
2176
- organizationName: zod.z.string(),
2177
- organizationSlug: OrganizationSlugSchema,
2178
- invitedByName: zod.z.string().optional(),
2179
- invitedByEmail: zod.z.string().email().optional(),
2180
- role: OrganizationMemberRoleSchema
2181
- });
2182
- const ListOrganizationInvitationsResponseSchema = zod.z.object({ invitations: zod.z.array(OrganizationInvitationSchema) });
2183
- const AcceptOrganizationInvitationResponseSchema = zod.z.object({ organization: UserOrganizationSchema });
2184
- const DeclineOrganizationInvitationResponseSchema = zod.z.object({ success: zod.z.literal(true) });
2185
- /** Web path to auto-accept an invitation after sign-in (used in invite emails). */
2186
- function organizationInvitationAcceptPath(invitationId) {
2187
- return `/organization/invitations?${new URLSearchParams({ accept: invitationId }).toString()}`;
2188
- }
2189
- const isoDateTime$3 = zod.z.string().datetime();
2190
- const ApiKeyCreatorSchema = zod.z.object({
2191
- id: zod.z.string(),
2192
- name: zod.z.string(),
2193
- email: zod.z.string().email().optional(),
2194
- avatarUrl: zod.z.string().optional(),
2195
- /** True when the creator user row no longer exists. */
2196
- deleted: zod.z.boolean().optional()
2197
- });
2198
- const ApiKeySummarySchema = zod.z.object({
2199
- id: zod.z.string(),
2200
- name: zod.z.string(),
2201
- keyPreview: zod.z.string(),
2202
- createdAt: isoDateTime$3,
2203
- createdBy: ApiKeyCreatorSchema,
2204
- isCreatedByCurrentUser: zod.z.boolean()
2205
- });
2206
- const ListApiKeysResponseSchema = zod.z.object({ apiKeys: zod.z.array(ApiKeySummarySchema) });
2207
- const CreateApiKeyRequestSchema = zod.z.object({ name: zod.z.string().trim().min(1).max(128) });
2208
- const CreateApiKeyResponseSchema = ApiKeySummarySchema.extend({ secret: zod.z.string() });
2209
- const ProjectUserRoleSchema = zod.z.enum(["admin", "builder"]);
2210
- const ProjectInvitePermissionSchema = zod.z.enum(["admin", "all"]);
2211
- const ProjectMemberStatusSchema = zod.z.enum(["active", "invited"]);
2212
- const isoDateTime$2 = zod.z.string().datetime();
2213
- const ProjectMemberSchema = zod.z.object({
2214
- id: zod.z.string(),
2215
- projectId: zod.z.string(),
2216
- name: zod.z.string(),
2217
- email: zod.z.string().email(),
2218
- role: ProjectUserRoleSchema,
2219
- status: ProjectMemberStatusSchema,
2220
- image: zod.z.string().nullable(),
2221
- createdAt: isoDateTime$2,
2222
- isCurrentUser: zod.z.boolean().optional()
2223
- });
2224
- const ListProjectMembersResponseSchema = zod.z.object({ members: zod.z.array(ProjectMemberSchema) });
2225
- const InviteProjectMembersRequestSchema = zod.z.object({
2226
- emails: zod.z.array(zod.z.string().trim().email()).min(1),
2227
- role: ProjectUserRoleSchema
2228
- });
2229
- const InviteProjectMemberResultStatusSchema = zod.z.enum([
2230
- "added",
2231
- "already_member",
2232
- "not_org_member",
2233
- "invalid"
2234
- ]);
2235
- const InviteProjectMemberResultSchema = zod.z.object({
2236
- email: zod.z.string(),
2237
- status: InviteProjectMemberResultStatusSchema
2238
- });
2239
- const InviteProjectMembersResponseSchema = zod.z.object({ results: zod.z.array(InviteProjectMemberResultSchema) });
2240
- const UpdateProjectMemberRequestSchema = zod.z.object({ role: ProjectUserRoleSchema });
2241
- const UpdateProjectMemberResponseSchema = zod.z.object({ member: ProjectMemberSchema });
2242
- const ProjectSettingsSchema = zod.z.object({
2243
- description: zod.z.string(),
2244
- defaultRole: ProjectUserRoleSchema,
2245
- invitePermission: ProjectInvitePermissionSchema
2246
- });
2247
- const UpdateProjectSettingsRequestSchema = zod.z.object({
2248
- description: zod.z.string().optional(),
2249
- defaultRole: ProjectUserRoleSchema.optional(),
2250
- invitePermission: ProjectInvitePermissionSchema.optional()
2251
- }).refine((data) => data.description !== void 0 || data.defaultRole !== void 0 || data.invitePermission !== void 0, { message: "At least one field is required" });
2252
- const ProjectSettingsResponseSchema = zod.z.object({ settings: ProjectSettingsSchema });
2253
- /** Custom avatar override; null means fall back to OAuth `users.image`. */
2254
- const UserAvatarSchema = zod.z.object({ url: zod.z.url().nullable() });
2255
- const UserAvatarPatchSchema = zod.z.object({
2256
- /** Storage key returned from presign; null removes the custom override. */
2257
- storageKey: zod.z.string().min(1).nullable() });
2258
- const PresignUserAvatarRequestSchema = zod.z.object({ contentType: zod.z.string().trim().min(1) });
2259
- const PresignUserAvatarResponseSchema = zod.z.object({
2260
- uploadUrl: zod.z.url(),
2261
- storageKey: zod.z.string().min(1)
2262
- });
2263
- const UserInterfaceThemeSchema = zod.z.enum([
2264
- "system",
2265
- "light",
2266
- "dark"
2267
- ]);
2268
- const UserSurfaceContrastSchema = zod.z.enum(["off", "on"]);
2269
- const UserWorkspaceLayoutModeSchema = zod.z.enum(["default", "linear"]);
2270
- const UserWorkspaceFontSizeSchema = zod.z.enum(["default", "large"]);
2271
- const UserSidebarNavIconVisibilitySchema = zod.z.enum(["hidden", "visible"]);
2272
- const UserSidebarFooterChatRowVisibilitySchema = zod.z.enum(["hidden", "visible"]);
2273
- const UserWorkspaceFavoriteKindSchema = zod.z.enum([
2274
- "agent",
2275
- "workflow",
2276
- "skill",
2277
- "run"
2278
- ]);
2279
- const UserWorkspaceFavoriteSchema = zod.z.object({
2280
- kind: UserWorkspaceFavoriteKindSchema,
2281
- resourceId: zod.z.string().min(1)
2282
- });
2283
- const UserSidebarPreferencesSchema = zod.z.object({
2284
- navIconVisibility: UserSidebarNavIconVisibilitySchema,
2285
- footerChatRowVisibility: UserSidebarFooterChatRowVisibilitySchema,
2286
- hiddenNavItemIds: zod.z.array(zod.z.string()),
2287
- topNavItemOrderIds: zod.z.array(zod.z.string()),
2288
- workspaceNavItemOrderIds: zod.z.array(zod.z.string())
2289
- });
2290
- const UserPreferencesSchema = zod.z.object({
2291
- interfaceTheme: UserInterfaceThemeSchema,
2292
- surfaceContrast: UserSurfaceContrastSchema,
2293
- layoutMode: UserWorkspaceLayoutModeSchema,
2294
- fontSize: UserWorkspaceFontSizeSchema,
2295
- sidebar: UserSidebarPreferencesSchema,
2296
- favorites: zod.z.array(UserWorkspaceFavoriteSchema),
2297
- projectOrderIds: zod.z.array(zod.z.string()),
2298
- projectDotColors: zod.z.record(zod.z.string(), zod.z.string()),
2299
- onboardingTabVisible: zod.z.boolean()
2300
- });
2301
- const UserSidebarPreferencesPatchSchema = zod.z.object({
2302
- navIconVisibility: UserSidebarNavIconVisibilitySchema.optional(),
2303
- footerChatRowVisibility: UserSidebarFooterChatRowVisibilitySchema.optional(),
2304
- hiddenNavItemIds: zod.z.array(zod.z.string()).optional(),
2305
- topNavItemOrderIds: zod.z.array(zod.z.string()).optional(),
2306
- workspaceNavItemOrderIds: zod.z.array(zod.z.string()).optional()
2307
- });
2308
- const UserPreferencesPatchSchema = zod.z.object({
2309
- interfaceTheme: UserInterfaceThemeSchema.optional(),
2310
- surfaceContrast: UserSurfaceContrastSchema.optional(),
2311
- layoutMode: UserWorkspaceLayoutModeSchema.optional(),
2312
- fontSize: UserWorkspaceFontSizeSchema.optional(),
2313
- sidebar: UserSidebarPreferencesPatchSchema.optional(),
2314
- favorites: zod.z.array(UserWorkspaceFavoriteSchema).optional(),
2315
- projectOrderIds: zod.z.array(zod.z.string()).optional(),
2316
- projectDotColors: zod.z.record(zod.z.string(), zod.z.string()).optional(),
2317
- onboardingTabVisible: zod.z.boolean().optional()
2318
- }).refine((value) => value.interfaceTheme !== void 0 || value.surfaceContrast !== void 0 || value.layoutMode !== void 0 || value.fontSize !== void 0 || value.sidebar !== void 0 || value.favorites !== void 0 || value.projectOrderIds !== void 0 || value.projectDotColors !== void 0 || value.onboardingTabVisible !== void 0, { message: "At least one preference field is required" });
2319
- const DEFAULT_USER_SIDEBAR_PREFERENCES = {
2320
- navIconVisibility: "visible",
2321
- footerChatRowVisibility: "visible",
2322
- hiddenNavItemIds: ["registry"],
2323
- topNavItemOrderIds: [],
2324
- workspaceNavItemOrderIds: []
2325
- };
2326
- const DEFAULT_USER_PREFERENCES = {
2327
- interfaceTheme: "system",
2328
- surfaceContrast: "on",
2329
- layoutMode: "linear",
2330
- fontSize: "default",
2331
- sidebar: DEFAULT_USER_SIDEBAR_PREFERENCES,
2332
- favorites: [],
2333
- projectOrderIds: [],
2334
- projectDotColors: {},
2335
- onboardingTabVisible: true
2336
- };
2337
- function normalizeInterfaceTheme(value) {
2338
- if (value === "light" || value === "dark") return value;
2339
- return "system";
2340
- }
2341
- function normalizeSurfaceContrast(value) {
2342
- return value === "off" ? "off" : "on";
2343
- }
2344
- function normalizeLayoutMode(value) {
2345
- return value === "default" ? "default" : "linear";
2346
- }
2347
- function normalizeFontSize(value) {
2348
- return value === "large" ? "large" : "default";
2349
- }
2350
- function normalizeStringList(value) {
2351
- if (!Array.isArray(value)) return [];
2352
- return Array.from(new Set(value.filter((item) => typeof item === "string")));
2353
- }
2354
- function normalizeHiddenNavItemIds(value) {
2355
- if (!Array.isArray(value)) return DEFAULT_USER_SIDEBAR_PREFERENCES.hiddenNavItemIds;
2356
- return normalizeStringList(value);
2357
- }
2358
- function normalizeSidebarPreferences(value) {
2359
- if (!value || typeof value !== "object") return DEFAULT_USER_SIDEBAR_PREFERENCES;
2360
- const sidebar = value;
2361
- return {
2362
- navIconVisibility: sidebar.navIconVisibility === "visible" ? "visible" : "hidden",
2363
- footerChatRowVisibility: sidebar.footerChatRowVisibility === "hidden" ? "hidden" : "visible",
2364
- hiddenNavItemIds: normalizeHiddenNavItemIds(sidebar.hiddenNavItemIds),
2365
- topNavItemOrderIds: normalizeStringList(sidebar.topNavItemOrderIds),
2366
- workspaceNavItemOrderIds: normalizeStringList(sidebar.workspaceNavItemOrderIds)
2367
- };
2368
- }
2369
- function isWorkspaceFavoriteKind(value) {
2370
- return value === "agent" || value === "workflow" || value === "skill" || value === "run";
2371
- }
2372
- function normalizeFavorites(value) {
2373
- if (!Array.isArray(value)) return [];
2374
- const seenKeys = /* @__PURE__ */ new Set();
2375
- const favorites = [];
2376
- for (const item of value) {
2377
- if (!item || typeof item !== "object") continue;
2378
- const favorite = item;
2379
- if (typeof favorite.kind !== "string" || !isWorkspaceFavoriteKind(favorite.kind) || typeof favorite.resourceId !== "string" || favorite.resourceId.length === 0) continue;
2380
- const key = `${favorite.kind}:${favorite.resourceId}`;
2381
- if (seenKeys.has(key)) continue;
2382
- seenKeys.add(key);
2383
- favorites.push({
2384
- kind: favorite.kind,
2385
- resourceId: favorite.resourceId
2386
- });
2387
- }
2388
- return favorites;
2389
- }
2390
- function normalizeProjectDotColors(value) {
2391
- if (!value || typeof value !== "object" || Array.isArray(value)) return {};
2392
- return Object.fromEntries(Object.entries(value).filter((entry) => typeof entry[0] === "string" && typeof entry[1] === "string"));
2393
- }
2394
- function normalizeOnboardingTabVisible(value) {
2395
- return typeof value === "boolean" ? value : DEFAULT_USER_PREFERENCES.onboardingTabVisible;
2396
- }
2397
- function normalizeUserPreferences(value) {
2398
- if (!value || typeof value !== "object") return DEFAULT_USER_PREFERENCES;
2399
- const preferences = value;
2400
- return UserPreferencesSchema.parse({
2401
- interfaceTheme: normalizeInterfaceTheme(preferences.interfaceTheme),
2402
- surfaceContrast: normalizeSurfaceContrast(preferences.surfaceContrast),
2403
- layoutMode: normalizeLayoutMode(preferences.layoutMode),
2404
- fontSize: normalizeFontSize(preferences.fontSize),
2405
- sidebar: normalizeSidebarPreferences(preferences.sidebar),
2406
- favorites: normalizeFavorites(preferences.favorites),
2407
- projectOrderIds: normalizeStringList(preferences.projectOrderIds),
2408
- projectDotColors: normalizeProjectDotColors(preferences.projectDotColors),
2409
- onboardingTabVisible: normalizeOnboardingTabVisible(preferences.onboardingTabVisible)
2410
- });
2411
- }
2412
- function mergeUserPreferences(current, patch) {
2413
- return normalizeUserPreferences({
2414
- ...current,
2415
- ...patch,
2416
- sidebar: patch.sidebar ? {
2417
- ...current.sidebar,
2418
- ...patch.sidebar
2419
- } : current.sidebar
2420
- });
2421
- }
2422
- const OrganizationLogoVariantSchema = zod.z.enum(["light", "dark"]);
2423
- const OrganizationSidebarBrandingSchema = zod.z.object({
2424
- customLogoEnabled: zod.z.boolean(),
2425
- customLogoExplicitlyDisabled: zod.z.boolean(),
2426
- logoLightUrl: zod.z.url().nullable(),
2427
- logoDarkUrl: zod.z.url().nullable(),
2428
- logoHeightPx: zod.z.number().int().min(14).max(32)
2429
- });
2430
- const OrganizationSidebarBrandingPatchSchema = zod.z.object({
2431
- customLogoEnabled: zod.z.boolean().optional(),
2432
- customLogoExplicitlyDisabled: zod.z.boolean().optional(),
2433
- logoLightStorageKey: zod.z.string().min(1).nullable().optional(),
2434
- logoDarkStorageKey: zod.z.string().min(1).nullable().optional(),
2435
- logoHeightPx: zod.z.number().int().min(14).max(32).optional()
2436
- }).refine((value) => value.customLogoEnabled !== void 0 || value.customLogoExplicitlyDisabled !== void 0 || value.logoLightStorageKey !== void 0 || value.logoDarkStorageKey !== void 0 || value.logoHeightPx !== void 0, { message: "At least one branding field is required" });
2437
- const PresignOrgLogoRequestSchema = zod.z.object({
2438
- variant: OrganizationLogoVariantSchema,
2439
- contentType: zod.z.string().trim().min(1)
2440
- });
2441
- const PresignOrgLogoResponseSchema = zod.z.object({
2442
- uploadUrl: zod.z.url(),
2443
- storageKey: zod.z.string().min(1)
2444
- });
2445
- const ProjectArtifactStatusSchema = zod.z.enum(["pending", "ready"]);
2446
- const isoDateTime$1 = zod.z.string().datetime();
2447
- const ProjectArtifactSchema = zod.z.object({
2448
- id: zod.z.string(),
2449
- projectId: zod.z.string(),
2450
- storageKey: zod.z.string(),
2451
- status: ProjectArtifactStatusSchema,
2452
- createdAt: isoDateTime$1,
2453
- updatedAt: isoDateTime$1
2454
- });
2455
- const CreateProjectArtifactResponseSchema = zod.z.object({
2456
- artifact: ProjectArtifactSchema,
2457
- uploadUrl: zod.z.string().url(),
2458
- expiresInSeconds: zod.z.number().int().positive()
2459
- });
2460
- const CompleteProjectArtifactResponseSchema = zod.z.object({
2461
- artifact: ProjectArtifactSchema,
2462
- project: ProjectSchema
2463
- });
2464
- const DownloadActiveProjectArtifactResponseSchema = zod.z.object({
2465
- artifactId: zod.z.string(),
2466
- downloadUrl: zod.z.string().url(),
2467
- expiresInSeconds: zod.z.number().int().positive()
2468
- });
2469
- const ProjectDeploymentSchema = zod.z.object({
2470
- id: zod.z.string(),
2471
- projectId: zod.z.string(),
2472
- version: zod.z.number().int().positive(),
2473
- deployedBy: zod.z.string().nullable(),
2474
- deployedByEmail: zod.z.string().optional(),
2475
- deployedByAvatarUrl: zod.z.string().optional(),
2476
- createdAt: isoDateTime$1,
2477
- active: zod.z.boolean()
2478
- });
2479
- const ListProjectDeploymentsResponseSchema = zod.z.object({ deployments: zod.z.array(ProjectDeploymentSchema) });
2480
- const PLATFORM_RESOURCE_UNSUPPORTED_TEXT = "Not Supported";
2481
- const optionalCount = zod.z.number().int().nonnegative().nullable().optional();
2482
- const optionalTimestamp = zod.z.string().nullable().optional();
2483
- const AgentSummarySchema = zod.z.object({
2484
- id: zod.z.string().min(1),
2485
- slug: zod.z.string().min(1),
2486
- name: zod.z.string().min(1),
2487
- projectId: zod.z.string().min(1),
2488
- updatedAt: zod.z.string().min(1),
2489
- description: zod.z.string().optional(),
2490
- sourcePath: zod.z.string().min(1).optional(),
2491
- model: zod.z.string().optional(),
2492
- toolCount: optionalCount,
2493
- credentialCount: optionalCount,
2494
- lastRunAt: optionalTimestamp
2495
- });
2496
- const WorkflowSummarySchema = zod.z.object({
2497
- id: zod.z.string().min(1),
2498
- slug: zod.z.string().min(1),
2499
- name: zod.z.string().min(1),
2500
- projectId: zod.z.string().min(1),
2501
- updatedAt: zod.z.string().min(1),
2502
- description: zod.z.string().optional(),
2503
- sourcePath: zod.z.string().min(1).optional(),
2504
- lastRunAt: optionalTimestamp
2505
- });
2506
- const SkillSummarySchema = zod.z.object({
2507
- id: zod.z.string().min(1),
2508
- slug: zod.z.string().min(1),
2509
- name: zod.z.string().min(1),
2510
- projectId: zod.z.string().min(1),
2511
- updatedAt: zod.z.string().min(1),
2512
- description: zod.z.string().optional(),
2513
- sourcePath: zod.z.string().min(1).optional()
2514
- });
2515
- const AgentSummaryListResponseSchema = zod.z.array(AgentSummarySchema);
2516
- const AgentSummaryDetailResponseSchema = AgentSummarySchema.nullable();
2517
- const WorkflowSummaryListResponseSchema = zod.z.array(WorkflowSummarySchema);
2518
- const WorkflowSummaryDetailResponseSchema = WorkflowSummarySchema.nullable();
2519
- const SkillSummaryListResponseSchema = zod.z.array(SkillSummarySchema);
2520
- const SkillSummaryDetailResponseSchema = SkillSummarySchema.nullable();
2521
- const RecentResourceKindSchema = zod.z.enum([
2522
- "agent",
2523
- "workflow",
2524
- "skill"
2525
- ]);
2526
- const RecentResourceSourceSchema = zod.z.enum(["owned", "shared"]);
2527
- const RecentResourceSchema = zod.z.object({
2528
- id: zod.z.string().min(1),
2529
- resourceKind: RecentResourceKindSchema,
2530
- resourceId: zod.z.string().min(1),
2531
- name: zod.z.string().min(1),
2532
- description: zod.z.string().optional(),
2533
- projectId: zod.z.string().min(1),
2534
- projectName: zod.z.string().min(1),
2535
- sourcePath: zod.z.string().min(1).optional(),
2536
- source: RecentResourceSourceSchema,
2537
- lastOpenedAt: zod.z.string().min(1),
2538
- lastModifiedAt: zod.z.string().min(1)
2539
- });
2540
- const RecentResourceListResponseSchema = zod.z.array(RecentResourceSchema);
2541
- const isoDateTime = zod.z.string().datetime();
2542
- const sha256Hex = zod.z.string().regex(/^[a-f0-9]{64}$/, "Expected a lowercase hex sha256 digest");
2543
- /**
2544
- * A single entry in a deploy's file tree, as served to the dashboard. Carries
2545
- * no contents: `id` is a stable, path-derived handle used for selection and
2546
- * `?file=` deep links; `hash` is the content address used to fetch the bytes
2547
- * lazily and to cache them immutably in the browser.
2548
- */
2549
- const ProjectFileSummarySchema = zod.z.object({
2550
- id: zod.z.string(),
2551
- path: zod.z.string().min(1),
2552
- hash: sha256Hex
2553
- });
2554
- /** Maps a runtime resource slug (agent/workflow/skill) to its source file path. */
2555
- const ProjectSourceResourceRefSchema = zod.z.object({
2556
- slug: zod.z.string().min(1),
2557
- path: zod.z.string().min(1)
2558
- });
2559
- const ProjectSourceResourcesSchema = zod.z.object({
2560
- agents: zod.z.array(ProjectSourceResourceRefSchema).default([]),
2561
- workflows: zod.z.array(ProjectSourceResourceRefSchema).default([]),
2562
- skills: zod.z.array(ProjectSourceResourceRefSchema).default([])
2563
- });
2564
- const emptyResources = () => ({
2565
- agents: [],
2566
- workflows: [],
2567
- skills: []
2568
- });
2569
- /** Response for the file-tree listing of a project's active deploy. */
2570
- const ListProjectFilesResponseSchema = zod.z.object({
2571
- artifactId: zod.z.string().nullable(),
2572
- files: zod.z.array(ProjectFileSummarySchema),
2573
- resources: ProjectSourceResourcesSchema.default(emptyResources())
2574
- });
2575
- zod.z.object({
2576
- path: zod.z.string().min(1),
2577
- contents: zod.z.string(),
2578
- hash: sha256Hex
2579
- });
2580
- /** A blob the CLI may need to upload, keyed by content hash. */
2581
- const SourceBlobRefSchema = zod.z.object({
2582
- hash: sha256Hex,
2583
- size: zod.z.number().int().nonnegative()
2584
- });
2585
- /** Request: ask the platform which blobs are missing and get presigned PUTs. */
2586
- const PresignProjectSourceRequestSchema = zod.z.object({ blobs: zod.z.array(SourceBlobRefSchema) });
2587
- const PresignedBlobUploadSchema = zod.z.object({
2588
- hash: sha256Hex,
2589
- url: zod.z.string().url()
2590
- });
2591
- /** Response: presigned PUTs for the subset of blobs not already stored. */
2592
- const PresignProjectSourceResponseSchema = zod.z.object({ uploads: zod.z.array(PresignedBlobUploadSchema) });
2593
- /** A file reference in a manifest upload: where the path's content lives. */
2594
- const ManifestFileRefSchema = zod.z.object({
2595
- path: zod.z.string().min(1),
2596
- hash: sha256Hex
2597
- });
2598
- /** Request body the CLI sends to finalize a deploy's source manifest. */
2599
- const UploadProjectSourceManifestRequestSchema = zod.z.object({ files: zod.z.array(ManifestFileRefSchema) });
2600
- const UploadProjectSourceResponseSchema = zod.z.object({
2601
- ok: zod.z.literal(true),
2602
- fileCount: zod.z.number().int().nonnegative()
2603
- });
2604
- /** A file entry as persisted in the stored manifest (path-derived id added). */
2605
- const StoredManifestFileSchema = zod.z.object({
2606
- id: zod.z.string(),
2607
- path: zod.z.string().min(1),
2608
- hash: sha256Hex
2609
- });
2610
- /** The immutable per-deploy manifest persisted to object storage. */
2611
- const StoredProjectSourceManifestSchema = zod.z.object({
2612
- files: zod.z.array(StoredManifestFileSchema),
2613
- generatedAt: isoDateTime
2614
- });
2615
- /** Stable, path-derived file id (used by the web for selection + deep links). */
2616
- function projectFileId(path) {
2617
- return `file-${path.trim().replace(/^\.?\/+/, "").replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-+|-+$/g, "").toLowerCase()}`;
2618
- }
2619
- function mapOrganization(row) {
2620
- return OrganizationSchema.parse({
2621
- id: row.id,
2622
- name: row.name,
2623
- slug: row.slug,
2624
- createdAt: row.createdAt.toISOString(),
2625
- updatedAt: row.updatedAt.toISOString()
2626
- });
2627
- }
2628
- function mapProject(row) {
2629
- return ProjectSchema.parse({
2630
- id: row.id,
2631
- organizationId: row.organizationId,
2632
- name: row.name,
2633
- slug: row.slug,
2634
- description: row.description,
2635
- status: row.status,
2636
- baseUrl: row.baseUrl,
2637
- runtimeId: row.runtimeId,
2638
- lastError: row.lastError,
2639
- createdAt: row.createdAt.toISOString(),
2640
- updatedAt: row.updatedAt.toISOString()
2641
- });
2642
- }
2643
- function mapUserOrganization(row) {
2644
- return UserOrganizationSchema.parse({
2645
- organization: mapOrganization(row.organization),
2646
- role: row.role
2647
- });
2648
- }
2649
- function mapOrganizationMember(row) {
2650
- return OrganizationMemberSchema.parse({
2651
- id: row.id,
2652
- name: row.name,
2653
- email: row.email,
2654
- role: row.role,
2655
- status: row.status,
2656
- ...row.image ? { avatarUrl: row.image } : {},
2657
- joinedAt: row.createdAt.toISOString(),
2658
- lastActiveAt: null
2659
- });
2660
- }
2661
- function mapOrganizationInvitation(row) {
2662
- return OrganizationInvitationSchema.parse({
2663
- id: row.id,
2664
- organizationName: row.organizationName,
2665
- organizationSlug: row.organizationSlug,
2666
- role: row.role,
2667
- ...row.invitedByName ? { invitedByName: row.invitedByName } : {},
2668
- ...row.invitedByEmail ? { invitedByEmail: row.invitedByEmail } : {}
2669
- });
2670
- }
2671
- function mapProjectMember(row, options) {
2672
- return ProjectMemberSchema.parse({
2673
- id: row.id,
2674
- projectId: row.projectId,
2675
- name: row.name,
2676
- email: row.email,
2677
- role: row.role,
2678
- status: row.status,
2679
- image: row.image,
2680
- createdAt: row.createdAt.toISOString(),
2681
- isCurrentUser: options?.isCurrentUser
2682
- });
2683
- }
2684
- function mapProjectSettings(row) {
2685
- return {
2686
- description: row.description ?? "",
2687
- defaultRole: row.defaultMemberRole,
2688
- invitePermission: row.invitePermission
2689
- };
2690
- }
2691
- function mapProjectArtifact(row) {
2692
- return ProjectArtifactSchema.parse({
2693
- id: row.id,
2694
- projectId: row.projectId,
2695
- storageKey: row.storageKey,
2696
- status: row.status,
2697
- createdAt: row.createdAt.toISOString(),
2698
- updatedAt: row.updatedAt.toISOString()
2699
- });
2700
- }
2701
- function mapProjectDeployment(row) {
2702
- return ProjectDeploymentSchema.parse({
2703
- id: row.id,
2704
- projectId: row.projectId,
2705
- version: row.version,
2706
- deployedBy: row.deployedByName,
2707
- ...row.deployedByEmail ? { deployedByEmail: row.deployedByEmail } : {},
2708
- ...row.deployedByAvatarUrl ? { deployedByAvatarUrl: row.deployedByAvatarUrl } : {},
2709
- createdAt: row.createdAt.toISOString(),
2710
- active: row.active
2711
- });
2712
- }
2713
- //#endregion
2714
- //#region ../../packages/storage/dist/index.mjs
2715
- function readEnv$1(env, ...keys) {
2716
- for (const key of keys) {
2717
- const value = env[key]?.trim();
2718
- if (value) return value;
2719
- }
2720
- }
2721
- function requireEnv(env, keys) {
2722
- const candidates = Array.isArray(keys) ? keys : [keys];
2723
- const value = readEnv$1(env, ...candidates);
2724
- if (!value) throw new Error(`${candidates[0]} is required`);
2725
- return value;
2726
- }
2727
- /** Admin S3 credentials for storage plugins (bucket is per-org, not from env). */
2728
- function storageAdminConfigFromEnv(env = process.env) {
2729
- const accessKeyId = requireEnv(env, ["STORAGE_ACCESS_KEY_ID", "AWS_ACCESS_KEY_ID"]);
2730
- const secretAccessKey = requireEnv(env, ["STORAGE_SECRET_ACCESS_KEY", "AWS_SECRET_ACCESS_KEY"]);
2731
- const endpoint = requireEnv(env, [
2732
- "STORAGE_ENDPOINT",
2733
- "AWS_ENDPOINT_URL_S3",
2734
- "AWS_S3_ENDPOINT"
2735
- ]);
2736
- return {
2737
- region: readEnv$1(env, "STORAGE_REGION", "AWS_REGION") ?? "us-east-1",
2738
- accessKeyId,
2739
- secretAccessKey,
2740
- endpoint,
2741
- forcePathStyle: env.STORAGE_FORCE_PATH_STYLE === void 0 ? true : env.STORAGE_FORCE_PATH_STYLE === "true"
2742
- };
2743
- }
2744
- const DEFAULT_PRESIGN_TTL_SECONDS = 900;
2745
- function createStorage(config) {
2746
- const client = new _aws_sdk_client_s3.S3Client(toClientConfig(config));
2747
- return {
2748
- async putObject(input) {
2749
- await client.send(new _aws_sdk_client_s3.PutObjectCommand({
2750
- Bucket: config.bucket,
2751
- Key: input.key,
2752
- Body: input.body,
2753
- ContentType: input.contentType
2754
- }));
2755
- },
2756
- async getObject(key) {
2757
- const response = await client.send(new _aws_sdk_client_s3.GetObjectCommand({
2758
- Bucket: config.bucket,
2759
- Key: key
2760
- }));
2761
- if (!response.Body) throw new Error(`Object body missing for key ${key}`);
2762
- return response.Body.transformToByteArray();
2763
- },
2764
- async headObject(key) {
2765
- try {
2766
- return { contentLength: (await client.send(new _aws_sdk_client_s3.HeadObjectCommand({
2767
- Bucket: config.bucket,
2768
- Key: key
2769
- }))).ContentLength ?? 0 };
2770
- } catch (error) {
2771
- if (isNotFoundError(error)) return;
2772
- throw error;
2773
- }
2774
- },
2775
- async presignGet(input) {
2776
- return (0, _aws_sdk_s3_request_presigner.getSignedUrl)(client, new _aws_sdk_client_s3.GetObjectCommand({
2777
- Bucket: config.bucket,
2778
- Key: input.key
2779
- }), { expiresIn: input.expiresInSeconds ?? DEFAULT_PRESIGN_TTL_SECONDS });
2780
- },
2781
- async presignPut(input) {
2782
- return (0, _aws_sdk_s3_request_presigner.getSignedUrl)(client, new _aws_sdk_client_s3.PutObjectCommand({
2783
- Bucket: config.bucket,
2784
- Key: input.key,
2785
- ContentType: input.contentType ?? "application/gzip"
2786
- }), { expiresIn: input.expiresInSeconds ?? DEFAULT_PRESIGN_TTL_SECONDS });
2787
- },
2788
- async deleteObject(key) {
2789
- await client.send(new _aws_sdk_client_s3.DeleteObjectCommand({
2790
- Bucket: config.bucket,
2791
- Key: key
2792
- }));
2793
- }
2794
- };
2795
- }
2796
- function toClientConfig(config) {
2797
- return {
2798
- region: config.region,
2799
- credentials: {
2800
- accessKeyId: config.accessKeyId,
2801
- secretAccessKey: config.secretAccessKey
2802
- },
2803
- endpoint: config.endpoint,
2804
- forcePathStyle: config.forcePathStyle
2805
- };
2806
- }
2807
- function isNotFoundError(error) {
2808
- if (!error || typeof error !== "object") return false;
2809
- const name = "name" in error ? String(error.name) : "";
2810
- const status = "$metadata" in error ? error.$metadata : void 0;
2811
- return name === "NotFound" || name === "NoSuchKey" || status?.httpStatusCode === 404;
2812
- }
2813
- var RouteManifestNotFoundError = class extends Error {
2814
- constructor(message = `Route manifest missing in artifact (${ROUTE_MANIFEST_REL_PATH})`) {
2815
- super(message);
2816
- this.name = "RouteManifestNotFoundError";
2817
- }
2818
- };
2819
- /** Read `.keystroke/route-manifest.json` from a packed project artifact tarball. */
2820
- function extractRouteManifestFromArtifact(archive) {
2821
- const tempDir = (0, node_fs.mkdtempSync)((0, node_path.join)((0, node_os.tmpdir)(), "keystroke-artifact-"));
2822
- const archivePath = (0, node_path.join)(tempDir, "artifact.tgz");
2823
- try {
2824
- (0, node_fs.writeFileSync)(archivePath, archive);
2825
- if ((0, node_child_process.spawnSync)("tar", [
2826
- "-xzf",
2827
- archivePath,
2828
- "-C",
2829
- tempDir,
2830
- "dist/.keystroke/route-manifest.json"
2831
- ], { encoding: "utf8" }).status !== 0) throw new RouteManifestNotFoundError();
2832
- const raw = (0, node_fs.readFileSync)((0, node_path.join)(tempDir, ROUTE_MANIFEST_REL_PATH), "utf8");
2833
- return JSON.parse(raw);
2834
- } catch (error) {
2835
- if (error instanceof RouteManifestNotFoundError) throw error;
2836
- throw new RouteManifestNotFoundError(error instanceof Error ? error.message : "Failed to extract route manifest");
2837
- } finally {
2838
- (0, node_fs.rmSync)(tempDir, {
2839
- recursive: true,
2840
- force: true
2841
- });
2842
- }
2843
- }
2844
- /** Object key for a built project artifact tarball. */
2845
- function projectArtifactKey(projectId, version) {
2846
- return `projects/${projectId}/artifacts/${version}.tgz`;
2847
- }
2848
- const SHA256_HEX = /^[a-f0-9]{64}$/;
2849
- /** True when `hash` is a lowercase hex sha256 digest (64 chars). */
2850
- function isSourceBlobHash(hash) {
2851
- return SHA256_HEX.test(hash);
2852
- }
2853
- /**
2854
- * Content-addressed key for a single source file's contents, deduped across all
2855
- * of a project's deploys. `hash` is a lowercase hex sha256 of the file bytes.
2856
- */
2857
- function projectSourceBlobKey(projectId, hash) {
2858
- if (!isSourceBlobHash(hash)) throw new Error("Invalid source blob hash");
2859
- return `projects/${projectId}/sources/blobs/${hash}`;
2860
- }
2861
- const AVATAR_EXTENSION = /^[a-z0-9]+$/;
2862
- /** Object key for a user's custom profile avatar in the shared keystroke-users bucket. */
2863
- function userAvatarStorageKey(userId, extension) {
2864
- const ext = extension.replace(/^\./, "").toLowerCase();
2865
- if (!AVATAR_EXTENSION.test(ext)) throw new Error("Invalid avatar extension");
2866
- return `avatars/${userId}/avatar.${ext}`;
2867
- }
2868
- /** True when `key` is the canonical avatar object for `userId`. */
2869
- function isUserAvatarStorageKey(key, userId) {
2870
- const prefix = `avatars/${userId}/avatar.`;
2871
- if (!key.startsWith(prefix)) return false;
2872
- const ext = key.slice(prefix.length);
2873
- return AVATAR_EXTENSION.test(ext);
2874
- }
2875
- /** Object key for an org logo in the shared keystroke-assets bucket. */
2876
- function orgLogoStorageKey(organizationId, variant, extension) {
2877
- const ext = extension.replace(/^\./, "").toLowerCase();
2878
- if (!AVATAR_EXTENSION.test(ext)) throw new Error("Invalid org logo extension");
2879
- return `org-logos/${organizationId}/logo-${variant}.${ext}`;
2880
- }
2881
- /** True when `key` is the canonical logo object for `organizationId` and `variant`. */
2882
- function isOrgLogoStorageKey(key, organizationId, variant) {
2883
- const prefix = `org-logos/${organizationId}/logo-${variant}.`;
2884
- if (!key.startsWith(prefix)) return false;
2885
- const ext = key.slice(prefix.length);
2886
- return AVATAR_EXTENSION.test(ext);
2887
- }
2888
- function isBucketAlreadyExistsError(error) {
2889
- if (!error || typeof error !== "object") return false;
2890
- const name = "name" in error ? String(error.name) : "";
2891
- const code = "Code" in error ? String(error.Code) : "";
2892
- return name === "BucketAlreadyOwnedByYou" || code === "BucketAlreadyOwnedByYou" || name === "BucketAlreadyExists" || code === "BucketAlreadyExists";
2893
- }
2894
- /** Shared bucket for cross-org public assets (avatars, org sidebar logos). */
2895
- const KEYSTROKE_ASSETS_BUCKET = "keystroke-assets";
2896
- /** Env var for the browser-facing origin of public asset objects (no trailing slash). */
2897
- const KEYSTROKE_ASSETS_PUBLIC_URL_BASE_ENV = "KEYSTROKE_ASSETS_PUBLIC_URL_BASE";
2898
- const KEYSTROKE_ASSETS_AVATAR_PREFIX = "avatars/";
2899
- const KEYSTROKE_ASSETS_ORG_LOGO_PREFIX = "org-logos/";
2900
- function readEnv(env, key) {
2901
- return env[key]?.trim() || void 0;
2902
- }
2903
- /** Default path-style base when `KEYSTROKE_ASSETS_PUBLIC_URL_BASE` is unset (local MinIO). */
2904
- function defaultKeystrokeAssetsPublicUrlBase(env = process.env) {
2905
- return `${storageAdminConfigFromEnv(env).endpoint.replace(/\/+$/, "")}/${KEYSTROKE_ASSETS_BUCKET}`;
2906
- }
2907
- /** Public URL prefix for asset objects — configured base or local path-style default. */
2908
- function keystrokeAssetsPublicUrlBase(env = process.env) {
2909
- const configured = readEnv(env, KEYSTROKE_ASSETS_PUBLIC_URL_BASE_ENV);
2910
- if (configured) return configured.replace(/\/+$/, "");
2911
- return defaultKeystrokeAssetsPublicUrlBase(env);
2912
- }
2913
- function keystrokeAssetsPublicUrlPrefixes(env = process.env) {
2914
- const prefixes = [keystrokeAssetsPublicUrlBase(env)];
2915
- if (readEnv(env, "KEYSTROKE_ASSETS_PUBLIC_URL_BASE")) prefixes.push(defaultKeystrokeAssetsPublicUrlBase(env));
2916
- return [...new Set(prefixes)];
2917
- }
2918
- function createAssetsStorageClient(env = process.env) {
2919
- return createStorage({
2920
- ...storageAdminConfigFromEnv(env),
2921
- bucket: KEYSTROKE_ASSETS_BUCKET
2922
- });
2923
- }
2924
- /** Stable public URL for an object in the keystroke-assets bucket. */
2925
- function publicKeystrokeAssetsObjectUrl(key, env = process.env) {
2926
- return `${keystrokeAssetsPublicUrlBase(env)}/${key}`;
2927
- }
2928
- /** Extract the object key from a public keystroke-assets URL when it matches `requiredPrefix`. */
2929
- function keystrokeAssetsKeyFromPublicUrl(url, requiredPrefix, env = process.env) {
2930
- for (const prefix of keystrokeAssetsPublicUrlPrefixes(env)) {
2931
- const normalizedPrefix = `${prefix.replace(/\/+$/, "")}/`;
2932
- if (!url.startsWith(normalizedPrefix)) continue;
2933
- const key = decodeURIComponent(url.slice(normalizedPrefix.length).split("?")[0] ?? "");
2934
- if (key.startsWith(requiredPrefix)) return key;
2935
- }
2936
- return null;
2937
- }
2938
- function isKeystrokeAssetsAvatarPublicUrl(url, env = process.env) {
2939
- return keystrokeAssetsKeyFromPublicUrl(url, KEYSTROKE_ASSETS_AVATAR_PREFIX, env) !== null;
2940
- }
2941
- function keystrokeAssetsAvatarKeyFromPublicUrl(url, env = process.env) {
2942
- return keystrokeAssetsKeyFromPublicUrl(url, KEYSTROKE_ASSETS_AVATAR_PREFIX, env);
2943
- }
2944
- function isKeystrokeAssetsOrgLogoPublicUrl(url, env = process.env) {
2945
- return keystrokeAssetsKeyFromPublicUrl(url, KEYSTROKE_ASSETS_ORG_LOGO_PREFIX, env) !== null;
2946
- }
2947
- function keystrokeAssetsOrgLogoKeyFromPublicUrl(url, env = process.env) {
2948
- return keystrokeAssetsKeyFromPublicUrl(url, KEYSTROKE_ASSETS_ORG_LOGO_PREFIX, env);
2949
- }
2950
- async function ensureKeystrokeAssetsBucket(env = process.env) {
2951
- const adminConfig = storageAdminConfigFromEnv(env);
2952
- const adminClient = new _aws_sdk_client_s3.S3Client({
2953
- region: adminConfig.region,
2954
- credentials: {
2955
- accessKeyId: adminConfig.accessKeyId,
2956
- secretAccessKey: adminConfig.secretAccessKey
2957
- },
2958
- endpoint: adminConfig.endpoint,
2959
- forcePathStyle: adminConfig.forcePathStyle
2960
- });
2961
- await createAssetsBucketIfNeeded(adminClient, KEYSTROKE_ASSETS_BUCKET);
2962
- await applyPublicAssetsBucketAcl(adminClient, KEYSTROKE_ASSETS_BUCKET);
2963
- await applyPublicAssetsBucketPolicy(adminClient, KEYSTROKE_ASSETS_BUCKET);
2964
- }
2965
- async function createAssetsBucketIfNeeded(adminClient, bucket) {
2966
- try {
2967
- await adminClient.send(new _aws_sdk_client_s3.CreateBucketCommand({
2968
- Bucket: bucket,
2969
- ACL: "public-read"
2970
- }));
2971
- return;
2972
- } catch (error) {
2973
- if (isBucketAlreadyExistsError(error)) return;
2974
- }
2975
- try {
2976
- await adminClient.send(new _aws_sdk_client_s3.CreateBucketCommand({ Bucket: bucket }));
2977
- } catch (error) {
2978
- if (!isBucketAlreadyExistsError(error)) throw error;
2979
- }
2980
- }
2981
- async function applyPublicAssetsBucketAcl(adminClient, bucket) {
2982
- try {
2983
- await adminClient.send(new _aws_sdk_client_s3.PutBucketAclCommand({
2984
- Bucket: bucket,
2985
- ACL: "public-read"
2986
- }));
2987
- } catch (error) {
2988
- if (!isUnsupportedStorageFeatureError(error)) console.warn("[storage] PutBucketAcl failed (continuing):", error);
2989
- }
2990
- }
2991
- async function applyPublicAssetsBucketPolicy(adminClient, bucket) {
2992
- try {
2993
- await adminClient.send(new _aws_sdk_client_s3.PutBucketPolicyCommand({
2994
- Bucket: bucket,
2995
- Policy: JSON.stringify({
2996
- Version: "2012-10-17",
2997
- Statement: [{
2998
- Effect: "Allow",
2999
- Principal: "*",
3000
- Action: ["s3:GetObject"],
3001
- Resource: [`arn:aws:s3:::${bucket}/${KEYSTROKE_ASSETS_AVATAR_PREFIX}*`, `arn:aws:s3:::${bucket}/${KEYSTROKE_ASSETS_ORG_LOGO_PREFIX}*`]
3002
- }]
3003
- })
3004
- }));
3005
- } catch (error) {
3006
- if (!isUnsupportedStorageFeatureError(error)) console.warn("[storage] PutBucketPolicy failed (continuing):", error);
3007
- }
3008
- }
3009
- function isUnsupportedStorageFeatureError(error) {
3010
- if (!error || typeof error !== "object") return false;
3011
- const name = "name" in error ? String(error.name) : "";
3012
- const code = "Code" in error ? String(error.Code) : "";
3013
- return name === "NotImplemented" || code === "NotImplemented" || code === "NotSupported";
3014
- }
3015
- const DEFAULT_BUCKET_NAME_PREFIX = "ks";
3016
- function orgStorageBucketName(input, prefix = DEFAULT_BUCKET_NAME_PREFIX) {
3017
- return `${prefix.trim().replace(/-+$/g, "")}-${input.organizationId.toLowerCase()}`;
3018
- }
3019
- function minioStoragePlugin(options = {}) {
3020
- const adminConfig = storageAdminConfigFromEnv(options.env ?? process.env);
3021
- const adminClient = new _aws_sdk_client_s3.S3Client({
3022
- region: adminConfig.region,
3023
- credentials: {
3024
- accessKeyId: adminConfig.accessKeyId,
3025
- secretAccessKey: adminConfig.secretAccessKey
3026
- },
3027
- endpoint: adminConfig.endpoint,
3028
- forcePathStyle: adminConfig.forcePathStyle
3029
- });
3030
- return {
3031
- async provisionOrganization(input) {
3032
- const bucket = orgStorageBucketName(input, options.bucketNamePrefix);
3033
- try {
3034
- await adminClient.send(new _aws_sdk_client_s3.CreateBucketCommand({ Bucket: bucket }));
3035
- } catch (error) {
3036
- if (!isBucketAlreadyExistsError(error)) throw error;
3037
- }
3038
- return {
3039
- bucket,
3040
- endpoint: adminConfig.endpoint,
3041
- accessKeyId: adminConfig.accessKeyId,
3042
- secretAccessKey: adminConfig.secretAccessKey,
3043
- region: adminConfig.region,
3044
- forcePathStyle: adminConfig.forcePathStyle
3045
- };
3046
- },
3047
- async deprovisionOrganization(result) {
3048
- const client = new _aws_sdk_client_s3.S3Client({
3049
- region: result.region ?? adminConfig.region,
3050
- credentials: {
3051
- accessKeyId: result.accessKeyId,
3052
- secretAccessKey: result.secretAccessKey
3053
- },
3054
- endpoint: result.endpoint,
3055
- forcePathStyle: result.forcePathStyle ?? true
3056
- });
3057
- if (((await client.send(new _aws_sdk_client_s3.ListObjectsV2Command({
3058
- Bucket: result.bucket,
3059
- MaxKeys: 1
3060
- }))).KeyCount ?? 0) > 0) throw new Error(`Refusing to delete non-empty storage bucket ${result.bucket}`);
3061
- await client.send(new _aws_sdk_client_s3.DeleteBucketCommand({ Bucket: result.bucket }));
3062
- }
3063
- };
3064
- }
3065
- //#endregion
3066
- Object.defineProperty(exports, "ACTIVE_ORG_HEADER", {
3067
- enumerable: true,
3068
- get: function() {
3069
- return ACTIVE_ORG_HEADER;
3070
- }
3071
- });
3072
- Object.defineProperty(exports, "AcceptOrganizationInvitationResponseSchema", {
3073
- enumerable: true,
3074
- get: function() {
3075
- return AcceptOrganizationInvitationResponseSchema;
3076
- }
3077
- });
3078
- Object.defineProperty(exports, "ActiveOrganizationResponseSchema", {
3079
- enumerable: true,
3080
- get: function() {
3081
- return ActiveOrganizationResponseSchema;
3082
- }
3083
- });
3084
- Object.defineProperty(exports, "AgentSummaryDetailResponseSchema", {
3085
- enumerable: true,
3086
- get: function() {
3087
- return AgentSummaryDetailResponseSchema;
3088
- }
3089
- });
3090
- Object.defineProperty(exports, "AgentSummaryListResponseSchema", {
3091
- enumerable: true,
3092
- get: function() {
3093
- return AgentSummaryListResponseSchema;
3094
- }
3095
- });
3096
- Object.defineProperty(exports, "AgentSummarySchema", {
3097
- enumerable: true,
3098
- get: function() {
3099
- return AgentSummarySchema;
3100
- }
3101
- });
3102
- Object.defineProperty(exports, "CompleteProjectArtifactResponseSchema", {
3103
- enumerable: true,
3104
- get: function() {
3105
- return CompleteProjectArtifactResponseSchema;
3106
- }
3107
- });
3108
- Object.defineProperty(exports, "CreateApiKeyRequestSchema", {
3109
- enumerable: true,
3110
- get: function() {
3111
- return CreateApiKeyRequestSchema;
3112
- }
3113
- });
3114
- Object.defineProperty(exports, "CreateApiKeyResponseSchema", {
3115
- enumerable: true,
3116
- get: function() {
3117
- return CreateApiKeyResponseSchema;
3118
- }
3119
- });
3120
- Object.defineProperty(exports, "CreateCredentialsRequestSchema", {
3121
- enumerable: true,
3122
- get: function() {
3123
- return CreateCredentialsRequestSchema;
3124
- }
3125
- });
3126
- Object.defineProperty(exports, "CreateCredentialsResponseSchema", {
3127
- enumerable: true,
3128
- get: function() {
3129
- return CreateCredentialsResponseSchema;
3130
- }
3131
- });
3132
- Object.defineProperty(exports, "CreateOrganizationRequestSchema", {
3133
- enumerable: true,
3134
- get: function() {
3135
- return CreateOrganizationRequestSchema;
3136
- }
3137
- });
3138
- Object.defineProperty(exports, "CreateOrganizationResponseSchema", {
3139
- enumerable: true,
3140
- get: function() {
3141
- return CreateOrganizationResponseSchema;
3142
- }
3143
- });
3144
- Object.defineProperty(exports, "CreateProjectArtifactResponseSchema", {
3145
- enumerable: true,
3146
- get: function() {
3147
- return CreateProjectArtifactResponseSchema;
3148
- }
3149
- });
3150
- Object.defineProperty(exports, "CreateProjectRequestSchema", {
3151
- enumerable: true,
3152
- get: function() {
3153
- return CreateProjectRequestSchema;
3154
- }
3155
- });
3156
- Object.defineProperty(exports, "CreateProjectResponseSchema", {
3157
- enumerable: true,
3158
- get: function() {
3159
- return CreateProjectResponseSchema;
3160
- }
3161
- });
3162
- Object.defineProperty(exports, "DeclineOrganizationInvitationResponseSchema", {
3163
- enumerable: true,
3164
- get: function() {
3165
- return DeclineOrganizationInvitationResponseSchema;
3166
- }
3167
- });
3168
- Object.defineProperty(exports, "DownloadActiveProjectArtifactResponseSchema", {
3169
- enumerable: true,
3170
- get: function() {
3171
- return DownloadActiveProjectArtifactResponseSchema;
3172
- }
3173
- });
3174
- Object.defineProperty(exports, "ErrorResponseSchema", {
3175
- enumerable: true,
3176
- get: function() {
3177
- return ErrorResponseSchema;
3178
- }
3179
- });
3180
- Object.defineProperty(exports, "GetCredentialResponseSchema", {
3181
- enumerable: true,
3182
- get: function() {
3183
- return GetCredentialResponseSchema;
3184
- }
3185
- });
3186
- Object.defineProperty(exports, "HistoryRunCancelResponseSchema", {
3187
- enumerable: true,
3188
- get: function() {
3189
- return HistoryRunCancelResponseSchema;
3190
- }
3191
- });
3192
- Object.defineProperty(exports, "HistoryRunDetailResponseSchema", {
3193
- enumerable: true,
3194
- get: function() {
3195
- return HistoryRunDetailResponseSchema;
3196
- }
3197
- });
3198
- Object.defineProperty(exports, "HistoryRunListQuerySchema", {
3199
- enumerable: true,
3200
- get: function() {
3201
- return HistoryRunListQuerySchema;
3202
- }
3203
- });
3204
- Object.defineProperty(exports, "HistoryRunListResponseSchema", {
3205
- enumerable: true,
3206
- get: function() {
3207
- return HistoryRunListResponseSchema;
3208
- }
3209
- });
3210
- Object.defineProperty(exports, "InviteOrganizationMembersRequestSchema", {
3211
- enumerable: true,
3212
- get: function() {
3213
- return InviteOrganizationMembersRequestSchema;
3214
- }
3215
- });
3216
- Object.defineProperty(exports, "InviteOrganizationMembersResponseSchema", {
3217
- enumerable: true,
3218
- get: function() {
3219
- return InviteOrganizationMembersResponseSchema;
3220
- }
3221
- });
3222
- Object.defineProperty(exports, "InviteProjectMembersRequestSchema", {
3223
- enumerable: true,
3224
- get: function() {
3225
- return InviteProjectMembersRequestSchema;
3226
- }
3227
- });
3228
- Object.defineProperty(exports, "InviteProjectMembersResponseSchema", {
3229
- enumerable: true,
3230
- get: function() {
3231
- return InviteProjectMembersResponseSchema;
3232
- }
3233
- });
3234
- Object.defineProperty(exports, "ListApiKeysResponseSchema", {
3235
- enumerable: true,
3236
- get: function() {
3237
- return ListApiKeysResponseSchema;
3238
- }
3239
- });
3240
- Object.defineProperty(exports, "ListAppsResponseSchema", {
3241
- enumerable: true,
3242
- get: function() {
3243
- return ListAppsResponseSchema;
3244
- }
3245
- });
3246
- Object.defineProperty(exports, "ListCredentialsResponseSchema", {
3247
- enumerable: true,
3248
- get: function() {
3249
- return ListCredentialsResponseSchema;
3250
- }
3251
- });
3252
- Object.defineProperty(exports, "ListOrganizationInvitationsResponseSchema", {
3253
- enumerable: true,
3254
- get: function() {
3255
- return ListOrganizationInvitationsResponseSchema;
3256
- }
3257
- });
3258
- Object.defineProperty(exports, "ListOrganizationMembersResponseSchema", {
3259
- enumerable: true,
3260
- get: function() {
3261
- return ListOrganizationMembersResponseSchema;
3262
- }
3263
- });
3264
- Object.defineProperty(exports, "ListOrganizationsResponseSchema", {
3265
- enumerable: true,
3266
- get: function() {
3267
- return ListOrganizationsResponseSchema;
3268
- }
3269
- });
3270
- Object.defineProperty(exports, "ListProjectDeploymentsResponseSchema", {
3271
- enumerable: true,
3272
- get: function() {
3273
- return ListProjectDeploymentsResponseSchema;
3274
- }
3275
- });
3276
- Object.defineProperty(exports, "ListProjectFilesResponseSchema", {
3277
- enumerable: true,
3278
- get: function() {
3279
- return ListProjectFilesResponseSchema;
3280
- }
3281
- });
3282
- Object.defineProperty(exports, "ListProjectMembersResponseSchema", {
3283
- enumerable: true,
3284
- get: function() {
3285
- return ListProjectMembersResponseSchema;
3286
- }
3287
- });
3288
- Object.defineProperty(exports, "ListProjectMetricsResponseSchema", {
3289
- enumerable: true,
3290
- get: function() {
3291
- return ListProjectMetricsResponseSchema;
3292
- }
3293
- });
3294
- Object.defineProperty(exports, "ListProjectsResponseSchema", {
3295
- enumerable: true,
3296
- get: function() {
3297
- return ListProjectsResponseSchema;
3298
- }
3299
- });
3300
- Object.defineProperty(exports, "OrganizationSidebarBrandingPatchSchema", {
3301
- enumerable: true,
3302
- get: function() {
3303
- return OrganizationSidebarBrandingPatchSchema;
3304
- }
3305
- });
3306
- Object.defineProperty(exports, "OrganizationSidebarBrandingSchema", {
3307
- enumerable: true,
3308
- get: function() {
3309
- return OrganizationSidebarBrandingSchema;
3310
- }
3311
- });
3312
- Object.defineProperty(exports, "PLATFORM_RESOURCE_UNSUPPORTED_TEXT", {
3313
- enumerable: true,
3314
- get: function() {
3315
- return PLATFORM_RESOURCE_UNSUPPORTED_TEXT;
3316
- }
3317
- });
3318
- Object.defineProperty(exports, "PROJECT_SLUG_TAKEN_MESSAGE", {
3319
- enumerable: true,
3320
- get: function() {
3321
- return PROJECT_SLUG_TAKEN_MESSAGE;
3322
- }
3323
- });
3324
- Object.defineProperty(exports, "PresignOrgLogoRequestSchema", {
3325
- enumerable: true,
3326
- get: function() {
3327
- return PresignOrgLogoRequestSchema;
3328
- }
3329
- });
3330
- Object.defineProperty(exports, "PresignOrgLogoResponseSchema", {
3331
- enumerable: true,
3332
- get: function() {
3333
- return PresignOrgLogoResponseSchema;
3334
- }
3335
- });
3336
- Object.defineProperty(exports, "PresignProjectSourceRequestSchema", {
3337
- enumerable: true,
3338
- get: function() {
3339
- return PresignProjectSourceRequestSchema;
3340
- }
3341
- });
3342
- Object.defineProperty(exports, "PresignProjectSourceResponseSchema", {
3343
- enumerable: true,
3344
- get: function() {
3345
- return PresignProjectSourceResponseSchema;
3346
- }
3347
- });
3348
- Object.defineProperty(exports, "PresignUserAvatarRequestSchema", {
3349
- enumerable: true,
3350
- get: function() {
3351
- return PresignUserAvatarRequestSchema;
3352
- }
3353
- });
3354
- Object.defineProperty(exports, "PresignUserAvatarResponseSchema", {
3355
- enumerable: true,
3356
- get: function() {
3357
- return PresignUserAvatarResponseSchema;
3358
- }
3359
- });
3360
- Object.defineProperty(exports, "ProjectReachabilityResponseSchema", {
3361
- enumerable: true,
3362
- get: function() {
3363
- return ProjectReachabilityResponseSchema;
3364
- }
3365
- });
3366
- Object.defineProperty(exports, "ProjectResponseSchema", {
3367
- enumerable: true,
3368
- get: function() {
3369
- return ProjectResponseSchema;
3370
- }
3371
- });
3372
- Object.defineProperty(exports, "ProjectSettingsResponseSchema", {
3373
- enumerable: true,
3374
- get: function() {
3375
- return ProjectSettingsResponseSchema;
3376
- }
3377
- });
3378
- Object.defineProperty(exports, "ProjectSlugAvailabilityQuerySchema", {
3379
- enumerable: true,
3380
- get: function() {
3381
- return ProjectSlugAvailabilityQuerySchema;
3382
- }
3383
- });
3384
- Object.defineProperty(exports, "ProjectSlugAvailabilityResponseSchema", {
3385
- enumerable: true,
3386
- get: function() {
3387
- return ProjectSlugAvailabilityResponseSchema;
3388
- }
3389
- });
3390
- Object.defineProperty(exports, "ProjectSourceResourcesSchema", {
3391
- enumerable: true,
3392
- get: function() {
3393
- return ProjectSourceResourcesSchema;
3394
- }
3395
- });
3396
- Object.defineProperty(exports, "RecentResourceListResponseSchema", {
3397
- enumerable: true,
3398
- get: function() {
3399
- return RecentResourceListResponseSchema;
3400
- }
3401
- });
3402
- Object.defineProperty(exports, "RecentResourceSchema", {
3403
- enumerable: true,
3404
- get: function() {
3405
- return RecentResourceSchema;
3406
- }
3407
- });
3408
- Object.defineProperty(exports, "RouteManifestNotFoundError", {
3409
- enumerable: true,
3410
- get: function() {
3411
- return RouteManifestNotFoundError;
3412
- }
3413
- });
3414
- Object.defineProperty(exports, "SkillSummaryDetailResponseSchema", {
3415
- enumerable: true,
3416
- get: function() {
3417
- return SkillSummaryDetailResponseSchema;
3418
- }
3419
- });
3420
- Object.defineProperty(exports, "SkillSummaryListResponseSchema", {
3421
- enumerable: true,
3422
- get: function() {
3423
- return SkillSummaryListResponseSchema;
3424
- }
3425
- });
3426
- Object.defineProperty(exports, "SkillSummarySchema", {
3427
- enumerable: true,
3428
- get: function() {
3429
- return SkillSummarySchema;
3430
- }
3431
- });
3432
- Object.defineProperty(exports, "SlugAvailabilityQuerySchema", {
3433
- enumerable: true,
3434
- get: function() {
3435
- return SlugAvailabilityQuerySchema;
3436
- }
3437
- });
3438
- Object.defineProperty(exports, "SlugAvailabilityResponseSchema", {
3439
- enumerable: true,
3440
- get: function() {
3441
- return SlugAvailabilityResponseSchema;
3442
- }
3443
- });
3444
- Object.defineProperty(exports, "StoredProjectSourceManifestSchema", {
3445
- enumerable: true,
3446
- get: function() {
3447
- return StoredProjectSourceManifestSchema;
3448
- }
3449
- });
3450
- Object.defineProperty(exports, "SubmitTeamRequestRequestSchema", {
3451
- enumerable: true,
3452
- get: function() {
3453
- return SubmitTeamRequestRequestSchema;
3454
- }
3455
- });
3456
- Object.defineProperty(exports, "SubmitTeamRequestResponseSchema", {
3457
- enumerable: true,
3458
- get: function() {
3459
- return SubmitTeamRequestResponseSchema;
3460
- }
3461
- });
3462
- Object.defineProperty(exports, "UpdateCredentialRequestSchema", {
3463
- enumerable: true,
3464
- get: function() {
3465
- return UpdateCredentialRequestSchema;
3466
- }
3467
- });
3468
- Object.defineProperty(exports, "UpdateOrganizationMemberRequestSchema", {
3469
- enumerable: true,
3470
- get: function() {
3471
- return UpdateOrganizationMemberRequestSchema;
3472
- }
3473
- });
3474
- Object.defineProperty(exports, "UpdateOrganizationMemberResponseSchema", {
3475
- enumerable: true,
3476
- get: function() {
3477
- return UpdateOrganizationMemberResponseSchema;
3478
- }
3479
- });
3480
- Object.defineProperty(exports, "UpdateOrganizationRequestSchema", {
3481
- enumerable: true,
3482
- get: function() {
3483
- return UpdateOrganizationRequestSchema;
3484
- }
3485
- });
3486
- Object.defineProperty(exports, "UpdateProjectMemberRequestSchema", {
3487
- enumerable: true,
3488
- get: function() {
3489
- return UpdateProjectMemberRequestSchema;
3490
- }
3491
- });
3492
- Object.defineProperty(exports, "UpdateProjectMemberResponseSchema", {
3493
- enumerable: true,
3494
- get: function() {
3495
- return UpdateProjectMemberResponseSchema;
3496
- }
3497
- });
3498
- Object.defineProperty(exports, "UpdateProjectRequestSchema", {
3499
- enumerable: true,
3500
- get: function() {
3501
- return UpdateProjectRequestSchema;
3502
- }
3503
- });
3504
- Object.defineProperty(exports, "UpdateProjectSettingsRequestSchema", {
3505
- enumerable: true,
3506
- get: function() {
3507
- return UpdateProjectSettingsRequestSchema;
3508
- }
3509
- });
3510
- Object.defineProperty(exports, "UploadProjectSourceManifestRequestSchema", {
3511
- enumerable: true,
3512
- get: function() {
3513
- return UploadProjectSourceManifestRequestSchema;
3514
- }
3515
- });
3516
- Object.defineProperty(exports, "UploadProjectSourceResponseSchema", {
3517
- enumerable: true,
3518
- get: function() {
3519
- return UploadProjectSourceResponseSchema;
3520
- }
3521
- });
3522
- Object.defineProperty(exports, "UserAvatarPatchSchema", {
3523
- enumerable: true,
3524
- get: function() {
3525
- return UserAvatarPatchSchema;
3526
- }
3527
- });
3528
- Object.defineProperty(exports, "UserAvatarSchema", {
3529
- enumerable: true,
3530
- get: function() {
3531
- return UserAvatarSchema;
3532
- }
3533
- });
3534
- Object.defineProperty(exports, "UserPreferencesPatchSchema", {
3535
- enumerable: true,
3536
- get: function() {
3537
- return UserPreferencesPatchSchema;
3538
- }
3539
- });
3540
- Object.defineProperty(exports, "UserPreferencesSchema", {
3541
- enumerable: true,
3542
- get: function() {
3543
- return UserPreferencesSchema;
3544
- }
3545
- });
3546
- Object.defineProperty(exports, "WorkflowSummaryDetailResponseSchema", {
3547
- enumerable: true,
3548
- get: function() {
3549
- return WorkflowSummaryDetailResponseSchema;
3550
- }
3551
- });
3552
- Object.defineProperty(exports, "WorkflowSummaryListResponseSchema", {
3553
- enumerable: true,
3554
- get: function() {
3555
- return WorkflowSummaryListResponseSchema;
3556
- }
3557
- });
3558
- Object.defineProperty(exports, "WorkflowSummarySchema", {
3559
- enumerable: true,
3560
- get: function() {
3561
- return WorkflowSummarySchema;
3562
- }
3563
- });
3564
- Object.defineProperty(exports, "__commonJSMin", {
3565
- enumerable: true,
3566
- get: function() {
3567
- return __commonJSMin;
3568
- }
3569
- });
3570
- Object.defineProperty(exports, "__toESM", {
3571
- enumerable: true,
3572
- get: function() {
3573
- return __toESM;
3574
- }
3575
- });
3576
- Object.defineProperty(exports, "buildCredentialInstanceLabel", {
3577
- enumerable: true,
3578
- get: function() {
3579
- return buildCredentialInstanceLabel;
3580
- }
3581
- });
3582
- Object.defineProperty(exports, "createAssetsStorageClient", {
3583
- enumerable: true,
3584
- get: function() {
3585
- return createAssetsStorageClient;
3586
- }
3587
- });
3588
- Object.defineProperty(exports, "credentialInputSchema", {
3589
- enumerable: true,
3590
- get: function() {
3591
- return credentialInputSchema;
3592
- }
3593
- });
3594
- Object.defineProperty(exports, "defaultHostingPlugin", {
3595
- enumerable: true,
3596
- get: function() {
3597
- return defaultHostingPlugin;
3598
- }
3599
- });
3600
- Object.defineProperty(exports, "displayCredentialAppName", {
3601
- enumerable: true,
3602
- get: function() {
3603
- return displayCredentialAppName;
3604
- }
3605
- });
3606
- Object.defineProperty(exports, "ensureKeystrokeAssetsBucket", {
3607
- enumerable: true,
3608
- get: function() {
3609
- return ensureKeystrokeAssetsBucket;
3610
- }
3611
- });
3612
- Object.defineProperty(exports, "extractRouteManifestFromArtifact", {
3613
- enumerable: true,
3614
- get: function() {
3615
- return extractRouteManifestFromArtifact;
3616
- }
3617
- });
3618
- Object.defineProperty(exports, "isKeystrokeAssetsAvatarPublicUrl", {
3619
- enumerable: true,
3620
- get: function() {
3621
- return isKeystrokeAssetsAvatarPublicUrl;
3622
- }
3623
- });
3624
- Object.defineProperty(exports, "isKeystrokeAssetsOrgLogoPublicUrl", {
3625
- enumerable: true,
3626
- get: function() {
3627
- return isKeystrokeAssetsOrgLogoPublicUrl;
3628
- }
3629
- });
3630
- Object.defineProperty(exports, "isOrgLogoStorageKey", {
3631
- enumerable: true,
3632
- get: function() {
3633
- return isOrgLogoStorageKey;
3634
- }
3635
- });
3636
- Object.defineProperty(exports, "isUserAvatarStorageKey", {
3637
- enumerable: true,
3638
- get: function() {
3639
- return isUserAvatarStorageKey;
3640
- }
3641
- });
3642
- Object.defineProperty(exports, "keystrokeAssetsAvatarKeyFromPublicUrl", {
3643
- enumerable: true,
3644
- get: function() {
3645
- return keystrokeAssetsAvatarKeyFromPublicUrl;
3646
- }
3647
- });
3648
- Object.defineProperty(exports, "keystrokeAssetsOrgLogoKeyFromPublicUrl", {
3649
- enumerable: true,
3650
- get: function() {
3651
- return keystrokeAssetsOrgLogoKeyFromPublicUrl;
3652
- }
3653
- });
3654
- Object.defineProperty(exports, "listenPortFromPublicUrl", {
3655
- enumerable: true,
3656
- get: function() {
3657
- return listenPortFromPublicUrl;
3658
- }
3659
- });
3660
- Object.defineProperty(exports, "mapOrganizationInvitation", {
3661
- enumerable: true,
3662
- get: function() {
3663
- return mapOrganizationInvitation;
3664
- }
3665
- });
3666
- Object.defineProperty(exports, "mapOrganizationMember", {
3667
- enumerable: true,
3668
- get: function() {
3669
- return mapOrganizationMember;
3670
- }
3671
- });
3672
- Object.defineProperty(exports, "mapProject", {
3673
- enumerable: true,
3674
- get: function() {
3675
- return mapProject;
3676
- }
3677
- });
3678
- Object.defineProperty(exports, "mapProjectArtifact", {
3679
- enumerable: true,
3680
- get: function() {
3681
- return mapProjectArtifact;
3682
- }
3683
- });
3684
- Object.defineProperty(exports, "mapProjectDeployment", {
3685
- enumerable: true,
3686
- get: function() {
3687
- return mapProjectDeployment;
3688
- }
3689
- });
3690
- Object.defineProperty(exports, "mapProjectMember", {
3691
- enumerable: true,
3692
- get: function() {
3693
- return mapProjectMember;
3694
- }
3695
- });
3696
- Object.defineProperty(exports, "mapProjectSettings", {
3697
- enumerable: true,
3698
- get: function() {
3699
- return mapProjectSettings;
3700
- }
3701
- });
3702
- Object.defineProperty(exports, "mapUserOrganization", {
3703
- enumerable: true,
3704
- get: function() {
3705
- return mapUserOrganization;
3706
- }
3707
- });
3708
- Object.defineProperty(exports, "mergeUserPreferences", {
3709
- enumerable: true,
3710
- get: function() {
3711
- return mergeUserPreferences;
3712
- }
3713
- });
3714
- Object.defineProperty(exports, "minioStoragePlugin", {
3715
- enumerable: true,
3716
- get: function() {
3717
- return minioStoragePlugin;
3718
- }
3719
- });
3720
- Object.defineProperty(exports, "normalizeUserPreferences", {
3721
- enumerable: true,
3722
- get: function() {
3723
- return normalizeUserPreferences;
3724
- }
3725
- });
3726
- Object.defineProperty(exports, "orgLogoStorageKey", {
3727
- enumerable: true,
3728
- get: function() {
3729
- return orgLogoStorageKey;
3730
- }
3731
- });
3732
- Object.defineProperty(exports, "organizationInvitationAcceptPath", {
3733
- enumerable: true,
3734
- get: function() {
3735
- return organizationInvitationAcceptPath;
3736
- }
3737
- });
3738
- Object.defineProperty(exports, "organizationSlugErrorCodeFromMessage", {
3739
- enumerable: true,
3740
- get: function() {
3741
- return organizationSlugErrorCodeFromMessage;
3742
- }
3743
- });
3744
- Object.defineProperty(exports, "parseStoredRouteManifest", {
3745
- enumerable: true,
3746
- get: function() {
3747
- return parseStoredRouteManifest;
3748
- }
3749
- });
3750
- Object.defineProperty(exports, "pingProjectTarget", {
3751
- enumerable: true,
3752
- get: function() {
3753
- return pingProjectTarget;
3754
- }
3755
- });
3756
- Object.defineProperty(exports, "projectArtifactKey", {
3757
- enumerable: true,
3758
- get: function() {
3759
- return projectArtifactKey;
3760
- }
3761
- });
3762
- Object.defineProperty(exports, "projectFileId", {
3763
- enumerable: true,
3764
- get: function() {
3765
- return projectFileId;
3766
- }
3767
- });
3768
- Object.defineProperty(exports, "projectSourceBlobKey", {
3769
- enumerable: true,
3770
- get: function() {
3771
- return projectSourceBlobKey;
3772
- }
3773
- });
3774
- Object.defineProperty(exports, "publicKeystrokeAssetsObjectUrl", {
3775
- enumerable: true,
3776
- get: function() {
3777
- return publicKeystrokeAssetsObjectUrl;
3778
- }
3779
- });
3780
- Object.defineProperty(exports, "resolveUniqueCredentialInstanceLabel", {
3781
- enumerable: true,
3782
- get: function() {
3783
- return resolveUniqueCredentialInstanceLabel;
3784
- }
3785
- });
3786
- Object.defineProperty(exports, "userAvatarStorageKey", {
3787
- enumerable: true,
3788
- get: function() {
3789
- return userAvatarStorageKey;
3790
- }
3791
- });
3792
- Object.defineProperty(exports, "validationErrorResponse", {
3793
- enumerable: true,
3794
- get: function() {
3795
- return validationErrorResponse;
3796
- }
3797
- });
3798
-
3799
- //# sourceMappingURL=dist-DvjFaP47.cjs.map