@keystrokehq/keystroke 0.0.0-staging-20260714181321

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 (831) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +68 -0
  3. package/dist/action.cjs +29 -0
  4. package/dist/action.d.cts +3 -0
  5. package/dist/action.d.mts +3 -0
  6. package/dist/action.mjs +3 -0
  7. package/dist/agent-types.cjs +1 -0
  8. package/dist/agent-types.d.cts +4 -0
  9. package/dist/agent-types.d.mts +4 -0
  10. package/dist/agent-types.mjs +2 -0
  11. package/dist/agent.cjs +2901 -0
  12. package/dist/agent.cjs.map +1 -0
  13. package/dist/agent.d.cts +6 -0
  14. package/dist/agent.d.mts +6 -0
  15. package/dist/agent.mjs +2861 -0
  16. package/dist/agent.mjs.map +1 -0
  17. package/dist/alias-RTYYYW3D-BoplVz6M.mjs +10 -0
  18. package/dist/alias-RTYYYW3D-BoplVz6M.mjs.map +1 -0
  19. package/dist/alias-RTYYYW3D-DJi5ww-s.cjs +10 -0
  20. package/dist/alias-RTYYYW3D-DJi5ww-s.cjs.map +1 -0
  21. package/dist/app.cjs +37 -0
  22. package/dist/app.cjs.map +1 -0
  23. package/dist/app.d.cts +52 -0
  24. package/dist/app.d.cts.map +1 -0
  25. package/dist/app.d.mts +52 -0
  26. package/dist/app.d.mts.map +1 -0
  27. package/dist/app.mjs +36 -0
  28. package/dist/app.mjs.map +1 -0
  29. package/dist/awk2-LA3USKJP-Ch5apWe8.mjs +14 -0
  30. package/dist/awk2-LA3USKJP-Ch5apWe8.mjs.map +1 -0
  31. package/dist/awk2-LA3USKJP-p3zBRv5_.cjs +13 -0
  32. package/dist/awk2-LA3USKJP-p3zBRv5_.cjs.map +1 -0
  33. package/dist/base64-C2AIWVNC-C2dQcWz-.mjs +12 -0
  34. package/dist/base64-C2AIWVNC-C2dQcWz-.mjs.map +1 -0
  35. package/dist/base64-C2AIWVNC-CI9ThqJg.cjs +11 -0
  36. package/dist/base64-C2AIWVNC-CI9ThqJg.cjs.map +1 -0
  37. package/dist/basename-UB3CIYNI-CxZbgJkb.cjs +9 -0
  38. package/dist/basename-UB3CIYNI-CxZbgJkb.cjs.map +1 -0
  39. package/dist/basename-UB3CIYNI-DqFwCFM7.mjs +10 -0
  40. package/dist/basename-UB3CIYNI-DqFwCFM7.mjs.map +1 -0
  41. package/dist/bash-YZ33HQZQ-CgTYovun.cjs +11 -0
  42. package/dist/bash-YZ33HQZQ-CgTYovun.cjs.map +1 -0
  43. package/dist/bash-YZ33HQZQ-DAvz1MDp.mjs +11 -0
  44. package/dist/bash-YZ33HQZQ-DAvz1MDp.mjs.map +1 -0
  45. package/dist/cat-TSFMZVYS-BtIKZKsM.cjs +12 -0
  46. package/dist/cat-TSFMZVYS-BtIKZKsM.cjs.map +1 -0
  47. package/dist/cat-TSFMZVYS-CBat54wc.mjs +13 -0
  48. package/dist/cat-TSFMZVYS-CBat54wc.mjs.map +1 -0
  49. package/dist/chmod-TFEPA42X-BV8Tc2FK.cjs +9 -0
  50. package/dist/chmod-TFEPA42X-BV8Tc2FK.cjs.map +1 -0
  51. package/dist/chmod-TFEPA42X-Bz8vl7h5.mjs +10 -0
  52. package/dist/chmod-TFEPA42X-Bz8vl7h5.mjs.map +1 -0
  53. package/dist/chunk-27JIFWUR-C_jDOm1q.mjs +99 -0
  54. package/dist/chunk-27JIFWUR-C_jDOm1q.mjs.map +1 -0
  55. package/dist/chunk-27JIFWUR-CyXQ6J5p.cjs +115 -0
  56. package/dist/chunk-27JIFWUR-CyXQ6J5p.cjs.map +1 -0
  57. package/dist/chunk-2JIPICV3-B9OkmoBT.cjs +110 -0
  58. package/dist/chunk-2JIPICV3-B9OkmoBT.cjs.map +1 -0
  59. package/dist/chunk-2JIPICV3-BmWa83TV.mjs +100 -0
  60. package/dist/chunk-2JIPICV3-BmWa83TV.mjs.map +1 -0
  61. package/dist/chunk-2SMD2AUA-CYS-KNkj.cjs +77 -0
  62. package/dist/chunk-2SMD2AUA-CYS-KNkj.cjs.map +1 -0
  63. package/dist/chunk-2SMD2AUA-Dt6FJ5Cu.mjs +67 -0
  64. package/dist/chunk-2SMD2AUA-Dt6FJ5Cu.mjs.map +1 -0
  65. package/dist/chunk-2VDTE5BV-BX404P_Q.mjs +111 -0
  66. package/dist/chunk-2VDTE5BV-BX404P_Q.mjs.map +1 -0
  67. package/dist/chunk-2VDTE5BV-CvO85Ytl.cjs +121 -0
  68. package/dist/chunk-2VDTE5BV-CvO85Ytl.cjs.map +1 -0
  69. package/dist/chunk-2VJJEDV2-Bv9GMUKc.cjs +207 -0
  70. package/dist/chunk-2VJJEDV2-Bv9GMUKc.cjs.map +1 -0
  71. package/dist/chunk-2VJJEDV2-FnY5yUZB.mjs +197 -0
  72. package/dist/chunk-2VJJEDV2-FnY5yUZB.mjs.map +1 -0
  73. package/dist/chunk-46RN27KI-B95iSuAb.mjs +1742 -0
  74. package/dist/chunk-46RN27KI-B95iSuAb.mjs.map +1 -0
  75. package/dist/chunk-46RN27KI-DFcNXJPs.cjs +1752 -0
  76. package/dist/chunk-46RN27KI-DFcNXJPs.cjs.map +1 -0
  77. package/dist/chunk-4I3HOE5Z-BYotzP2w.mjs +718 -0
  78. package/dist/chunk-4I3HOE5Z-BYotzP2w.mjs.map +1 -0
  79. package/dist/chunk-4I3HOE5Z-CGJlGU0s.cjs +722 -0
  80. package/dist/chunk-4I3HOE5Z-CGJlGU0s.cjs.map +1 -0
  81. package/dist/chunk-4JLVZKHC-Bfvc4qEV.mjs +127 -0
  82. package/dist/chunk-4JLVZKHC-Bfvc4qEV.mjs.map +1 -0
  83. package/dist/chunk-4JLVZKHC-C55f7-bf.cjs +137 -0
  84. package/dist/chunk-4JLVZKHC-C55f7-bf.cjs.map +1 -0
  85. package/dist/chunk-4MZPEZTU-BTGVZBTX.cjs +32 -0
  86. package/dist/chunk-4MZPEZTU-BTGVZBTX.cjs.map +1 -0
  87. package/dist/chunk-4MZPEZTU-BcphrDpY.mjs +22 -0
  88. package/dist/chunk-4MZPEZTU-BcphrDpY.mjs.map +1 -0
  89. package/dist/chunk-4N6J7B5P-XNX8F_xN.mjs +91 -0
  90. package/dist/chunk-4N6J7B5P-XNX8F_xN.mjs.map +1 -0
  91. package/dist/chunk-4N6J7B5P-gzT_WzjI.cjs +101 -0
  92. package/dist/chunk-4N6J7B5P-gzT_WzjI.cjs.map +1 -0
  93. package/dist/chunk-4RUAZWKT-CISqwIli.mjs +22542 -0
  94. package/dist/chunk-4RUAZWKT-CISqwIli.mjs.map +1 -0
  95. package/dist/chunk-4RUAZWKT-D0EYlGEM.cjs +22552 -0
  96. package/dist/chunk-4RUAZWKT-D0EYlGEM.cjs.map +1 -0
  97. package/dist/chunk-4WKZNNJK-CuElmTiB.cjs +114 -0
  98. package/dist/chunk-4WKZNNJK-CuElmTiB.cjs.map +1 -0
  99. package/dist/chunk-4WKZNNJK-x25SBHbd.mjs +68 -0
  100. package/dist/chunk-4WKZNNJK-x25SBHbd.mjs.map +1 -0
  101. package/dist/chunk-5H5SCKJM-BAdWm9gp.mjs +601 -0
  102. package/dist/chunk-5H5SCKJM-BAdWm9gp.mjs.map +1 -0
  103. package/dist/chunk-5H5SCKJM-BRzmmj8G.cjs +611 -0
  104. package/dist/chunk-5H5SCKJM-BRzmmj8G.cjs.map +1 -0
  105. package/dist/chunk-6LASZU3O-Ct_82V6R.cjs +148 -0
  106. package/dist/chunk-6LASZU3O-Ct_82V6R.cjs.map +1 -0
  107. package/dist/chunk-6LASZU3O-D5mzy_lg.mjs +138 -0
  108. package/dist/chunk-6LASZU3O-D5mzy_lg.mjs.map +1 -0
  109. package/dist/chunk-6SHYIICL-BSYBVfvW.mjs +150 -0
  110. package/dist/chunk-6SHYIICL-BSYBVfvW.mjs.map +1 -0
  111. package/dist/chunk-6SHYIICL-DJqHuH0Q.cjs +160 -0
  112. package/dist/chunk-6SHYIICL-DJqHuH0Q.cjs.map +1 -0
  113. package/dist/chunk-6VAT5Z2D-DJEEw_Ty.mjs +108 -0
  114. package/dist/chunk-6VAT5Z2D-DJEEw_Ty.mjs.map +1 -0
  115. package/dist/chunk-6VAT5Z2D-DZJSQyuR.cjs +118 -0
  116. package/dist/chunk-6VAT5Z2D-DZJSQyuR.cjs.map +1 -0
  117. package/dist/chunk-7AISL3XV-BQAcS9rE.cjs +213 -0
  118. package/dist/chunk-7AISL3XV-BQAcS9rE.cjs.map +1 -0
  119. package/dist/chunk-7AISL3XV-DtlBq8ZM.mjs +203 -0
  120. package/dist/chunk-7AISL3XV-DtlBq8ZM.mjs.map +1 -0
  121. package/dist/chunk-7EUWTCWK-CFIPY2xQ.cjs +36 -0
  122. package/dist/chunk-7EUWTCWK-CFIPY2xQ.cjs.map +1 -0
  123. package/dist/chunk-7EUWTCWK-lrDJugXH.mjs +26 -0
  124. package/dist/chunk-7EUWTCWK-lrDJugXH.mjs.map +1 -0
  125. package/dist/chunk-7JHM3L42-CbQ7uKuB.mjs +138 -0
  126. package/dist/chunk-7JHM3L42-CbQ7uKuB.mjs.map +1 -0
  127. package/dist/chunk-7JHM3L42-o7UQXVvn.cjs +148 -0
  128. package/dist/chunk-7JHM3L42-o7UQXVvn.cjs.map +1 -0
  129. package/dist/chunk-A4R2GWRF-BhatkJvi.mjs +126 -0
  130. package/dist/chunk-A4R2GWRF-BhatkJvi.mjs.map +1 -0
  131. package/dist/chunk-A4R2GWRF-DnmmNb1N.cjs +148 -0
  132. package/dist/chunk-A4R2GWRF-DnmmNb1N.cjs.map +1 -0
  133. package/dist/chunk-ACSZB4FE-BteEu9EB.cjs +172 -0
  134. package/dist/chunk-ACSZB4FE-BteEu9EB.cjs.map +1 -0
  135. package/dist/chunk-ACSZB4FE-DztQwBfs.mjs +162 -0
  136. package/dist/chunk-ACSZB4FE-DztQwBfs.mjs.map +1 -0
  137. package/dist/chunk-AQ6FYS2X-BQ5Y2cHL.mjs +36 -0
  138. package/dist/chunk-AQ6FYS2X-BQ5Y2cHL.mjs.map +1 -0
  139. package/dist/chunk-AQ6FYS2X-BmpovEEJ.cjs +40 -0
  140. package/dist/chunk-AQ6FYS2X-BmpovEEJ.cjs.map +1 -0
  141. package/dist/chunk-BVKWRAS6-BTpbA0Ve.cjs +139 -0
  142. package/dist/chunk-BVKWRAS6-BTpbA0Ve.cjs.map +1 -0
  143. package/dist/chunk-BVKWRAS6-rGqDhDIf.mjs +129 -0
  144. package/dist/chunk-BVKWRAS6-rGqDhDIf.mjs.map +1 -0
  145. package/dist/chunk-BZUGFHVS-7RRM7Jpb.cjs +67 -0
  146. package/dist/chunk-BZUGFHVS-7RRM7Jpb.cjs.map +1 -0
  147. package/dist/chunk-BZUGFHVS-B2NchobP.mjs +33 -0
  148. package/dist/chunk-BZUGFHVS-B2NchobP.mjs.map +1 -0
  149. package/dist/chunk-CBJVD2XA-BTNFYxbU.mjs +772 -0
  150. package/dist/chunk-CBJVD2XA-BTNFYxbU.mjs.map +1 -0
  151. package/dist/chunk-CBJVD2XA-DNaADZvz.cjs +783 -0
  152. package/dist/chunk-CBJVD2XA-DNaADZvz.cjs.map +1 -0
  153. package/dist/chunk-CHFEPBH4-DgvknHqN.cjs +609 -0
  154. package/dist/chunk-CHFEPBH4-DgvknHqN.cjs.map +1 -0
  155. package/dist/chunk-CHFEPBH4-frsHsnTZ.mjs +593 -0
  156. package/dist/chunk-CHFEPBH4-frsHsnTZ.mjs.map +1 -0
  157. package/dist/chunk-CN5XGDNN-BJ4wq2Kf.cjs +139 -0
  158. package/dist/chunk-CN5XGDNN-BJ4wq2Kf.cjs.map +1 -0
  159. package/dist/chunk-CN5XGDNN-Bt9ykxRg.mjs +129 -0
  160. package/dist/chunk-CN5XGDNN-Bt9ykxRg.mjs.map +1 -0
  161. package/dist/chunk-DnnnRqeS.mjs +26 -0
  162. package/dist/chunk-EBAPSGAO-Bkf3xjZt.mjs +246 -0
  163. package/dist/chunk-EBAPSGAO-Bkf3xjZt.mjs.map +1 -0
  164. package/dist/chunk-EBAPSGAO-Jl9--2Uo.cjs +250 -0
  165. package/dist/chunk-EBAPSGAO-Jl9--2Uo.cjs.map +1 -0
  166. package/dist/chunk-FAXLQUCQ-BrRRzC5l.cjs +75 -0
  167. package/dist/chunk-FAXLQUCQ-BrRRzC5l.cjs.map +1 -0
  168. package/dist/chunk-FAXLQUCQ-DHw2Aai6.mjs +65 -0
  169. package/dist/chunk-FAXLQUCQ-DHw2Aai6.mjs.map +1 -0
  170. package/dist/chunk-FHC24QSK-0eusXJ-O.mjs +102 -0
  171. package/dist/chunk-FHC24QSK-0eusXJ-O.mjs.map +1 -0
  172. package/dist/chunk-FHC24QSK-B86B1Cz2.cjs +124 -0
  173. package/dist/chunk-FHC24QSK-B86B1Cz2.cjs.map +1 -0
  174. package/dist/chunk-FJK43EBQ-XInZFwsh.mjs +238 -0
  175. package/dist/chunk-FJK43EBQ-XInZFwsh.mjs.map +1 -0
  176. package/dist/chunk-FJK43EBQ-dasZe3EC.cjs +248 -0
  177. package/dist/chunk-FJK43EBQ-dasZe3EC.cjs.map +1 -0
  178. package/dist/chunk-FW54FHZR-CnEw1eCY.cjs +26 -0
  179. package/dist/chunk-FW54FHZR-CnEw1eCY.cjs.map +1 -0
  180. package/dist/chunk-FW54FHZR-D7uUjYjL.mjs +16 -0
  181. package/dist/chunk-FW54FHZR-D7uUjYjL.mjs.map +1 -0
  182. package/dist/chunk-FX4RBUYU-DpjbPT4m.cjs +52 -0
  183. package/dist/chunk-FX4RBUYU-DpjbPT4m.cjs.map +1 -0
  184. package/dist/chunk-FX4RBUYU-UO7fSPYF.mjs +42 -0
  185. package/dist/chunk-FX4RBUYU-UO7fSPYF.mjs.map +1 -0
  186. package/dist/chunk-FX7KQCEA-BcmaXUKB.cjs +1640 -0
  187. package/dist/chunk-FX7KQCEA-BcmaXUKB.cjs.map +1 -0
  188. package/dist/chunk-FX7KQCEA-DxfpN7b4.mjs +1629 -0
  189. package/dist/chunk-FX7KQCEA-DxfpN7b4.mjs.map +1 -0
  190. package/dist/chunk-FZRQOL3C-Bx5-8UBj.mjs +121 -0
  191. package/dist/chunk-FZRQOL3C-Bx5-8UBj.mjs.map +1 -0
  192. package/dist/chunk-FZRQOL3C-CBnDVYtW.cjs +131 -0
  193. package/dist/chunk-FZRQOL3C-CBnDVYtW.cjs.map +1 -0
  194. package/dist/chunk-GGC5NEPZ-BDcxHM8i.mjs +121 -0
  195. package/dist/chunk-GGC5NEPZ-BDcxHM8i.mjs.map +1 -0
  196. package/dist/chunk-GGC5NEPZ-D5IT5qVO.cjs +131 -0
  197. package/dist/chunk-GGC5NEPZ-D5IT5qVO.cjs.map +1 -0
  198. package/dist/chunk-GIUR5SNU-BTM2YOuk.cjs +896 -0
  199. package/dist/chunk-GIUR5SNU-BTM2YOuk.cjs.map +1 -0
  200. package/dist/chunk-GIUR5SNU-D36Uv3dr.mjs +885 -0
  201. package/dist/chunk-GIUR5SNU-D36Uv3dr.mjs.map +1 -0
  202. package/dist/chunk-GJC3WVOW-BYjyETf9.cjs +26 -0
  203. package/dist/chunk-GJC3WVOW-BYjyETf9.cjs.map +1 -0
  204. package/dist/chunk-GJC3WVOW-GJMDWjrT.mjs +16 -0
  205. package/dist/chunk-GJC3WVOW-GJMDWjrT.mjs.map +1 -0
  206. package/dist/chunk-GSPYNYZA-C_7GKjiT.cjs +151 -0
  207. package/dist/chunk-GSPYNYZA-C_7GKjiT.cjs.map +1 -0
  208. package/dist/chunk-GSPYNYZA-DVJtbW9g.mjs +129 -0
  209. package/dist/chunk-GSPYNYZA-DVJtbW9g.mjs.map +1 -0
  210. package/dist/chunk-GTQIUQM6-CbzW1lEX.mjs +153 -0
  211. package/dist/chunk-GTQIUQM6-CbzW1lEX.mjs.map +1 -0
  212. package/dist/chunk-GTQIUQM6-hJW9WFGA.cjs +163 -0
  213. package/dist/chunk-GTQIUQM6-hJW9WFGA.cjs.map +1 -0
  214. package/dist/chunk-HDRAUQK2-CJM41vHX.cjs +54 -0
  215. package/dist/chunk-HDRAUQK2-CJM41vHX.cjs.map +1 -0
  216. package/dist/chunk-HDRAUQK2-DqOxTpsf.mjs +32 -0
  217. package/dist/chunk-HDRAUQK2-DqOxTpsf.mjs.map +1 -0
  218. package/dist/chunk-HJBTD7PY-BczgIhpV.cjs +193 -0
  219. package/dist/chunk-HJBTD7PY-BczgIhpV.cjs.map +1 -0
  220. package/dist/chunk-HJBTD7PY-CrtQ4gie.mjs +183 -0
  221. package/dist/chunk-HJBTD7PY-CrtQ4gie.mjs.map +1 -0
  222. package/dist/chunk-ICIEVHY5-FEGmVNQ9.cjs +2894 -0
  223. package/dist/chunk-ICIEVHY5-FEGmVNQ9.cjs.map +1 -0
  224. package/dist/chunk-ICIEVHY5-fy83vdIp.mjs +2875 -0
  225. package/dist/chunk-ICIEVHY5-fy83vdIp.mjs.map +1 -0
  226. package/dist/chunk-KATRCGLX-CC0LaZYR.cjs +65 -0
  227. package/dist/chunk-KATRCGLX-CC0LaZYR.cjs.map +1 -0
  228. package/dist/chunk-KATRCGLX-UcOdcj3k.mjs +55 -0
  229. package/dist/chunk-KATRCGLX-UcOdcj3k.mjs.map +1 -0
  230. package/dist/chunk-KD3KENL6-BkDquANH.cjs +162 -0
  231. package/dist/chunk-KD3KENL6-BkDquANH.cjs.map +1 -0
  232. package/dist/chunk-KD3KENL6-DpwUxq9s.mjs +152 -0
  233. package/dist/chunk-KD3KENL6-DpwUxq9s.mjs.map +1 -0
  234. package/dist/chunk-KWGBQNTV-Ba-YzffV.cjs +719 -0
  235. package/dist/chunk-KWGBQNTV-Ba-YzffV.cjs.map +1 -0
  236. package/dist/chunk-KWGBQNTV-DfE0VBdx.mjs +684 -0
  237. package/dist/chunk-KWGBQNTV-DfE0VBdx.mjs.map +1 -0
  238. package/dist/chunk-LEKBROJD-C5ANB3SA.mjs +3111 -0
  239. package/dist/chunk-LEKBROJD-C5ANB3SA.mjs.map +1 -0
  240. package/dist/chunk-LEKBROJD-e48-Mcrg.cjs +3121 -0
  241. package/dist/chunk-LEKBROJD-e48-Mcrg.cjs.map +1 -0
  242. package/dist/chunk-LNBPBRV4-Dd_D8irI.cjs +2754 -0
  243. package/dist/chunk-LNBPBRV4-Dd_D8irI.cjs.map +1 -0
  244. package/dist/chunk-LNBPBRV4-dUOQ4a6x.mjs +2744 -0
  245. package/dist/chunk-LNBPBRV4-dUOQ4a6x.mjs.map +1 -0
  246. package/dist/chunk-LPJEKUCB-BSjA_8f7.mjs +95 -0
  247. package/dist/chunk-LPJEKUCB-BSjA_8f7.mjs.map +1 -0
  248. package/dist/chunk-LPJEKUCB-d_TFMtsF.cjs +105 -0
  249. package/dist/chunk-LPJEKUCB-d_TFMtsF.cjs.map +1 -0
  250. package/dist/chunk-LSLPJOYM-CNIdl9jx.cjs +58 -0
  251. package/dist/chunk-LSLPJOYM-CNIdl9jx.cjs.map +1 -0
  252. package/dist/chunk-LSLPJOYM-DLRxrFR6.mjs +48 -0
  253. package/dist/chunk-LSLPJOYM-DLRxrFR6.mjs.map +1 -0
  254. package/dist/chunk-MFDPAVC6-Lsnf2J2b.cjs +208 -0
  255. package/dist/chunk-MFDPAVC6-Lsnf2J2b.cjs.map +1 -0
  256. package/dist/chunk-MFDPAVC6-Qj00Ay3i.mjs +198 -0
  257. package/dist/chunk-MFDPAVC6-Qj00Ay3i.mjs.map +1 -0
  258. package/dist/chunk-MLIO3BK2-CHUA_NrL.mjs +61 -0
  259. package/dist/chunk-MLIO3BK2-CHUA_NrL.mjs.map +1 -0
  260. package/dist/chunk-MLIO3BK2-SVEJbZNB.cjs +71 -0
  261. package/dist/chunk-MLIO3BK2-SVEJbZNB.cjs.map +1 -0
  262. package/dist/chunk-MQKGGNPS-CoJpEuJU.mjs +121 -0
  263. package/dist/chunk-MQKGGNPS-CoJpEuJU.mjs.map +1 -0
  264. package/dist/chunk-MQKGGNPS-DkB6LiMi.cjs +131 -0
  265. package/dist/chunk-MQKGGNPS-DkB6LiMi.cjs.map +1 -0
  266. package/dist/chunk-MZFCCXPZ-CtqHeO_b.mjs +2881 -0
  267. package/dist/chunk-MZFCCXPZ-CtqHeO_b.mjs.map +1 -0
  268. package/dist/chunk-MZFCCXPZ-f-V1JFCy.cjs +2895 -0
  269. package/dist/chunk-MZFCCXPZ-f-V1JFCy.cjs.map +1 -0
  270. package/dist/chunk-N6DXJ2JN-BIRkw3tM.mjs +8630 -0
  271. package/dist/chunk-N6DXJ2JN-BIRkw3tM.mjs.map +1 -0
  272. package/dist/chunk-N6DXJ2JN-CbTOXlJg.cjs +8640 -0
  273. package/dist/chunk-N6DXJ2JN-CbTOXlJg.cjs.map +1 -0
  274. package/dist/chunk-OC35HPHG-D_SNv3be.cjs +64 -0
  275. package/dist/chunk-OC35HPHG-D_SNv3be.cjs.map +1 -0
  276. package/dist/chunk-OC35HPHG-ajyBAU_j.mjs +54 -0
  277. package/dist/chunk-OC35HPHG-ajyBAU_j.mjs.map +1 -0
  278. package/dist/chunk-OGJ5CFPR-BAmKHJkE.mjs +52 -0
  279. package/dist/chunk-OGJ5CFPR-BAmKHJkE.mjs.map +1 -0
  280. package/dist/chunk-OGJ5CFPR-DmSopoKh.cjs +62 -0
  281. package/dist/chunk-OGJ5CFPR-DmSopoKh.cjs.map +1 -0
  282. package/dist/chunk-OVGANXCG-C52GhE5U.mjs +167 -0
  283. package/dist/chunk-OVGANXCG-C52GhE5U.mjs.map +1 -0
  284. package/dist/chunk-OVGANXCG-CiIRldWP.cjs +177 -0
  285. package/dist/chunk-OVGANXCG-CiIRldWP.cjs.map +1 -0
  286. package/dist/chunk-Q7H5W7YE-DIAe7nW8.mjs +2941 -0
  287. package/dist/chunk-Q7H5W7YE-DIAe7nW8.mjs.map +1 -0
  288. package/dist/chunk-Q7H5W7YE-DPq8Od8j.cjs +2964 -0
  289. package/dist/chunk-Q7H5W7YE-DPq8Od8j.cjs.map +1 -0
  290. package/dist/chunk-QAYAQNCG-B1r1SmqS.mjs +62 -0
  291. package/dist/chunk-QAYAQNCG-B1r1SmqS.mjs.map +1 -0
  292. package/dist/chunk-QAYAQNCG-ROQh1hrZ.cjs +78 -0
  293. package/dist/chunk-QAYAQNCG-ROQh1hrZ.cjs.map +1 -0
  294. package/dist/chunk-QIQMJJZ4-Cm4e9-4O.cjs +96 -0
  295. package/dist/chunk-QIQMJJZ4-Cm4e9-4O.cjs.map +1 -0
  296. package/dist/chunk-QIQMJJZ4-Dn8UfvJ9.mjs +92 -0
  297. package/dist/chunk-QIQMJJZ4-Dn8UfvJ9.mjs.map +1 -0
  298. package/dist/chunk-R4IFXNY5-Csrv6AhU.cjs +1946 -0
  299. package/dist/chunk-R4IFXNY5-Csrv6AhU.cjs.map +1 -0
  300. package/dist/chunk-R4IFXNY5-TuOLBm8W.mjs +1935 -0
  301. package/dist/chunk-R4IFXNY5-TuOLBm8W.mjs.map +1 -0
  302. package/dist/chunk-R74UQCKX-CPtn5NJv.cjs +15903 -0
  303. package/dist/chunk-R74UQCKX-CPtn5NJv.cjs.map +1 -0
  304. package/dist/chunk-R74UQCKX-rTYiDvqn.mjs +15889 -0
  305. package/dist/chunk-R74UQCKX-rTYiDvqn.mjs.map +1 -0
  306. package/dist/chunk-S3LEJEPP-BUVoLpnB.mjs +16 -0
  307. package/dist/chunk-S3LEJEPP-BUVoLpnB.mjs.map +1 -0
  308. package/dist/chunk-S3LEJEPP-C-zWCDCK.cjs +26 -0
  309. package/dist/chunk-S3LEJEPP-C-zWCDCK.cjs.map +1 -0
  310. package/dist/chunk-S443BAN4-CWfl3e_x.mjs +66 -0
  311. package/dist/chunk-S443BAN4-CWfl3e_x.mjs.map +1 -0
  312. package/dist/chunk-S443BAN4-DzTRCubJ.cjs +76 -0
  313. package/dist/chunk-S443BAN4-DzTRCubJ.cjs.map +1 -0
  314. package/dist/chunk-SAI2SPQQ-D6YWGjkC.mjs +107 -0
  315. package/dist/chunk-SAI2SPQQ-D6YWGjkC.mjs.map +1 -0
  316. package/dist/chunk-SAI2SPQQ-DBSaHSMv.cjs +195 -0
  317. package/dist/chunk-SAI2SPQQ-DBSaHSMv.cjs.map +1 -0
  318. package/dist/chunk-SBBYKIYU-BX9jd0cC.mjs +22 -0
  319. package/dist/chunk-SBBYKIYU-BX9jd0cC.mjs.map +1 -0
  320. package/dist/chunk-SBBYKIYU-KcomBm3F.cjs +32 -0
  321. package/dist/chunk-SBBYKIYU-KcomBm3F.cjs.map +1 -0
  322. package/dist/chunk-SETW5JBN-BpqhTKA7.mjs +71 -0
  323. package/dist/chunk-SETW5JBN-BpqhTKA7.mjs.map +1 -0
  324. package/dist/chunk-SETW5JBN-CoDj5SEz.cjs +81 -0
  325. package/dist/chunk-SETW5JBN-CoDj5SEz.cjs.map +1 -0
  326. package/dist/chunk-SHKOQWO4-D30l6Ug1.mjs +38 -0
  327. package/dist/chunk-SHKOQWO4-D30l6Ug1.mjs.map +1 -0
  328. package/dist/chunk-SHKOQWO4-JHQfW8rf.cjs +48 -0
  329. package/dist/chunk-SHKOQWO4-JHQfW8rf.cjs.map +1 -0
  330. package/dist/chunk-SJYEXC2Z-BN7uvChV.mjs +137 -0
  331. package/dist/chunk-SJYEXC2Z-BN7uvChV.mjs.map +1 -0
  332. package/dist/chunk-SJYEXC2Z-BXK_p_zv.cjs +147 -0
  333. package/dist/chunk-SJYEXC2Z-BXK_p_zv.cjs.map +1 -0
  334. package/dist/chunk-SO6R3ZKN-DIoHJ9o1.mjs +139 -0
  335. package/dist/chunk-SO6R3ZKN-DIoHJ9o1.mjs.map +1 -0
  336. package/dist/chunk-SO6R3ZKN-DYeOBPNJ.cjs +161 -0
  337. package/dist/chunk-SO6R3ZKN-DYeOBPNJ.cjs.map +1 -0
  338. package/dist/chunk-SX2HC7SO-BrE3qB0x.mjs +19 -0
  339. package/dist/chunk-SX2HC7SO-BrE3qB0x.mjs.map +1 -0
  340. package/dist/chunk-SX2HC7SO-CN1P7tXw.cjs +23 -0
  341. package/dist/chunk-SX2HC7SO-CN1P7tXw.cjs.map +1 -0
  342. package/dist/chunk-T4TFLF3R-Bb_8pxg5.mjs +379 -0
  343. package/dist/chunk-T4TFLF3R-Bb_8pxg5.mjs.map +1 -0
  344. package/dist/chunk-T4TFLF3R-Gu-7ZmXM.cjs +389 -0
  345. package/dist/chunk-T4TFLF3R-Gu-7ZmXM.cjs.map +1 -0
  346. package/dist/chunk-TDD4NFYE-CyVGcZCt.cjs +24 -0
  347. package/dist/chunk-TDD4NFYE-CyVGcZCt.cjs.map +1 -0
  348. package/dist/chunk-TDD4NFYE-Djy1ztDY.mjs +20 -0
  349. package/dist/chunk-TDD4NFYE-Djy1ztDY.mjs.map +1 -0
  350. package/dist/chunk-TN7HHBQW-B8PYcKz5.mjs +1136 -0
  351. package/dist/chunk-TN7HHBQW-B8PYcKz5.mjs.map +1 -0
  352. package/dist/chunk-TN7HHBQW-D_SK6w5n.cjs +1146 -0
  353. package/dist/chunk-TN7HHBQW-D_SK6w5n.cjs.map +1 -0
  354. package/dist/chunk-U73A73IE-CDaNc6aR.mjs +239 -0
  355. package/dist/chunk-U73A73IE-CDaNc6aR.mjs.map +1 -0
  356. package/dist/chunk-U73A73IE-C_li6Ywy.cjs +249 -0
  357. package/dist/chunk-U73A73IE-C_li6Ywy.cjs.map +1 -0
  358. package/dist/chunk-UIJUTQPH-D5B7TGJb.mjs +49 -0
  359. package/dist/chunk-UIJUTQPH-D5B7TGJb.mjs.map +1 -0
  360. package/dist/chunk-UIJUTQPH-DwMywiZD.cjs +59 -0
  361. package/dist/chunk-UIJUTQPH-DwMywiZD.cjs.map +1 -0
  362. package/dist/chunk-UP6MSJGD-Ce_ugQjA.cjs +282 -0
  363. package/dist/chunk-UP6MSJGD-Ce_ugQjA.cjs.map +1 -0
  364. package/dist/chunk-UP6MSJGD-qtfY-kMd.mjs +272 -0
  365. package/dist/chunk-UP6MSJGD-qtfY-kMd.mjs.map +1 -0
  366. package/dist/chunk-VLCHOJWK-BkLKLhJt.mjs +128 -0
  367. package/dist/chunk-VLCHOJWK-BkLKLhJt.mjs.map +1 -0
  368. package/dist/chunk-VLCHOJWK-C6ClsB_n.cjs +138 -0
  369. package/dist/chunk-VLCHOJWK-C6ClsB_n.cjs.map +1 -0
  370. package/dist/chunk-WM5IJFMP-DaCkWqms.mjs +132 -0
  371. package/dist/chunk-WM5IJFMP-DaCkWqms.mjs.map +1 -0
  372. package/dist/chunk-WM5IJFMP-xVcv7T82.cjs +142 -0
  373. package/dist/chunk-WM5IJFMP-xVcv7T82.cjs.map +1 -0
  374. package/dist/chunk-WPGQVBSY-0OUgx3uG.mjs +81 -0
  375. package/dist/chunk-WPGQVBSY-0OUgx3uG.mjs.map +1 -0
  376. package/dist/chunk-WPGQVBSY-BFMb_fKs.cjs +91 -0
  377. package/dist/chunk-WPGQVBSY-BFMb_fKs.cjs.map +1 -0
  378. package/dist/chunk-WVRWIZF5-B5z8SbAq.cjs +4225 -0
  379. package/dist/chunk-WVRWIZF5-B5z8SbAq.cjs.map +1 -0
  380. package/dist/chunk-WVRWIZF5-DMlo9K-r.mjs +4214 -0
  381. package/dist/chunk-WVRWIZF5-DMlo9K-r.mjs.map +1 -0
  382. package/dist/chunk-XCQWV4AU-CGtzquM1.mjs +152 -0
  383. package/dist/chunk-XCQWV4AU-CGtzquM1.mjs.map +1 -0
  384. package/dist/chunk-XCQWV4AU-C_Y_0wWt.cjs +162 -0
  385. package/dist/chunk-XCQWV4AU-C_Y_0wWt.cjs.map +1 -0
  386. package/dist/chunk-XDGLKIHR-BDFXwzdX.cjs +464 -0
  387. package/dist/chunk-XDGLKIHR-BDFXwzdX.cjs.map +1 -0
  388. package/dist/chunk-XDGLKIHR-D0vcPbdW.mjs +430 -0
  389. package/dist/chunk-XDGLKIHR-D0vcPbdW.mjs.map +1 -0
  390. package/dist/chunk-XHLMAZX2-BrJucUTF.mjs +93 -0
  391. package/dist/chunk-XHLMAZX2-BrJucUTF.mjs.map +1 -0
  392. package/dist/chunk-XHLMAZX2-DNQuFoGb.cjs +103 -0
  393. package/dist/chunk-XHLMAZX2-DNQuFoGb.cjs.map +1 -0
  394. package/dist/chunk-XUIHBHL5-Bz2HzJ45.mjs +204 -0
  395. package/dist/chunk-XUIHBHL5-Bz2HzJ45.mjs.map +1 -0
  396. package/dist/chunk-XUIHBHL5-CaVMT8uQ.cjs +214 -0
  397. package/dist/chunk-XUIHBHL5-CaVMT8uQ.cjs.map +1 -0
  398. package/dist/chunk-XYXUMFSU-C1butS4L.cjs +295 -0
  399. package/dist/chunk-XYXUMFSU-C1butS4L.cjs.map +1 -0
  400. package/dist/chunk-XYXUMFSU-CbkoFwJa.mjs +285 -0
  401. package/dist/chunk-XYXUMFSU-CbkoFwJa.mjs.map +1 -0
  402. package/dist/chunk-Y4LIDHSD-CFAzhWFF.mjs +91 -0
  403. package/dist/chunk-Y4LIDHSD-CFAzhWFF.mjs.map +1 -0
  404. package/dist/chunk-Y4LIDHSD-DfVwb2PX.cjs +101 -0
  405. package/dist/chunk-Y4LIDHSD-DfVwb2PX.cjs.map +1 -0
  406. package/dist/chunk-YCLFEX4T-CzQl99Kn.mjs +76 -0
  407. package/dist/chunk-YCLFEX4T-CzQl99Kn.mjs.map +1 -0
  408. package/dist/chunk-YCLFEX4T-DHl1XO8T.cjs +86 -0
  409. package/dist/chunk-YCLFEX4T-DHl1XO8T.cjs.map +1 -0
  410. package/dist/chunk-YS4NUBYX-pjl7FL1K.cjs +128 -0
  411. package/dist/chunk-YS4NUBYX-pjl7FL1K.cjs.map +1 -0
  412. package/dist/chunk-YS4NUBYX-urCufyr4.mjs +118 -0
  413. package/dist/chunk-YS4NUBYX-urCufyr4.mjs.map +1 -0
  414. package/dist/chunk-ZDIT6ST5-BOhlYgab.mjs +106 -0
  415. package/dist/chunk-ZDIT6ST5-BOhlYgab.mjs.map +1 -0
  416. package/dist/chunk-ZDIT6ST5-BanJQ2rN.cjs +116 -0
  417. package/dist/chunk-ZDIT6ST5-BanJQ2rN.cjs.map +1 -0
  418. package/dist/chunk-ZDPFA4L3-B9CgTrRM.cjs +69 -0
  419. package/dist/chunk-ZDPFA4L3-B9CgTrRM.cjs.map +1 -0
  420. package/dist/chunk-ZDPFA4L3-CFiGvFmX.mjs +59 -0
  421. package/dist/chunk-ZDPFA4L3-CFiGvFmX.mjs.map +1 -0
  422. package/dist/chunk-ZZKH2ELC-ax83hgqF.mjs +1370 -0
  423. package/dist/chunk-ZZKH2ELC-ax83hgqF.mjs.map +1 -0
  424. package/dist/chunk-ZZKH2ELC-f-RKOsqX.cjs +1380 -0
  425. package/dist/chunk-ZZKH2ELC-f-RKOsqX.cjs.map +1 -0
  426. package/dist/chunk-emK7D4bc.cjs +35 -0
  427. package/dist/clear-HKGFEOF6-CYyBOq3X.mjs +10 -0
  428. package/dist/clear-HKGFEOF6-CYyBOq3X.mjs.map +1 -0
  429. package/dist/clear-HKGFEOF6-ZGwSsMXs.cjs +9 -0
  430. package/dist/clear-HKGFEOF6-ZGwSsMXs.cjs.map +1 -0
  431. package/dist/client.cjs +78 -0
  432. package/dist/client.cjs.map +1 -0
  433. package/dist/client.d.cts +32 -0
  434. package/dist/client.d.cts.map +1 -0
  435. package/dist/client.d.mts +32 -0
  436. package/dist/client.d.mts.map +1 -0
  437. package/dist/client.mjs +74 -0
  438. package/dist/client.mjs.map +1 -0
  439. package/dist/column-XT6UFXNQ-CWF7QRjz.cjs +11 -0
  440. package/dist/column-XT6UFXNQ-CWF7QRjz.cjs.map +1 -0
  441. package/dist/column-XT6UFXNQ-CoTCXAQA.mjs +12 -0
  442. package/dist/column-XT6UFXNQ-CoTCXAQA.mjs.map +1 -0
  443. package/dist/comm-VV2LDX2J-DOzyBOMs.cjs +10 -0
  444. package/dist/comm-VV2LDX2J-DOzyBOMs.cjs.map +1 -0
  445. package/dist/comm-VV2LDX2J-IeNG1fNU.mjs +11 -0
  446. package/dist/comm-VV2LDX2J-IeNG1fNU.mjs.map +1 -0
  447. package/dist/config.cjs +88 -0
  448. package/dist/config.cjs.map +1 -0
  449. package/dist/config.d.cts +1316 -0
  450. package/dist/config.d.cts.map +1 -0
  451. package/dist/config.d.mts +1316 -0
  452. package/dist/config.d.mts.map +1 -0
  453. package/dist/config.mjs +81 -0
  454. package/dist/config.mjs.map +1 -0
  455. package/dist/context-compaction-Bxp4WK2B-CWLdNWoS.cjs +966 -0
  456. package/dist/context-compaction-Bxp4WK2B-CWLdNWoS.cjs.map +1 -0
  457. package/dist/context-compaction-Bxp4WK2B-Ct4RSjlg.mjs +811 -0
  458. package/dist/context-compaction-Bxp4WK2B-Ct4RSjlg.mjs.map +1 -0
  459. package/dist/cp-BISAAS7A-fWG_vkSv.cjs +11 -0
  460. package/dist/cp-BISAAS7A-fWG_vkSv.cjs.map +1 -0
  461. package/dist/cp-BISAAS7A-y3hdv9xC.mjs +12 -0
  462. package/dist/cp-BISAAS7A-y3hdv9xC.mjs.map +1 -0
  463. package/dist/credentials.cjs +10 -0
  464. package/dist/credentials.d.cts +2 -0
  465. package/dist/credentials.d.mts +2 -0
  466. package/dist/credentials.mjs +3 -0
  467. package/dist/curl-LV5Y3AMS-Bf9eKOTr.cjs +364 -0
  468. package/dist/curl-LV5Y3AMS-Bf9eKOTr.cjs.map +1 -0
  469. package/dist/curl-LV5Y3AMS-DY6AEvUN.mjs +365 -0
  470. package/dist/curl-LV5Y3AMS-DY6AEvUN.mjs.map +1 -0
  471. package/dist/cut-OKARJCCV-B5hj6PNw.cjs +11 -0
  472. package/dist/cut-OKARJCCV-B5hj6PNw.cjs.map +1 -0
  473. package/dist/cut-OKARJCCV-BeA2qK8B.mjs +12 -0
  474. package/dist/cut-OKARJCCV-BeA2qK8B.mjs.map +1 -0
  475. package/dist/date-UUUPW43J-BvO9KK8b.mjs +10 -0
  476. package/dist/date-UUUPW43J-BvO9KK8b.mjs.map +1 -0
  477. package/dist/date-UUUPW43J-mv37dOgT.cjs +9 -0
  478. package/dist/date-UUUPW43J-mv37dOgT.cjs.map +1 -0
  479. package/dist/diff-MWJFIG7X-CWeDF1mh.mjs +12 -0
  480. package/dist/diff-MWJFIG7X-CWeDF1mh.mjs.map +1 -0
  481. package/dist/diff-MWJFIG7X-Dt8HnbgX.cjs +11 -0
  482. package/dist/diff-MWJFIG7X-Dt8HnbgX.cjs.map +1 -0
  483. package/dist/dirname-MPHRFUTI-CG4kCjEj.mjs +10 -0
  484. package/dist/dirname-MPHRFUTI-CG4kCjEj.mjs.map +1 -0
  485. package/dist/dirname-MPHRFUTI-DSaDfKGY.cjs +9 -0
  486. package/dist/dirname-MPHRFUTI-DSaDfKGY.cjs.map +1 -0
  487. package/dist/dist-BQo9dZi7.cjs +30135 -0
  488. package/dist/dist-BQo9dZi7.cjs.map +1 -0
  489. package/dist/dist-C_APGtUJ.mjs +17330 -0
  490. package/dist/dist-C_APGtUJ.mjs.map +1 -0
  491. package/dist/dist-D0P3wUQe.mjs +3846 -0
  492. package/dist/dist-D0P3wUQe.mjs.map +1 -0
  493. package/dist/dist-DD3DTmkE.mjs +29949 -0
  494. package/dist/dist-DD3DTmkE.mjs.map +1 -0
  495. package/dist/dist-DbUdD0Ue.mjs +18643 -0
  496. package/dist/dist-DbUdD0Ue.mjs.map +1 -0
  497. package/dist/dist-Dg83IPct.cjs +4031 -0
  498. package/dist/dist-Dg83IPct.cjs.map +1 -0
  499. package/dist/dist-Dz88Bzu0.cjs +359 -0
  500. package/dist/dist-Dz88Bzu0.cjs.map +1 -0
  501. package/dist/dist-IS8Bvv2i.cjs +17803 -0
  502. package/dist/dist-IS8Bvv2i.cjs.map +1 -0
  503. package/dist/dist-UT46qwZV.mjs +246 -0
  504. package/dist/dist-UT46qwZV.mjs.map +1 -0
  505. package/dist/dist-j8370AIo.cjs +19057 -0
  506. package/dist/dist-j8370AIo.cjs.map +1 -0
  507. package/dist/du-572XNP42-BAVJiiXo.cjs +11 -0
  508. package/dist/du-572XNP42-BAVJiiXo.cjs.map +1 -0
  509. package/dist/du-572XNP42-D7y3efrk.mjs +12 -0
  510. package/dist/du-572XNP42-D7y3efrk.mjs.map +1 -0
  511. package/dist/echo-NDWZZHPO-C_aAwo4z.cjs +8 -0
  512. package/dist/echo-NDWZZHPO-C_aAwo4z.cjs.map +1 -0
  513. package/dist/echo-NDWZZHPO-DJUqNm-A.mjs +9 -0
  514. package/dist/echo-NDWZZHPO-DJUqNm-A.mjs.map +1 -0
  515. package/dist/env-36M5BO7M-BQURw4Ru.mjs +11 -0
  516. package/dist/env-36M5BO7M-BQURw4Ru.mjs.map +1 -0
  517. package/dist/env-36M5BO7M-D80iesj1.cjs +11 -0
  518. package/dist/env-36M5BO7M-D80iesj1.cjs.map +1 -0
  519. package/dist/expand-JSPG6VOP-Db6frNfE.mjs +11 -0
  520. package/dist/expand-JSPG6VOP-Db6frNfE.mjs.map +1 -0
  521. package/dist/expand-JSPG6VOP-qqexeJob.cjs +10 -0
  522. package/dist/expand-JSPG6VOP-qqexeJob.cjs.map +1 -0
  523. package/dist/expansion-R25BK4W3-DMCU-2pt.cjs +10 -0
  524. package/dist/expansion-R25BK4W3-DMCU-2pt.cjs.map +1 -0
  525. package/dist/expansion-R25BK4W3-VsydFac3.mjs +11 -0
  526. package/dist/expansion-R25BK4W3-VsydFac3.mjs.map +1 -0
  527. package/dist/expr-5JAACS4X-BtI6FOVh.cjs +10 -0
  528. package/dist/expr-5JAACS4X-BtI6FOVh.cjs.map +1 -0
  529. package/dist/expr-5JAACS4X-CguKIVSC.mjs +11 -0
  530. package/dist/expr-5JAACS4X-CguKIVSC.mjs.map +1 -0
  531. package/dist/file-IPZJC3FQ-BHvdw59X.cjs +9 -0
  532. package/dist/file-IPZJC3FQ-BHvdw59X.cjs.map +1 -0
  533. package/dist/file-IPZJC3FQ-DdWB_Mi3.mjs +10 -0
  534. package/dist/file-IPZJC3FQ-DdWB_Mi3.mjs.map +1 -0
  535. package/dist/find-INTH3OLC-D127IzUe.cjs +14 -0
  536. package/dist/find-INTH3OLC-D127IzUe.cjs.map +1 -0
  537. package/dist/find-INTH3OLC-DUj1QWUD.mjs +15 -0
  538. package/dist/find-INTH3OLC-DUj1QWUD.mjs.map +1 -0
  539. package/dist/flag-coverage-XWSYNE72-BvlYPLhT.cjs +193 -0
  540. package/dist/flag-coverage-XWSYNE72-BvlYPLhT.cjs.map +1 -0
  541. package/dist/flag-coverage-XWSYNE72-D2Xac5QE.mjs +194 -0
  542. package/dist/flag-coverage-XWSYNE72-D2Xac5QE.mjs.map +1 -0
  543. package/dist/fold-4TQNYMSW-CCrJbaeb.cjs +10 -0
  544. package/dist/fold-4TQNYMSW-CCrJbaeb.cjs.map +1 -0
  545. package/dist/fold-4TQNYMSW-CQSEN6_M.mjs +11 -0
  546. package/dist/fold-4TQNYMSW-CQSEN6_M.mjs.map +1 -0
  547. package/dist/grep-V3LQVMRQ-BNOljaul.mjs +14 -0
  548. package/dist/grep-V3LQVMRQ-BNOljaul.mjs.map +1 -0
  549. package/dist/grep-V3LQVMRQ-DsVq7Ozb.cjs +15 -0
  550. package/dist/grep-V3LQVMRQ-DsVq7Ozb.cjs.map +1 -0
  551. package/dist/gzip-O5ASJAFY-CJyjjhtQ.mjs +12 -0
  552. package/dist/gzip-O5ASJAFY-CJyjjhtQ.mjs.map +1 -0
  553. package/dist/gzip-O5ASJAFY-CbKyjNWZ.cjs +13 -0
  554. package/dist/gzip-O5ASJAFY-CbKyjNWZ.cjs.map +1 -0
  555. package/dist/head-442HYESI-6eRGfaC4.mjs +12 -0
  556. package/dist/head-442HYESI-6eRGfaC4.mjs.map +1 -0
  557. package/dist/head-442HYESI-Du8bb8I3.cjs +11 -0
  558. package/dist/head-442HYESI-Du8bb8I3.cjs.map +1 -0
  559. package/dist/help-HZ6M2CKN-CE-5DWIv.mjs +10 -0
  560. package/dist/help-HZ6M2CKN-CE-5DWIv.mjs.map +1 -0
  561. package/dist/help-HZ6M2CKN-Dz29-pqL.cjs +9 -0
  562. package/dist/help-HZ6M2CKN-Dz29-pqL.cjs.map +1 -0
  563. package/dist/history-WYYKSLSZ-D4HoTLXV.cjs +9 -0
  564. package/dist/history-WYYKSLSZ-D4HoTLXV.cjs.map +1 -0
  565. package/dist/history-WYYKSLSZ-mKzPt20Z.mjs +10 -0
  566. package/dist/history-WYYKSLSZ-mKzPt20Z.mjs.map +1 -0
  567. package/dist/hostname-C4HQXXUP-DkWSvRYp.mjs +9 -0
  568. package/dist/hostname-C4HQXXUP-DkWSvRYp.mjs.map +1 -0
  569. package/dist/hostname-C4HQXXUP-ZNyZ70pV.cjs +8 -0
  570. package/dist/hostname-C4HQXXUP-ZNyZ70pV.cjs.map +1 -0
  571. package/dist/html-to-markdown-JW4MSQZO-BWdLbF_8.mjs +11 -0
  572. package/dist/html-to-markdown-JW4MSQZO-BWdLbF_8.mjs.map +1 -0
  573. package/dist/html-to-markdown-JW4MSQZO-CG8v0p9s.cjs +10 -0
  574. package/dist/html-to-markdown-JW4MSQZO-CG8v0p9s.cjs.map +1 -0
  575. package/dist/index-BolOkiNw.d.mts +10808 -0
  576. package/dist/index-BolOkiNw.d.mts.map +1 -0
  577. package/dist/index-BpfGWrr3.d.cts +294 -0
  578. package/dist/index-BpfGWrr3.d.cts.map +1 -0
  579. package/dist/index-BrZw4MnL.d.mts +388 -0
  580. package/dist/index-BrZw4MnL.d.mts.map +1 -0
  581. package/dist/index-CPzkzEn8.d.mts +294 -0
  582. package/dist/index-CPzkzEn8.d.mts.map +1 -0
  583. package/dist/index-CX3Pvwnv.d.cts +388 -0
  584. package/dist/index-CX3Pvwnv.d.cts.map +1 -0
  585. package/dist/index-DO4QkV10.d.cts +167 -0
  586. package/dist/index-DO4QkV10.d.cts.map +1 -0
  587. package/dist/index-DT0Rt3bM.d.mts +167 -0
  588. package/dist/index-DT0Rt3bM.d.mts.map +1 -0
  589. package/dist/index-DVFIo-WE.d.cts +420 -0
  590. package/dist/index-DVFIo-WE.d.cts.map +1 -0
  591. package/dist/index-DZq4rZr0.d.cts +731 -0
  592. package/dist/index-DZq4rZr0.d.cts.map +1 -0
  593. package/dist/index-GJs4NjSJ.d.cts +10808 -0
  594. package/dist/index-GJs4NjSJ.d.cts.map +1 -0
  595. package/dist/index-KtVVfAg8.d.mts +421 -0
  596. package/dist/index-KtVVfAg8.d.mts.map +1 -0
  597. package/dist/index-vwk4evMi.d.mts +731 -0
  598. package/dist/index-vwk4evMi.d.mts.map +1 -0
  599. package/dist/index-whyhiCRD.d.cts +476 -0
  600. package/dist/index-whyhiCRD.d.cts.map +1 -0
  601. package/dist/index-whyhiCRD.d.mts +476 -0
  602. package/dist/index-whyhiCRD.d.mts.map +1 -0
  603. package/dist/join-TBRGI3LQ-D03-ugeA.cjs +10 -0
  604. package/dist/join-TBRGI3LQ-D03-ugeA.cjs.map +1 -0
  605. package/dist/join-TBRGI3LQ-DeOTGxwS.mjs +11 -0
  606. package/dist/join-TBRGI3LQ-DeOTGxwS.mjs.map +1 -0
  607. package/dist/jq-4XLYLOS5-BiaBAx7g.mjs +17 -0
  608. package/dist/jq-4XLYLOS5-BiaBAx7g.mjs.map +1 -0
  609. package/dist/jq-4XLYLOS5-DIhMdpox.cjs +16 -0
  610. package/dist/jq-4XLYLOS5-DIhMdpox.cjs.map +1 -0
  611. package/dist/js-exec-N5KEZBH7-Bsu5rZc5.cjs +326 -0
  612. package/dist/js-exec-N5KEZBH7-Bsu5rZc5.cjs.map +1 -0
  613. package/dist/js-exec-N5KEZBH7-mjx8kL-E.mjs +325 -0
  614. package/dist/js-exec-N5KEZBH7-mjx8kL-E.mjs.map +1 -0
  615. package/dist/lib-BDS_VKdS.cjs +47 -0
  616. package/dist/lib-BDS_VKdS.cjs.map +1 -0
  617. package/dist/lib-DtkdlhpW.mjs +44 -0
  618. package/dist/lib-DtkdlhpW.mjs.map +1 -0
  619. package/dist/ln-4LGSXXGD-BP3dsKRk.mjs +11 -0
  620. package/dist/ln-4LGSXXGD-BP3dsKRk.mjs.map +1 -0
  621. package/dist/ln-4LGSXXGD-CLME5hAZ.cjs +10 -0
  622. package/dist/ln-4LGSXXGD-CLME5hAZ.cjs.map +1 -0
  623. package/dist/ls-ZJGQER7M-BHjvyBRP.cjs +11 -0
  624. package/dist/ls-ZJGQER7M-BHjvyBRP.cjs.map +1 -0
  625. package/dist/ls-ZJGQER7M-D6ZqtwnS.mjs +12 -0
  626. package/dist/ls-ZJGQER7M-D6ZqtwnS.mjs.map +1 -0
  627. package/dist/lzma-DV6-5HMr.mjs +1134 -0
  628. package/dist/lzma-DV6-5HMr.mjs.map +1 -0
  629. package/dist/lzma-xM_ySpEU.cjs +1204 -0
  630. package/dist/lzma-xM_ySpEU.cjs.map +1 -0
  631. package/dist/md5sum-SPU24VSG-BpB7MOoX.cjs +11 -0
  632. package/dist/md5sum-SPU24VSG-BpB7MOoX.cjs.map +1 -0
  633. package/dist/md5sum-SPU24VSG-tBMX8Ykn.mjs +12 -0
  634. package/dist/md5sum-SPU24VSG-tBMX8Ykn.mjs.map +1 -0
  635. package/dist/microsandbox-CcqbJofH-BPQ_yy69.cjs +356 -0
  636. package/dist/microsandbox-CcqbJofH-BPQ_yy69.cjs.map +1 -0
  637. package/dist/microsandbox-CcqbJofH-BpjD0cPa.mjs +355 -0
  638. package/dist/microsandbox-CcqbJofH-BpjD0cPa.mjs.map +1 -0
  639. package/dist/mkdir-MEPGZOB6-2LBcfvx6.mjs +12 -0
  640. package/dist/mkdir-MEPGZOB6-2LBcfvx6.mjs.map +1 -0
  641. package/dist/mkdir-MEPGZOB6-CvvrtAwB.cjs +11 -0
  642. package/dist/mkdir-MEPGZOB6-CvvrtAwB.cjs.map +1 -0
  643. package/dist/mv-W5BIQ646-DAcBlQnB.mjs +12 -0
  644. package/dist/mv-W5BIQ646-DAcBlQnB.mjs.map +1 -0
  645. package/dist/mv-W5BIQ646-DyH_IHk6.cjs +11 -0
  646. package/dist/mv-W5BIQ646-DyH_IHk6.cjs.map +1 -0
  647. package/dist/nl-WSDW7I4O-BIPyW92d.cjs +10 -0
  648. package/dist/nl-WSDW7I4O-BIPyW92d.cjs.map +1 -0
  649. package/dist/nl-WSDW7I4O-CeIwgoyv.mjs +11 -0
  650. package/dist/nl-WSDW7I4O-CeIwgoyv.mjs.map +1 -0
  651. package/dist/od-WOKFDJTP-B5F93Msv.cjs +9 -0
  652. package/dist/od-WOKFDJTP-B5F93Msv.cjs.map +1 -0
  653. package/dist/od-WOKFDJTP-DoAnAOHS.mjs +10 -0
  654. package/dist/od-WOKFDJTP-DoAnAOHS.mjs.map +1 -0
  655. package/dist/paste-7JC6S4DX-BpJGsGFI.mjs +12 -0
  656. package/dist/paste-7JC6S4DX-BpJGsGFI.mjs.map +1 -0
  657. package/dist/paste-7JC6S4DX-Bxm6lkH0.cjs +11 -0
  658. package/dist/paste-7JC6S4DX-Bxm6lkH0.cjs.map +1 -0
  659. package/dist/printf-TWGXF445-CM_JvUBE.mjs +13 -0
  660. package/dist/printf-TWGXF445-CM_JvUBE.mjs.map +1 -0
  661. package/dist/printf-TWGXF445-DWZu7Yxe.cjs +12 -0
  662. package/dist/printf-TWGXF445-DWZu7Yxe.cjs.map +1 -0
  663. package/dist/pwd-WE6EN5AV-BJeFTIaB.cjs +8 -0
  664. package/dist/pwd-WE6EN5AV-BJeFTIaB.cjs.map +1 -0
  665. package/dist/pwd-WE6EN5AV-E0-h0Wwr.mjs +9 -0
  666. package/dist/pwd-WE6EN5AV-E0-h0Wwr.mjs.map +1 -0
  667. package/dist/python3-POMOR4OA-B2lp8q-q.mjs +290 -0
  668. package/dist/python3-POMOR4OA-B2lp8q-q.mjs.map +1 -0
  669. package/dist/python3-POMOR4OA-DWaHkuYd.cjs +291 -0
  670. package/dist/python3-POMOR4OA-DWaHkuYd.cjs.map +1 -0
  671. package/dist/readlink-OPJF4DL5-CGTRp9ZR.cjs +9 -0
  672. package/dist/readlink-OPJF4DL5-CGTRp9ZR.cjs.map +1 -0
  673. package/dist/readlink-OPJF4DL5-VSFHWdJq.mjs +10 -0
  674. package/dist/readlink-OPJF4DL5-VSFHWdJq.mjs.map +1 -0
  675. package/dist/rev-5EHFX4EJ-BFssnHjX.cjs +10 -0
  676. package/dist/rev-5EHFX4EJ-BFssnHjX.cjs.map +1 -0
  677. package/dist/rev-5EHFX4EJ-DUvotxKa.mjs +11 -0
  678. package/dist/rev-5EHFX4EJ-DUvotxKa.mjs.map +1 -0
  679. package/dist/rg-S4FXYXWB-BwJXnxm4.mjs +14 -0
  680. package/dist/rg-S4FXYXWB-BwJXnxm4.mjs.map +1 -0
  681. package/dist/rg-S4FXYXWB-kNVxue3X.cjs +13 -0
  682. package/dist/rg-S4FXYXWB-kNVxue3X.cjs.map +1 -0
  683. package/dist/rm-SSGETQVQ-BxR8YqEi.cjs +11 -0
  684. package/dist/rm-SSGETQVQ-BxR8YqEi.cjs.map +1 -0
  685. package/dist/rm-SSGETQVQ-COVyMix7.mjs +12 -0
  686. package/dist/rm-SSGETQVQ-COVyMix7.mjs.map +1 -0
  687. package/dist/rmdir-OC4ZLPYA-BlyrDOEB.mjs +12 -0
  688. package/dist/rmdir-OC4ZLPYA-BlyrDOEB.mjs.map +1 -0
  689. package/dist/rmdir-OC4ZLPYA-CFXt8yJF.cjs +11 -0
  690. package/dist/rmdir-OC4ZLPYA-CFXt8yJF.cjs.map +1 -0
  691. package/dist/sandbox.cjs +42 -0
  692. package/dist/sandbox.d.cts +3 -0
  693. package/dist/sandbox.d.mts +3 -0
  694. package/dist/sandbox.mjs +3 -0
  695. package/dist/schemas-B9dXuD9C-C8e8P8s7.d.cts +132 -0
  696. package/dist/schemas-B9dXuD9C-C8e8P8s7.d.cts.map +1 -0
  697. package/dist/schemas-B9dXuD9C-Ddw29BVM.d.mts +132 -0
  698. package/dist/schemas-B9dXuD9C-Ddw29BVM.d.mts.map +1 -0
  699. package/dist/sed-S5UIK574-CJzty4_y.cjs +13 -0
  700. package/dist/sed-S5UIK574-CJzty4_y.cjs.map +1 -0
  701. package/dist/sed-S5UIK574-DvVx1z1Q.mjs +14 -0
  702. package/dist/sed-S5UIK574-DvVx1z1Q.mjs.map +1 -0
  703. package/dist/seq-M5EC7Q57-BQh8_jzT.cjs +8 -0
  704. package/dist/seq-M5EC7Q57-BQh8_jzT.cjs.map +1 -0
  705. package/dist/seq-M5EC7Q57-DH2Gzjh4.mjs +9 -0
  706. package/dist/seq-M5EC7Q57-DH2Gzjh4.mjs.map +1 -0
  707. package/dist/sha1sum-2PTOAFR6-Cvv2AvkK.mjs +12 -0
  708. package/dist/sha1sum-2PTOAFR6-Cvv2AvkK.mjs.map +1 -0
  709. package/dist/sha1sum-2PTOAFR6-D0D026_D.cjs +11 -0
  710. package/dist/sha1sum-2PTOAFR6-D0D026_D.cjs.map +1 -0
  711. package/dist/sha256sum-NS7D3IXX-BUptyILb.mjs +12 -0
  712. package/dist/sha256sum-NS7D3IXX-BUptyILb.mjs.map +1 -0
  713. package/dist/sha256sum-NS7D3IXX-f4vjCg8j.cjs +11 -0
  714. package/dist/sha256sum-NS7D3IXX-f4vjCg8j.cjs.map +1 -0
  715. package/dist/sleep-X22JJINO-CUccG_hp.cjs +12 -0
  716. package/dist/sleep-X22JJINO-CUccG_hp.cjs.map +1 -0
  717. package/dist/sleep-X22JJINO-DKqudoCa.mjs +13 -0
  718. package/dist/sleep-X22JJINO-DKqudoCa.mjs.map +1 -0
  719. package/dist/sort-SW2YEO5B-C1iiYCfD.mjs +12 -0
  720. package/dist/sort-SW2YEO5B-C1iiYCfD.mjs.map +1 -0
  721. package/dist/sort-SW2YEO5B-UwvRD2KZ.cjs +11 -0
  722. package/dist/sort-SW2YEO5B-UwvRD2KZ.cjs.map +1 -0
  723. package/dist/split-4KKZZXXE-C8oQYolE.cjs +10 -0
  724. package/dist/split-4KKZZXXE-C8oQYolE.cjs.map +1 -0
  725. package/dist/split-4KKZZXXE-DawUQvpV.mjs +11 -0
  726. package/dist/split-4KKZZXXE-DawUQvpV.mjs.map +1 -0
  727. package/dist/sqlite3-CGOEFJAO-CWUiOXbW.mjs +12 -0
  728. package/dist/sqlite3-CGOEFJAO-CWUiOXbW.mjs.map +1 -0
  729. package/dist/sqlite3-CGOEFJAO-NAfEsd3K.cjs +11 -0
  730. package/dist/sqlite3-CGOEFJAO-NAfEsd3K.cjs.map +1 -0
  731. package/dist/stat-CD34IZ4P-3s7p-H_1.mjs +12 -0
  732. package/dist/stat-CD34IZ4P-3s7p-H_1.mjs.map +1 -0
  733. package/dist/stat-CD34IZ4P-mFmbg9jE.cjs +11 -0
  734. package/dist/stat-CD34IZ4P-mFmbg9jE.cjs.map +1 -0
  735. package/dist/strings-6WDHLGMX-C0mZR3rL.cjs +10 -0
  736. package/dist/strings-6WDHLGMX-C0mZR3rL.cjs.map +1 -0
  737. package/dist/strings-6WDHLGMX-rN-GcYzc.mjs +11 -0
  738. package/dist/strings-6WDHLGMX-rN-GcYzc.mjs.map +1 -0
  739. package/dist/tac-2STMMJYW-CCGCXdL3.mjs +10 -0
  740. package/dist/tac-2STMMJYW-CCGCXdL3.mjs.map +1 -0
  741. package/dist/tac-2STMMJYW-CF3jBQn-.cjs +9 -0
  742. package/dist/tac-2STMMJYW-CF3jBQn-.cjs.map +1 -0
  743. package/dist/tail-R4PCA2C4-Dm1YzgX1.cjs +11 -0
  744. package/dist/tail-R4PCA2C4-Dm1YzgX1.cjs.map +1 -0
  745. package/dist/tail-R4PCA2C4-nWJj_9BP.mjs +12 -0
  746. package/dist/tail-R4PCA2C4-nWJj_9BP.mjs.map +1 -0
  747. package/dist/tar-STHHZTZ6-B1QzW_Yc.cjs +13 -0
  748. package/dist/tar-STHHZTZ6-B1QzW_Yc.cjs.map +1 -0
  749. package/dist/tar-STHHZTZ6-pW3sdOC1.mjs +14 -0
  750. package/dist/tar-STHHZTZ6-pW3sdOC1.mjs.map +1 -0
  751. package/dist/tee-YUZ2FKCJ-Ckn5_Rfr.mjs +12 -0
  752. package/dist/tee-YUZ2FKCJ-Ckn5_Rfr.mjs.map +1 -0
  753. package/dist/tee-YUZ2FKCJ-DG2P81sh.cjs +11 -0
  754. package/dist/tee-YUZ2FKCJ-DG2P81sh.cjs.map +1 -0
  755. package/dist/time-D4LNBSWX-BqX1SKTT.cjs +9 -0
  756. package/dist/time-D4LNBSWX-BqX1SKTT.cjs.map +1 -0
  757. package/dist/time-D4LNBSWX-CQ-61FuA.mjs +10 -0
  758. package/dist/time-D4LNBSWX-CQ-61FuA.mjs.map +1 -0
  759. package/dist/timeout-YDCRSLPQ-Bjpy2rYC.mjs +13 -0
  760. package/dist/timeout-YDCRSLPQ-Bjpy2rYC.mjs.map +1 -0
  761. package/dist/timeout-YDCRSLPQ-DHxvt-m9.cjs +12 -0
  762. package/dist/timeout-YDCRSLPQ-DHxvt-m9.cjs.map +1 -0
  763. package/dist/token-D8ZVWGW9.mjs +57 -0
  764. package/dist/token-D8ZVWGW9.mjs.map +1 -0
  765. package/dist/token-n2UdmfEO.cjs +61 -0
  766. package/dist/token-n2UdmfEO.cjs.map +1 -0
  767. package/dist/touch-UA33VN3N-CnPhjQMY.cjs +10 -0
  768. package/dist/touch-UA33VN3N-CnPhjQMY.cjs.map +1 -0
  769. package/dist/touch-UA33VN3N-Js-2D7wH.mjs +11 -0
  770. package/dist/touch-UA33VN3N-Js-2D7wH.mjs.map +1 -0
  771. package/dist/tr-36LHWFRQ-BX3JsTgE.mjs +12 -0
  772. package/dist/tr-36LHWFRQ-BX3JsTgE.mjs.map +1 -0
  773. package/dist/tr-36LHWFRQ-CTUGBq_y.cjs +11 -0
  774. package/dist/tr-36LHWFRQ-CTUGBq_y.cjs.map +1 -0
  775. package/dist/tree-YLD52CNT-BFjxBVvk.cjs +11 -0
  776. package/dist/tree-YLD52CNT-BFjxBVvk.cjs.map +1 -0
  777. package/dist/tree-YLD52CNT-CWiXyUaB.mjs +12 -0
  778. package/dist/tree-YLD52CNT-CWiXyUaB.mjs.map +1 -0
  779. package/dist/trigger.cjs +9156 -0
  780. package/dist/trigger.cjs.map +1 -0
  781. package/dist/trigger.d.cts +1309 -0
  782. package/dist/trigger.d.cts.map +1 -0
  783. package/dist/trigger.d.mts +1309 -0
  784. package/dist/trigger.d.mts.map +1 -0
  785. package/dist/trigger.mjs +9112 -0
  786. package/dist/trigger.mjs.map +1 -0
  787. package/dist/true-FHQXJXBE-BlqzUPqo.mjs +9 -0
  788. package/dist/true-FHQXJXBE-BlqzUPqo.mjs.map +1 -0
  789. package/dist/true-FHQXJXBE-DPgY13SB.cjs +9 -0
  790. package/dist/true-FHQXJXBE-DPgY13SB.cjs.map +1 -0
  791. package/dist/unexpand-CADSA4VO-C1IYKiZT.cjs +10 -0
  792. package/dist/unexpand-CADSA4VO-C1IYKiZT.cjs.map +1 -0
  793. package/dist/unexpand-CADSA4VO-Dma5x4Hd.mjs +11 -0
  794. package/dist/unexpand-CADSA4VO-Dma5x4Hd.mjs.map +1 -0
  795. package/dist/uniq-XSIZR6PB-DhPcC3e6.cjs +12 -0
  796. package/dist/uniq-XSIZR6PB-DhPcC3e6.cjs.map +1 -0
  797. package/dist/uniq-XSIZR6PB-s2lyDSBa.mjs +13 -0
  798. package/dist/uniq-XSIZR6PB-s2lyDSBa.mjs.map +1 -0
  799. package/dist/wc-LF7NU4LA-Bw66Xw1g.mjs +13 -0
  800. package/dist/wc-LF7NU4LA-Bw66Xw1g.mjs.map +1 -0
  801. package/dist/wc-LF7NU4LA-Crk1776-.cjs +12 -0
  802. package/dist/wc-LF7NU4LA-Crk1776-.cjs.map +1 -0
  803. package/dist/which-XEM24D5D-BH8nIFWN.cjs +10 -0
  804. package/dist/which-XEM24D5D-BH8nIFWN.cjs.map +1 -0
  805. package/dist/which-XEM24D5D-BVK1Mp4Z.mjs +11 -0
  806. package/dist/which-XEM24D5D-BVK1Mp4Z.mjs.map +1 -0
  807. package/dist/whoami-XMTX52VE-BesJdRRD.mjs +9 -0
  808. package/dist/whoami-XMTX52VE-BesJdRRD.mjs.map +1 -0
  809. package/dist/whoami-XMTX52VE-BwqJ8U2J.cjs +8 -0
  810. package/dist/whoami-XMTX52VE-BwqJ8U2J.cjs.map +1 -0
  811. package/dist/workflow.cjs +20 -0
  812. package/dist/workflow.d.cts +3 -0
  813. package/dist/workflow.d.mts +3 -0
  814. package/dist/workflow.mjs +2 -0
  815. package/dist/xan-Y6WF3IRG-B7cPBFsH.cjs +17 -0
  816. package/dist/xan-Y6WF3IRG-B7cPBFsH.cjs.map +1 -0
  817. package/dist/xan-Y6WF3IRG-BSQujFfS.mjs +18 -0
  818. package/dist/xan-Y6WF3IRG-BSQujFfS.mjs.map +1 -0
  819. package/dist/xan-view-HDVKHFC2-CKQzVgGS.cjs +10 -0
  820. package/dist/xan-view-HDVKHFC2-CKQzVgGS.cjs.map +1 -0
  821. package/dist/xan-view-HDVKHFC2-LBHIXDkw.mjs +11 -0
  822. package/dist/xan-view-HDVKHFC2-LBHIXDkw.mjs.map +1 -0
  823. package/dist/xargs-MGZPH7AX-C5Es61sr.mjs +11 -0
  824. package/dist/xargs-MGZPH7AX-C5Es61sr.mjs.map +1 -0
  825. package/dist/xargs-MGZPH7AX-zKLR_wid.cjs +10 -0
  826. package/dist/xargs-MGZPH7AX-zKLR_wid.cjs.map +1 -0
  827. package/dist/yq-4QJW3EQG-Bxs5Q2R8.mjs +17 -0
  828. package/dist/yq-4QJW3EQG-Bxs5Q2R8.mjs.map +1 -0
  829. package/dist/yq-4QJW3EQG-CoeNxruD.cjs +16 -0
  830. package/dist/yq-4QJW3EQG-CoeNxruD.cjs.map +1 -0
  831. package/package.json +97 -0
@@ -0,0 +1,3846 @@
1
+ import { z } from "zod";
2
+ new Set([
3
+ "hello",
4
+ "greeting",
5
+ "greet"
6
+ ]);
7
+ /**
8
+ * Set by the platform LLM proxy on inference responses: `byok` when the
9
+ * request was served with the customer's own provider key, else `platform`.
10
+ * The worker-side usage recorder reads it to bill (or not bill) the tokens.
11
+ */
12
+ const LLM_KEY_SOURCE_HEADER = "x-keystroke-llm-key-source";
13
+ /**
14
+ * Best-effort run attribution the worker sets on LLM proxy requests so the
15
+ * platform can tag gateway-recorded usage to a run for the history UI. Billing
16
+ * never depends on these — a missing or forged value only loses attribution.
17
+ */
18
+ const LLM_RUN_ID_HEADER = "x-keystroke-run-id";
19
+ const LLM_RUN_KIND_HEADER = "x-keystroke-run-kind";
20
+ /**
21
+ * Marks internal, best-effort model calls (such as chat title generation) that
22
+ * must not create a billable platform usage event.
23
+ */
24
+ const LLM_SKIP_USAGE_HEADER = "x-keystroke-skip-usage";
25
+ /** Auth, session, and account-entry URL segments. */
26
+ const AUTH_ACCOUNT_SLUGS = [
27
+ "2fa",
28
+ "accept-invite",
29
+ "auth",
30
+ "authorize",
31
+ "callback",
32
+ "callbacks",
33
+ "confirm-email",
34
+ "confirmation",
35
+ "connect",
36
+ "device",
37
+ "email-verification",
38
+ "forgot-password",
39
+ "invite",
40
+ "invites",
41
+ "login",
42
+ "logout",
43
+ "magic-link",
44
+ "mfa",
45
+ "oauth",
46
+ "onboarding",
47
+ "password",
48
+ "recovery",
49
+ "register",
50
+ "reset-password",
51
+ "saml",
52
+ "session",
53
+ "sessions",
54
+ "sign-in",
55
+ "sign-up",
56
+ "signin",
57
+ "signout",
58
+ "signup",
59
+ "sso",
60
+ "token",
61
+ "tokens",
62
+ "unlink",
63
+ "verify",
64
+ "verify-email"
65
+ ];
66
+ /** Org, workspace, billing, and account-management URL segments. */
67
+ const ORG_ACCOUNT_SLUGS = [
68
+ "account",
69
+ "accounts",
70
+ "billing",
71
+ "console",
72
+ "invoice",
73
+ "invoices",
74
+ "member",
75
+ "members",
76
+ "me",
77
+ "org",
78
+ "organization",
79
+ "organizations",
80
+ "orgs",
81
+ "payment",
82
+ "payments",
83
+ "plan",
84
+ "plans",
85
+ "portal",
86
+ "preferences",
87
+ "profile",
88
+ "settings",
89
+ "subscription",
90
+ "subscriptions",
91
+ "team",
92
+ "teams",
93
+ "upgrade",
94
+ "usage",
95
+ "user",
96
+ "users",
97
+ "workspace",
98
+ "workspaces"
99
+ ];
100
+ /** Product surfaces, resource types, and in-app navigation segments. */
101
+ const PRODUCT_SLUGS = [
102
+ "action",
103
+ "actions",
104
+ "activity",
105
+ "agent",
106
+ "agents",
107
+ "analytics",
108
+ "app",
109
+ "apps",
110
+ "artifact",
111
+ "artifacts",
112
+ "assistant",
113
+ "assistants",
114
+ "audit",
115
+ "audit-log",
116
+ "automation",
117
+ "automations",
118
+ "branch",
119
+ "branches",
120
+ "canvas",
121
+ "chat",
122
+ "chats",
123
+ "connection",
124
+ "connections",
125
+ "create",
126
+ "credential",
127
+ "credentials",
128
+ "dashboard",
129
+ "deployment",
130
+ "deployments",
131
+ "examples",
132
+ "execute",
133
+ "execution",
134
+ "executions",
135
+ "explore",
136
+ "get-started",
137
+ "history",
138
+ "inbox",
139
+ "inspector",
140
+ "integration",
141
+ "integrations",
142
+ "library",
143
+ "logs",
144
+ "marketplace",
145
+ "mcp",
146
+ "mcps",
147
+ "new",
148
+ "notifications",
149
+ "observe",
150
+ "plugin",
151
+ "plugins",
152
+ "primitive",
153
+ "primitives",
154
+ "project",
155
+ "projects",
156
+ "recents",
157
+ "registry",
158
+ "reports",
159
+ "run",
160
+ "runs",
161
+ "runtime",
162
+ "runtimes",
163
+ "sandbox",
164
+ "sandboxes",
165
+ "search",
166
+ "skill",
167
+ "skills",
168
+ "templates",
169
+ "thread",
170
+ "threads",
171
+ "trigger",
172
+ "triggers",
173
+ "version",
174
+ "versions",
175
+ "workflow",
176
+ "workflows"
177
+ ];
178
+ /** Marketing, docs, company, and go-to-market URL segments. */
179
+ const MARKETING_SITE_SLUGS = [
180
+ "about",
181
+ "affiliates",
182
+ "ai",
183
+ "announcements",
184
+ "anthropic",
185
+ "blog",
186
+ "book-demo",
187
+ "brand",
188
+ "campaigns",
189
+ "career",
190
+ "careers",
191
+ "case-studies",
192
+ "casestudies",
193
+ "changelog",
194
+ "chatgpt",
195
+ "chrome-extension",
196
+ "claude",
197
+ "codex",
198
+ "community",
199
+ "company",
200
+ "compare",
201
+ "contact",
202
+ "contribute",
203
+ "creators",
204
+ "customers",
205
+ "demo",
206
+ "demos",
207
+ "discord",
208
+ "docs",
209
+ "documentation",
210
+ "download",
211
+ "downloads",
212
+ "dust",
213
+ "emerging-talent",
214
+ "engineering-blog",
215
+ "enterprise",
216
+ "events",
217
+ "experts",
218
+ "extension",
219
+ "faq",
220
+ "faqs",
221
+ "features",
222
+ "forum",
223
+ "glean",
224
+ "grok",
225
+ "guide",
226
+ "guides",
227
+ "gumloop",
228
+ "handbook",
229
+ "help",
230
+ "help-center",
231
+ "home",
232
+ "how-it-works",
233
+ "howitworks",
234
+ "inspo",
235
+ "intern",
236
+ "investors",
237
+ "jobs",
238
+ "legal",
239
+ "lindy",
240
+ "llm",
241
+ "llms",
242
+ "love",
243
+ "make",
244
+ "manifesto",
245
+ "media",
246
+ "merch",
247
+ "mission",
248
+ "mobile",
249
+ "models",
250
+ "n8n",
251
+ "news",
252
+ "newsroom",
253
+ "open",
254
+ "open-claw",
255
+ "open-source",
256
+ "openai",
257
+ "our-story",
258
+ "overview",
259
+ "partners",
260
+ "pi",
261
+ "pipedream",
262
+ "platform",
263
+ "press",
264
+ "press-kit",
265
+ "pricing",
266
+ "privacy",
267
+ "product",
268
+ "products",
269
+ "provider",
270
+ "providers",
271
+ "quick-start",
272
+ "quickstart",
273
+ "refer",
274
+ "relay",
275
+ "relay-app",
276
+ "reporting",
277
+ "request-demo",
278
+ "resources",
279
+ "roadmap",
280
+ "schedule-demo",
281
+ "security",
282
+ "solutions",
283
+ "stack-ai",
284
+ "stackai",
285
+ "startup",
286
+ "startups",
287
+ "status",
288
+ "stories",
289
+ "story",
290
+ "students",
291
+ "support",
292
+ "swag",
293
+ "switch",
294
+ "talent",
295
+ "terms",
296
+ "testimonials",
297
+ "thesis",
298
+ "tines",
299
+ "trust",
300
+ "tutorials",
301
+ "university",
302
+ "use-case",
303
+ "use-cases",
304
+ "usecases",
305
+ "versus",
306
+ "vellum",
307
+ "vs",
308
+ "webinars",
309
+ "workato",
310
+ "xai",
311
+ "yc",
312
+ "zapier"
313
+ ];
314
+ /** Integrations, competitors, and partner brand slugs (marketing / integration pages). */
315
+ const INTEGRATION_BRAND_SLUGS = [
316
+ "airtable",
317
+ "asana",
318
+ "aws",
319
+ "azure",
320
+ "bun",
321
+ "confluence",
322
+ "copilot",
323
+ "cursor",
324
+ "databricks",
325
+ "figma",
326
+ "firebase",
327
+ "fly",
328
+ "gcp",
329
+ "gemini",
330
+ "github",
331
+ "gitlab",
332
+ "gmail",
333
+ "heroku",
334
+ "hubspot",
335
+ "huggingface",
336
+ "jira",
337
+ "linear",
338
+ "mailchimp",
339
+ "meta",
340
+ "mistral",
341
+ "mixmax",
342
+ "monday",
343
+ "netlify",
344
+ "neon",
345
+ "notion",
346
+ "npm",
347
+ "outlook",
348
+ "outreach",
349
+ "perplexity",
350
+ "planetscale",
351
+ "pnpm",
352
+ "postmark",
353
+ "ramp",
354
+ "railway",
355
+ "render",
356
+ "resend",
357
+ "salesforce",
358
+ "segment",
359
+ "sendgrid",
360
+ "shopify",
361
+ "slack",
362
+ "snowflake",
363
+ "stripe",
364
+ "supabase",
365
+ "terraform",
366
+ "trello",
367
+ "turso",
368
+ "twilio",
369
+ "typeform",
370
+ "vercel",
371
+ "vscode",
372
+ "windsurf",
373
+ "yarn"
374
+ ];
375
+ /** Company, team, and department landing-page segments. */
376
+ const COMPANY_TEAM_SLUGS = [
377
+ "engineers",
378
+ "engineering",
379
+ "executives",
380
+ "hc",
381
+ "intern",
382
+ "it",
383
+ "leadership",
384
+ "marketing",
385
+ "ops",
386
+ "revops",
387
+ "sales",
388
+ "services",
389
+ "tech"
390
+ ];
391
+ /** Legal, trust, compliance, and policy URL segments. */
392
+ const LEGAL_TRUST_SLUGS = [
393
+ "accessibility",
394
+ "agreement",
395
+ "a11y",
396
+ "bug-bounty",
397
+ "compliance",
398
+ "cookie-policy",
399
+ "cookies",
400
+ "data-use",
401
+ "disclose",
402
+ "dpa",
403
+ "eula",
404
+ "gdpr",
405
+ "hipaa",
406
+ "iso",
407
+ "msa",
408
+ "pci",
409
+ "responsible-disclosure",
410
+ "sla",
411
+ "soc2",
412
+ "tos",
413
+ "trust-center",
414
+ "trustcenter",
415
+ "vulnerability"
416
+ ];
417
+ /** Developer, API, CLI, and technical URL segments. */
418
+ const DEVELOPER_TECH_SLUGS = [
419
+ "api",
420
+ "api-docs",
421
+ "cli",
422
+ "code",
423
+ "config",
424
+ "developer",
425
+ "developer-tools",
426
+ "developers",
427
+ "dev-tools",
428
+ "devtools",
429
+ "dev",
430
+ "dev-states",
431
+ "graphql",
432
+ "graphql-playground",
433
+ "mcp-server",
434
+ "mcp-servers",
435
+ "openapi",
436
+ "sdk",
437
+ "swagger"
438
+ ];
439
+ /** Infra, ops, static assets, and system URL segments. */
440
+ const INFRA_SYSTEM_SLUGS = [
441
+ "acme-challenge",
442
+ "admin",
443
+ "apple-app-site-association",
444
+ "assets",
445
+ "batch",
446
+ "cache",
447
+ "cdn",
448
+ "cron",
449
+ "debug",
450
+ "error",
451
+ "errors",
452
+ "favicon",
453
+ "feed",
454
+ "files",
455
+ "health",
456
+ "healthcheck",
457
+ "healthz",
458
+ "hook-resume",
459
+ "hooks",
460
+ "internal",
461
+ "item",
462
+ "manifest",
463
+ "metrics",
464
+ "null",
465
+ "ping",
466
+ "prod",
467
+ "public",
468
+ "redirect",
469
+ "robots",
470
+ "rpc",
471
+ "rss",
472
+ "sharer",
473
+ "sitemap",
474
+ "staging",
475
+ "static",
476
+ "storage",
477
+ "test",
478
+ "undefined",
479
+ "universal",
480
+ "webhooks",
481
+ "well-known",
482
+ "www"
483
+ ];
484
+ /** Reserved slugs that are valid org names in theory but blocked for routing safety. */
485
+ const ROUTING_SAFETY_SLUGS = [
486
+ "alpha",
487
+ "anonymous",
488
+ "archive",
489
+ "archived",
490
+ "beta",
491
+ "clone",
492
+ "copy",
493
+ "default",
494
+ "deleted",
495
+ "demo-org",
496
+ "draft",
497
+ "drafts",
498
+ "duplicate",
499
+ "early-access",
500
+ "embed",
501
+ "embedded",
502
+ "export",
503
+ "fork",
504
+ "free",
505
+ "guest",
506
+ "import",
507
+ "index",
508
+ "list",
509
+ "manage",
510
+ "moderator",
511
+ "newsletter",
512
+ "owner",
513
+ "preview",
514
+ "previews",
515
+ "private",
516
+ "pro",
517
+ "public-api",
518
+ "publish",
519
+ "published",
520
+ "queue",
521
+ "remove",
522
+ "root",
523
+ "sample",
524
+ "samples",
525
+ "selection",
526
+ "share",
527
+ "shared",
528
+ "sponsor",
529
+ "sponsors",
530
+ "sponsorship",
531
+ "subscribe",
532
+ "super",
533
+ "superuser",
534
+ "system",
535
+ "sys",
536
+ "test-org",
537
+ "trash",
538
+ "unpublish",
539
+ "unsubscribe",
540
+ "upload",
541
+ "uploads",
542
+ "waitlist",
543
+ "widget",
544
+ "widgets",
545
+ "worker",
546
+ "workers"
547
+ ];
548
+ /**
549
+ * URL segments reserved for global (non-org) routes — cannot be used as an org slug.
550
+ * Prefer adding new entries to the category arrays above; the Set is the enforcement surface.
551
+ */
552
+ const RESERVED_ORGANIZATION_SLUGS = new Set([
553
+ ...AUTH_ACCOUNT_SLUGS,
554
+ ...ORG_ACCOUNT_SLUGS,
555
+ ...PRODUCT_SLUGS,
556
+ ...MARKETING_SITE_SLUGS,
557
+ ...INTEGRATION_BRAND_SLUGS,
558
+ ...COMPANY_TEAM_SLUGS,
559
+ ...LEGAL_TRUST_SLUGS,
560
+ ...DEVELOPER_TECH_SLUGS,
561
+ ...INFRA_SYSTEM_SLUGS,
562
+ ...ROUTING_SAFETY_SLUGS
563
+ ]);
564
+ /**
565
+ * Base slug format: lowercase, 2-64 chars, alphanumeric + dashes.
566
+ *
567
+ * IMPORTANT: this is the schema for *reading* slugs (persisted rows, API
568
+ * responses). It intentionally does NOT enforce the reserved-name list — an org
569
+ * created before a name became reserved must still parse on read. Use
570
+ * `ClaimableOrganizationSlugSchema` to validate slugs a user is trying to claim.
571
+ */
572
+ const OrganizationSlugSchema = 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");
573
+ /**
574
+ * Slug validation for *claiming* a slug (organization create/rename). Adds the
575
+ * reserved-name check on top of the base format. Never use this to parse
576
+ * existing org data, or pre-existing orgs whose slug later became reserved would
577
+ * fail to load.
578
+ */
579
+ const ClaimableOrganizationSlugSchema = OrganizationSlugSchema.refine((slug) => !RESERVED_ORGANIZATION_SLUGS.has(slug), "This slug is reserved");
580
+ /** Same format as organization slugs — org-scoped, no global reserved list. */
581
+ const ProjectSlugSchema = OrganizationSlugSchema;
582
+ const OrganizationSlugErrorCodeSchema = z.enum([
583
+ "slug_taken",
584
+ "slug_reserved",
585
+ "slug_invalid"
586
+ ]);
587
+ const SlugAvailabilityReasonSchema = z.enum([
588
+ "taken",
589
+ "reserved",
590
+ "invalid"
591
+ ]);
592
+ z.object({
593
+ slug: z.string(),
594
+ available: z.boolean(),
595
+ reason: SlugAvailabilityReasonSchema.optional(),
596
+ suggestion: OrganizationSlugSchema.optional()
597
+ });
598
+ z.object({
599
+ slug: z.string().trim().min(1),
600
+ excludeOrganizationId: z.string().min(1).optional()
601
+ });
602
+ const ProjectSlugAvailabilityReasonSchema = z.enum(["taken", "invalid"]);
603
+ z.object({
604
+ slug: z.string(),
605
+ available: z.boolean(),
606
+ reason: ProjectSlugAvailabilityReasonSchema.optional(),
607
+ suggestion: ProjectSlugSchema.optional()
608
+ });
609
+ z.object({
610
+ slug: z.string().trim().min(1),
611
+ excludeProjectId: z.string().min(1).optional()
612
+ });
613
+ const ProjectStatusSchema = z.enum([
614
+ "inactive",
615
+ "starting",
616
+ "active",
617
+ "failed"
618
+ ]);
619
+ const OrganizationUserRoleSchema = z.enum([
620
+ "owner",
621
+ "admin",
622
+ "builder"
623
+ ]);
624
+ const isoDateTime$7 = z.string().datetime();
625
+ const OrganizationSchema = z.object({
626
+ id: z.string(),
627
+ name: z.string(),
628
+ slug: OrganizationSlugSchema,
629
+ verified: z.boolean(),
630
+ createdAt: isoDateTime$7,
631
+ updatedAt: isoDateTime$7
632
+ });
633
+ const ProjectSchema = z.object({
634
+ id: z.string(),
635
+ organizationId: z.string(),
636
+ name: z.string(),
637
+ slug: ProjectSlugSchema,
638
+ description: z.string().nullable(),
639
+ status: ProjectStatusSchema,
640
+ baseUrl: z.string().nullable(),
641
+ runtimeId: z.string().nullable(),
642
+ lastError: z.string().nullable(),
643
+ createdAt: isoDateTime$7,
644
+ updatedAt: isoDateTime$7
645
+ });
646
+ const UserOrganizationSchema = z.object({
647
+ organization: OrganizationSchema,
648
+ role: OrganizationUserRoleSchema
649
+ });
650
+ UserOrganizationSchema.nullable();
651
+ z.array(UserOrganizationSchema);
652
+ z.object({
653
+ name: z.string().trim().min(1),
654
+ /** Format-only at the wire boundary; reserved-name checks run in platform-database. */
655
+ slug: OrganizationSlugSchema.optional()
656
+ });
657
+ z.object({
658
+ name: z.string().trim().min(1).optional(),
659
+ slug: ClaimableOrganizationSlugSchema.optional()
660
+ }).refine((data) => data.name !== void 0 || data.slug !== void 0, { message: "At least one field is required" });
661
+ z.array(ProjectSchema);
662
+ const ProjectListMetricsSchema = z.object({
663
+ agentCount: z.number(),
664
+ workflowCount: z.number(),
665
+ skillCount: z.number(),
666
+ credentialCount: z.number(),
667
+ lastDeploymentAt: isoDateTime$7.nullable()
668
+ });
669
+ z.record(z.string(), ProjectListMetricsSchema);
670
+ z.object({
671
+ name: z.string().trim().min(1),
672
+ description: z.string().trim().min(1).optional()
673
+ });
674
+ z.object({
675
+ name: z.string().trim().min(1).optional(),
676
+ description: z.string().trim().optional(),
677
+ slug: ProjectSlugSchema.optional()
678
+ }).refine((data) => data.name !== void 0 || data.description !== void 0 || data.slug !== void 0, { message: "At least one field is required" });
679
+ z.object({ reachable: z.boolean() });
680
+ /** Org-custom app slug segment (the part after `{orgSlug}/`). Same format as project slugs. */
681
+ const AppSlugSchema = ProjectSlugSchema;
682
+ /** Default production platform origin when no env override is set. */
683
+ const DEFAULT_CLOUD_PLATFORM_ORIGIN = "https://api.keystroke.ai";
684
+ /**
685
+ * JSON Schema draft 2020-12 for LLM tool inputs (not OpenAPI 3.0).
686
+ *
687
+ * Enforces an object root: Anthropic (and the AI SDK gateway path) reject any
688
+ * tool whose `input_schema` is a bare union/array at the root with
689
+ * `input_schema.type: Field required`, which silently kills the whole turn. A
690
+ * top-level `z.discriminatedUnion`/`z.union` is the usual culprit — flatten it
691
+ * into a single object (discriminator field + optional fields). Unions nested
692
+ * under a property are fine.
693
+ */
694
+ function toolParameters(schema) {
695
+ const json = z.toJSONSchema(schema, { target: "draft-2020-12" });
696
+ if (json.type !== "object") {
697
+ const root = json.type ?? Object.keys(json).find((key) => key === "anyOf" || key === "oneOf");
698
+ throw new Error(`Tool input schema root must be type:"object" (got ${JSON.stringify(root)}). Flatten top-level unions into one object with a discriminator field.`);
699
+ }
700
+ return json;
701
+ }
702
+ function isValidIanaTimezone(value) {
703
+ try {
704
+ Intl.DateTimeFormat(void 0, { timeZone: value });
705
+ return true;
706
+ } catch {
707
+ return false;
708
+ }
709
+ }
710
+ function formatAgentTimestampContext(now, timezone) {
711
+ const lines = [`Current date and time (UTC): ${now.toISOString()}`];
712
+ if (timezone && isValidIanaTimezone(timezone)) {
713
+ const local = new Intl.DateTimeFormat("en-US", {
714
+ timeZone: timezone,
715
+ dateStyle: "full",
716
+ timeStyle: "long"
717
+ }).format(now);
718
+ lines.push(`Current date and time (${timezone}): ${local}`);
719
+ }
720
+ return lines.join("\n");
721
+ }
722
+ const AGENT_CONTEXT_OPEN = "<keystroke-context>";
723
+ const AGENT_CONTEXT_CLOSE = "</keystroke-context>";
724
+ /** Wrap injected prompt context so the UI can strip it while the agent still reads it. */
725
+ function wrapPromptContext(context) {
726
+ return `${AGENT_CONTEXT_OPEN}\n${context}\n${AGENT_CONTEXT_CLOSE}`;
727
+ }
728
+ /** Remove sentinel tag strings from user-controlled values before embedding them. */
729
+ function sanitizePromptContextContent(text) {
730
+ return text.replaceAll(AGENT_CONTEXT_OPEN, "").replaceAll(AGENT_CONTEXT_CLOSE, "");
731
+ }
732
+ const CONTEXT_BLOCK = /<keystroke-context>[\s\S]*?<\/keystroke-context>\s*/g;
733
+ /** Remove any wrapped context block(s) from a text string. */
734
+ function stripPromptContext(text) {
735
+ return text.replace(CONTEXT_BLOCK, "").trimStart();
736
+ }
737
+ /** True when a message already carries the injected current-time context block. */
738
+ function hasAgentTimestampContext(message) {
739
+ return message.match(/^<keystroke-context>\n([\s\S]*?)\n<\/keystroke-context>/)?.[1]?.includes("Current date and time (UTC):") ?? false;
740
+ }
741
+ /**
742
+ * Prepend From + current time into one `<keystroke-context>` block so the UI can
743
+ * strip it while the model still sees it. Keeps the system prompt cache-stable.
744
+ */
745
+ function prependAgentUserContext(message, options = {}) {
746
+ const lines = [];
747
+ const name = sanitizePromptContextContent(options.user?.name?.trim() ?? "");
748
+ const email = sanitizePromptContextContent(options.user?.email?.trim() ?? "");
749
+ const label = name && email ? `${name} <${email}>` : name || email;
750
+ if (label) lines.push(`[From: ${label}]`);
751
+ lines.push(formatAgentTimestampContext(options.now ?? /* @__PURE__ */ new Date(), options.timezone));
752
+ return `${wrapPromptContext(lines.join("\n"))}\n\n${message}`;
753
+ }
754
+ /** Attached by {@link defineTool} for optional introspection (not on wire). */
755
+ const AGENT_TOOL_INPUT = Symbol.for("keystroke.agentTool.inputSchema");
756
+ /** Author an agent tool from Zod; converts to JSON Schema and validates input on every `execute`. */
757
+ function defineTool(tool) {
758
+ const { parameters: inputSchema, execute, prepareArguments, ...rest } = tool;
759
+ return {
760
+ ...rest,
761
+ parameters: toolParameters(inputSchema),
762
+ async execute(toolCallId, params, signal, onUpdate) {
763
+ const parsed = inputSchema.parse(params);
764
+ return execute(toolCallId, prepareArguments ? prepareArguments(parsed) : parsed, signal, onUpdate);
765
+ },
766
+ [AGENT_TOOL_INPUT]: inputSchema
767
+ };
768
+ }
769
+ /** How a credential instance is stored (`credential_instances.auth_kind`). */
770
+ const CredentialAuthKindSchema = z.enum([
771
+ "api_key",
772
+ "oauth_managed",
773
+ "keystroke"
774
+ ]);
775
+ /**
776
+ * Where a credential instance is stored (`credential_instances.scope_type`), and the only thing an
777
+ * action/tool can pin via `.scope(...)`. There is no resolution chain: when no scope is pinned, the
778
+ * resolver tries the project default, then the org default, then throws.
779
+ */
780
+ const CredentialScopeTypeSchema = z.enum([
781
+ "organization",
782
+ "project",
783
+ "user"
784
+ ]);
785
+ CredentialAuthKindSchema.options;
786
+ const CREDENTIAL_SCOPE_TYPES = CredentialScopeTypeSchema.options;
787
+ /** Non-empty human-readable label or description (trimmed). */
788
+ const requiredDisplayTextSchema = z.string().trim().min(1);
789
+ /**
790
+ * Structural workflow-canvas graph contract.
791
+ *
792
+ * This is the deterministic skeleton the deploy-time AST producer emits for a
793
+ * workflow (nodes + edges), plus the manifest-derived trigger-source nodes. It
794
+ * is the single source of truth shared by:
795
+ * - the AST producer (emits it at deploy, stored with the manifest),
796
+ * - the platform route that serves the canvas, and
797
+ * - the SDK / web client that renders it (React Flow).
798
+ *
799
+ * Only the structural skeleton lives here. The LLM enrichment + run-overlay
800
+ * envelope types live in `workflow-canvas-envelope.ts`; the SDK re-exports them.
801
+ * See WORKFLOW.md (§4 grammar, §8 node ids, §9 caching).
802
+ */
803
+ /**
804
+ * Canvas node taxonomy — the single discriminator for every canvas node. The
805
+ * client derives the React Flow component, icon, and per-node treatment from it
806
+ * (no parallel `type` / `data.kind` fields), and the producer + fixtures emit it
807
+ * directly, so the structural contract can never silently diverge across the
808
+ * deploy → render boundary.
809
+ * - Boundaries: `entry` (Start, owns input) · `exit` (Output, owns output) ·
810
+ * `error` (a terminal `throw` — an error output that ends the run on a branch)
811
+ * - Callable: `step` (action / agent / llm / hook / child-workflow invocation) —
812
+ * the invocation flavor lives in {@link WorkflowCanvasCallKind}
813
+ * - Structural control flow: `code-block` · `decision` · `merge` · `loop` ·
814
+ * `parallel` (group containers) · `loop-start` (the group body's entry marker,
815
+ * shared by loop + parallel)
816
+ * - Upstream of entry: `trigger-source` (one per manifest trigger attachment)
817
+ *
818
+ * `Promise.all([...])` is modeled as a `parallel` group container: the branches
819
+ * are stacked inside and the container itself is the single prong leaving the
820
+ * wrapper (there is no separate fork/join pair).
821
+ *
822
+ * `exit` and `error` are both terminals: a `return` flows to the shared `exit`
823
+ * (the workflow output), while a `throw` gets its own `error` terminal off the
824
+ * branch so guard clauses (`if (bad) throw …`) read as a visible dead-end.
825
+ */
826
+ const WorkflowCanvasNodeTypeSchema = z.enum([
827
+ "entry",
828
+ "exit",
829
+ "error",
830
+ "step",
831
+ "code-block",
832
+ "decision",
833
+ "merge",
834
+ "loop",
835
+ "parallel",
836
+ "loop-start",
837
+ "trigger-source"
838
+ ]);
839
+ z.enum([
840
+ "workflow-step",
841
+ "agent",
842
+ "llm",
843
+ "wait",
844
+ "hook",
845
+ "tool",
846
+ "child-workflow"
847
+ ]);
848
+ /** A labeled branch output on a decision-style node. */
849
+ const WorkflowCanvasNodeOutputSchema = z.object({
850
+ id: z.string(),
851
+ label: z.string()
852
+ });
853
+ /**
854
+ * One token of a step's call-site argument value as captured by the producer.
855
+ *
856
+ * Raw form, one per source-expression shape so the inspector can render each
857
+ * distinctly instead of dumping raw text:
858
+ * - `text` — a literal value (string/number/boolean) or inert template chunk.
859
+ * - `reference` — an upstream node output; carries only the structural
860
+ * `sourceNodeId` + `field` (the human `sourceLabel` is filled by the platform
861
+ * metadata join).
862
+ * - `variable` — a code identifier / property access that isn't an upstream
863
+ * reference (e.g. a `const`, a loop variable, `job.id`). `text` is the source
864
+ * name; the platform may attach a `resolvedValue` for known top-level consts.
865
+ * - `call` — a function call; carries only the callee `name` (e.g.
866
+ * `buildPrompt`), never the full argument list.
867
+ */
868
+ const WorkflowCanvasRawValueTokenSchema = z.discriminatedUnion("kind", [
869
+ z.object({
870
+ kind: z.literal("text"),
871
+ text: z.string()
872
+ }),
873
+ z.object({
874
+ kind: z.literal("reference"),
875
+ /** Upstream node id this value flows from; absent only for unresolved refs. */
876
+ sourceNodeId: z.string().optional(),
877
+ /** Output field of the source (dotted path); omitted = the whole output. */
878
+ field: z.string().optional()
879
+ }),
880
+ z.object({
881
+ kind: z.literal("variable"),
882
+ text: z.string()
883
+ }),
884
+ z.object({
885
+ kind: z.literal("call"),
886
+ name: z.string()
887
+ })
888
+ ]);
889
+ /**
890
+ * A step input's configured value at its call site, captured deterministically
891
+ * by the producer from the call's argument object. The platform join turns this
892
+ * into the inspector's {@link WorkflowNodeInputBinding} (filling display labels).
893
+ */
894
+ const WorkflowCanvasRawBindingSchema = z.object({
895
+ tokens: z.array(WorkflowCanvasRawValueTokenSchema),
896
+ /** Render as a tall multi-line box (object/array/multiline template values). */
897
+ multiline: z.boolean().optional()
898
+ });
899
+ /**
900
+ * Statically-captured `promptLlm` options for an `llm` step node. Literal-only:
901
+ * dynamic/expression values (a computed model, a `system` built by a function) are
902
+ * not captured; `system`/`outputSchema` record presence so the inspector can note
903
+ * "a system prompt is configured" / "structured output" without their values.
904
+ */
905
+ const WorkflowCanvasLlmOptionsSchema = z.object({
906
+ model: z.string().optional(),
907
+ maxTokens: z.number().optional(),
908
+ temperature: z.number().optional(),
909
+ thinkingLevel: z.string().optional(),
910
+ hasSystemPrompt: z.boolean().optional(),
911
+ hasOutputSchema: z.boolean().optional()
912
+ });
913
+ const WorkflowCanvasNodeDataSchema = z.object({
914
+ label: z.string(),
915
+ /** Set on group nodes (loop / parallel section containers). */
916
+ groupKind: z.enum([
917
+ "loop",
918
+ "parallel",
919
+ "conditional"
920
+ ]).optional(),
921
+ description: z.string().optional(),
922
+ /** {@link WorkflowCanvasCallKind} or a looser raw call-site label. */
923
+ callKind: z.string().optional(),
924
+ /**
925
+ * App/integration slug for a `step` whose action/agent is imported directly
926
+ * from a `@keystrokehq/<app>` package (e.g. "slack", "apollo"). Lets the client
927
+ * badge the node with that app's logo; absent for custom (project-local)
928
+ * actions, which fall back to the call-kind icon.
929
+ */
930
+ appSlug: z.string().optional(),
931
+ /** Cron/webhook/poll discriminator on trigger-source nodes. */
932
+ triggerType: z.string().optional(),
933
+ /** Branch outputs (decision nodes). */
934
+ outputs: z.array(WorkflowCanvasNodeOutputSchema).optional(),
935
+ /**
936
+ * Action/agent/workflow slug resolved at deploy time (via import → definition).
937
+ * Optional when the deploy build cannot resolve source (dist-only artifacts).
938
+ */
939
+ slug: z.string().optional(),
940
+ /**
941
+ * Durable call-site ids nested inside an off-grammar `code-block` (same-file only).
942
+ * Used by the run overlay to light the block when any contained step executes.
943
+ */
944
+ containedCallSiteIds: z.array(z.string()).optional(),
945
+ /**
946
+ * Per-input call-site value bindings for `step` nodes, keyed by input field name.
947
+ * Deterministically captured from the call's argument object; reference tokens point
948
+ * at the upstream node that produced the value. The platform join fills display labels.
949
+ */
950
+ inputBindings: z.record(z.string(), WorkflowCanvasRawBindingSchema).optional(),
951
+ /**
952
+ * Static `promptLlm(prompt, options)` configuration captured at the call site for
953
+ * `llm` step nodes. Only literal values are captured (model/maxTokens/temperature/
954
+ * thinkingLevel); `system`/`outputSchema` are usually expressions, so only their
955
+ * presence is recorded. Absent when no options are statically resolvable.
956
+ */
957
+ llmOptions: WorkflowCanvasLlmOptionsSchema.optional()
958
+ });
959
+ /**
960
+ * A single structural node. This is the deploy artifact's shape: identity
961
+ * (`id`), the canonical discriminator (`nodeType`), display `data`, and group
962
+ * nesting (`parentId`). All layout/rendering — React Flow component key,
963
+ * positions, sizes, `extent`, group box dimensions — is derived entirely
964
+ * client-side from this structure, so it never leaks into the wire contract.
965
+ */
966
+ const WorkflowCanvasGraphNodeSchema = z.object({
967
+ id: z.string(),
968
+ nodeType: WorkflowCanvasNodeTypeSchema,
969
+ data: WorkflowCanvasNodeDataSchema,
970
+ /** Set on children nested inside a group (loop / parallel) container. */
971
+ parentId: z.string().optional()
972
+ });
973
+ const WorkflowCanvasEdgeSchema = z.object({
974
+ id: z.string(),
975
+ source: z.string(),
976
+ target: z.string(),
977
+ type: z.string().optional(),
978
+ label: z.string().optional(),
979
+ sourceHandle: z.string().optional(),
980
+ targetHandle: z.string().optional(),
981
+ data: z.object({ branchKind: z.enum([
982
+ "then",
983
+ "else",
984
+ "parallel-branch",
985
+ "error"
986
+ ]).optional() }).optional()
987
+ });
988
+ /** A statically-evaluable top-level `const` value (literal scalars only). */
989
+ const WorkflowCanvasConstantValueSchema = z.union([
990
+ z.string(),
991
+ z.number(),
992
+ z.boolean()
993
+ ]);
994
+ /**
995
+ * Top-level `const NAME = <literal>` declarations in the workflow source, captured
996
+ * at deploy. Lets the platform resolve `variable` value tokens (e.g. a `model` set
997
+ * to a named const) to their concrete value for display. Scalars only — computed,
998
+ * function-local, or non-literal consts are intentionally omitted.
999
+ */
1000
+ const WorkflowCanvasConstantsSchema = z.record(z.string(), WorkflowCanvasConstantValueSchema);
1001
+ const WorkflowCanvasGraphSchema = z.object({
1002
+ nodes: z.array(WorkflowCanvasGraphNodeSchema),
1003
+ edges: z.array(WorkflowCanvasEdgeSchema),
1004
+ /** Top-level literal constants from the workflow source (for value-token resolution). */
1005
+ constants: WorkflowCanvasConstantsSchema.optional()
1006
+ });
1007
+ /**
1008
+ * Deploy-time summary of one credential a step requires, derived from the
1009
+ * action/agent-tool definition's `.credentials`. The workflow-canvas credential
1010
+ * overlay joins a step node's `slug` to these to resolve the bound instance.
1011
+ * `key` doubles as the app slug (matches `credential_instances.app_slug`).
1012
+ */
1013
+ const CredentialRequirementSummarySchema = z.object({
1014
+ key: z.string(),
1015
+ kind: CredentialAuthKindSchema,
1016
+ /** Scope pinned via `.scope(...)`; absent means project-default → org-default. */
1017
+ scope: CredentialScopeTypeSchema.optional()
1018
+ });
1019
+ const StoredRouteManifestSkillSchema = z.object({
1020
+ slug: z.string(),
1021
+ name: requiredDisplayTextSchema,
1022
+ description: requiredDisplayTextSchema,
1023
+ moduleFile: z.string()
1024
+ });
1025
+ const attachmentSchemasSchema = z.record(z.string(), z.object({
1026
+ requestSchema: z.record(z.string(), z.unknown()),
1027
+ filterSchema: z.record(z.string(), z.unknown()).optional()
1028
+ }));
1029
+ const attachmentMetaSchema = z.record(z.string(), z.object({
1030
+ name: requiredDisplayTextSchema,
1031
+ description: requiredDisplayTextSchema
1032
+ }));
1033
+ const storedRouteManifestEntryV2Schema = z.discriminatedUnion("kind", [
1034
+ z.object({ kind: z.literal("health") }),
1035
+ z.object({
1036
+ kind: z.literal("agent"),
1037
+ slug: z.string(),
1038
+ moduleFile: z.string(),
1039
+ name: requiredDisplayTextSchema,
1040
+ description: requiredDisplayTextSchema,
1041
+ model: z.string(),
1042
+ compactionModel: z.string().optional(),
1043
+ systemPrompt: z.string(),
1044
+ toolCount: z.number().int().nonnegative(),
1045
+ credentialCount: z.number().int().nonnegative(),
1046
+ appSlugs: z.array(z.string()).default([]),
1047
+ toolSlugs: z.array(z.string()).default([]),
1048
+ /** Credential requirements per tool slug (the agent's credential consumer key). */
1049
+ toolRequirements: z.record(z.string(), z.array(CredentialRequirementSummarySchema)).optional()
1050
+ }),
1051
+ z.object({
1052
+ kind: z.literal("action"),
1053
+ slug: z.string(),
1054
+ name: requiredDisplayTextSchema,
1055
+ description: requiredDisplayTextSchema,
1056
+ moduleFile: z.string(),
1057
+ /** App slug for actions imported from an integration package (`@keystrokehq/<app>/actions`). */
1058
+ appSlug: z.string().optional(),
1059
+ inputSchema: z.record(z.string(), z.unknown()),
1060
+ outputSchema: z.record(z.string(), z.unknown()),
1061
+ /** Credentials this action requires (for the canvas credential overlay). */
1062
+ requirements: z.array(CredentialRequirementSummarySchema).optional()
1063
+ }),
1064
+ z.object({
1065
+ kind: z.literal("workflow"),
1066
+ slug: z.string(),
1067
+ name: requiredDisplayTextSchema,
1068
+ description: requiredDisplayTextSchema,
1069
+ subscribable: z.boolean(),
1070
+ moduleFile: z.string(),
1071
+ requestSchema: z.record(z.string(), z.unknown()),
1072
+ responseSchema: z.record(z.string(), z.unknown()).optional(),
1073
+ /** Deterministic AST control-flow skeleton (deploy-time producer). */
1074
+ flowGraph: WorkflowCanvasGraphSchema.optional(),
1075
+ /** sha256 of the workflow source the `flowGraph` was produced from (staleness). */
1076
+ flowGraphSourceHash: z.string().optional(),
1077
+ /** sha256 of `JSON.stringify(flowGraph)` — baked at build so canvas polls skip re-hashing. */
1078
+ flowGraphHash: z.string().optional()
1079
+ }),
1080
+ z.object({
1081
+ kind: z.literal("trigger-webhook"),
1082
+ endpoint: z.string(),
1083
+ attachmentIds: z.array(z.string()),
1084
+ moduleFile: z.string(),
1085
+ /** sha256 of the trigger source file, baked at build time for overview change-detection. */
1086
+ sourceHash: z.string().optional(),
1087
+ attachmentSchemas: attachmentSchemasSchema,
1088
+ attachmentMeta: attachmentMetaSchema.optional()
1089
+ }),
1090
+ z.object({
1091
+ kind: z.literal("trigger-poll"),
1092
+ attachmentId: z.string(),
1093
+ attachmentIds: z.array(z.string()),
1094
+ moduleFile: z.string(),
1095
+ sourceHash: z.string().optional(),
1096
+ schedule: z.string(),
1097
+ name: requiredDisplayTextSchema,
1098
+ description: requiredDisplayTextSchema
1099
+ }),
1100
+ z.object({
1101
+ kind: z.literal("trigger-poll-group"),
1102
+ pollId: z.string(),
1103
+ attachmentIds: z.array(z.string()),
1104
+ moduleFile: z.string(),
1105
+ schedule: z.string()
1106
+ }),
1107
+ z.object({
1108
+ kind: z.literal("cron-schedule"),
1109
+ attachmentId: z.string(),
1110
+ attachmentIds: z.array(z.string()),
1111
+ moduleFile: z.string(),
1112
+ sourceHash: z.string().optional(),
1113
+ schedule: z.string(),
1114
+ /** Static cron payload from `defineCronSource({ payload })` — omitted when the source has none. */
1115
+ payload: z.unknown().optional(),
1116
+ name: requiredDisplayTextSchema,
1117
+ description: requiredDisplayTextSchema
1118
+ })
1119
+ ]);
1120
+ z.object({
1121
+ version: z.literal(2),
1122
+ entries: z.array(storedRouteManifestEntryV2Schema),
1123
+ skills: z.array(StoredRouteManifestSkillSchema).default([]),
1124
+ integrations: z.array(z.string()).optional()
1125
+ });
1126
+ const isoDateTime$6 = z.string().datetime();
1127
+ const subscriptionStatusSchema = z.enum([
1128
+ "none",
1129
+ "trialing",
1130
+ "active",
1131
+ "past_due",
1132
+ "canceled"
1133
+ ]);
1134
+ const CreditPackSchema = z.object({
1135
+ id: z.string(),
1136
+ usd: z.number(),
1137
+ microCredits: z.number(),
1138
+ label: z.string()
1139
+ });
1140
+ const AutoTopupSummarySchema = z.object({
1141
+ enabled: z.boolean(),
1142
+ thresholdMicroCredits: z.number().nullable(),
1143
+ amountMicroCredits: z.number().nullable(),
1144
+ /** A saved payment method exists to charge off-session. */
1145
+ hasPaymentMethod: z.boolean(),
1146
+ /** A top-up invoice payment is in flight. */
1147
+ pending: z.boolean()
1148
+ });
1149
+ /**
1150
+ * The plan's resolved limits. Storage overage is billed from the wallet's
1151
+ * pushed-down `includedStorageGb`; concurrency, per-pass run timeouts, and
1152
+ * API/MCP rate limits are enforced from the wallet (timeouts/concurrency) or
1153
+ * plan preset (rate limits). Log retention is configured but not pruned yet.
1154
+ */
1155
+ const PlanLimitsSchema = z.object({
1156
+ includedStorageGb: z.number(),
1157
+ concurrencyLimit: z.number(),
1158
+ /** Max non-deleted projects; enforced on create only. */
1159
+ maxProjects: z.number(),
1160
+ agentTimeoutMs: z.number(),
1161
+ workflowTimeoutMs: z.number(),
1162
+ pollTimeoutMs: z.number(),
1163
+ /** Configured retention window; pruning not implemented yet. */
1164
+ logRetentionDays: z.number(),
1165
+ apiRateLimitCapacity: z.number(),
1166
+ apiRateLimitRefillPerSec: z.number(),
1167
+ mcpRateLimitCapacity: z.number(),
1168
+ mcpRateLimitRefillPerSec: z.number()
1169
+ });
1170
+ z.object({
1171
+ planKey: z.string(),
1172
+ subscriptionStatus: subscriptionStatusSchema,
1173
+ /** Remaining plan-bucket balance this period (µc). */
1174
+ planCreditMicroCredits: z.number(),
1175
+ /** Remaining prepaid balance (µc). Never expires. */
1176
+ prepaidCreditMicroCredits: z.number(),
1177
+ /**
1178
+ * Resolved monthly plan allotment (µc) — override ?? preset. Powers the
1179
+ * credit-usage progress denominator (`used = allotment − remaining`).
1180
+ */
1181
+ monthlyCreditMicroCredits: z.number(),
1182
+ periodStart: isoDateTime$6.nullable(),
1183
+ periodEnd: isoDateTime$6.nullable(),
1184
+ autoTopup: AutoTopupSummarySchema,
1185
+ creditPacks: z.array(CreditPackSchema),
1186
+ limits: PlanLimitsSchema
1187
+ });
1188
+ const BillingUsageMeterSchema = z.object({
1189
+ /** Meter key (`llm`, `vm_second`, …); null groups uncategorized rows. */
1190
+ meterKey: z.string().nullable(),
1191
+ /** Charged this period, µc. */
1192
+ microCredits: z.number(),
1193
+ /** Tracked-but-not-charged usage (e.g. BYOK LLM calls), display USD. */
1194
+ unchargedUsd: z.number()
1195
+ });
1196
+ z.object({
1197
+ periodStart: isoDateTime$6.nullable(),
1198
+ periodEnd: isoDateTime$6.nullable(),
1199
+ totalMicroCredits: z.number(),
1200
+ byMeter: z.array(BillingUsageMeterSchema)
1201
+ });
1202
+ const billingLedgerEntryTypeSchema = z.enum([
1203
+ "grant_plan",
1204
+ "grant_prepaid",
1205
+ "expire_plan",
1206
+ "adjustment"
1207
+ ]);
1208
+ const BillingActivityEntrySchema = z.object({
1209
+ id: z.string(),
1210
+ entryType: billingLedgerEntryTypeSchema,
1211
+ label: z.string(),
1212
+ /** Signed: positive grants, negative expirations/adjustments. */
1213
+ microCredits: z.number(),
1214
+ bucket: z.enum(["plan", "prepaid"]).nullable(),
1215
+ /** Stripe invoice behind the entry, when there is one — powers "View invoice". */
1216
+ stripeInvoiceId: z.string().nullable(),
1217
+ createdAt: isoDateTime$6
1218
+ });
1219
+ z.object({
1220
+ entries: z.array(BillingActivityEntrySchema),
1221
+ /** Set only when the latest payment failure is newer than the latest successful payment. */
1222
+ lastPaymentFailureAt: isoDateTime$6.nullable()
1223
+ });
1224
+ z.object({
1225
+ /** Web-app path to land on after Checkout (must be a path, not a URL). */
1226
+ returnPath: z.string().startsWith("/").max(512).optional() });
1227
+ z.object({
1228
+ packId: z.string(),
1229
+ returnPath: z.string().startsWith("/").max(512).optional()
1230
+ });
1231
+ z.object({ returnPath: z.string().startsWith("/").max(512).optional() });
1232
+ z.object({ url: z.string().url() });
1233
+ z.object({
1234
+ /** Hosted invoice page (view, download, receipt). */
1235
+ url: z.string().url(),
1236
+ /** Direct PDF download when Stripe provides one. */
1237
+ pdf: z.string().url().nullable()
1238
+ });
1239
+ z.object({
1240
+ /** Stripe Checkout Session id from the `session_id` success-URL param. */
1241
+ sessionId: z.string().min(1).max(255) });
1242
+ z.object({
1243
+ /**
1244
+ * `granted` — credits are in the wallet now; `processing` — payment not
1245
+ * complete yet, the webhook will finish it; `ignored` — not a confirmable
1246
+ * session for this org.
1247
+ */
1248
+ status: z.enum([
1249
+ "granted",
1250
+ "processing",
1251
+ "ignored"
1252
+ ]),
1253
+ reason: z.string().optional()
1254
+ });
1255
+ z.object({
1256
+ enabled: z.boolean(),
1257
+ thresholdMicroCredits: z.number().int().positive().optional(),
1258
+ packId: z.string().optional()
1259
+ });
1260
+ const BillingUsageEventSourceSchema = z.enum([
1261
+ "ai_gateway",
1262
+ "sandbox",
1263
+ "web_proxy",
1264
+ "storage",
1265
+ "dispatch",
1266
+ "poll"
1267
+ ]);
1268
+ const BillingUsageMeterKeySchema = z.enum([
1269
+ "llm",
1270
+ "vm_second",
1271
+ "web_search",
1272
+ "web_fetch",
1273
+ "workflow_run",
1274
+ "agent_run",
1275
+ "poll_trigger",
1276
+ "tigris_storage"
1277
+ ]);
1278
+ const BillingUsageKeySourceSchema = z.enum(["platform", "byok"]);
1279
+ const BillingUsageRunKindSchema = z.enum(["agent", "workflow"]);
1280
+ const SubmitBillingUsageEventSchema = z.object({
1281
+ projectId: z.string().min(1).max(255).nullable().optional(),
1282
+ runId: z.string().min(1).max(255).nullable().optional(),
1283
+ runKind: BillingUsageRunKindSchema.nullable().optional(),
1284
+ source: BillingUsageEventSourceSchema,
1285
+ sourceEventId: z.string().min(1).max(512),
1286
+ meterKey: BillingUsageMeterKeySchema,
1287
+ quantity: z.number().finite().nonnegative(),
1288
+ unit: z.string().min(1).max(64),
1289
+ providerCostUsd: z.number().finite().nonnegative().nullable().optional(),
1290
+ keySource: BillingUsageKeySourceSchema.nullable().optional(),
1291
+ occurredAt: isoDateTime$6,
1292
+ metadata: z.record(z.string(), z.unknown()).nullable().optional()
1293
+ }).strict();
1294
+ z.object({ events: z.array(SubmitBillingUsageEventSchema).min(1).max(100) }).strict();
1295
+ z.object({
1296
+ accepted: z.number().int().nonnegative(),
1297
+ inserted: z.number().int().nonnegative(),
1298
+ duplicate: z.number().int().nonnegative(),
1299
+ settledLedgerId: z.string().nullable(),
1300
+ chargeMicroCredits: z.number().int().nonnegative()
1301
+ });
1302
+ /** Messaging platforms that support agent gateway bindings. */
1303
+ const ChannelPlatformKeySchema = z.enum(["slack"]);
1304
+ const ChannelReactionSupportSchema = z.enum([
1305
+ "full",
1306
+ "read-only",
1307
+ "none"
1308
+ ]);
1309
+ const ChannelCardSupportSchema = z.enum([
1310
+ "full",
1311
+ "partial",
1312
+ "none"
1313
+ ]);
1314
+ const ChannelStreamingSupportSchema = z.enum([
1315
+ "native",
1316
+ "post-edit",
1317
+ "buffered",
1318
+ "drafts",
1319
+ "none"
1320
+ ]);
1321
+ const ChannelCapabilitiesSchema = z.object({
1322
+ mentions: z.boolean(),
1323
+ reactions: ChannelReactionSupportSchema,
1324
+ cards: ChannelCardSupportSchema,
1325
+ modals: z.boolean(),
1326
+ streaming: ChannelStreamingSupportSchema,
1327
+ dms: z.boolean()
1328
+ });
1329
+ const ChannelListenModeSchema = z.enum([
1330
+ "mention",
1331
+ "all",
1332
+ "dm"
1333
+ ]);
1334
+ const ChannelBindingKindSchema = z.enum([
1335
+ "public",
1336
+ "private",
1337
+ "dm",
1338
+ "group",
1339
+ "space"
1340
+ ]);
1341
+ const AppGatewaySchema = z.object({
1342
+ capabilities: ChannelCapabilitiesSchema,
1343
+ supportedModes: z.array(ChannelListenModeSchema).min(1),
1344
+ resourceNoun: z.object({
1345
+ singular: z.string().min(1),
1346
+ plural: z.string().min(1)
1347
+ }),
1348
+ supportsChannelDirectory: z.boolean(),
1349
+ webhookPathHint: z.string().min(1),
1350
+ /** Composio/keystroke app slug for Connect when it differs from the gateway platform key (e.g. slack → slackbot). */
1351
+ connectAppId: z.string().min(1).optional(),
1352
+ docsUrl: z.string().url().optional(),
1353
+ tagline: z.string().min(1).optional()
1354
+ });
1355
+ /** Projected catalog row for the agent channels panel (derived from apps with `gateway`). */
1356
+ const ChannelPlatformSchema = z.object({
1357
+ key: ChannelPlatformKeySchema,
1358
+ name: z.string().min(1),
1359
+ appLogoId: z.string().min(1),
1360
+ fallbackDomain: z.string().min(1),
1361
+ description: z.string().min(1),
1362
+ tagline: z.string().min(1),
1363
+ authKind: z.enum([
1364
+ "oauth",
1365
+ "api_key",
1366
+ "keystroke"
1367
+ ]),
1368
+ credentialFields: z.array(z.object({
1369
+ key: z.string().min(1),
1370
+ label: z.string().min(1),
1371
+ placeholder: z.string().optional(),
1372
+ helpText: z.string().optional(),
1373
+ type: z.enum([
1374
+ "text",
1375
+ "password",
1376
+ "textarea"
1377
+ ]),
1378
+ required: z.boolean(),
1379
+ prefix: z.string().optional()
1380
+ })),
1381
+ capabilities: ChannelCapabilitiesSchema,
1382
+ supportedModes: z.array(ChannelListenModeSchema).min(1),
1383
+ resourceNoun: z.object({
1384
+ singular: z.string().min(1),
1385
+ plural: z.string().min(1)
1386
+ }),
1387
+ webhookPathHint: z.string().min(1),
1388
+ supportsChannelDirectory: z.boolean(),
1389
+ connectAppId: z.string().min(1).optional(),
1390
+ docsUrl: z.string().url().optional()
1391
+ });
1392
+ const ChannelBindingSchema = z.object({
1393
+ id: z.string().min(1),
1394
+ channelId: z.string().min(1),
1395
+ channelName: z.string().min(1),
1396
+ channelKind: ChannelBindingKindSchema,
1397
+ mode: ChannelListenModeSchema,
1398
+ subscribeOnMention: z.boolean(),
1399
+ createdAt: z.string(),
1400
+ updatedAt: z.string()
1401
+ });
1402
+ const ChannelConnectionSchema = z.object({
1403
+ id: z.string().min(1),
1404
+ platform: ChannelPlatformKeySchema,
1405
+ agentId: z.string().min(1),
1406
+ accountLabel: z.string().min(1),
1407
+ accountId: z.string().min(1),
1408
+ connectedAt: z.string(),
1409
+ bindings: z.array(ChannelBindingSchema)
1410
+ });
1411
+ const ChannelDirectoryEntrySchema = z.object({
1412
+ id: z.string().min(1),
1413
+ name: z.string().min(1),
1414
+ kind: ChannelBindingKindSchema,
1415
+ memberCount: z.number().int().nonnegative().optional(),
1416
+ isArchived: z.boolean().optional()
1417
+ });
1418
+ z.array(ChannelConnectionSchema);
1419
+ z.array(ChannelDirectoryEntrySchema);
1420
+ z.object({ teamName: z.string().min(1).optional() });
1421
+ /** OAuth workspace available for channel bindings (e.g. Slack team). */
1422
+ const ChannelAccountSchema = z.object({
1423
+ id: z.string().min(1),
1424
+ platform: ChannelPlatformKeySchema,
1425
+ label: z.string().min(1),
1426
+ connectedAt: z.string()
1427
+ });
1428
+ z.array(ChannelAccountSchema);
1429
+ const NewChannelBindingInputSchema = z.object({
1430
+ channelId: z.string().min(1),
1431
+ channelName: z.string().min(1),
1432
+ channelKind: ChannelBindingKindSchema.optional(),
1433
+ mode: ChannelListenModeSchema.optional(),
1434
+ subscribeOnMention: z.boolean().optional()
1435
+ });
1436
+ z.object({
1437
+ platform: ChannelPlatformKeySchema,
1438
+ accountId: z.string().min(1),
1439
+ binding: NewChannelBindingInputSchema
1440
+ });
1441
+ z.object({ patch: z.object({
1442
+ mode: ChannelListenModeSchema.optional(),
1443
+ subscribeOnMention: z.boolean().optional()
1444
+ }) });
1445
+ z.array(ChannelPlatformSchema);
1446
+ /**
1447
+ * Where a manual MCP API key is injected on each request. MCP servers don't
1448
+ * advertise API-key support in a discoverable way, so the user picks the
1449
+ * placement: a request header (optionally prefixed, e.g. `Bearer `) or a query
1450
+ * param (e.g. Exa's `exaApiKey`).
1451
+ */
1452
+ const McpApiKeyPlacementSchema = z.discriminatedUnion("kind", [z.object({
1453
+ kind: z.literal("header"),
1454
+ name: z.string().trim().min(1),
1455
+ /** Prepended to the token, e.g. `"Bearer "` for `Authorization: Bearer <token>`. */
1456
+ prefix: z.string().optional()
1457
+ }), z.object({
1458
+ kind: z.literal("query"),
1459
+ name: z.string().trim().min(1)
1460
+ })]);
1461
+ z.object({
1462
+ token: z.string().trim().min(1),
1463
+ placement: McpApiKeyPlacementSchema.default({
1464
+ kind: "header",
1465
+ name: "Authorization",
1466
+ prefix: "Bearer "
1467
+ })
1468
+ });
1469
+ /** Metadata for one vault field on a custom api_key app. */
1470
+ const AppCredentialFieldSchema = z.object({
1471
+ label: z.string().trim().min(1).optional(),
1472
+ secret: z.boolean().optional(),
1473
+ optional: z.boolean().optional(),
1474
+ description: z.string().trim().min(1).optional(),
1475
+ default: z.string().optional(),
1476
+ /** For direct MCP api-key apps: where this field's value is injected on the request. */
1477
+ placement: McpApiKeyPlacementSchema.optional()
1478
+ });
1479
+ /** Credential template keyed by vault field name. */
1480
+ const AppCredentialFieldsSchema = z.record(z.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/), AppCredentialFieldSchema).refine((fields) => Object.keys(fields).length > 0, { message: "At least one credential field is required" }).refine((fields) => Object.values(fields).some((field) => field.optional !== true), { message: "At least one credential field must be required" });
1481
+ /** A single OAuth scope an app can request, with human copy for connect UI. */
1482
+ const OAuthScopeOptionSchema = z.object({
1483
+ name: z.string().min(1),
1484
+ description: z.string().min(1),
1485
+ defaultSelected: z.boolean().optional(),
1486
+ required: z.boolean().optional()
1487
+ });
1488
+ /** How an app authenticates when connecting credentials. */
1489
+ const AppAuthKindSchema = z.enum([
1490
+ "oauth",
1491
+ "api_key",
1492
+ "keystroke"
1493
+ ]);
1494
+ /** Composio auth scheme for API-key style connections. */
1495
+ const AppCredentialSchemeSchema = z.enum([
1496
+ "API_KEY",
1497
+ "BEARER_TOKEN",
1498
+ "BASIC",
1499
+ "BASIC_WITH_JWT"
1500
+ ]);
1501
+ /**
1502
+ * Where app metadata and execution are sourced (e.g. native, composio, pipedream, custom).
1503
+ * Opaque string — cloud/hosted entrypoints choose values; keystroke stays provider-agnostic.
1504
+ */
1505
+ const AppSourceSchema = z.string().trim().min(1);
1506
+ z.object({
1507
+ slug: z.string().trim().min(1),
1508
+ name: z.string().min(1),
1509
+ description: z.string().min(1),
1510
+ category: z.string().min(1),
1511
+ logo: z.string().url().optional(),
1512
+ authKind: AppAuthKindSchema,
1513
+ oauthScopes: z.array(OAuthScopeOptionSchema)
1514
+ }).extend({
1515
+ source: AppSourceSchema,
1516
+ credentialFields: AppCredentialFieldsSchema.optional(),
1517
+ credentialScheme: AppCredentialSchemeSchema.optional()
1518
+ });
1519
+ const customAppNameSchema = z.string().trim().min(1, "Name is required");
1520
+ const AppSlugAvailabilityReasonSchema = ProjectSlugAvailabilityReasonSchema;
1521
+ z.object({
1522
+ slug: z.string(),
1523
+ available: z.boolean(),
1524
+ reason: AppSlugAvailabilityReasonSchema.optional(),
1525
+ suggestion: AppSlugSchema.optional()
1526
+ });
1527
+ z.object({ slug: z.string().trim().min(1) });
1528
+ /** Request body for creating an org custom app (api_key or direct MCP). */
1529
+ const optionalCredentialFieldsSchema = z.record(z.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/), AppCredentialFieldSchema);
1530
+ z.object({
1531
+ name: customAppNameSchema,
1532
+ slug: AppSlugSchema,
1533
+ description: z.string().trim().min(1),
1534
+ source: z.enum([
1535
+ "custom",
1536
+ "mcp",
1537
+ "openapi",
1538
+ "graphql"
1539
+ ]).default("custom"),
1540
+ url: z.string().url().optional(),
1541
+ authKind: AppAuthKindSchema.optional(),
1542
+ fields: optionalCredentialFieldsSchema.optional(),
1543
+ credentialScheme: AppCredentialSchemeSchema.optional(),
1544
+ oauthScopes: z.array(OAuthScopeOptionSchema).optional()
1545
+ }).superRefine((data, ctx) => {
1546
+ if ((data.source === "mcp" || data.source === "openapi" || data.source === "graphql") && !data.url) ctx.addIssue({
1547
+ code: "custom",
1548
+ message: "url is required for this app source",
1549
+ path: ["url"]
1550
+ });
1551
+ if (!(data.authKind ?? (data.source === "custom" ? "api_key" : void 0))) {
1552
+ ctx.addIssue({
1553
+ code: "custom",
1554
+ message: "authKind is required",
1555
+ path: ["authKind"]
1556
+ });
1557
+ return;
1558
+ }
1559
+ if (data.source === "custom") {
1560
+ const parsed = AppCredentialFieldsSchema.safeParse(data.fields ?? {});
1561
+ if (!parsed.success) for (const issue of parsed.error.issues) ctx.addIssue({
1562
+ ...issue,
1563
+ path: ["fields", ...issue.path]
1564
+ });
1565
+ }
1566
+ });
1567
+ z.object({
1568
+ id: z.string().min(1),
1569
+ slug: z.string().min(1),
1570
+ name: z.string().min(1),
1571
+ description: z.string().min(1),
1572
+ category: z.string().min(1),
1573
+ authKind: AppAuthKindSchema,
1574
+ source: AppSourceSchema,
1575
+ url: z.string().url().nullable().optional(),
1576
+ credentialFields: optionalCredentialFieldsSchema.optional(),
1577
+ credentialScheme: AppCredentialSchemeSchema.optional(),
1578
+ oauthScopes: z.array(OAuthScopeOptionSchema).optional(),
1579
+ createdAt: z.string().min(1),
1580
+ updatedAt: z.string().min(1)
1581
+ });
1582
+ z.object({
1583
+ id: z.string().min(1),
1584
+ organizationId: z.string().min(1).nullable(),
1585
+ slug: z.string().min(1),
1586
+ name: z.string().min(1),
1587
+ description: z.string().min(1),
1588
+ category: z.string().min(1),
1589
+ logo: z.string().url().nullable(),
1590
+ authKind: AppAuthKindSchema,
1591
+ oauthScopes: z.array(OAuthScopeOptionSchema),
1592
+ source: AppSourceSchema,
1593
+ credentialFields: AppCredentialFieldsSchema.optional(),
1594
+ credentialScheme: AppCredentialSchemeSchema.optional(),
1595
+ url: z.string().url().nullable().optional(),
1596
+ createdAt: z.string().min(1),
1597
+ updatedAt: z.string().min(1)
1598
+ });
1599
+ /**
1600
+ * Slim connect-picker row for `GET /api/apps`. Omits oauthScopes / credential
1601
+ * templates (loaded via catalog detail) so the ~1k-app list stays small.
1602
+ */
1603
+ const AppCatalogSummarySchema = z.object({
1604
+ id: z.string().min(1),
1605
+ name: z.string().min(1),
1606
+ description: z.string().min(1),
1607
+ category: z.string().min(1),
1608
+ integrationDescription: z.string().min(1),
1609
+ logo: z.string().url().nullable().optional(),
1610
+ authKind: AppAuthKindSchema,
1611
+ /** Where app metadata and execution are sourced (e.g. composio, custom). */
1612
+ source: AppSourceSchema,
1613
+ /** Endpoint URL for MCP, OpenAPI, or GraphQL custom apps. */
1614
+ url: z.string().url().nullable().optional(),
1615
+ /** True when the app has a non-empty credential field template. */
1616
+ hasCredentialFields: z.boolean().optional()
1617
+ });
1618
+ AppCatalogSummarySchema.extend({
1619
+ oauthScopes: z.array(OAuthScopeOptionSchema),
1620
+ /** Custom api_key apps — vault field template for connect UI and sync. */
1621
+ credentialFields: AppCredentialFieldsSchema.optional(),
1622
+ /** Composio auth scheme when credentialFields are present. */
1623
+ credentialScheme: AppCredentialSchemeSchema.optional(),
1624
+ /** When present, the app supports agent gateway bindings (external channels). */
1625
+ gateway: AppGatewaySchema.optional()
1626
+ });
1627
+ z.array(AppCatalogSummarySchema);
1628
+ const McpAuthProbeModeSchema = z.enum([
1629
+ "none",
1630
+ "token",
1631
+ "oauth"
1632
+ ]);
1633
+ const McpAuthProbeOAuthSchema = z.object({
1634
+ issuer: z.string().optional(),
1635
+ authorizationEndpoint: z.string().url(),
1636
+ tokenEndpoint: z.string().url(),
1637
+ registrationEndpoint: z.string().url().optional(),
1638
+ scopes: z.array(z.string()),
1639
+ resource: z.string().optional(),
1640
+ /** Human-readable label from OAuth protected-resource metadata (RFC 9728). */
1641
+ resourceName: z.string().optional()
1642
+ });
1643
+ z.object({
1644
+ url: z.string().url(),
1645
+ mode: McpAuthProbeModeSchema,
1646
+ unauthenticatedStatus: z.number().int().optional(),
1647
+ scheme: AppCredentialSchemeSchema.optional(),
1648
+ oauth: McpAuthProbeOAuthSchema.optional()
1649
+ });
1650
+ z.object({ url: z.string().url() });
1651
+ z.object({
1652
+ detected: z.boolean(),
1653
+ template: z.object({
1654
+ authKind: AppAuthKindSchema,
1655
+ credentialFields: z.record(z.string(), AppCredentialFieldSchema).optional(),
1656
+ credentialScheme: AppCredentialSchemeSchema.optional(),
1657
+ oauthScopes: z.array(OAuthScopeOptionSchema),
1658
+ url: z.string().url(),
1659
+ oauth: McpAuthProbeOAuthSchema.optional(),
1660
+ serverName: z.string().optional(),
1661
+ serverDescription: z.string().optional()
1662
+ })
1663
+ });
1664
+ z.object({
1665
+ appSlug: z.string().trim().min(1),
1666
+ projects: z.array(z.string().trim().min(1)).optional(),
1667
+ createOrganizationCredential: z.boolean().optional(),
1668
+ createUserProvidedCredential: z.boolean().optional(),
1669
+ label: z.string().trim().min(1).optional(),
1670
+ credentialInstanceId: z.string().trim().min(1).optional(),
1671
+ scopes: z.array(z.string()).optional()
1672
+ });
1673
+ z.object({ authorizeUrl: z.string().url() });
1674
+ function isRecord$2(value) {
1675
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1676
+ }
1677
+ function parsedJsonRecord(value) {
1678
+ try {
1679
+ const parsed = JSON.parse(value);
1680
+ return isRecord$2(parsed) ? parsed : null;
1681
+ } catch {
1682
+ return null;
1683
+ }
1684
+ }
1685
+ function mimeTypeFromBlock(part) {
1686
+ if (typeof part.mimeType === "string" && part.mimeType.length > 0) return part.mimeType;
1687
+ if (typeof part.mediaType === "string" && part.mediaType.length > 0) return part.mediaType;
1688
+ }
1689
+ function filenameFromUri(uri) {
1690
+ const segment = uri.split("/").at(-1)?.split("?")[0]?.trim();
1691
+ return segment && segment.length > 0 ? segment : void 0;
1692
+ }
1693
+ function looksLikeBase64ImageData(data) {
1694
+ if (data.startsWith("data:image/")) return true;
1695
+ return data.startsWith("iVBORw0KGgo") || data.startsWith("/9j/") || data.startsWith("R0lGOD") || data.startsWith("UklGR");
1696
+ }
1697
+ function imageMediaTypeFromData(data, explicit) {
1698
+ if (explicit?.startsWith("image/")) return explicit;
1699
+ if (data.startsWith("data:image/")) return /^data:(image\/[^;]+);/i.exec(data)?.[1] ?? "image/png";
1700
+ if (data.startsWith("/9j/")) return "image/jpeg";
1701
+ if (data.startsWith("R0lGOD")) return "image/gif";
1702
+ if (data.startsWith("UklGR")) return "image/webp";
1703
+ return "image/png";
1704
+ }
1705
+ function isProbablyBase64Payload(value) {
1706
+ return value.length > 64 && /^[A-Za-z0-9+/=\r\n]+$/.test(value.slice(0, 256));
1707
+ }
1708
+ function isMcpImageBlock(part) {
1709
+ const blockType = typeof part.type === "string" ? part.type : void 0;
1710
+ if (blockType === "text" || blockType === "resource" || blockType === "resource_link" || blockType === "audio") return false;
1711
+ if (typeof part.data !== "string" || part.data.length === 0) return false;
1712
+ if (blockType === "image" || blockType === "image-data") return true;
1713
+ const mimeType = mimeTypeFromBlock(part);
1714
+ if (mimeType?.startsWith("image/")) return true;
1715
+ if (looksLikeBase64ImageData(part.data)) return true;
1716
+ if (!blockType && !mimeType && isProbablyBase64Payload(part.data)) return true;
1717
+ return false;
1718
+ }
1719
+ /** Extract MCP `content` blocks from persisted tool output envelopes. */
1720
+ function mcpContentBlocksFromToolOutput(output) {
1721
+ if (typeof output === "string") {
1722
+ const parsed = parsedJsonRecord(output.trim());
1723
+ return parsed ? mcpContentBlocksFromRecord(parsed) : [];
1724
+ }
1725
+ if (!isRecord$2(output)) return [];
1726
+ if (output.type === "text" && typeof output.value === "string") return mcpContentBlocksFromToolOutput(output.value);
1727
+ return mcpContentBlocksFromRecord(output);
1728
+ }
1729
+ function mcpContentBlocksFromRecord(record) {
1730
+ if (record.type === "content" && Array.isArray(record.value)) return record.value;
1731
+ if (record.type === "json" && isRecord$2(record.value) && Array.isArray(record.value.content)) return record.value.content;
1732
+ if (isRecord$2(record.details) && Array.isArray(record.details.content)) return record.details.content;
1733
+ if (Array.isArray(record.content)) return record.content;
1734
+ return [];
1735
+ }
1736
+ /** Map MCP content blocks to AI SDK tool result parts for model consumption. */
1737
+ function mcpContentBlocksToAiSdkParts(blocks) {
1738
+ const parts = [];
1739
+ for (const block of blocks) {
1740
+ if (!isRecord$2(block)) continue;
1741
+ if (block.type === "text" && typeof block.text === "string") {
1742
+ parts.push({
1743
+ type: "text",
1744
+ text: block.text
1745
+ });
1746
+ continue;
1747
+ }
1748
+ if (isMcpImageBlock(block) && typeof block.data === "string") {
1749
+ parts.push({
1750
+ type: "image-data",
1751
+ data: block.data,
1752
+ mediaType: imageMediaTypeFromData(block.data, mimeTypeFromBlock(block))
1753
+ });
1754
+ continue;
1755
+ }
1756
+ if (block.type === "resource" && isRecord$2(block.resource)) {
1757
+ const resource = block.resource;
1758
+ const blob = typeof resource.blob === "string" ? resource.blob : void 0;
1759
+ const mediaType = mimeTypeFromBlock(resource);
1760
+ if (!blob || !mediaType) continue;
1761
+ const uri = typeof resource.uri === "string" ? resource.uri : void 0;
1762
+ if (mediaType.startsWith("image/")) parts.push({
1763
+ type: "image-data",
1764
+ data: blob,
1765
+ mediaType
1766
+ });
1767
+ else parts.push({
1768
+ type: "file-data",
1769
+ data: blob,
1770
+ mediaType,
1771
+ ...uri ? { filename: filenameFromUri(uri) } : {}
1772
+ });
1773
+ }
1774
+ }
1775
+ return parts;
1776
+ }
1777
+ function isRedundantMcpJsonText(text, details) {
1778
+ if (text.length === 0 || details == null) return false;
1779
+ try {
1780
+ return text === JSON.stringify(details);
1781
+ } catch {
1782
+ return false;
1783
+ }
1784
+ }
1785
+ z.object({ url: z.string().url() });
1786
+ z.object({
1787
+ detected: z.boolean(),
1788
+ template: z.object({
1789
+ authKind: AppAuthKindSchema,
1790
+ credentialFields: z.record(z.string(), AppCredentialFieldSchema).optional(),
1791
+ credentialScheme: AppCredentialSchemeSchema.optional(),
1792
+ oauthScopes: z.array(OAuthScopeOptionSchema),
1793
+ url: z.string().url(),
1794
+ name: z.string().optional(),
1795
+ description: z.string().optional(),
1796
+ homepageUrl: z.string().optional()
1797
+ })
1798
+ });
1799
+ z.object({ url: z.string().url() });
1800
+ z.object({
1801
+ detected: z.boolean(),
1802
+ template: z.object({
1803
+ authKind: AppAuthKindSchema,
1804
+ credentialFields: z.record(z.string(), AppCredentialFieldSchema).optional(),
1805
+ credentialScheme: AppCredentialSchemeSchema.optional(),
1806
+ oauthScopes: z.array(OAuthScopeOptionSchema),
1807
+ url: z.string().url(),
1808
+ name: z.string().optional(),
1809
+ description: z.string().optional(),
1810
+ homepageUrl: z.string().optional()
1811
+ })
1812
+ });
1813
+ const CatalogAppSummarySchema = z.object({
1814
+ name: z.string(),
1815
+ description: z.string(),
1816
+ package: z.string()
1817
+ });
1818
+ z.object({
1819
+ items: z.array(CatalogAppSummarySchema),
1820
+ nextCursor: z.string().optional()
1821
+ });
1822
+ z.object({
1823
+ name: z.string(),
1824
+ description: z.string(),
1825
+ package: z.string(),
1826
+ version: z.string().optional()
1827
+ });
1828
+ const CatalogActionSummarySchema = z.object({
1829
+ slug: z.string(),
1830
+ name: z.string(),
1831
+ description: z.string().optional()
1832
+ });
1833
+ z.object({
1834
+ toolkit: z.string().optional(),
1835
+ items: z.array(CatalogActionSummarySchema),
1836
+ nextCursor: z.string().optional()
1837
+ });
1838
+ z.object({
1839
+ slug: z.string(),
1840
+ name: z.string(),
1841
+ description: z.string().optional(),
1842
+ inputParameters: z.record(z.string(), z.unknown()).optional(),
1843
+ outputParameters: z.record(z.string(), z.unknown()).optional(),
1844
+ version: z.string().optional()
1845
+ });
1846
+ /** Web URL that opens the org apps page with a connect dialog for the given app. */
1847
+ function buildConnectDeeplink(options) {
1848
+ const base = options.webUrl.replace(/\/+$/, "");
1849
+ const params = new URLSearchParams({ connect: options.appSlug });
1850
+ return `${base}/${options.orgSlug}/apps?${params.toString()}`;
1851
+ }
1852
+ /** Scope of a platform app credential (maps to `credential_instances.scope_type`). */
1853
+ const AppCredentialScopeSchema = z.enum([
1854
+ "user",
1855
+ "project",
1856
+ "organization"
1857
+ ]);
1858
+ /** How the credential was connected (OAuth vs manual api-key entry). */
1859
+ const AppCredentialConnectionKindSchema = z.enum(["oauth", "manual"]);
1860
+ /** Connect-dialog permission preset for OAuth scope selection. */
1861
+ const OAuthPermissionModeSchema = z.enum(["default", "restricted"]);
1862
+ const optionalTimestamp$1 = z.string().optional();
1863
+ const nullableOptionalTimestamp = z.string().nullable().optional();
1864
+ /**
1865
+ * Summary row for the apps/credentials table and credential detail page.
1866
+ * Plaintext secrets are never returned — only masked `keyPreviews`.
1867
+ */
1868
+ const AppCredentialSummarySchema = z.object({
1869
+ id: z.string().min(1),
1870
+ appId: z.string().min(1),
1871
+ /** Stable per-scope identifier; pass to `--credential` to pin a specific instance. */
1872
+ slug: z.string().min(1),
1873
+ label: z.string().min(1),
1874
+ scope: AppCredentialScopeSchema,
1875
+ lastRefreshedAt: z.string().nullable(),
1876
+ appName: z.string().min(1).optional(),
1877
+ projectId: z.string().min(1).optional(),
1878
+ projectName: z.string().min(1).optional(),
1879
+ status: z.string().optional(),
1880
+ createdAt: optionalTimestamp$1,
1881
+ lastUsedAt: nullableOptionalTimestamp,
1882
+ isDefault: z.boolean().optional(),
1883
+ connectionKind: AppCredentialConnectionKindSchema.optional(),
1884
+ ownerUserId: z.string().min(1).optional(),
1885
+ ownerName: z.string().min(1).optional(),
1886
+ ownerAvatarUrl: z.string().url().optional(),
1887
+ grantedScopes: z.array(z.string().min(1)).optional(),
1888
+ credentialKeys: z.array(z.string().min(1)).optional(),
1889
+ keyPreviews: z.record(z.string(), z.string()).optional(),
1890
+ expiresAt: optionalTimestamp$1
1891
+ });
1892
+ const credentialSecretValueSchema = z.record(z.string(), z.unknown()).refine((value) => Object.keys(value).length > 0, { message: "value must be a non-empty object" });
1893
+ function hasCredentialTarget(input) {
1894
+ return input.projects.length > 0 || input.createOrganizationCredential || input.createUserProvidedCredential || Boolean(input.credentialInstanceId?.trim());
1895
+ }
1896
+ function addMissingCredentialTargetIssue(ctx, path = ["projects"]) {
1897
+ ctx.addIssue({
1898
+ code: "custom",
1899
+ message: "At least one credential target is required",
1900
+ path
1901
+ });
1902
+ }
1903
+ /** Target fields shared by create and OAuth start flows. */
1904
+ const CredentialTargetsFieldsSchema = z.object({
1905
+ projects: z.array(z.string().min(1)).default([]),
1906
+ createOrganizationCredential: z.boolean().default(false),
1907
+ createUserProvidedCredential: z.boolean().default(false),
1908
+ /** Display label for created credential instances (apps table / detail page). */
1909
+ label: z.string().trim().min(1).optional(),
1910
+ /** When set, update this credential instance in place (reconnect) instead of creating a new row. */
1911
+ credentialInstanceId: z.string().trim().min(1).optional()
1912
+ });
1913
+ CredentialTargetsFieldsSchema.extend({
1914
+ appId: z.string().min(1),
1915
+ scopes: z.array(z.string().min(1)),
1916
+ permissionMode: OAuthPermissionModeSchema
1917
+ });
1918
+ z.object({
1919
+ status: z.enum(["connected", "redirecting"]),
1920
+ authorizeUrl: z.string().url().nullable()
1921
+ });
1922
+ CredentialTargetsFieldsSchema.extend({
1923
+ app: z.string().trim().min(1),
1924
+ value: credentialSecretValueSchema.optional()
1925
+ }).superRefine((input, ctx) => {
1926
+ if (!hasCredentialTarget(input)) addMissingCredentialTargetIssue(ctx);
1927
+ });
1928
+ const connectedKeystrokeConnectionResultSchema = z.object({
1929
+ status: z.literal("connected"),
1930
+ connectionId: z.string().min(1)
1931
+ });
1932
+ const redirectingKeystrokeConnectionResultSchema = z.object({
1933
+ status: z.literal("redirecting"),
1934
+ authorizeUrl: z.string().url(),
1935
+ connectionId: z.string().min(1)
1936
+ });
1937
+ z.discriminatedUnion("status", [connectedKeystrokeConnectionResultSchema, redirectingKeystrokeConnectionResultSchema]);
1938
+ CredentialTargetsFieldsSchema.extend({
1939
+ appId: z.string().min(1),
1940
+ connectionKind: AppCredentialConnectionKindSchema,
1941
+ value: credentialSecretValueSchema.optional(),
1942
+ scopes: z.array(z.string().min(1)).optional()
1943
+ }).superRefine((input, ctx) => {
1944
+ if (!hasCredentialTarget(input)) addMissingCredentialTargetIssue(ctx);
1945
+ if (input.connectionKind === "manual" && !input.value) ctx.addIssue({
1946
+ code: "custom",
1947
+ message: "value is required for manual connections",
1948
+ path: ["value"]
1949
+ });
1950
+ if (input.connectionKind === "oauth") ctx.addIssue({
1951
+ code: "custom",
1952
+ message: "OAuth credentials are created via the OAuth callback",
1953
+ path: ["connectionKind"]
1954
+ });
1955
+ });
1956
+ z.object({
1957
+ label: z.string().trim().min(1).optional(),
1958
+ isDefault: z.boolean().optional(),
1959
+ value: credentialSecretValueSchema.optional()
1960
+ }).refine((input) => input.label !== void 0 || input.isDefault !== void 0 || input.value !== void 0, { message: "At least one field is required" });
1961
+ z.array(AppCredentialSummarySchema);
1962
+ z.object({
1963
+ limit: z.coerce.number().int().min(1).max(200).optional(),
1964
+ cursor: z.string().min(1).optional()
1965
+ });
1966
+ z.object({
1967
+ items: z.array(AppCredentialSummarySchema),
1968
+ nextCursor: z.string().nullable()
1969
+ });
1970
+ z.array(AppCredentialSummarySchema);
1971
+ const CredentialAssignmentTargetTypeSchema = z.enum([
1972
+ "workflow",
1973
+ "agent",
1974
+ "poll"
1975
+ ]);
1976
+ const CredentialAssignmentRecordSchema = z.object({
1977
+ id: z.string(),
1978
+ targetType: CredentialAssignmentTargetTypeSchema,
1979
+ targetKey: z.string(),
1980
+ consumerId: z.string(),
1981
+ credentialSlug: z.string(),
1982
+ instanceId: z.string(),
1983
+ credential: z.string().optional(),
1984
+ scopeType: z.enum([
1985
+ "organization",
1986
+ "project",
1987
+ "user"
1988
+ ]).optional(),
1989
+ createdAt: z.string(),
1990
+ updatedAt: z.string()
1991
+ });
1992
+ z.object({ assignments: z.array(CredentialAssignmentRecordSchema) });
1993
+ z.object({
1994
+ targetType: CredentialAssignmentTargetTypeSchema,
1995
+ targetKey: z.string().min(1),
1996
+ /** Omit or '*' for wildcard assignment. */
1997
+ consumerId: z.string().optional(),
1998
+ credential: z.string().min(1)
1999
+ });
2000
+ z.object({
2001
+ targetType: CredentialAssignmentTargetTypeSchema,
2002
+ targetKey: z.string().min(1)
2003
+ });
2004
+ z.object({
2005
+ targetType: CredentialAssignmentTargetTypeSchema,
2006
+ targetKey: z.string().min(1)
2007
+ });
2008
+ const CredentialConsumerSummarySchema = z.object({
2009
+ consumerId: z.string(),
2010
+ label: z.string(),
2011
+ appSlugs: z.array(z.string())
2012
+ });
2013
+ z.object({ consumers: z.array(CredentialConsumerSummarySchema) });
2014
+ const McpConnectionStatusSchema = z.enum([
2015
+ "INITIATED",
2016
+ "ACTIVE",
2017
+ "EXPIRED",
2018
+ "FAILED",
2019
+ "INACTIVE",
2020
+ "REVOKED"
2021
+ ]);
2022
+ const McpAppSchema = z.object({
2023
+ slug: z.string(),
2024
+ name: z.string(),
2025
+ connected: z.boolean(),
2026
+ connectionId: z.string().optional(),
2027
+ status: McpConnectionStatusSchema.optional()
2028
+ });
2029
+ z.array(McpAppSchema);
2030
+ const MCP_ENTITY_PREFIX = {
2031
+ user: "user",
2032
+ organization: "org",
2033
+ project: "proj"
2034
+ };
2035
+ /** MCP provider entity id for a credential scope subject (`user_<id>` / `org_<id>` / `proj_<id>`). */
2036
+ function mcpEntityId(scopeType, scopeId) {
2037
+ return `${MCP_ENTITY_PREFIX[scopeType]}_${scopeId}`;
2038
+ }
2039
+ const KeystrokeCredentialSchema = z.object({
2040
+ connectionId: z.string(),
2041
+ entityId: z.string(),
2042
+ instanceId: z.string()
2043
+ });
2044
+ const McpCredentialAssignmentTargetSchema = z.object({
2045
+ type: CredentialAssignmentTargetTypeSchema,
2046
+ key: z.string().trim().min(1)
2047
+ });
2048
+ z.object({
2049
+ app: z.string().trim().min(1),
2050
+ tool: z.string().trim().min(1),
2051
+ arguments: z.record(z.string(), z.unknown()).default({}),
2052
+ /** Pinned provider toolkit version, sourced from the app definition; forwarded to the provider. */
2053
+ version: z.string().trim().min(1),
2054
+ /** When set, platform MCP resolve checks credential assignments before scope defaults. */
2055
+ assignmentTarget: McpCredentialAssignmentTargetSchema.optional(),
2056
+ /** Tool/step consumer id for assignment lookup (action slug or workflow step correlation id). */
2057
+ consumerId: z.string().trim().min(1).optional(),
2058
+ /** Explicit credential instance slug; overrides default resolution to pick that instance. */
2059
+ credentialSlug: z.string().trim().min(1).optional(),
2060
+ /** Project slug (CLI --project); the platform resolves it to a project and binds that scope. */
2061
+ projectSlug: z.string().trim().min(1).optional()
2062
+ });
2063
+ const ExecuteKeystrokeToolErrorCodeSchema = z.enum([
2064
+ "not_found",
2065
+ "forbidden",
2066
+ "mcp_execute_failed"
2067
+ ]);
2068
+ /** Platform MCP execute error body (422 for upstream tool failures, 404/403 for resolve/access). */
2069
+ const ExecuteKeystrokeToolErrorResponseSchema = z.object({
2070
+ error: ExecuteKeystrokeToolErrorCodeSchema,
2071
+ message: z.string()
2072
+ });
2073
+ /** Turn upstream provider JSON error strings into LLM-readable text. */
2074
+ function formatMcpToolErrorMessage(raw) {
2075
+ const trimmed = raw.trim();
2076
+ if (!trimmed) return trimmed;
2077
+ try {
2078
+ const parsed = JSON.parse(trimmed);
2079
+ if (typeof parsed.detail === "string" && parsed.detail.trim()) return typeof parsed.code === "string" && parsed.code.trim() ? `${parsed.code}: ${parsed.detail.trim()}` : parsed.detail.trim();
2080
+ if (typeof parsed.message === "string" && parsed.message.trim()) return typeof parsed.code === "string" && parsed.code.trim() ? `${parsed.code}: ${parsed.message.trim()}` : parsed.message.trim();
2081
+ } catch {}
2082
+ return trimmed;
2083
+ }
2084
+ const TeamRequestTypeSchema = z.enum([
2085
+ "org-deletion",
2086
+ "contact",
2087
+ "enterprise-upgrade",
2088
+ "verification",
2089
+ "slack-connect"
2090
+ ]);
2091
+ z.object({
2092
+ type: TeamRequestTypeSchema,
2093
+ message: z.string().trim().max(5e3).optional()
2094
+ });
2095
+ z.object({ ok: z.literal(true) });
2096
+ const MarketingContactCompanySizeSchema = z.enum([
2097
+ "1-10",
2098
+ "11-50",
2099
+ "51-200",
2100
+ "201-500",
2101
+ "500+"
2102
+ ]);
2103
+ z.object({
2104
+ fullName: z.string().trim().min(1, "Full name is required").max(200),
2105
+ workEmail: z.string().trim().email("Enter a valid email address").max(320),
2106
+ companySize: MarketingContactCompanySizeSchema,
2107
+ message: z.string().trim().min(1, "Message is required").max(5e3),
2108
+ /** Honeypot — must stay empty; bots that fill it are ignored silently. */
2109
+ companyWebsite: z.string().optional()
2110
+ });
2111
+ const PublicModelsResponseSchema = z.object({ models: z.array(z.string()) });
2112
+ function isCredentialInput(value) {
2113
+ if (typeof value !== "object" || value === null) return false;
2114
+ const candidate = value;
2115
+ return typeof candidate.key === "string" && CredentialAuthKindSchema.safeParse(candidate.kind).success && candidate.schema instanceof z.ZodType;
2116
+ }
2117
+ const credentialInputSchema = z.custom((value) => isCredentialInput(value), "must be a credential requirement");
2118
+ function createRef(kind, key, schema, options) {
2119
+ const tokenField = options?.tokenField;
2120
+ return {
2121
+ kind,
2122
+ key,
2123
+ schema,
2124
+ ...tokenField !== void 0 ? { tokenField } : {},
2125
+ scope(scope) {
2126
+ return {
2127
+ key,
2128
+ kind,
2129
+ schema,
2130
+ scope,
2131
+ ...tokenField !== void 0 ? { tokenField } : {}
2132
+ };
2133
+ }
2134
+ };
2135
+ }
2136
+ function staticCredential(key, schema) {
2137
+ return createRef("api_key", key, schema instanceof z.ZodType ? schema : z.object(schema));
2138
+ }
2139
+ function oauthCredential(key, options) {
2140
+ const tokenField = options?.tokenField ?? "accessToken";
2141
+ return createRef("oauth_managed", key, tokenField === "accessToken" ? z.object({ accessToken: z.string() }) : z.object({ [tokenField]: z.string() }), { tokenField });
2142
+ }
2143
+ function keystrokeCredential(key) {
2144
+ return createRef("keystroke", key, KeystrokeCredentialSchema);
2145
+ }
2146
+ const credential = {
2147
+ static: staticCredential,
2148
+ oauth: oauthCredential,
2149
+ keystroke: keystrokeCredential
2150
+ };
2151
+ function defineCredential(input) {
2152
+ if (input.kind === "oauth") return input.tokenField !== void 0 ? credential.oauth(input.key, { tokenField: input.tokenField }) : credential.oauth(input.key);
2153
+ if (input.kind === "keystroke") return credential.keystroke(input.key);
2154
+ if ("schema" in input) return credential.static(input.key, input.schema);
2155
+ return credential.static(input.key, input.fields);
2156
+ }
2157
+ function normalizeCredentialList(list) {
2158
+ return list.map((item) => toCredentialRequirement(item));
2159
+ }
2160
+ function isCredentialRequirement(item) {
2161
+ return typeof item.scope !== "function";
2162
+ }
2163
+ function toCredentialRequirement(item) {
2164
+ if (isCredentialRequirement(item)) return item;
2165
+ return {
2166
+ key: item.key,
2167
+ kind: item.kind,
2168
+ schema: item.schema,
2169
+ ...item.tokenField !== void 0 ? { tokenField: item.tokenField } : {}
2170
+ };
2171
+ }
2172
+ const ValidationErrorDetailSchema = z.object({
2173
+ path: z.string(),
2174
+ message: z.string()
2175
+ });
2176
+ /** Machine-readable codes returned in standard API error bodies. */
2177
+ const ErrorResponseCodeSchema = OrganizationSlugErrorCodeSchema.or(z.enum([
2178
+ "needs_org_selection",
2179
+ "org_unverified",
2180
+ "connector_unavailable"
2181
+ ]));
2182
+ z.object({
2183
+ error: z.string(),
2184
+ code: ErrorResponseCodeSchema.optional(),
2185
+ message: z.string().optional(),
2186
+ details: z.array(ValidationErrorDetailSchema).optional()
2187
+ });
2188
+ z.object({ message: z.string() });
2189
+ const CHAT_ATTACHMENT_MAX_BYTES = 10 * 1024 * 1024;
2190
+ /** Single source of truth for supported chat attachment types and their file extension. */
2191
+ const CHAT_ATTACHMENT_TYPES = [
2192
+ {
2193
+ mediaType: "image/png",
2194
+ ext: "png"
2195
+ },
2196
+ {
2197
+ mediaType: "image/jpeg",
2198
+ ext: "jpg"
2199
+ },
2200
+ {
2201
+ mediaType: "image/webp",
2202
+ ext: "webp"
2203
+ },
2204
+ {
2205
+ mediaType: "image/gif",
2206
+ ext: "gif"
2207
+ },
2208
+ {
2209
+ mediaType: "application/pdf",
2210
+ ext: "pdf"
2211
+ }
2212
+ ];
2213
+ CHAT_ATTACHMENT_TYPES.map((type) => type.mediaType);
2214
+ /** Canonical file extension for an allowed attachment media type. */
2215
+ function chatAttachmentExtension(mediaType) {
2216
+ return CHAT_ATTACHMENT_TYPES.find((type) => type.mediaType === mediaType)?.ext;
2217
+ }
2218
+ const ChatAttachmentInputSchema = z.object({
2219
+ storageKey: z.string().min(1),
2220
+ mediaType: z.string().min(1),
2221
+ filename: z.string().optional()
2222
+ });
2223
+ /** JSON-safe file ref for workflow inputs, step outputs, and `agent.prompt({ files })`. */
2224
+ const FilePartSchema = z.object({
2225
+ type: z.literal("file"),
2226
+ mediaType: z.string().min(1),
2227
+ url: z.string().min(1),
2228
+ filename: z.string().optional()
2229
+ });
2230
+ z.object({
2231
+ contentType: z.string().min(1),
2232
+ filename: z.string().min(1),
2233
+ size: z.number().int().positive().max(CHAT_ATTACHMENT_MAX_BYTES)
2234
+ });
2235
+ z.object({
2236
+ uploadUrl: z.string().url(),
2237
+ storageKey: z.string().min(1)
2238
+ });
2239
+ function modelSupportsMediaType(capabilities, mediaType) {
2240
+ if (mediaType.startsWith("image/")) return capabilities.images;
2241
+ return capabilities.files;
2242
+ }
2243
+ /** Canonical serve path for a chat attachment (stored in `FileUIPart.url`). */
2244
+ function chatAttachmentServePath(projectId, agentSlug, storageKey) {
2245
+ const encodedKey = storageKey.split("/").map((segment) => encodeURIComponent(segment)).join("/");
2246
+ return `/api/projects/${encodeURIComponent(projectId)}/agents/${encodeURIComponent(agentSlug)}/attachments/${encodedKey}`;
2247
+ }
2248
+ /** Parse a serve URL or path back to project, agent slug, and storage key. */
2249
+ function parseChatAttachmentServePath(url) {
2250
+ let pathname;
2251
+ try {
2252
+ pathname = url instanceof URL ? url.pathname : new URL(url, "http://local").pathname;
2253
+ } catch {
2254
+ return null;
2255
+ }
2256
+ if (!pathname.startsWith("/api/projects/")) return null;
2257
+ const match = pathname.slice(14).match(/^([^/]+)\/agents\/([^/]+)\/attachments\/(.+)$/);
2258
+ if (!match) return null;
2259
+ const [, projectId, agentSlug, encodedKey] = match;
2260
+ if (!projectId || !agentSlug || !encodedKey) return null;
2261
+ try {
2262
+ const storageKey = encodedKey.split("/").map((segment) => decodeURIComponent(segment)).join("/");
2263
+ return {
2264
+ projectId: decodeURIComponent(projectId),
2265
+ agentSlug: decodeURIComponent(agentSlug),
2266
+ storageKey
2267
+ };
2268
+ } catch {
2269
+ return null;
2270
+ }
2271
+ }
2272
+ const CredentialRunContextSchema = z.object({
2273
+ orgId: z.string().min(1).optional(),
2274
+ projectId: z.string().min(1).optional(),
2275
+ userId: z.string().min(1).optional(),
2276
+ userIds: z.record(z.string(), z.string()).optional(),
2277
+ selection: z.record(z.string(), z.string()).optional()
2278
+ });
2279
+ const ThinkingLevelSchema = z.enum([
2280
+ "provider-default",
2281
+ "none",
2282
+ "minimal",
2283
+ "low",
2284
+ "medium",
2285
+ "high",
2286
+ "xhigh"
2287
+ ]);
2288
+ z.object({
2289
+ message: z.string(),
2290
+ sessionId: z.string().min(1).optional(),
2291
+ subscriptionId: z.string().min(1).optional(),
2292
+ context: CredentialRunContextSchema.optional(),
2293
+ thinkingLevel: ThinkingLevelSchema.optional(),
2294
+ files: z.array(ChatAttachmentInputSchema).max(5).optional()
2295
+ }).refine((data) => data.message.trim().length > 0 || (data.files?.length ?? 0) > 0, { message: "message or files is required" });
2296
+ z.object({
2297
+ sessionId: z.string(),
2298
+ messages: z.array(z.record(z.string(), z.unknown())),
2299
+ text: z.string(),
2300
+ error: z.string().nullable()
2301
+ });
2302
+ const SkipResponseSchema = z.object({
2303
+ ok: z.literal(true),
2304
+ skipped: z.literal(true)
2305
+ });
2306
+ z.object({ ok: z.literal(true) });
2307
+ z.object({ service: z.string() });
2308
+ const ConnectProviderSchema = z.object({
2309
+ key: z.string(),
2310
+ mode: z.enum(["authorize-url", "browser-redirect"]),
2311
+ path: z.string(),
2312
+ requiresAuth: z.boolean()
2313
+ });
2314
+ z.object({ providers: z.array(ConnectProviderSchema) });
2315
+ z.object({ url: z.string() });
2316
+ z.object({ runId: z.string() });
2317
+ z.object({
2318
+ sessionId: z.string(),
2319
+ runId: z.string()
2320
+ });
2321
+ z.object({
2322
+ workflows: z.array(z.string().min(1)).optional(),
2323
+ attachments: z.array(z.string().min(1)).optional()
2324
+ });
2325
+ const PollAttachmentResultSchema = z.object({
2326
+ attachmentSlug: z.string(),
2327
+ workflowKey: z.string(),
2328
+ runId: z.string().optional(),
2329
+ body: z.unknown().optional(),
2330
+ queued: z.boolean(),
2331
+ skipped: z.boolean().optional()
2332
+ });
2333
+ const PollRunMultiResponseSchema = z.object({ results: z.array(PollAttachmentResultSchema) });
2334
+ z.union([
2335
+ z.record(z.string(), z.unknown()),
2336
+ PollRunMultiResponseSchema,
2337
+ SkipResponseSchema,
2338
+ z.object({ runId: z.string() })
2339
+ ]);
2340
+ z.object({
2341
+ sql: z.string().min(1),
2342
+ params: z.array(z.unknown()).default([]),
2343
+ method: z.string().min(1).optional()
2344
+ });
2345
+ const DbProxyMigrationSchema = z.object({
2346
+ sql: z.array(z.string().min(1)),
2347
+ hash: z.string().min(1),
2348
+ folderMillis: z.number()
2349
+ });
2350
+ z.object({ migrations: z.array(DbProxyMigrationSchema) });
2351
+ const DbProxyQueryResponseSchema = z.object({ rows: z.array(z.unknown()) });
2352
+ z.object({ results: z.array(DbProxyQueryResponseSchema) });
2353
+ const RunSourceKindSchema = z.enum([
2354
+ "api",
2355
+ "trigger",
2356
+ "gateway",
2357
+ "workflow",
2358
+ "agent"
2359
+ ]);
2360
+ z.object({
2361
+ kind: RunSourceKindSchema,
2362
+ id: z.string().nullable()
2363
+ });
2364
+ const AgentTriggerOriginSchema = z.enum(["project", "ephemeral"]);
2365
+ const AgentTriggerStatusSchema = z.enum([
2366
+ "active",
2367
+ "disabled",
2368
+ "completed"
2369
+ ]);
2370
+ const AgentTriggerTypeSchema = z.enum([
2371
+ "webhook",
2372
+ "cron",
2373
+ "poll"
2374
+ ]);
2375
+ const AgentTriggerSummarySchema = z.object({
2376
+ id: z.string(),
2377
+ label: z.string(),
2378
+ name: z.string().nullable().optional(),
2379
+ description: z.string().nullable().optional(),
2380
+ type: AgentTriggerTypeSchema,
2381
+ schedule: z.string().nullable(),
2382
+ endpoint: z.string().nullable(),
2383
+ origin: AgentTriggerOriginSchema,
2384
+ prompt: z.string().nullable(),
2385
+ status: AgentTriggerStatusSchema,
2386
+ executionCount: z.number().int().nonnegative(),
2387
+ until: z.string().nullable(),
2388
+ attachmentId: z.string(),
2389
+ attachmentSlug: z.string()
2390
+ });
2391
+ z.array(AgentTriggerSummarySchema);
2392
+ const HistoryRunKindSchema = z.enum(["workflow", "agent"]);
2393
+ const HistoryRunStatusSchema = z.enum([
2394
+ "pending",
2395
+ "running",
2396
+ "sleeping",
2397
+ "waiting_hook",
2398
+ "waiting_children",
2399
+ "completed",
2400
+ "failed",
2401
+ "canceled"
2402
+ ]);
2403
+ const HistoryRunActorSchema = z.object({
2404
+ userId: z.string(),
2405
+ name: z.string(),
2406
+ avatarUrl: z.string().nullable().optional()
2407
+ });
2408
+ const HistoryRunUsageLineItemSchema = z.object({
2409
+ id: z.string(),
2410
+ label: z.string(),
2411
+ /** Amount debited from the org's Keystroke balance for this line. */
2412
+ billedUsd: z.number(),
2413
+ /** Provider cost for LLM usage on the org's API key (informational; not billed by Keystroke). */
2414
+ providerCostUsd: z.number().nullable().optional(),
2415
+ keySource: z.enum(["byok", "platform"]).nullable().optional()
2416
+ });
2417
+ const HistoryRunUsageSchema = z.object({
2418
+ runDurationMs: z.number().nullable(),
2419
+ lineItems: z.array(HistoryRunUsageLineItemSchema),
2420
+ /** Sum of `billedUsd` — what Keystroke charged for this run. */
2421
+ totalBilledUsd: z.number().nullable(),
2422
+ /** Sum of BYOK LLM provider costs (billed externally by the org's provider). */
2423
+ externalProviderCostUsd: z.number().nullable().optional()
2424
+ });
2425
+ const HistoryRunSchema = z.object({
2426
+ id: z.string(),
2427
+ kind: HistoryRunKindSchema,
2428
+ traceId: z.string().nullable(),
2429
+ projectId: z.string(),
2430
+ projectName: z.string(),
2431
+ resourceKey: z.string(),
2432
+ resourceId: z.string(),
2433
+ resourceName: z.string(),
2434
+ status: HistoryRunStatusSchema,
2435
+ triggeredAt: z.string(),
2436
+ timeInQueueMs: z.number().nullable(),
2437
+ startedAt: z.string(),
2438
+ finishedAt: z.string().nullable(),
2439
+ durationMs: z.number().nullable(),
2440
+ triggerLabel: z.string(),
2441
+ triggerRaw: z.string(),
2442
+ ranAs: HistoryRunActorSchema.nullable(),
2443
+ modelsUsed: z.array(z.string()),
2444
+ otherServicesUsed: z.array(z.string()),
2445
+ totalCostUsd: z.number().nullable(),
2446
+ messageCount: z.number().optional(),
2447
+ stepCount: z.number().optional()
2448
+ });
2449
+ const HistoryTraceSpanSchema = z.object({
2450
+ id: z.string(),
2451
+ traceId: z.string(),
2452
+ parentSpanId: z.string().nullable(),
2453
+ kind: z.string(),
2454
+ refId: z.string(),
2455
+ name: z.string(),
2456
+ status: z.string(),
2457
+ startedAt: z.string(),
2458
+ finishedAt: z.string().nullable(),
2459
+ metadata: z.unknown().nullable(),
2460
+ error: z.unknown().nullable()
2461
+ });
2462
+ const HistoryTraceLogSchema = z.object({
2463
+ id: z.string(),
2464
+ traceId: z.string(),
2465
+ spanId: z.string(),
2466
+ seq: z.number(),
2467
+ level: z.string(),
2468
+ message: z.string(),
2469
+ data: z.unknown().nullable(),
2470
+ source: z.string(),
2471
+ createdAt: z.string()
2472
+ });
2473
+ const HistoryTraceTriggerSchema = z.object({
2474
+ triggerType: z.string(),
2475
+ triggerRunId: z.string(),
2476
+ workflowKey: z.string().optional(),
2477
+ agentKey: z.string().optional(),
2478
+ attachmentId: z.string().nullable().optional(),
2479
+ attachmentSlug: z.string().nullable().optional(),
2480
+ route: z.string().optional(),
2481
+ sourcePath: z.string().nullable().optional()
2482
+ }).nullable();
2483
+ const HistoryTraceGatewaySchema = z.object({
2484
+ gatewayAttachmentId: z.string(),
2485
+ gatewayAttachmentKey: z.string(),
2486
+ threadId: z.string().optional(),
2487
+ channelId: z.string().optional(),
2488
+ mode: z.string().optional()
2489
+ }).nullable();
2490
+ const HistoryTraceSchema = z.object({
2491
+ traceId: z.string(),
2492
+ trigger: HistoryTraceTriggerSchema,
2493
+ gateway: HistoryTraceGatewaySchema,
2494
+ spans: z.array(HistoryTraceSpanSchema),
2495
+ logs: z.array(HistoryTraceLogSchema)
2496
+ });
2497
+ const HistoryWorkflowStepSchema = z.object({
2498
+ id: z.string(),
2499
+ actionKey: z.string(),
2500
+ output: z.unknown(),
2501
+ completedAt: z.string()
2502
+ });
2503
+ const HistoryWorkflowRunDetailSchema = z.object({
2504
+ kind: z.literal("workflow"),
2505
+ run: z.object({
2506
+ id: z.string(),
2507
+ workflowKey: z.string(),
2508
+ status: HistoryRunStatusSchema,
2509
+ trigger: z.string(),
2510
+ triggeredAt: z.string(),
2511
+ startedAt: z.string().nullable(),
2512
+ finishedAt: z.string().nullable(),
2513
+ input: z.unknown().nullable(),
2514
+ output: z.unknown().nullable(),
2515
+ error: z.unknown().nullable()
2516
+ }),
2517
+ trigger: z.object({
2518
+ id: z.string(),
2519
+ attachmentSlug: z.string().nullable(),
2520
+ triggerType: z.string(),
2521
+ sourcePath: z.string().nullable(),
2522
+ payload: z.unknown().nullable(),
2523
+ triggeredAt: z.string()
2524
+ }).nullable(),
2525
+ steps: z.array(HistoryWorkflowStepSchema),
2526
+ trace: HistoryTraceSchema.nullable(),
2527
+ ranAs: HistoryRunActorSchema.nullable().optional(),
2528
+ usage: HistoryRunUsageSchema.nullable().optional()
2529
+ });
2530
+ const HistoryAgentCompactionEventSchema = z.object({
2531
+ seq: z.number(),
2532
+ createdAt: z.string(),
2533
+ compactionModel: z.string(),
2534
+ sourceModel: z.string(),
2535
+ estimatedBeforeTokens: z.number().optional(),
2536
+ retainedTailEstimate: z.number().optional(),
2537
+ durable: z.boolean()
2538
+ });
2539
+ const HistoryAgentSessionDetailSchema = z.object({
2540
+ kind: z.literal("agent"),
2541
+ runId: z.string(),
2542
+ session: z.object({
2543
+ id: z.string(),
2544
+ agentKey: z.string(),
2545
+ status: HistoryRunStatusSchema,
2546
+ source: z.enum([
2547
+ "api",
2548
+ "gateway",
2549
+ "trigger",
2550
+ "workflow",
2551
+ "agent"
2552
+ ]),
2553
+ sourceId: z.string().nullable(),
2554
+ createdAt: z.string(),
2555
+ updatedAt: z.string(),
2556
+ messageCount: z.number(),
2557
+ error: z.unknown().nullable()
2558
+ }),
2559
+ gateway: z.object({
2560
+ threadId: z.string(),
2561
+ attachmentSlug: z.string().nullable()
2562
+ }).nullable(),
2563
+ messages: z.array(z.record(z.string(), z.unknown())),
2564
+ /** Sanitized context-compaction markers for the conversation timeline. */
2565
+ compactionEvents: z.array(HistoryAgentCompactionEventSchema).default([]),
2566
+ trace: HistoryTraceSchema.nullable(),
2567
+ ranAs: HistoryRunActorSchema.nullable().optional(),
2568
+ usage: HistoryRunUsageSchema.nullable().optional()
2569
+ });
2570
+ const HistoryRunDetailSchema = z.discriminatedUnion("kind", [HistoryWorkflowRunDetailSchema, HistoryAgentSessionDetailSchema]);
2571
+ z.object({
2572
+ project: z.string().min(1).optional(),
2573
+ status: HistoryRunStatusSchema.optional(),
2574
+ kind: HistoryRunKindSchema.optional(),
2575
+ limit: z.coerce.number().int().min(1).max(200).optional()
2576
+ });
2577
+ z.array(HistoryRunSchema);
2578
+ HistoryRunDetailSchema.nullable();
2579
+ HistoryRunSchema.nullable();
2580
+ const WorkflowRunStatusSchema = z.enum([
2581
+ "pending",
2582
+ "running",
2583
+ "sleeping",
2584
+ "waiting_hook",
2585
+ "waiting_children",
2586
+ "completed",
2587
+ "failed",
2588
+ "canceled"
2589
+ ]);
2590
+ const WorkflowRunTriggerSchema = z.enum([
2591
+ "api",
2592
+ "cron",
2593
+ "webhook",
2594
+ "poll",
2595
+ "retry"
2596
+ ]);
2597
+ z.enum([
2598
+ "run_started",
2599
+ "step_completed",
2600
+ "step_failed",
2601
+ "step_retrying",
2602
+ "sleep_scheduled",
2603
+ "sleep_completed",
2604
+ "hook_created",
2605
+ "hook_resumed",
2606
+ "child_dispatched",
2607
+ "run_completed",
2608
+ "run_failed",
2609
+ "run_canceled"
2610
+ ]);
2611
+ const WorkflowRunSummarySchema = z.object({
2612
+ id: z.string(),
2613
+ status: WorkflowRunStatusSchema,
2614
+ trigger: WorkflowRunTriggerSchema,
2615
+ triggeredAt: z.string(),
2616
+ startedAt: z.string().nullable(),
2617
+ finishedAt: z.string().nullable(),
2618
+ sourceKind: RunSourceKindSchema,
2619
+ sourceId: z.string().nullable(),
2620
+ triggerRunId: z.string().nullable(),
2621
+ attachmentId: z.string().nullable()
2622
+ });
2623
+ const WorkflowRunRecordSchema = z.object({
2624
+ id: z.string(),
2625
+ workflowSlug: z.string(),
2626
+ status: WorkflowRunStatusSchema,
2627
+ trigger: WorkflowRunTriggerSchema,
2628
+ triggeredAt: z.string(),
2629
+ startedAt: z.string().nullable(),
2630
+ finishedAt: z.string().nullable(),
2631
+ sourceKind: RunSourceKindSchema,
2632
+ sourceId: z.string().nullable(),
2633
+ triggerRunId: z.string().nullable(),
2634
+ attachmentId: z.string().nullable(),
2635
+ parentWorkflowRunId: z.string().nullable(),
2636
+ parentSpanId: z.string().nullable(),
2637
+ input: z.unknown().nullable(),
2638
+ output: z.unknown().nullable(),
2639
+ error: z.unknown().nullable()
2640
+ });
2641
+ z.object({
2642
+ limit: z.coerce.number().int().min(1).max(100).optional().default(20),
2643
+ cursor: z.string().min(1).optional(),
2644
+ status: WorkflowRunStatusSchema.optional(),
2645
+ trigger: WorkflowRunTriggerSchema.optional()
2646
+ });
2647
+ z.object({
2648
+ items: z.array(WorkflowRunSummarySchema),
2649
+ nextCursor: z.string().nullable()
2650
+ });
2651
+ z.enum([
2652
+ "trigger",
2653
+ "steps",
2654
+ "trace"
2655
+ ]);
2656
+ z.object({ include: z.string().optional() });
2657
+ const TriggerRunDetailSchema = z.object({
2658
+ id: z.string(),
2659
+ triggerId: z.string(),
2660
+ attachmentSlug: z.string().nullable(),
2661
+ triggerType: z.enum([
2662
+ "cron",
2663
+ "webhook",
2664
+ "poll"
2665
+ ]),
2666
+ sourcePath: z.string().nullable(),
2667
+ payload: z.unknown().nullable(),
2668
+ triggeredAt: z.string()
2669
+ });
2670
+ const WorkflowStepRunSchema = z.object({
2671
+ id: z.string(),
2672
+ actionKey: z.string(),
2673
+ output: z.unknown(),
2674
+ completedAt: z.string()
2675
+ });
2676
+ const TraceTriggerSummarySchema = z.object({
2677
+ triggerType: z.string(),
2678
+ triggerRunId: z.string(),
2679
+ workflowSlug: z.string().optional(),
2680
+ agentSlug: z.string().optional(),
2681
+ attachmentId: z.string().nullable().optional(),
2682
+ attachmentSlug: z.string().nullable().optional(),
2683
+ route: z.string().optional(),
2684
+ sourcePath: z.string().nullable().optional()
2685
+ }).nullable();
2686
+ const TraceGatewaySummarySchema = z.object({
2687
+ gatewayAttachmentId: z.string(),
2688
+ gatewayAttachmentKey: z.string(),
2689
+ threadId: z.string().optional(),
2690
+ channelId: z.string().optional(),
2691
+ mode: z.string().optional()
2692
+ }).nullable();
2693
+ const TraceSpanSchema = z.object({
2694
+ id: z.string(),
2695
+ traceId: z.string(),
2696
+ parentSpanId: z.string().nullable(),
2697
+ kind: z.string(),
2698
+ refId: z.string(),
2699
+ name: z.string(),
2700
+ status: z.string(),
2701
+ startedAt: z.string(),
2702
+ finishedAt: z.string().nullable(),
2703
+ metadata: z.unknown().nullable(),
2704
+ error: z.unknown().nullable()
2705
+ });
2706
+ const TraceLogSchema = z.object({
2707
+ id: z.string(),
2708
+ traceId: z.string(),
2709
+ spanId: z.string(),
2710
+ seq: z.number(),
2711
+ level: z.string(),
2712
+ message: z.string(),
2713
+ data: z.unknown().nullable(),
2714
+ source: z.string(),
2715
+ createdAt: z.string()
2716
+ });
2717
+ const TraceResponseSchema = z.object({
2718
+ traceId: z.string(),
2719
+ trigger: TraceTriggerSummarySchema,
2720
+ gateway: TraceGatewaySummarySchema,
2721
+ spans: z.array(TraceSpanSchema),
2722
+ logs: z.array(TraceLogSchema)
2723
+ });
2724
+ z.object({
2725
+ run: WorkflowRunRecordSchema,
2726
+ trigger: TriggerRunDetailSchema.nullable(),
2727
+ steps: z.array(WorkflowStepRunSchema),
2728
+ trace: TraceResponseSchema.nullable()
2729
+ });
2730
+ const WorkflowHookStatusSchema = z.enum(["waiting", "resumed"]);
2731
+ const WorkflowHookSummarySchema = z.object({
2732
+ token: z.string(),
2733
+ correlationId: z.string(),
2734
+ status: WorkflowHookStatusSchema,
2735
+ createdAt: z.string(),
2736
+ resumeUrl: z.string().nullable()
2737
+ });
2738
+ z.object({ items: z.array(WorkflowHookSummarySchema) });
2739
+ const AgentSessionStatusSchema = z.enum([
2740
+ "running",
2741
+ "completed",
2742
+ "failed",
2743
+ "canceled"
2744
+ ]);
2745
+ const AgentSessionSummarySchema = z.object({
2746
+ id: z.string(),
2747
+ status: AgentSessionStatusSchema,
2748
+ source: RunSourceKindSchema,
2749
+ sourceId: z.string().nullable(),
2750
+ title: z.string().nullable(),
2751
+ ranByUserName: z.string().nullable(),
2752
+ gatewayPlatform: z.string().nullable(),
2753
+ triggerType: AgentTriggerTypeSchema.nullable(),
2754
+ createdAt: z.string(),
2755
+ updatedAt: z.string(),
2756
+ messageCount: z.number()
2757
+ });
2758
+ const AgentSessionRecordSchema = z.object({
2759
+ id: z.string(),
2760
+ agentSlug: z.string(),
2761
+ status: AgentSessionStatusSchema,
2762
+ source: RunSourceKindSchema,
2763
+ sourceId: z.string().nullable(),
2764
+ title: z.string().nullable(),
2765
+ createdAt: z.string(),
2766
+ updatedAt: z.string(),
2767
+ parentSpanId: z.string().nullable(),
2768
+ messageCount: z.number(),
2769
+ error: z.unknown().nullable()
2770
+ });
2771
+ z.object({
2772
+ limit: z.coerce.number().int().min(1).max(100).optional().default(20),
2773
+ cursor: z.string().min(1).optional(),
2774
+ status: AgentSessionStatusSchema.optional(),
2775
+ source: RunSourceKindSchema.optional()
2776
+ });
2777
+ z.object({
2778
+ items: z.array(AgentSessionSummarySchema),
2779
+ nextCursor: z.string().nullable()
2780
+ });
2781
+ z.enum([
2782
+ "gateway",
2783
+ "messages",
2784
+ "events",
2785
+ "trace"
2786
+ ]);
2787
+ z.object({ include: z.string().optional() });
2788
+ const GatewaySessionDetailSchema = z.object({
2789
+ threadId: z.string(),
2790
+ attachmentId: z.string(),
2791
+ attachmentSlug: z.string().nullable()
2792
+ });
2793
+ const AgentEventSchema = z.object({
2794
+ id: z.string(),
2795
+ sessionId: z.string(),
2796
+ seq: z.number(),
2797
+ eventType: z.string(),
2798
+ payload: z.unknown(),
2799
+ createdAt: z.string()
2800
+ });
2801
+ z.object({
2802
+ session: AgentSessionRecordSchema,
2803
+ activeRunId: z.string().nullable().default(null),
2804
+ gateway: GatewaySessionDetailSchema.nullable(),
2805
+ messages: z.array(z.record(z.string(), z.unknown())),
2806
+ events: z.array(AgentEventSchema),
2807
+ /**
2808
+ * Sanitized context-compaction markers, populated alongside `messages`.
2809
+ * A cheap indexed lookup (session_id + event_type) — never the full event
2810
+ * log. Defaulted so older servers remain compatible.
2811
+ */
2812
+ compactionEvents: z.array(HistoryAgentCompactionEventSchema).default([]),
2813
+ trace: TraceResponseSchema.nullable()
2814
+ });
2815
+ const SlackGatewayModeSchema = z.enum([
2816
+ "mention",
2817
+ "channel",
2818
+ "dm"
2819
+ ]);
2820
+ const GatewayAttachmentSourceSchema = z.object({
2821
+ kind: z.literal("slack"),
2822
+ mode: SlackGatewayModeSchema,
2823
+ credentialKey: z.string(),
2824
+ channelIds: z.array(z.string()).optional(),
2825
+ subscribeOnMention: z.boolean()
2826
+ });
2827
+ const GatewayAttachmentRecordSchema = z.object({
2828
+ id: z.string(),
2829
+ key: z.string(),
2830
+ agentKey: z.string(),
2831
+ channelId: z.string(),
2832
+ teamId: z.string().nullable().optional(),
2833
+ platform: z.string(),
2834
+ source: GatewayAttachmentSourceSchema,
2835
+ registeredAt: z.string(),
2836
+ updatedAt: z.string()
2837
+ });
2838
+ z.object({ attachments: z.array(GatewayAttachmentRecordSchema) });
2839
+ z.object({
2840
+ agentKey: z.string().min(1),
2841
+ teamId: z.string().min(1).optional(),
2842
+ mode: SlackGatewayModeSchema.optional(),
2843
+ subscribeOnMention: z.boolean().optional()
2844
+ });
2845
+ const AgentListItemSchema = z.object({
2846
+ key: z.string(),
2847
+ name: z.string().optional(),
2848
+ route: z.string()
2849
+ });
2850
+ z.object({ agents: z.array(AgentListItemSchema) });
2851
+ const WorkflowSubscriptionRecordSchema = z.object({
2852
+ id: z.string(),
2853
+ workflowKey: z.string(),
2854
+ userId: z.string(),
2855
+ enabled: z.boolean(),
2856
+ createdAt: z.string(),
2857
+ updatedAt: z.string()
2858
+ });
2859
+ z.object({ subscriptions: z.array(WorkflowSubscriptionRecordSchema) });
2860
+ z.object({
2861
+ userId: z.string().min(1).optional(),
2862
+ enabled: z.boolean().optional()
2863
+ });
2864
+ const CredentialInstanceRecordSchema = z.object({
2865
+ id: z.string(),
2866
+ appSlug: z.string(),
2867
+ slug: z.string(),
2868
+ name: z.string().nullable(),
2869
+ scopeType: CredentialScopeTypeSchema,
2870
+ scopeId: z.string().nullable(),
2871
+ label: z.string().nullable(),
2872
+ isDefault: z.boolean(),
2873
+ authKind: CredentialAuthKindSchema
2874
+ });
2875
+ z.object({ instances: z.array(CredentialInstanceRecordSchema) });
2876
+ z.object({
2877
+ key: z.string().min(1),
2878
+ slug: z.string().min(1).optional(),
2879
+ name: z.string().nullable().optional(),
2880
+ scopeType: CredentialScopeTypeSchema,
2881
+ scopeId: z.string().nullable().optional(),
2882
+ label: z.string().nullable().optional(),
2883
+ isDefault: z.boolean().optional(),
2884
+ value: z.record(z.string(), z.unknown()).refine((value) => Object.keys(value).length > 0, { message: "value must be a non-empty object" })
2885
+ });
2886
+ z.object({
2887
+ slug: z.string().min(1).optional(),
2888
+ name: z.string().nullable().optional(),
2889
+ label: z.string().nullable().optional(),
2890
+ isDefault: z.boolean().optional(),
2891
+ value: z.record(z.string(), z.unknown()).refine((value) => Object.keys(value).length > 0, { message: "value must be a non-empty object" }).optional()
2892
+ });
2893
+ const TriggerRunTypeSchema = z.enum([
2894
+ "cron",
2895
+ "webhook",
2896
+ "poll"
2897
+ ]);
2898
+ const TriggerRunOutcomeSchema = z.enum([
2899
+ "dispatched",
2900
+ "skipped",
2901
+ "failed"
2902
+ ]);
2903
+ const TriggerRunReasonSchema = z.enum([
2904
+ "filter_rejected",
2905
+ "transform_undefined",
2906
+ "invalid_payload",
2907
+ "source_error",
2908
+ "handler_error"
2909
+ ]);
2910
+ const TriggerRunWorkflowSummarySchema = z.object({
2911
+ id: z.string(),
2912
+ status: WorkflowRunStatusSchema,
2913
+ workflowSlug: z.string()
2914
+ });
2915
+ const TriggerRunAgentSessionSummarySchema = z.object({
2916
+ id: z.string(),
2917
+ agentSlug: z.string()
2918
+ });
2919
+ const TriggerRunSummarySchema = z.object({
2920
+ id: z.string(),
2921
+ triggerType: TriggerRunTypeSchema,
2922
+ triggeredAt: z.string(),
2923
+ sourcePath: z.string().nullable(),
2924
+ outcome: TriggerRunOutcomeSchema,
2925
+ reason: TriggerRunReasonSchema.nullable(),
2926
+ detail: z.string().nullable(),
2927
+ /** Workflow runs dispatched by this fire (fan-out → one per matched workflow attachment). */
2928
+ workflowRuns: z.array(TriggerRunWorkflowSummarySchema),
2929
+ /** Agent sessions dispatched by this fire (fan-out → one per matched agent attachment). */
2930
+ agentSessions: z.array(TriggerRunAgentSessionSummarySchema)
2931
+ });
2932
+ const TriggerRunRecordSchema = z.object({
2933
+ id: z.string(),
2934
+ triggerId: z.string(),
2935
+ attachmentSlug: z.string(),
2936
+ triggerType: TriggerRunTypeSchema,
2937
+ sourcePath: z.string().nullable(),
2938
+ outcome: TriggerRunOutcomeSchema,
2939
+ reason: TriggerRunReasonSchema.nullable(),
2940
+ detail: z.string().nullable(),
2941
+ payload: z.unknown().nullable(),
2942
+ triggeredAt: z.string()
2943
+ });
2944
+ z.object({
2945
+ limit: z.coerce.number().int().min(1).max(100).optional().default(20),
2946
+ cursor: z.string().min(1).optional(),
2947
+ triggerType: TriggerRunTypeSchema.optional(),
2948
+ outcome: TriggerRunOutcomeSchema.optional()
2949
+ });
2950
+ z.object({
2951
+ items: z.array(TriggerRunSummarySchema),
2952
+ nextCursor: z.string().nullable()
2953
+ });
2954
+ z.enum([
2955
+ "workflows",
2956
+ "agents",
2957
+ "trace"
2958
+ ]);
2959
+ z.object({ include: z.string().optional() });
2960
+ const TriggerRunAgentSessionDetailSchema = z.object({
2961
+ id: z.string(),
2962
+ agentSlug: z.string()
2963
+ });
2964
+ z.object({
2965
+ run: TriggerRunRecordSchema,
2966
+ workflowRuns: z.array(WorkflowRunSummarySchema),
2967
+ agentSessions: z.array(TriggerRunAgentSessionDetailSchema),
2968
+ trace: TraceResponseSchema.nullable()
2969
+ });
2970
+ const TriggerTypeSchema = z.enum([
2971
+ "webhook",
2972
+ "poll",
2973
+ "cron"
2974
+ ]);
2975
+ const TriggerTargetKindSchema = z.enum(["workflow", "agent"]);
2976
+ const TriggerStatusSchema = z.enum(["active", "disabled"]);
2977
+ const TriggerAttachmentStatusSchema = z.enum(["active", "disabled"]);
2978
+ const TriggerListItemSchema = z.object({
2979
+ slug: z.string(),
2980
+ name: z.string().optional(),
2981
+ description: z.string().optional(),
2982
+ type: TriggerTypeSchema,
2983
+ status: TriggerStatusSchema.optional(),
2984
+ schedule: z.string().nullable().optional(),
2985
+ sourcePath: z.string().optional(),
2986
+ route: z.string().optional(),
2987
+ webhookUrl: z.string().url().optional(),
2988
+ targetKind: TriggerTargetKindSchema,
2989
+ workflowKey: z.string().optional(),
2990
+ agentKey: z.string().optional()
2991
+ });
2992
+ z.object({ triggers: z.array(TriggerListItemSchema) });
2993
+ z.object({ endpoint: z.string().min(1).optional() });
2994
+ const TriggerAssignmentSchema = z.object({
2995
+ kind: TriggerTargetKindSchema,
2996
+ id: z.string(),
2997
+ slug: z.string(),
2998
+ name: z.string(),
2999
+ attachmentId: z.string(),
3000
+ attachmentSlug: z.string(),
3001
+ status: TriggerAttachmentStatusSchema,
3002
+ disabledAt: z.string().nullable()
3003
+ });
3004
+ /** Status of the downstream run/session a dispatched fire produced. */
3005
+ const WorkspaceTriggerRunStatusSchema = z.enum([
3006
+ "completed",
3007
+ "running",
3008
+ "failed"
3009
+ ]);
3010
+ /**
3011
+ * Categorical reason a fire was recorded but produced no downstream run. These map
3012
+ * from the persisted `trigger_runs.reason` enum onto the labels the UI renders.
3013
+ */
3014
+ const WorkspaceTriggerSkipReasonSchema = z.enum([
3015
+ "filtered",
3016
+ "no_new_data",
3017
+ "transform_undefined",
3018
+ "payload_mismatch"
3019
+ ]);
3020
+ /**
3021
+ * A single downstream run/session a dispatched fire produced. A fan-out fire can
3022
+ * dispatch several of these (multiple workflows and/or agents off one source event).
3023
+ */
3024
+ const WorkspaceTriggerRunTargetSchema = z.discriminatedUnion("kind", [z.object({
3025
+ kind: z.literal("workflow"),
3026
+ runId: z.string(),
3027
+ workflowId: z.string(),
3028
+ status: WorkspaceTriggerRunStatusSchema,
3029
+ name: z.string()
3030
+ }), z.object({
3031
+ kind: z.literal("agent"),
3032
+ sessionId: z.string(),
3033
+ agentId: z.string(),
3034
+ status: WorkspaceTriggerRunStatusSchema,
3035
+ name: z.string()
3036
+ })]);
3037
+ /**
3038
+ * Outcome of a single trigger fire — drives the run-history row presentation. Every
3039
+ * recorded fire either dispatched one or more workflow/agent targets, was skipped by
3040
+ * trigger logic, or failed before any target ran.
3041
+ */
3042
+ const WorkspaceTriggerRunOutcomeSchema = z.discriminatedUnion("kind", [
3043
+ z.object({
3044
+ kind: z.literal("dispatched"),
3045
+ targets: z.array(WorkspaceTriggerRunTargetSchema)
3046
+ }),
3047
+ z.object({
3048
+ kind: z.literal("skipped"),
3049
+ reason: WorkspaceTriggerSkipReasonSchema,
3050
+ /** One-line Zod issue summary when reason is payload_mismatch. */
3051
+ detail: z.string().nullable().optional()
3052
+ }),
3053
+ z.object({
3054
+ kind: z.literal("failed"),
3055
+ error: z.string()
3056
+ })
3057
+ ]);
3058
+ const WorkspaceTriggerSummarySchema = z.object({
3059
+ /** `triggers.id` UUID for the trigger row. */
3060
+ id: z.string(),
3061
+ slug: z.string(),
3062
+ name: z.string(),
3063
+ description: z.string().min(1),
3064
+ type: TriggerTypeSchema,
3065
+ status: TriggerStatusSchema,
3066
+ projectId: z.string(),
3067
+ projectName: z.string(),
3068
+ /** Webhook ingress URL (webhook triggers only). */
3069
+ webhookUrl: z.string().nullable(),
3070
+ /** Cron expression or poll cadence label (cron/poll triggers only). */
3071
+ schedule: z.string().nullable(),
3072
+ /** Workflows + agents currently bound to this source. */
3073
+ assignments: z.array(TriggerAssignmentSchema),
3074
+ lastFiredAt: z.string().nullable(),
3075
+ fireCount: z.number().int().nonnegative(),
3076
+ createdAt: z.string()
3077
+ });
3078
+ WorkspaceTriggerSummarySchema.extend({
3079
+ /** Source module file path, relative to the project root. */
3080
+ sourcePath: z.string() });
3081
+ z.array(WorkspaceTriggerSummarySchema);
3082
+ const WorkspaceTriggerRunSummarySchema = z.object({
3083
+ id: z.string(),
3084
+ triggerType: TriggerTypeSchema,
3085
+ triggeredAt: z.string(),
3086
+ /** Poll/webhook source path or endpoint that produced the fire. */
3087
+ sourcePath: z.string().nullable(),
3088
+ outcome: WorkspaceTriggerRunOutcomeSchema
3089
+ });
3090
+ z.object({
3091
+ items: z.array(WorkspaceTriggerRunSummarySchema),
3092
+ nextCursor: z.string().nullable()
3093
+ });
3094
+ z.object({
3095
+ path: z.string(),
3096
+ contents: z.string()
3097
+ });
3098
+ /** Whether the LLM overview is still being produced, finished, or errored. */
3099
+ const WorkspaceTriggerOverviewStatusSchema = z.enum([
3100
+ "generating",
3101
+ "ready",
3102
+ "failed"
3103
+ ]);
3104
+ z.object({
3105
+ status: WorkspaceTriggerOverviewStatusSchema,
3106
+ markdown: z.string(),
3107
+ hash: z.string(),
3108
+ generatedAt: z.string().nullable(),
3109
+ model: z.string()
3110
+ });
3111
+ /** Inputs the worker feeds the LLM to generate a trigger overview. */
3112
+ const TriggerOverviewInputSchema = z.object({
3113
+ name: z.string(),
3114
+ description: z.string().nullable(),
3115
+ type: TriggerTypeSchema,
3116
+ schedule: z.string().nullable(),
3117
+ sourcePath: z.string(),
3118
+ sourceContents: z.string(),
3119
+ assignments: z.array(TriggerAssignmentSchema)
3120
+ });
3121
+ z.object({
3122
+ triggerId: z.string(),
3123
+ projectId: z.string(),
3124
+ triggerHash: z.string(),
3125
+ model: z.string(),
3126
+ input: TriggerOverviewInputSchema
3127
+ });
3128
+ z.object({ enabled: z.boolean() });
3129
+ z.object({
3130
+ input: z.unknown().optional(),
3131
+ workflow: z.string().min(1).optional(),
3132
+ agent: z.string().min(1).optional()
3133
+ });
3134
+ z.object({ runId: z.string().min(1) });
3135
+ /** One attachment's invoke-form metadata for the dashboard. */
3136
+ const TriggerInvokeAttachmentSchema = z.object({
3137
+ attachmentSlug: z.string().min(1),
3138
+ kind: TriggerTargetKindSchema,
3139
+ targetSlug: z.string().min(1),
3140
+ targetName: z.string().min(1),
3141
+ enabled: z.boolean(),
3142
+ /** Webhook attachment JSON Schema used to drive the invoke form. */
3143
+ requestSchema: z.record(z.string(), z.unknown()).optional()
3144
+ });
3145
+ z.object({
3146
+ type: TriggerTypeSchema,
3147
+ attachments: z.array(TriggerInvokeAttachmentSchema),
3148
+ /** Cron source static payload — display only; never overridden on invoke. */
3149
+ staticPayload: z.unknown().optional()
3150
+ });
3151
+ z.object({
3152
+ manual: z.literal(true),
3153
+ attachments: z.array(z.string().min(1)).optional()
3154
+ });
3155
+ const OrganizationMemberRoleSchema = z.enum([
3156
+ "owner",
3157
+ "admin",
3158
+ "builder"
3159
+ ]);
3160
+ const OrganizationMemberStatusSchema = z.enum([
3161
+ "invited",
3162
+ "active",
3163
+ "rejected",
3164
+ "suspended"
3165
+ ]);
3166
+ const InvitableOrganizationMemberRoleSchema = z.enum(["admin", "builder"]);
3167
+ const isoDateTime$5 = z.string().datetime();
3168
+ const OrganizationMemberSchema = z.object({
3169
+ id: z.string(),
3170
+ name: z.string(),
3171
+ email: z.string().email(),
3172
+ role: OrganizationMemberRoleSchema,
3173
+ status: OrganizationMemberStatusSchema,
3174
+ avatarUrl: z.string().optional(),
3175
+ joinedAt: isoDateTime$5.optional(),
3176
+ lastActiveAt: isoDateTime$5.nullable().optional()
3177
+ });
3178
+ z.array(OrganizationMemberSchema);
3179
+ z.object({
3180
+ limit: z.coerce.number().int().min(1).max(200).optional(),
3181
+ cursor: z.string().min(1).optional()
3182
+ });
3183
+ z.object({
3184
+ items: z.array(OrganizationMemberSchema),
3185
+ nextCursor: z.string().nullable()
3186
+ });
3187
+ z.object({
3188
+ emails: z.array(z.string().trim().email()).min(1),
3189
+ role: InvitableOrganizationMemberRoleSchema
3190
+ });
3191
+ const InviteOrganizationMemberResultStatusSchema = z.enum([
3192
+ "sent",
3193
+ "already_member",
3194
+ "pending",
3195
+ "invalid"
3196
+ ]);
3197
+ const InviteOrganizationMemberResultSchema = z.object({
3198
+ email: z.string(),
3199
+ status: InviteOrganizationMemberResultStatusSchema,
3200
+ invitationId: z.string().optional()
3201
+ });
3202
+ z.array(InviteOrganizationMemberResultSchema);
3203
+ z.object({ role: InvitableOrganizationMemberRoleSchema });
3204
+ const OrganizationInvitationSchema = z.object({
3205
+ id: z.string(),
3206
+ organizationName: z.string(),
3207
+ organizationSlug: OrganizationSlugSchema,
3208
+ invitedByName: z.string().optional(),
3209
+ invitedByEmail: z.string().email().optional(),
3210
+ role: OrganizationMemberRoleSchema
3211
+ });
3212
+ z.array(OrganizationInvitationSchema);
3213
+ z.object({ success: z.literal(true) });
3214
+ const isoDateTime$4 = z.string().datetime();
3215
+ const ApiKeyCreatorSchema = z.object({
3216
+ id: z.string(),
3217
+ name: z.string(),
3218
+ email: z.string().email().optional(),
3219
+ avatarUrl: z.string().optional(),
3220
+ /** True when the creator user row no longer exists. */
3221
+ deleted: z.boolean().optional()
3222
+ });
3223
+ const ApiKeySummarySchema = z.object({
3224
+ id: z.string(),
3225
+ name: z.string(),
3226
+ keyPreview: z.string(),
3227
+ createdAt: isoDateTime$4,
3228
+ createdBy: ApiKeyCreatorSchema,
3229
+ isCreatedByCurrentUser: z.boolean()
3230
+ });
3231
+ z.array(ApiKeySummarySchema);
3232
+ z.object({ name: z.string().trim().min(1).max(128) });
3233
+ ApiKeySummarySchema.extend({ secret: z.string() });
3234
+ const isoDateTime$3 = z.string().datetime();
3235
+ const ManagedServiceKindSchema = z.enum(["llm"]);
3236
+ z.enum([
3237
+ "openai",
3238
+ "anthropic",
3239
+ "google",
3240
+ "groq",
3241
+ "xai"
3242
+ ]);
3243
+ const ManagedServiceCredentialSchema = z.object({
3244
+ id: z.string(),
3245
+ kind: ManagedServiceKindSchema,
3246
+ provider: z.string(),
3247
+ keyPreview: z.string(),
3248
+ createdAt: isoDateTime$3,
3249
+ updatedAt: isoDateTime$3,
3250
+ createdBy: ApiKeyCreatorSchema,
3251
+ isCreatedByCurrentUser: z.boolean()
3252
+ });
3253
+ z.array(ManagedServiceCredentialSchema);
3254
+ z.object({
3255
+ kind: ManagedServiceKindSchema.default("llm"),
3256
+ provider: z.string().trim().min(1),
3257
+ apiKey: z.string().trim().min(1)
3258
+ });
3259
+ z.object({ apiKey: z.string().trim().min(1) });
3260
+ const ProjectUserRoleSchema = z.enum(["admin", "builder"]);
3261
+ const ProjectInvitePermissionSchema = z.enum(["admin", "all"]);
3262
+ const ProjectMemberStatusSchema = z.enum(["active", "invited"]);
3263
+ const isoDateTime$2 = z.string().datetime();
3264
+ const ProjectMemberSchema = z.object({
3265
+ id: z.string(),
3266
+ projectId: z.string(),
3267
+ name: z.string(),
3268
+ email: z.string().email(),
3269
+ role: ProjectUserRoleSchema,
3270
+ status: ProjectMemberStatusSchema,
3271
+ image: z.string().nullable(),
3272
+ createdAt: isoDateTime$2,
3273
+ isCurrentUser: z.boolean().optional()
3274
+ });
3275
+ z.array(ProjectMemberSchema);
3276
+ z.object({
3277
+ emails: z.array(z.string().trim().email()).min(1),
3278
+ role: ProjectUserRoleSchema
3279
+ });
3280
+ const InviteProjectMemberResultStatusSchema = z.enum([
3281
+ "added",
3282
+ "already_member",
3283
+ "not_org_member",
3284
+ "invalid"
3285
+ ]);
3286
+ const InviteProjectMemberResultSchema = z.object({
3287
+ email: z.string(),
3288
+ status: InviteProjectMemberResultStatusSchema
3289
+ });
3290
+ z.array(InviteProjectMemberResultSchema);
3291
+ z.object({ role: ProjectUserRoleSchema });
3292
+ z.object({
3293
+ description: z.string(),
3294
+ defaultRole: ProjectUserRoleSchema,
3295
+ invitePermission: ProjectInvitePermissionSchema
3296
+ });
3297
+ z.object({
3298
+ description: z.string().optional(),
3299
+ defaultRole: ProjectUserRoleSchema.optional(),
3300
+ invitePermission: ProjectInvitePermissionSchema.optional()
3301
+ }).refine((data) => data.description !== void 0 || data.defaultRole !== void 0 || data.invitePermission !== void 0, { message: "At least one field is required" });
3302
+ z.object({ url: z.url().nullable() });
3303
+ z.object({
3304
+ /** Storage key returned from presign; null removes the custom override. */
3305
+ storageKey: z.string().min(1).nullable() });
3306
+ z.object({ contentType: z.string().trim().min(1) });
3307
+ z.object({
3308
+ uploadUrl: z.url(),
3309
+ storageKey: z.string().min(1)
3310
+ });
3311
+ const UserInterfaceThemeSchema = z.enum([
3312
+ "system",
3313
+ "light",
3314
+ "dark"
3315
+ ]);
3316
+ const UserSurfaceContrastSchema = z.enum(["off", "on"]);
3317
+ const UserWorkspaceLayoutModeSchema = z.enum(["default", "linear"]);
3318
+ const UserWorkspaceFontSizeSchema = z.enum(["default", "large"]);
3319
+ const UserSidebarNavIconVisibilitySchema = z.enum(["hidden", "visible"]);
3320
+ const UserSidebarFooterChatRowVisibilitySchema = z.enum(["hidden", "visible"]);
3321
+ const UserWorkspaceFavoriteKindSchema = z.enum([
3322
+ "agent",
3323
+ "workflow",
3324
+ "skill",
3325
+ "run"
3326
+ ]);
3327
+ const UserWorkspaceFavoriteSchema = z.object({
3328
+ kind: UserWorkspaceFavoriteKindSchema,
3329
+ resourceId: z.string().min(1)
3330
+ });
3331
+ const UserSidebarPreferencesSchema = z.object({
3332
+ navIconVisibility: UserSidebarNavIconVisibilitySchema,
3333
+ footerChatRowVisibility: UserSidebarFooterChatRowVisibilitySchema,
3334
+ hiddenNavItemIds: z.array(z.string()),
3335
+ topNavItemOrderIds: z.array(z.string()),
3336
+ workspaceNavItemOrderIds: z.array(z.string())
3337
+ });
3338
+ const UserTimezoneSchema = z.string().refine(isValidIanaTimezone, { message: "Invalid IANA timezone" });
3339
+ z.object({
3340
+ interfaceTheme: UserInterfaceThemeSchema,
3341
+ surfaceContrast: UserSurfaceContrastSchema,
3342
+ layoutMode: UserWorkspaceLayoutModeSchema,
3343
+ fontSize: UserWorkspaceFontSizeSchema,
3344
+ sidebar: UserSidebarPreferencesSchema,
3345
+ favorites: z.array(UserWorkspaceFavoriteSchema),
3346
+ projectOrderIds: z.array(z.string()),
3347
+ projectDotColors: z.record(z.string(), z.string()),
3348
+ onboardingTabVisible: z.boolean(),
3349
+ timezone: z.union([UserTimezoneSchema, z.null()])
3350
+ });
3351
+ const UserSidebarPreferencesPatchSchema = z.object({
3352
+ navIconVisibility: UserSidebarNavIconVisibilitySchema.optional(),
3353
+ footerChatRowVisibility: UserSidebarFooterChatRowVisibilitySchema.optional(),
3354
+ hiddenNavItemIds: z.array(z.string()).optional(),
3355
+ topNavItemOrderIds: z.array(z.string()).optional(),
3356
+ workspaceNavItemOrderIds: z.array(z.string()).optional()
3357
+ });
3358
+ z.object({
3359
+ interfaceTheme: UserInterfaceThemeSchema.optional(),
3360
+ surfaceContrast: UserSurfaceContrastSchema.optional(),
3361
+ layoutMode: UserWorkspaceLayoutModeSchema.optional(),
3362
+ fontSize: UserWorkspaceFontSizeSchema.optional(),
3363
+ sidebar: UserSidebarPreferencesPatchSchema.optional(),
3364
+ favorites: z.array(UserWorkspaceFavoriteSchema).optional(),
3365
+ projectOrderIds: z.array(z.string()).optional(),
3366
+ projectDotColors: z.record(z.string(), z.string()).optional(),
3367
+ onboardingTabVisible: z.boolean().optional(),
3368
+ timezone: z.union([UserTimezoneSchema, z.null()]).optional()
3369
+ }).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 || value.timezone !== void 0, { message: "At least one preference field is required" });
3370
+ const OrganizationLogoVariantSchema = z.enum(["light", "dark"]);
3371
+ z.object({
3372
+ customLogoEnabled: z.boolean(),
3373
+ customLogoExplicitlyDisabled: z.boolean(),
3374
+ logoLightUrl: z.url().nullable(),
3375
+ logoDarkUrl: z.url().nullable(),
3376
+ logoHeightPx: z.number().int().min(14).max(32)
3377
+ });
3378
+ z.object({
3379
+ customLogoEnabled: z.boolean().optional(),
3380
+ customLogoExplicitlyDisabled: z.boolean().optional(),
3381
+ logoLightStorageKey: z.string().min(1).nullable().optional(),
3382
+ logoDarkStorageKey: z.string().min(1).nullable().optional(),
3383
+ logoHeightPx: z.number().int().min(14).max(32).optional()
3384
+ }).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" });
3385
+ z.object({
3386
+ variant: OrganizationLogoVariantSchema,
3387
+ contentType: z.string().trim().min(1)
3388
+ });
3389
+ z.object({
3390
+ uploadUrl: z.url(),
3391
+ storageKey: z.string().min(1)
3392
+ });
3393
+ const ProjectArtifactStatusSchema = z.enum(["pending", "ready"]);
3394
+ const isoDateTime$1 = z.string().datetime();
3395
+ const ProjectArtifactSchema = z.object({
3396
+ id: z.string(),
3397
+ projectId: z.string(),
3398
+ storageKey: z.string(),
3399
+ status: ProjectArtifactStatusSchema,
3400
+ createdAt: isoDateTime$1,
3401
+ updatedAt: isoDateTime$1
3402
+ });
3403
+ z.object({
3404
+ artifact: ProjectArtifactSchema,
3405
+ uploadUrl: z.string().url(),
3406
+ expiresInSeconds: z.number().int().positive()
3407
+ });
3408
+ z.object({
3409
+ artifact: ProjectArtifactSchema,
3410
+ project: ProjectSchema
3411
+ });
3412
+ z.object({
3413
+ artifactId: z.string(),
3414
+ downloadUrl: z.string().url(),
3415
+ expiresInSeconds: z.number().int().positive()
3416
+ });
3417
+ const ProjectDeploymentSchema = z.object({
3418
+ id: z.string(),
3419
+ projectId: z.string(),
3420
+ version: z.number().int().positive(),
3421
+ deployedBy: z.string().nullable(),
3422
+ deployedByEmail: z.string().optional(),
3423
+ deployedByAvatarUrl: z.string().optional(),
3424
+ createdAt: isoDateTime$1,
3425
+ active: z.boolean()
3426
+ });
3427
+ z.array(ProjectDeploymentSchema);
3428
+ const optionalCount = z.number().int().nonnegative().nullable().optional();
3429
+ const optionalTimestamp = z.string().nullable().optional();
3430
+ const AgentSummarySchema = z.object({
3431
+ id: z.string().min(1),
3432
+ slug: z.string().min(1),
3433
+ name: z.string().min(1),
3434
+ projectId: z.string().min(1),
3435
+ updatedAt: z.string().min(1),
3436
+ description: z.string().min(1),
3437
+ sourcePath: z.string().min(1).optional(),
3438
+ model: z.string().optional(),
3439
+ capabilities: z.object({
3440
+ images: z.boolean(),
3441
+ files: z.boolean()
3442
+ }).optional(),
3443
+ systemPrompt: z.string().optional(),
3444
+ toolCount: optionalCount,
3445
+ credentialCount: optionalCount,
3446
+ apps: z.array(z.object({
3447
+ id: z.string(),
3448
+ label: z.string()
3449
+ })).optional(),
3450
+ lastRunAt: optionalTimestamp
3451
+ });
3452
+ const WorkflowSummarySchema = z.object({
3453
+ id: z.string().min(1),
3454
+ slug: z.string().min(1),
3455
+ name: z.string().min(1),
3456
+ projectId: z.string().min(1),
3457
+ updatedAt: z.string().min(1),
3458
+ description: z.string().min(1),
3459
+ sourcePath: z.string().min(1).optional(),
3460
+ lastRunAt: optionalTimestamp
3461
+ });
3462
+ const SkillSummarySchema = z.object({
3463
+ id: z.string().min(1),
3464
+ slug: z.string().min(1),
3465
+ name: z.string().min(1),
3466
+ projectId: z.string().min(1),
3467
+ updatedAt: z.string().min(1),
3468
+ description: z.string().min(1),
3469
+ sourcePath: z.string().min(1).optional()
3470
+ });
3471
+ z.array(AgentSummarySchema);
3472
+ AgentSummarySchema.nullable();
3473
+ z.array(WorkflowSummarySchema);
3474
+ WorkflowSummarySchema.nullable();
3475
+ z.array(SkillSummarySchema);
3476
+ SkillSummarySchema.nullable();
3477
+ const RecentResourceKindSchema = z.enum([
3478
+ "agent",
3479
+ "workflow",
3480
+ "skill"
3481
+ ]);
3482
+ const RecentResourceSourceSchema = z.enum(["owned", "shared"]);
3483
+ const RecentResourceSchema = z.object({
3484
+ id: z.string().min(1),
3485
+ resourceKind: RecentResourceKindSchema,
3486
+ resourceId: z.string().min(1),
3487
+ name: z.string().min(1),
3488
+ description: z.string().optional(),
3489
+ projectId: z.string().min(1),
3490
+ projectName: z.string().min(1),
3491
+ sourcePath: z.string().min(1).optional(),
3492
+ source: RecentResourceSourceSchema,
3493
+ lastOpenedAt: z.string().min(1),
3494
+ lastModifiedAt: z.string().min(1)
3495
+ });
3496
+ z.array(RecentResourceSchema);
3497
+ const isoDateTime = z.string().datetime();
3498
+ const sha256Hex = z.string().regex(/^[a-f0-9]{64}$/, "Expected a lowercase hex sha256 digest");
3499
+ /**
3500
+ * A single entry in a deploy's file tree, as served to the dashboard. Carries
3501
+ * no contents: `id` is a stable, path-derived handle used for selection and
3502
+ * `?file=` deep links; `hash` is the content address used to fetch the bytes
3503
+ * lazily and to cache them immutably in the browser.
3504
+ */
3505
+ const ProjectFileSummarySchema = z.object({
3506
+ id: z.string(),
3507
+ path: z.string().min(1),
3508
+ hash: sha256Hex
3509
+ });
3510
+ /** Maps a runtime resource slug (agent/workflow/skill) to its source file path. */
3511
+ const ProjectSourceResourceRefSchema = z.object({
3512
+ slug: z.string().min(1),
3513
+ path: z.string().min(1)
3514
+ });
3515
+ const ProjectSourceResourcesSchema = z.object({
3516
+ agents: z.array(ProjectSourceResourceRefSchema).default([]),
3517
+ workflows: z.array(ProjectSourceResourceRefSchema).default([]),
3518
+ skills: z.array(ProjectSourceResourceRefSchema).default([])
3519
+ });
3520
+ const emptyResources = () => ({
3521
+ agents: [],
3522
+ workflows: [],
3523
+ skills: []
3524
+ });
3525
+ z.object({
3526
+ artifactId: z.string().nullable(),
3527
+ files: z.array(ProjectFileSummarySchema),
3528
+ resources: ProjectSourceResourcesSchema.default(emptyResources())
3529
+ });
3530
+ z.object({
3531
+ path: z.string().min(1),
3532
+ contents: z.string(),
3533
+ hash: sha256Hex
3534
+ });
3535
+ /** A blob the CLI may need to upload, keyed by content hash. */
3536
+ const SourceBlobRefSchema = z.object({
3537
+ hash: sha256Hex,
3538
+ size: z.number().int().nonnegative()
3539
+ });
3540
+ z.object({ blobs: z.array(SourceBlobRefSchema) });
3541
+ const PresignedBlobUploadSchema = z.object({
3542
+ hash: sha256Hex,
3543
+ url: z.string().url()
3544
+ });
3545
+ z.object({ uploads: z.array(PresignedBlobUploadSchema) });
3546
+ /** A file reference in a manifest upload: where the path's content lives. */
3547
+ const ManifestFileRefSchema = z.object({
3548
+ path: z.string().min(1),
3549
+ hash: sha256Hex
3550
+ });
3551
+ z.object({ files: z.array(ManifestFileRefSchema) });
3552
+ z.object({
3553
+ ok: z.literal(true),
3554
+ fileCount: z.number().int().nonnegative()
3555
+ });
3556
+ /** A file entry as persisted in the stored manifest (path-derived id added). */
3557
+ const StoredManifestFileSchema = z.object({
3558
+ id: z.string(),
3559
+ path: z.string().min(1),
3560
+ hash: sha256Hex
3561
+ });
3562
+ z.object({
3563
+ files: z.array(StoredManifestFileSchema),
3564
+ generatedAt: isoDateTime
3565
+ });
3566
+ /** A single source file returned by the bulk active-source download endpoint. */
3567
+ const DownloadActiveProjectSourceFileSchema = z.object({
3568
+ path: z.string().min(1),
3569
+ contents: z.string()
3570
+ });
3571
+ z.object({
3572
+ artifactId: z.string(),
3573
+ files: z.array(DownloadActiveProjectSourceFileSchema)
3574
+ });
3575
+ z.object({
3576
+ projectId: z.string(),
3577
+ artifactId: z.string(),
3578
+ pulledAt: z.string().datetime()
3579
+ });
3580
+ /** A single memory file exposed to the dashboard (no contents in list responses). */
3581
+ const AgentMemoryFileSummarySchema = z.object({
3582
+ id: z.string(),
3583
+ path: z.string().min(1)
3584
+ });
3585
+ z.object({ files: z.array(AgentMemoryFileSummarySchema) });
3586
+ /** A single workspace file exposed to the dashboard (no contents in list responses). */
3587
+ const AgentWorkspaceFileSummarySchema = z.object({
3588
+ id: z.string(),
3589
+ path: z.string().min(1)
3590
+ });
3591
+ z.object({ files: z.array(AgentWorkspaceFileSummarySchema) });
3592
+ /** Whether the overview is still being produced or finished. */
3593
+ const WorkflowOverviewStatusSchema = z.enum(["generating", "ready"]);
3594
+ /** One phase of the guided-tour overview. */
3595
+ const WorkflowPhaseSchema = z.object({
3596
+ id: z.string(),
3597
+ title: z.string(),
3598
+ copy: z.string(),
3599
+ nodeIds: z.array(z.string())
3600
+ });
3601
+ z.object({
3602
+ status: WorkflowOverviewStatusSchema,
3603
+ summary: z.string(),
3604
+ phases: z.array(WorkflowPhaseSchema),
3605
+ hash: z.string(),
3606
+ generatedAt: z.string().nullable(),
3607
+ model: z.string()
3608
+ });
3609
+ /** Subset of JSON-Schema field types the dashboard form renders inline. */
3610
+ const WorkflowInputFieldTypeSchema = z.enum([
3611
+ "string",
3612
+ "number",
3613
+ "boolean",
3614
+ "enum",
3615
+ "object",
3616
+ "array",
3617
+ "file"
3618
+ ]);
3619
+ const WorkflowInputFieldSchema = z.lazy(() => z.object({
3620
+ key: z.string(),
3621
+ label: z.string(),
3622
+ type: WorkflowInputFieldTypeSchema,
3623
+ required: z.boolean(),
3624
+ description: z.string().optional(),
3625
+ placeholder: z.string().optional(),
3626
+ options: z.array(z.string()).optional(),
3627
+ default: z.union([
3628
+ z.string(),
3629
+ z.number(),
3630
+ z.boolean()
3631
+ ]).optional(),
3632
+ children: z.array(WorkflowInputFieldSchema).optional(),
3633
+ format: z.string().optional()
3634
+ }));
3635
+ /** Flat, render-ready view of a workflow's input schema. */
3636
+ const WorkflowInputSchemaSchema = z.object({ fields: z.array(WorkflowInputFieldSchema) });
3637
+ z.object({
3638
+ schema: WorkflowInputSchemaSchema,
3639
+ values: z.record(z.string(), z.unknown()).nullable()
3640
+ });
3641
+ z.object({ runId: z.string() });
3642
+ /** Annotation lifecycle: "generating" while the LLM pass streams in, then "ready". */
3643
+ const WorkflowCanvasStatusSchema = z.enum(["generating", "ready"]);
3644
+ /** LLM-produced enrichment for a single skeleton node. */
3645
+ const WorkflowCanvasAnnotationSchema = z.object({
3646
+ label: z.string().optional(),
3647
+ description: z.string().optional()
3648
+ });
3649
+ /**
3650
+ * One token of a configured input value (inspector form). Mirrors the producer's
3651
+ * raw token kinds, with display fields filled by the platform join: `reference`
3652
+ * gains a human `sourceLabel`; `variable` may gain a `resolvedValue` when the name
3653
+ * matches a known top-level constant.
3654
+ */
3655
+ const WorkflowNodeValueTokenSchema = z.discriminatedUnion("kind", [
3656
+ z.object({
3657
+ kind: z.literal("text"),
3658
+ text: z.string()
3659
+ }),
3660
+ z.object({
3661
+ kind: z.literal("reference"),
3662
+ sourceNodeId: z.string().optional(),
3663
+ sourceLabel: z.string(),
3664
+ field: z.string().optional()
3665
+ }),
3666
+ z.object({
3667
+ kind: z.literal("variable"),
3668
+ text: z.string(),
3669
+ /** Concrete value when `text` resolves to a top-level literal constant. */
3670
+ resolvedValue: z.string().optional()
3671
+ }),
3672
+ z.object({
3673
+ kind: z.literal("call"),
3674
+ name: z.string()
3675
+ })
3676
+ ]);
3677
+ /** The configured value of one input at this call site. */
3678
+ const WorkflowNodeInputBindingSchema = z.object({
3679
+ tokens: z.array(WorkflowNodeValueTokenSchema),
3680
+ multiline: z.boolean().optional()
3681
+ });
3682
+ /** An inspector input with optional call-site binding. */
3683
+ const WorkflowCanvasNodeInputSchema = WorkflowInputFieldSchema.and(z.object({
3684
+ binding: WorkflowNodeInputBindingSchema.optional(),
3685
+ additional: z.boolean().optional()
3686
+ }));
3687
+ /** Authored, deterministic metadata for a single node. */
3688
+ const WorkflowCanvasNodeMetaSchema = z.object({
3689
+ kind: z.enum([
3690
+ "action",
3691
+ "agent",
3692
+ "workflow",
3693
+ "llm",
3694
+ "trigger",
3695
+ "boundary"
3696
+ ]),
3697
+ slug: z.string(),
3698
+ name: z.string(),
3699
+ description: z.string().optional(),
3700
+ appSlug: z.string().optional(),
3701
+ inputs: z.array(WorkflowCanvasNodeInputSchema),
3702
+ outputs: z.array(WorkflowInputFieldSchema),
3703
+ requiredApps: z.array(z.string()).optional(),
3704
+ model: z.string().optional(),
3705
+ toolCount: z.number().int().nonnegative().optional()
3706
+ });
3707
+ z.object({
3708
+ graph: WorkflowCanvasGraphSchema,
3709
+ nodeMetadata: z.record(z.string(), WorkflowCanvasNodeMetaSchema),
3710
+ annotations: z.record(z.string(), WorkflowCanvasAnnotationSchema),
3711
+ status: WorkflowCanvasStatusSchema,
3712
+ hash: z.string(),
3713
+ generatedAt: z.string().nullable(),
3714
+ model: z.string()
3715
+ });
3716
+ /** Per-node execution state for a single run. */
3717
+ const WorkflowCanvasNodeRunStatusSchema = z.enum([
3718
+ "pending",
3719
+ "running",
3720
+ "succeeded",
3721
+ "failed",
3722
+ "skipped"
3723
+ ]);
3724
+ const WorkflowCanvasNodeRunStateSchema = z.object({
3725
+ status: WorkflowCanvasNodeRunStatusSchema,
3726
+ iteration: z.object({
3727
+ index: z.number().int().nonnegative(),
3728
+ total: z.number().int().nonnegative()
3729
+ }).optional()
3730
+ });
3731
+ /** Overall lifecycle of a run as the canvas animates it. */
3732
+ const WorkflowCanvasRunStatusSchema = z.enum([
3733
+ "running",
3734
+ "succeeded",
3735
+ "failed",
3736
+ "canceled"
3737
+ ]);
3738
+ z.object({
3739
+ runId: z.string(),
3740
+ status: WorkflowCanvasRunStatusSchema,
3741
+ startedAt: z.string(),
3742
+ finishedAt: z.string().nullable(),
3743
+ nodeStates: z.record(z.string(), WorkflowCanvasNodeRunStateSchema)
3744
+ });
3745
+ /** Scope a credential instance lives in. */
3746
+ const WorkflowCredentialScopeSchema = z.enum([
3747
+ "organization",
3748
+ "project",
3749
+ "user"
3750
+ ]);
3751
+ /** The concrete credential instance a binding currently resolves to. */
3752
+ const WorkflowResolvedCredentialSchema = z.object({
3753
+ id: z.string(),
3754
+ name: z.string(),
3755
+ scope: WorkflowCredentialScopeSchema,
3756
+ appSlug: z.string().optional(),
3757
+ isDefault: z.boolean().optional(),
3758
+ projectId: z.string().optional(),
3759
+ projectName: z.string().optional()
3760
+ });
3761
+ z.record(z.string(), WorkflowCanvasAnnotationSchema);
3762
+ /** One opaque code-block the annotation pass should label, keyed by its canvas node id. */
3763
+ const WorkflowCanvasAnnotationCodeBlockSchema = z.object({
3764
+ nodeId: z.string(),
3765
+ /** The raw source snippet (the node's label) the LLM turns into human copy. */
3766
+ source: z.string()
3767
+ });
3768
+ /** Inputs the worker feeds the LLM for the gated code-block annotation pass. */
3769
+ const WorkflowCanvasAnnotationsInputSchema = z.object({
3770
+ workflowName: z.string(),
3771
+ workflowDescription: z.string().nullable(),
3772
+ codeBlocks: z.array(WorkflowCanvasAnnotationCodeBlockSchema)
3773
+ });
3774
+ z.object({
3775
+ workflowId: z.string(),
3776
+ projectId: z.string(),
3777
+ hash: z.string(),
3778
+ model: z.string(),
3779
+ input: WorkflowCanvasAnnotationsInputSchema
3780
+ });
3781
+ /** One node as the overview LLM sees it (derived from the canvas node metadata + graph). */
3782
+ const WorkflowOverviewNodeSchema = z.object({
3783
+ nodeId: z.string(),
3784
+ label: z.string(),
3785
+ kind: z.string(),
3786
+ description: z.string().optional(),
3787
+ /** App/integration slug for steps imported from a `@keystrokehq/<app>` package. */
3788
+ appSlug: z.string().optional(),
3789
+ /** Authored input field keys (from the action/agent/workflow definition). */
3790
+ inputs: z.array(z.string()).optional(),
3791
+ /** Authored output field keys. */
3792
+ outputs: z.array(z.string()).optional(),
3793
+ /** Agent-only: the model the agent runs on. */
3794
+ model: z.string().optional(),
3795
+ /** Agent-only: number of tools available to the agent. */
3796
+ toolCount: z.number().int().nonnegative().optional()
3797
+ });
3798
+ /** Inputs the worker feeds the LLM to produce the workflow overview (summary + phases). */
3799
+ const WorkflowOverviewInputSchema = z.object({
3800
+ workflowName: z.string(),
3801
+ workflowDescription: z.string().nullable(),
3802
+ /** Display labels of the trigger sources upstream of the workflow (read-only context). */
3803
+ triggers: z.array(z.string()),
3804
+ nodes: z.array(WorkflowOverviewNodeSchema),
3805
+ /** The workflow's TypeScript source (best-effort; null when the deploy has no source snapshot). */
3806
+ source: z.string().nullable()
3807
+ });
3808
+ z.object({
3809
+ workflowId: z.string(),
3810
+ projectId: z.string(),
3811
+ hash: z.string(),
3812
+ model: z.string(),
3813
+ input: WorkflowOverviewInputSchema
3814
+ });
3815
+ const WorkflowCanvasCredentialBindingBaseSchema = z.object({
3816
+ credentialKey: z.string(),
3817
+ label: z.string(),
3818
+ appSlug: z.string().optional()
3819
+ });
3820
+ /** How one credential requirement on a step currently resolves. */
3821
+ const WorkflowCanvasCredentialBindingSchema = z.union([
3822
+ WorkflowCanvasCredentialBindingBaseSchema.extend({
3823
+ policy: z.enum([
3824
+ "project-default",
3825
+ "org-default",
3826
+ "assigned"
3827
+ ]),
3828
+ instance: WorkflowResolvedCredentialSchema
3829
+ }),
3830
+ WorkflowCanvasCredentialBindingBaseSchema.extend({
3831
+ policy: z.literal("scope-pinned"),
3832
+ pinnedScope: WorkflowCredentialScopeSchema,
3833
+ instance: WorkflowResolvedCredentialSchema
3834
+ }),
3835
+ WorkflowCanvasCredentialBindingBaseSchema.extend({
3836
+ policy: z.literal("unresolved"),
3837
+ reason: z.enum(["needs-selection", "missing"]),
3838
+ pinnedScope: WorkflowCredentialScopeSchema.optional()
3839
+ })
3840
+ ]);
3841
+ z.record(z.string(), z.array(WorkflowCanvasCredentialBindingSchema));
3842
+ z.record(z.string(), z.unknown());
3843
+ //#endregion
3844
+ export { stripPromptContext as A, mcpContentBlocksToAiSdkParts as C, parseChatAttachmentServePath as D, normalizeCredentialList as E, prependAgentUserContext as O, mcpContentBlocksFromToolOutput as S, modelSupportsMediaType as T, defineTool as _, FilePartSchema as a, isCredentialInput as b, LLM_RUN_KIND_HEADER as c, buildConnectDeeplink as d, chatAttachmentExtension as f, defineCredential as g, credentialInputSchema as h, ExecuteKeystrokeToolErrorResponseSchema as i, toCredentialRequirement as j, requiredDisplayTextSchema as k, LLM_SKIP_USAGE_HEADER as l, credential as m, CREDENTIAL_SCOPE_TYPES as n, LLM_KEY_SOURCE_HEADER as o, chatAttachmentServePath as p, DEFAULT_CLOUD_PLATFORM_ORIGIN as r, LLM_RUN_ID_HEADER as s, CHAT_ATTACHMENT_MAX_BYTES as t, PublicModelsResponseSchema as u, formatMcpToolErrorMessage as v, mcpEntityId as w, isRedundantMcpJsonText as x, hasAgentTimestampContext as y };
3845
+
3846
+ //# sourceMappingURL=dist-D0P3wUQe.mjs.map