@vercel/cli-support 66.6.0 → 68.0.0-snapshot-c9dfd83f2293

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 (404) hide show
  1. package/dist/chunks/add-NIIHCHGH.js +8 -0
  2. package/dist/chunks/add-ORZO4EJ7.js +8 -0
  3. package/dist/chunks/add-SKRNSMC6.js +8 -0
  4. package/dist/chunks/{alerts-72Q42HNT.js → alerts-MNMZH6BO.js} +1 -1
  5. package/dist/chunks/build-P7KKWO4O.js +7 -0
  6. package/dist/chunks/{chunk-ZZD5W5KT.js → chunk-23FY4PR3.js} +1 -1
  7. package/dist/chunks/{chunk-YTRKHRL3.js → chunk-27FVSW45.js} +1 -1
  8. package/dist/chunks/{chunk-IIK6GUVI.js → chunk-2BK7SZQA.js} +1 -1
  9. package/dist/chunks/{chunk-WJX5PGNN.js → chunk-2DH6LTUI.js} +1 -1
  10. package/dist/chunks/{chunk-D2TVI7KK.js → chunk-2HFP22IP.js} +4 -4
  11. package/dist/chunks/{chunk-7AVHDJSP.js → chunk-2KXLL3DX.js} +4 -4
  12. package/dist/chunks/{chunk-YEDS2UMW.js → chunk-2ZN4JRDA.js} +1 -1
  13. package/dist/chunks/{chunk-DJZBJC2A.js → chunk-3AFEVHHY.js} +1 -1
  14. package/dist/chunks/{chunk-FOFX7LHS.js → chunk-3OPLG6HM.js} +1 -1
  15. package/dist/chunks/{chunk-Q66LJNIV.js → chunk-3RFQ2NXZ.js} +1 -1
  16. package/dist/chunks/{chunk-F4UEGELU.js → chunk-3VNS4D7V.js} +1 -1
  17. package/dist/chunks/{chunk-XAGG5BJT.js → chunk-43XDA7ST.js} +1 -1
  18. package/dist/chunks/{chunk-OXS5VO4X.js → chunk-4D5DAM3D.js} +1 -1
  19. package/dist/chunks/chunk-4Z6R5KHZ.js +78 -0
  20. package/dist/chunks/{chunk-5KSBRQI2.js → chunk-5727HGA6.js} +1 -1
  21. package/dist/chunks/{chunk-6GE4V7MW.js → chunk-572VGS6P.js} +2 -2
  22. package/dist/chunks/{chunk-O7GNYVVM.js → chunk-5OGPMRRQ.js} +2 -2
  23. package/dist/chunks/{chunk-UUBPAYTG.js → chunk-5RMIM4S2.js} +1 -1
  24. package/dist/chunks/chunk-67GZ5REA.js +7 -0
  25. package/dist/chunks/{chunk-VHSAI6FS.js → chunk-6FEMU5YF.js} +1 -1
  26. package/dist/chunks/chunk-6JTZZSFH.js +7 -0
  27. package/dist/chunks/{chunk-UDZJCD5W.js → chunk-6KNWKZR4.js} +1 -1
  28. package/dist/chunks/{chunk-ZKNEIE44.js → chunk-6NC2JFUQ.js} +1 -1
  29. package/dist/chunks/{chunk-5O4AXCN7.js → chunk-6OJVCMG5.js} +1 -1
  30. package/dist/chunks/{chunk-X7KKWUPS.js → chunk-6WBEU34Y.js} +1 -1
  31. package/dist/chunks/{chunk-NBTFAXL4.js → chunk-6Z5REGCM.js} +1 -1
  32. package/dist/chunks/{chunk-VPSR2O55.js → chunk-7AAYWDIZ.js} +3 -3
  33. package/dist/chunks/{chunk-WIF4VGYZ.js → chunk-7GJ37QPL.js} +1 -1
  34. package/dist/chunks/chunk-7HQZRU25.js +10 -0
  35. package/dist/chunks/{chunk-XECELSF5.js → chunk-7JU5RJ3H.js} +1 -1
  36. package/dist/chunks/{chunk-KSGN5OCV.js → chunk-7K5ZWVDL.js} +1 -1
  37. package/dist/chunks/{chunk-UQZZX2J7.js → chunk-7OZ7OKPS.js} +1 -1
  38. package/dist/chunks/{chunk-PFOOPXTN.js → chunk-7RABG6HV.js} +2 -2
  39. package/dist/chunks/{chunk-AMH5MXDW.js → chunk-7WDSOKOY.js} +1 -1
  40. package/dist/chunks/{chunk-ELM2KPYX.js → chunk-A4LOQ3UK.js} +1 -1
  41. package/dist/chunks/{chunk-SYJXONEV.js → chunk-A6CMQOL7.js} +1 -1
  42. package/dist/chunks/chunk-AOPFMMUK.js +13 -0
  43. package/dist/chunks/{chunk-2OMI3IUW.js → chunk-AVXX4Q6S.js} +1 -1
  44. package/dist/chunks/{chunk-YEUIG3JC.js → chunk-AZVSMIPP.js} +1 -1
  45. package/dist/chunks/{chunk-XLYO5QNG.js → chunk-B7IUFV5P.js} +2 -2
  46. package/dist/chunks/{chunk-IF6GA273.js → chunk-BGIGZUFG.js} +1 -1
  47. package/dist/chunks/{chunk-YLLFLPNA.js → chunk-BHL2HM6I.js} +1 -1
  48. package/dist/chunks/{chunk-YIOMTAUF.js → chunk-BKFRN6C2.js} +1 -1
  49. package/dist/chunks/chunk-BS32OUOC.js +7 -0
  50. package/dist/chunks/{chunk-YJNMDXEG.js → chunk-BUBVZ6SQ.js} +1 -1
  51. package/dist/chunks/{chunk-VZ4URN3U.js → chunk-BYBELFCP.js} +1 -1
  52. package/dist/chunks/{chunk-B7GCRM5I.js → chunk-BYYNR34Q.js} +1 -1
  53. package/dist/chunks/{chunk-5TMHRECT.js → chunk-CAJ2OUSR.js} +1 -1
  54. package/dist/chunks/chunk-CDJ25IKC.js +7 -0
  55. package/dist/chunks/chunk-CJMNUD2I.js +12 -0
  56. package/dist/chunks/chunk-CSNP5RIM.js +11 -0
  57. package/dist/chunks/{chunk-REJLEESP.js → chunk-CTMTO2W4.js} +1 -1
  58. package/dist/chunks/{chunk-K3MGQQEP.js → chunk-D5JQZXL7.js} +1 -1
  59. package/dist/chunks/{chunk-6PDKIOAO.js → chunk-DEFA6XAB.js} +1 -1
  60. package/dist/chunks/{chunk-OE26EQSH.js → chunk-DEX4QU4S.js} +1 -1
  61. package/dist/chunks/{chunk-W2L24GM7.js → chunk-DMA77UYG.js} +1 -1
  62. package/dist/chunks/{chunk-LM3YPF3K.js → chunk-DOOBZO4W.js} +1 -1
  63. package/dist/chunks/chunk-DORCX7UB.js +7 -0
  64. package/dist/chunks/{chunk-C335SWOB.js → chunk-DUSMVY4N.js} +1 -1
  65. package/dist/chunks/{chunk-XDYVJWGX.js → chunk-E5A7E7X6.js} +1 -1
  66. package/dist/chunks/{chunk-GLCSWIB4.js → chunk-E7IN2DGU.js} +1 -1
  67. package/dist/chunks/chunk-EYRBV6RM.js +25 -0
  68. package/dist/chunks/{chunk-AKOYIH3A.js → chunk-F4KY2TOK.js} +1 -1
  69. package/dist/chunks/{chunk-DZ77BIEV.js → chunk-F4ZKTFQH.js} +1 -1
  70. package/dist/chunks/chunk-F7X6O4ZC.js +7 -0
  71. package/dist/chunks/{chunk-TSNRTRIM.js → chunk-FB37TFVF.js} +1 -1
  72. package/dist/chunks/{chunk-BCAI7MED.js → chunk-FGWYM3SF.js} +1 -1
  73. package/dist/chunks/{chunk-SYVWRGFQ.js → chunk-FGXULLNK.js} +1 -1
  74. package/dist/chunks/{chunk-T7GKQYWA.js → chunk-FXLZM6Q7.js} +1 -1
  75. package/dist/chunks/{chunk-JBYROCAC.js → chunk-FYM5EUNW.js} +1 -1
  76. package/dist/chunks/{chunk-RVIJRFVD.js → chunk-G24EKATW.js} +1 -1
  77. package/dist/chunks/chunk-GQXKF3PR.js +7 -0
  78. package/dist/chunks/{chunk-2G2SALNN.js → chunk-H2QMSLKJ.js} +1 -1
  79. package/dist/chunks/{chunk-33HVDSWP.js → chunk-HMJR6RVF.js} +1 -1
  80. package/dist/chunks/{chunk-S4AANAHX.js → chunk-HQ3ZFXXQ.js} +1 -1
  81. package/dist/chunks/chunk-HYGWJQN6.js +8 -0
  82. package/dist/chunks/chunk-I4O53MKV.js +8 -0
  83. package/dist/chunks/{chunk-TOTTVS5P.js → chunk-ID663OJ7.js} +1 -1
  84. package/dist/chunks/{chunk-FFN3EGSF.js → chunk-IKNAOU5O.js} +1 -1
  85. package/dist/chunks/{chunk-CINNNQDJ.js → chunk-INIZJZ3O.js} +1 -1
  86. package/dist/chunks/{chunk-LNZEYUEC.js → chunk-IVZNPSHU.js} +1 -1
  87. package/dist/chunks/{chunk-YOAQNRBN.js → chunk-IY7OKDHU.js} +3 -3
  88. package/dist/chunks/{chunk-2D5PTFAY.js → chunk-J7POLUHY.js} +1 -1
  89. package/dist/chunks/{chunk-6CJFPT4F.js → chunk-JDDPCL3K.js} +1 -1
  90. package/dist/chunks/chunk-JR25PLC7.js +13 -0
  91. package/dist/chunks/chunk-JV3YIOCO.js +7 -0
  92. package/dist/chunks/{chunk-RBW62SOU.js → chunk-JXE7GYE3.js} +1 -1
  93. package/dist/chunks/{chunk-EFP3LK4G.js → chunk-K5SM5NIY.js} +1 -1
  94. package/dist/chunks/chunk-K6KS5GZD.js +16 -0
  95. package/dist/chunks/chunk-K7TSWIKR.js +12 -0
  96. package/dist/chunks/{chunk-FEJD7MRH.js → chunk-KA2KG3SY.js} +1 -1
  97. package/dist/chunks/{chunk-GUGP6OY2.js → chunk-KFBA2MAV.js} +1 -1
  98. package/dist/chunks/{table-W6LOHWWF.js → chunk-KG526MHL.js} +1 -1
  99. package/dist/chunks/chunk-KHMNANEN.js +7 -0
  100. package/dist/chunks/chunk-KVXEYKIX.js +7 -0
  101. package/dist/chunks/{chunk-F37XFLFP.js → chunk-L3YEI2RW.js} +1 -1
  102. package/dist/chunks/{chunk-54FY6GJ5.js → chunk-L46V6VL3.js} +1 -1
  103. package/dist/chunks/chunk-LD25KYMI.js +30 -0
  104. package/dist/chunks/{chunk-ANIA2G6F.js → chunk-LDDXXDN5.js} +1 -1
  105. package/dist/chunks/{chunk-M7FED5YP.js → chunk-M2Q2DUHO.js} +1 -1
  106. package/dist/chunks/{chunk-5ZCSFPWG.js → chunk-MDRI27KN.js} +1 -1
  107. package/dist/chunks/{chunk-2AU6O6Z5.js → chunk-MJ77FDK2.js} +1 -1
  108. package/dist/chunks/{chunk-GHNHUSVK.js → chunk-MMMJO2M3.js} +1 -1
  109. package/dist/chunks/chunk-N4PID4SD.js +7 -0
  110. package/dist/chunks/chunk-N6MNUNZ4.js +37 -0
  111. package/dist/chunks/chunk-NMY2YZ6M.js +8 -0
  112. package/dist/chunks/{chunk-QRG24GJG.js → chunk-NOAZDAOU.js} +1 -1
  113. package/dist/chunks/{chunk-ZJNDLFZ7.js → chunk-OOPF73RV.js} +1 -1
  114. package/dist/chunks/{chunk-YRKW42CD.js → chunk-OQXHBPPS.js} +1 -1
  115. package/dist/chunks/{chunk-SQCVI2EG.js → chunk-OVWS4CFW.js} +1 -1
  116. package/dist/chunks/{chunk-WAFBTC45.js → chunk-PHPJS2G2.js} +1 -1
  117. package/dist/chunks/{chunk-TNQUCTJH.js → chunk-PPCZYUSO.js} +1 -1
  118. package/dist/chunks/chunk-PZL7NSDA.js +24 -0
  119. package/dist/chunks/{chunk-OISNKAC6.js → chunk-Q45SQL44.js} +2 -2
  120. package/dist/chunks/{chunk-XDWAUOFO.js → chunk-Q4XCBBWK.js} +1 -1
  121. package/dist/chunks/chunk-Q7HFUXJ4.js +10 -0
  122. package/dist/chunks/chunk-QFE3RPMA.js +19 -0
  123. package/dist/chunks/{chunk-L5PIUIUM.js → chunk-QFSIUMC6.js} +1 -1
  124. package/dist/chunks/{chunk-CSCUVSJM.js → chunk-QG5UBKDA.js} +1 -1
  125. package/dist/chunks/{chunk-KLYFOXYH.js → chunk-QGS3ERDZ.js} +3 -3
  126. package/dist/chunks/{chunk-3UZE566G.js → chunk-QSL6AG2B.js} +1 -1
  127. package/dist/chunks/chunk-QU74BFN2.js +10 -0
  128. package/dist/chunks/{chunk-ACN6DBTC.js → chunk-R3QHEJL6.js} +1 -1
  129. package/dist/chunks/{chunk-BDXK4TCN.js → chunk-RHFNVIFD.js} +1 -1
  130. package/dist/chunks/chunk-RPYIWRSN.js +7 -0
  131. package/dist/chunks/{chunk-AP6DZGTK.js → chunk-RYSO5U3E.js} +1 -1
  132. package/dist/chunks/{chunk-N6JHFCWC.js → chunk-S7Y24A5X.js} +1 -1
  133. package/dist/chunks/chunk-SGNDE4YS.js +7 -0
  134. package/dist/chunks/{chunk-OF32Z3UP.js → chunk-SHJ3XTD3.js} +1 -1
  135. package/dist/chunks/{chunk-R33HJGYA.js → chunk-SHL6BPBV.js} +1 -1
  136. package/dist/chunks/{chunk-GLIQ4KNY.js → chunk-SQ62IODX.js} +1 -1
  137. package/dist/chunks/{chunk-PIDEH4SJ.js → chunk-T44RB754.js} +1 -1
  138. package/dist/chunks/{chunk-DHKWTBF6.js → chunk-T4DOV5S4.js} +1 -1
  139. package/dist/chunks/chunk-T5JHWXS5.js +8 -0
  140. package/dist/chunks/{chunk-TJUZVODP.js → chunk-TLKBGAOL.js} +1 -1
  141. package/dist/chunks/{chunk-ZA5O22ZY.js → chunk-TOCPUQ6N.js} +1 -1
  142. package/dist/chunks/{chunk-CJZE7647.js → chunk-U5SZQUYO.js} +1 -1
  143. package/dist/chunks/chunk-UAS3WUFB.js +11 -0
  144. package/dist/chunks/chunk-VIOIR6II.js +7 -0
  145. package/dist/chunks/{chunk-3A3GU62R.js → chunk-VMRFCU6F.js} +1 -1
  146. package/dist/chunks/{chunk-Y77DXGGN.js → chunk-VQZ773A2.js} +1 -1
  147. package/dist/chunks/chunk-VWKA6RKB.js +7 -0
  148. package/dist/chunks/{chunk-FCTTEFC5.js → chunk-WAOS5OCB.js} +1 -1
  149. package/dist/chunks/chunk-WBEPIG4S.js +31 -0
  150. package/dist/chunks/{chunk-AFHZC47H.js → chunk-WBXM3W44.js} +1 -1
  151. package/dist/chunks/{chunk-MINTHN6C.js → chunk-WEL2Y6OH.js} +1 -1
  152. package/dist/chunks/{chunk-RDDIWY3O.js → chunk-WGU2IQPY.js} +3 -3
  153. package/dist/chunks/{chunk-DOMBKOLJ.js → chunk-WLD4SGKM.js} +1 -1
  154. package/dist/chunks/{chunk-6FYPSSL4.js → chunk-X6JQI64G.js} +1 -1
  155. package/dist/chunks/{chunk-L75A5BMY.js → chunk-X755TPX6.js} +1 -1
  156. package/dist/chunks/{chunk-QZKRVE44.js → chunk-XQZBXQZ2.js} +1 -1
  157. package/dist/chunks/{chunk-AB4WXRCO.js → chunk-Y3V4JYK6.js} +1 -1
  158. package/dist/chunks/{chunk-LKW6GVP2.js → chunk-Y4YBQUQM.js} +1 -1
  159. package/dist/chunks/{chunk-I5KIA2XV.js → chunk-YBAGKQXC.js} +1 -1
  160. package/dist/chunks/{chunk-3OZCZF4N.js → chunk-YFOBGEOW.js} +1 -1
  161. package/dist/chunks/{chunk-E4VPDMRQ.js → chunk-YJJCELMY.js} +1 -1
  162. package/dist/chunks/chunk-YLXXGQQQ.js +7 -0
  163. package/dist/chunks/{chunk-BMIYC2MH.js → chunk-YN3HZJXW.js} +1 -1
  164. package/dist/chunks/chunk-YNMTP26U.js +7 -0
  165. package/dist/chunks/chunk-YTSGFU5T.js +7 -0
  166. package/dist/chunks/{chunk-Z2PTPD6J.js → chunk-YTSUDTAK.js} +1 -1
  167. package/dist/chunks/{chunk-QZJOKECY.js → chunk-YYDI5Q5K.js} +2 -2
  168. package/dist/chunks/{chunk-DOBV3XLO.js → chunk-Z3YQZSU4.js} +1 -1
  169. package/dist/chunks/chunk-Z643WTC4.js +15 -0
  170. package/dist/chunks/{chunk-D2E4COIY.js → chunk-ZBZQEDZY.js} +1 -1
  171. package/dist/chunks/chunk-ZRFDZO7Y.js +7 -0
  172. package/dist/chunks/chunk-ZSEFELXB.js +23 -0
  173. package/dist/chunks/{chunk-UECFEOOH.js → chunk-ZXSZH7N5.js} +1 -1
  174. package/dist/chunks/clear-B3I7ZYEY.js +8 -0
  175. package/dist/chunks/cli-embedded-NR5F35LW.js +87 -0
  176. package/dist/chunks/compile-vercel-config-ZQMPTEM6.js +7 -0
  177. package/dist/chunks/config-4GZY5MR4.js +7 -0
  178. package/dist/chunks/config-ZY22VRFX.js +8 -0
  179. package/dist/chunks/config-validator.mjs +1 -1
  180. package/dist/chunks/{connect-git-provider-CIRRFPI2.js → connect-git-provider-WGKVFXW2.js} +1 -1
  181. package/dist/chunks/create-project-BTOHPKZB.js +7 -0
  182. package/dist/chunks/delete-K2HS7YCM.js +10 -0
  183. package/dist/chunks/delete-RVTGE4BU.js +9 -0
  184. package/dist/chunks/describe-5ZCOXUID.js +25 -0
  185. package/dist/chunks/detect-projects-AZXG6BRD.js +7 -0
  186. package/dist/chunks/detect-services-FLNYWWJS.js +7 -0
  187. package/dist/chunks/disable-AS6DQMHM.js +7 -0
  188. package/dist/chunks/discard-PYU5CG67.js +14 -0
  189. package/dist/chunks/edit-HSMIPVPN.js +9 -0
  190. package/dist/chunks/edit-RLRJSNZY.js +8 -0
  191. package/dist/chunks/enable-JPWR5EPC.js +7 -0
  192. package/dist/chunks/{engine-D8YAsQS_-WNPHYRQF.js → engine-C8wCzkw--PYVABGU4.js} +1 -1
  193. package/dist/chunks/esm-5GQXHN7C.js +9 -0
  194. package/dist/chunks/esm-FJCIOBBV.js +7 -0
  195. package/dist/chunks/{esm-FSME24KA.js → esm-IYH32MTQ.js} +1 -1
  196. package/dist/chunks/esm-LEQXRLFV.js +9 -0
  197. package/dist/chunks/esm-NHCCFW7Z.js +7 -0
  198. package/dist/chunks/esm-QQ3MUOW4.js +7 -0
  199. package/dist/chunks/esm-T655CG6O.js +7 -0
  200. package/dist/chunks/{exec-ALB7WFEF.js → exec-PCSP64LR.js} +1 -1
  201. package/dist/chunks/{export-TOSUN6JO.js → export-6WFWSAO4.js} +2 -3
  202. package/dist/chunks/future-QLQMHIPL.js +7 -0
  203. package/dist/chunks/generate-cert-for-deploy-JKVOVQ3B.js +7 -0
  204. package/dist/chunks/image-POIJ2G2Y.js +7 -0
  205. package/dist/chunks/import-builders-YF5MX6ZA.js +7 -0
  206. package/dist/chunks/{inspect-SX3QQUEQ.js → inspect-4CURZZPU.js} +1 -1
  207. package/dist/chunks/{inspect-DFYVVIJW.js → inspect-BAYMK22S.js} +1 -1
  208. package/dist/chunks/inspect-JTBMNWWI.js +13 -0
  209. package/dist/chunks/{inspect-GBH7FAW6.js → inspect-TBQRBTX3.js} +1 -1
  210. package/dist/chunks/inspect-W4WSFBOF.js +9 -0
  211. package/dist/chunks/{inspect-4Y2OD5MI.js → inspect-YKSWSH3T.js} +1 -1
  212. package/dist/chunks/{list-HD6KXAIG.js → list-E65OFWSS.js} +1 -1
  213. package/dist/chunks/list-EWYN3F4Y.js +12 -0
  214. package/dist/chunks/{list-MW2FV253.js → list-ZHES2WYK.js} +1 -1
  215. package/dist/chunks/{list-4RRL326Z.js → list-ZWJDFJNY.js} +1 -1
  216. package/dist/chunks/login-JAKNSTW3.js +9 -0
  217. package/dist/chunks/login-JRGX6HGZ.js +7 -0
  218. package/dist/chunks/logs-3DPLX3CB.js +7 -0
  219. package/dist/chunks/{ls-VFE7PE25.js → ls-5YLM3ICH.js} +1 -1
  220. package/dist/chunks/ls-6HPMZVYA.js +11 -0
  221. package/dist/chunks/{ls-RKOM46KV.js → ls-FWOTN6V6.js} +1 -1
  222. package/dist/chunks/{ls-I767MTW4.js → ls-MW3WIHH5.js} +1 -1
  223. package/dist/chunks/{ls-Q4WGEEBZ.js → ls-RAVFLQTQ.js} +1 -1
  224. package/dist/chunks/ls-SY2FW3WA.js +8 -0
  225. package/dist/chunks/{ls-TLEAYYXQ.js → ls-ZX5FNEK2.js} +1 -1
  226. package/dist/chunks/migrate-experimental-services-XYUCY2G6.js +7 -0
  227. package/dist/chunks/mutate-4KTZMM3X.js +9 -0
  228. package/dist/chunks/{native-self-update-JDTL3IBF.js → native-self-update-Q3EN6NZK.js} +1 -1
  229. package/dist/chunks/notifications-LBZ7KWGS.js +7 -0
  230. package/dist/chunks/open-PXLVSFII.js +7 -0
  231. package/dist/chunks/{openapi-NEYEIRF2.js → openapi-6RKKA6JG.js} +1 -1
  232. package/dist/chunks/permissions-DQ5AF6XL.js +7 -0
  233. package/dist/chunks/{plugin-offer-NPJAEILN.js → plugin-offer-VU3R572E.js} +1 -1
  234. package/dist/chunks/prompt-missing-credentials-AJH3HM36.js +7 -0
  235. package/dist/chunks/publish-QJJL3IHG.js +15 -0
  236. package/dist/chunks/pull-3PQHXMPB.js +7 -0
  237. package/dist/chunks/purchase-domain-if-available-IFCQ4QFP.js +7 -0
  238. package/dist/chunks/push-4VIQFKP3.js +7 -0
  239. package/dist/chunks/query-BQ4HYVQ7.js +7 -0
  240. package/dist/chunks/raw-query-VA6VVMR4.js +8 -0
  241. package/dist/chunks/reauthenticate-2SMCQQHF.js +7 -0
  242. package/dist/chunks/{remove-IEEZGRB2.js → remove-CSIMGLLS.js} +1 -1
  243. package/dist/chunks/reorder-ERRB7OJL.js +10 -0
  244. package/dist/chunks/reply-XCBWXFWS.js +9 -0
  245. package/dist/chunks/repo-root-DZ6WFHMP.js +7 -0
  246. package/dist/chunks/resolve-VWGZ632M.js +12 -0
  247. package/dist/chunks/resolve-agent-team-NWELD5FN.js +7 -0
  248. package/dist/chunks/{resolve-deployment-framework-preset-4TKUU6AH.js → resolve-deployment-framework-preset-BLMQLCIN.js} +1 -1
  249. package/dist/chunks/restore-SXZUZGZE.js +16 -0
  250. package/dist/chunks/rm-5TRC5YND.js +8 -0
  251. package/dist/chunks/rm-IQ33QTQ2.js +8 -0
  252. package/dist/chunks/rm-KURYLLD6.js +8 -0
  253. package/dist/chunks/rm-WCE3ISB2.js +8 -0
  254. package/dist/chunks/rm-XMWM76JA.js +8 -0
  255. package/dist/chunks/routes-SBMN6SDF.js +7 -0
  256. package/dist/chunks/rule-inspect-USW6K7Y7.js +8 -0
  257. package/dist/chunks/schema-2G5VJ7EY.js +14 -0
  258. package/dist/chunks/{schema-L5VCG6FJ.js → schema-LRRKG2KJ.js} +1 -1
  259. package/dist/chunks/select-org-JG6GRWTS.js +7 -0
  260. package/dist/chunks/{serving-aOQsBok0-OL36TMZU.js → serving-C1mhZQqH-73TMEGEB.js} +1 -1
  261. package/dist/chunks/set-4JTH62JO.js +7 -0
  262. package/dist/chunks/{set-6U4QIX7A.js → set-BS5KCRE4.js} +1 -1
  263. package/dist/chunks/setup-and-link-GY4O7UJP.js +7 -0
  264. package/dist/chunks/{skills-ZMFZGPQL.js → skills-SUGA6D3G.js} +4 -19
  265. package/dist/chunks/table-SCLK33K7.js +7 -0
  266. package/dist/chunks/tags-B7MKMQKJ.js +7 -0
  267. package/dist/chunks/{types-CVLZCTL2.js → types-YFDB4QZA.js} +1 -1
  268. package/dist/chunks/{update-A727QN7H.js → update-LWRCCEXG.js} +1 -1
  269. package/dist/chunks/usage-HABW5VJ7.js +15 -0
  270. package/dist/chunks/validate-config-LDOYJ4LL.js +7 -0
  271. package/dist/commands/build/index.js +1 -1
  272. package/dist/commands/deploy/index.js +28 -25
  273. package/dist/commands/dev/index.js +7 -7
  274. package/dist/commands/env/index.js +12 -11
  275. package/dist/commands/link/index.js +3 -3
  276. package/dist/commands/list/index.js +1 -1
  277. package/dist/commands/project/index.js +4 -4
  278. package/dist/commands/tunnel/index.js +1 -1
  279. package/dist/commands-account.js +18 -12
  280. package/dist/commands-ai.js +18 -11
  281. package/dist/commands-blob.js +6 -6
  282. package/dist/commands-core.js +34 -48
  283. package/dist/commands-deployments.js +12 -11
  284. package/dist/commands-flags.js +27 -22
  285. package/dist/commands-integrations.js +7 -10
  286. package/dist/commands-observability.js +38 -28
  287. package/dist/commands-routing.js +6 -7
  288. package/dist/help.js +1 -1
  289. package/dist/index.js +6 -6
  290. package/dist/internal-build-worker.js +1 -1
  291. package/dist/internal-build.js +1 -1
  292. package/dist/package.json +43 -43
  293. package/dist/version.mjs +1 -1
  294. package/package.json +44 -44
  295. package/dist/chunks/add-563RV6JX.js +0 -8
  296. package/dist/chunks/add-HRB6XY33.js +0 -8
  297. package/dist/chunks/add-IUTGTBA4.js +0 -8
  298. package/dist/chunks/build-OMIYCGMR.js +0 -7
  299. package/dist/chunks/chunk-2GBU6ULJ.js +0 -7
  300. package/dist/chunks/chunk-2RRZCRWX.js +0 -7
  301. package/dist/chunks/chunk-4SS6W6JK.js +0 -11
  302. package/dist/chunks/chunk-5J4E2W4F.js +0 -12
  303. package/dist/chunks/chunk-76DSBD4X.js +0 -7
  304. package/dist/chunks/chunk-7W565DJB.js +0 -8
  305. package/dist/chunks/chunk-AIXEVICT.js +0 -37
  306. package/dist/chunks/chunk-AM46JVVN.js +0 -7
  307. package/dist/chunks/chunk-BULSRTQE.js +0 -7
  308. package/dist/chunks/chunk-C35SG42R.js +0 -7
  309. package/dist/chunks/chunk-CFJBDBYH.js +0 -7
  310. package/dist/chunks/chunk-DDPH26ZO.js +0 -7
  311. package/dist/chunks/chunk-EAQAV7UZ.js +0 -8
  312. package/dist/chunks/chunk-EFFJUYYS.js +0 -31
  313. package/dist/chunks/chunk-GOI2VVI7.js +0 -19
  314. package/dist/chunks/chunk-GYUNOFDD.js +0 -10
  315. package/dist/chunks/chunk-H2KNSYPR.js +0 -16
  316. package/dist/chunks/chunk-KDCODXVL.js +0 -25
  317. package/dist/chunks/chunk-KMTHGHJV.js +0 -8
  318. package/dist/chunks/chunk-KQ6X77WP.js +0 -7
  319. package/dist/chunks/chunk-KRP4EMD2.js +0 -10
  320. package/dist/chunks/chunk-NLK7NGVP.js +0 -7
  321. package/dist/chunks/chunk-OCR5CRTH.js +0 -10
  322. package/dist/chunks/chunk-PKR32I2N.js +0 -30
  323. package/dist/chunks/chunk-QGHAD5A5.js +0 -12
  324. package/dist/chunks/chunk-SPVOJ3HW.js +0 -7
  325. package/dist/chunks/chunk-SXW2G4WD.js +0 -10
  326. package/dist/chunks/chunk-TC4E2TFA.js +0 -8
  327. package/dist/chunks/chunk-TUB3APDV.js +0 -7
  328. package/dist/chunks/chunk-UG3FZ5Q7.js +0 -7
  329. package/dist/chunks/chunk-VF7XWPXA.js +0 -7
  330. package/dist/chunks/chunk-VKVH7LHB.js +0 -7
  331. package/dist/chunks/chunk-VUUU4KDL.js +0 -7
  332. package/dist/chunks/chunk-W3ZH27MN.js +0 -13
  333. package/dist/chunks/chunk-X47GV5HM.js +0 -15
  334. package/dist/chunks/chunk-XBHAU2M3.js +0 -9
  335. package/dist/chunks/chunk-XR2J7PQN.js +0 -12
  336. package/dist/chunks/chunk-YI7NKOCU.js +0 -23
  337. package/dist/chunks/chunk-Z2KANBOU.js +0 -69
  338. package/dist/chunks/chunk-Z7WZVEPP.js +0 -7
  339. package/dist/chunks/clear-TH6G33QK.js +0 -8
  340. package/dist/chunks/cli-embedded-FD3CAPRY.js +0 -84
  341. package/dist/chunks/compile-vercel-config-24IXPM4W.js +0 -7
  342. package/dist/chunks/config-2SBML7OY.js +0 -8
  343. package/dist/chunks/config-BCKJNJPS.js +0 -7
  344. package/dist/chunks/create-project-I7UXVWIR.js +0 -7
  345. package/dist/chunks/delete-RGHXL4JH.js +0 -9
  346. package/dist/chunks/delete-ZV4SHUTR.js +0 -10
  347. package/dist/chunks/describe-442UUQIF.js +0 -25
  348. package/dist/chunks/detect-projects-NBZSMQ5C.js +0 -7
  349. package/dist/chunks/detect-services-CRZW6FKM.js +0 -7
  350. package/dist/chunks/disable-MYGA6HVS.js +0 -7
  351. package/dist/chunks/discard-I5TKYCDJ.js +0 -14
  352. package/dist/chunks/edit-KGCUTTOZ.js +0 -8
  353. package/dist/chunks/edit-ZRNGGRVL.js +0 -9
  354. package/dist/chunks/enable-NODSFDKF.js +0 -7
  355. package/dist/chunks/esm-CF5UHWPM.js +0 -7
  356. package/dist/chunks/esm-EYOXGOVF.js +0 -7
  357. package/dist/chunks/esm-IUATPKKB.js +0 -9
  358. package/dist/chunks/esm-L6OKDFWP.js +0 -7
  359. package/dist/chunks/esm-ORQC2ZSA.js +0 -7
  360. package/dist/chunks/esm-PYIZNQIK.js +0 -9
  361. package/dist/chunks/future-RXI2OW2C.js +0 -7
  362. package/dist/chunks/generate-cert-for-deploy-7BX47IPD.js +0 -7
  363. package/dist/chunks/image-6A2EJP4N.js +0 -7
  364. package/dist/chunks/import-builders-I4JB6BA6.js +0 -7
  365. package/dist/chunks/inspect-STKCC3MC.js +0 -9
  366. package/dist/chunks/inspect-VFUV7BDM.js +0 -13
  367. package/dist/chunks/list-6ENV2ZGG.js +0 -12
  368. package/dist/chunks/login-O6NLJ42W.js +0 -7
  369. package/dist/chunks/login-U5VDJURN.js +0 -9
  370. package/dist/chunks/logs-X3KGHA3J.js +0 -7
  371. package/dist/chunks/ls-HRSD6VNW.js +0 -8
  372. package/dist/chunks/ls-OLJMGFTV.js +0 -11
  373. package/dist/chunks/migrate-experimental-services-7ZYHE5WA.js +0 -7
  374. package/dist/chunks/mutate-BJXJON5E.js +0 -9
  375. package/dist/chunks/notifications-F3NRNUHQ.js +0 -7
  376. package/dist/chunks/open-JK42ZTLB.js +0 -7
  377. package/dist/chunks/permissions-3AQO3DCH.js +0 -7
  378. package/dist/chunks/prompt-missing-credentials-AHAH27TZ.js +0 -7
  379. package/dist/chunks/publish-7SCXBVZR.js +0 -15
  380. package/dist/chunks/pull-LAPD5XJG.js +0 -7
  381. package/dist/chunks/purchase-domain-if-available-7MI52MFD.js +0 -7
  382. package/dist/chunks/push-BCSGQBAM.js +0 -7
  383. package/dist/chunks/query-U72BDMAK.js +0 -7
  384. package/dist/chunks/raw-query-4UAW7M5Q.js +0 -8
  385. package/dist/chunks/reauthenticate-HGOLSK2M.js +0 -7
  386. package/dist/chunks/reorder-YL6L6IWC.js +0 -10
  387. package/dist/chunks/reply-7Y5TN5UV.js +0 -9
  388. package/dist/chunks/resolve-C62436YM.js +0 -12
  389. package/dist/chunks/resolve-agent-team-SR3ALPCH.js +0 -7
  390. package/dist/chunks/restore-Z63JM5CN.js +0 -16
  391. package/dist/chunks/rm-C6QSHEA2.js +0 -8
  392. package/dist/chunks/rm-DDKE62T7.js +0 -8
  393. package/dist/chunks/rm-IUB55CCM.js +0 -8
  394. package/dist/chunks/rm-NZX43GMQ.js +0 -8
  395. package/dist/chunks/rm-UBUI7JNY.js +0 -8
  396. package/dist/chunks/routes-TME3VYIF.js +0 -7
  397. package/dist/chunks/rule-inspect-KF4BLH4K.js +0 -8
  398. package/dist/chunks/schema-P7DFLXCG.js +0 -14
  399. package/dist/chunks/select-org-MBBMOUK2.js +0 -7
  400. package/dist/chunks/set-SCKMJ7LZ.js +0 -7
  401. package/dist/chunks/setup-and-link-5TPDTJIN.js +0 -7
  402. package/dist/chunks/tags-7M2EW6LU.js +0 -7
  403. package/dist/chunks/usage-HT5JXVAA.js +0 -13
  404. package/dist/chunks/validate-config-Q77XESW5.js +0 -7
@@ -1,8 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{ZodError,external_exports}from"./chunk-2AMO2VMV.js";function fileSize(bytes){return bytes<1024?`${bytes} B`:bytes<1048576?`${Math.round(bytes/1024)} KB`:`${(bytes/1024/1024).toFixed(1)} MB`}var TYPES={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".mp4":"video/mp4",".webm":"video/webm",".mov":"video/quicktime",".pdf":"application/pdf",".txt":"text/plain",".log":"text/plain",".md":"text/markdown",".json":"application/json",".csv":"text/csv",".html":"text/html",".zip":"application/zip"};function typeOf(name){let dot=name.lastIndexOf(".");return dot>0&&TYPES[name.slice(dot).toLowerCase()]||"application/octet-stream"}function fileName(name){return(name??"").split(/[\\/]/).pop().replace(/[\u0000-\u001f\u007f]/g,"").trim().slice(0,255)||"file"}var INVISIBLE=/[\p{Cf}\u2028\u2029]/u;function fileNameProblem(name){if(name.startsWith("."))return`attachment names can't start with a dot: ${JSON.stringify(name)}`;if(INVISIBLE.test(name))return`attachment names can't hold invisible formatting characters: ${JSON.stringify(name)}`}function importedFileName(name){return fileName(fileName(name).replace(new RegExp(INVISIBLE.source,"gu"),"").replace(/^[.\s]+/,""))}function mediaType(type){let value=(type??"").split(";")[0].trim().toLowerCase();return/^[a-z0-9][a-z0-9!#$&^_.+-]*\/[a-z0-9][a-z0-9!#$&^_.+-]*$/.test(value)&&value.length<=255?value:"application/octet-stream"}var InvalidProfileHeader=class extends Error{},TOKEN_START=/[A-Za-z*]/,TCHAR=/[!#$%&'*+\-.^_`|~0-9A-Za-z:/]/,KEY_START=/[a-z*]/,KEY_CHAR=/[a-z0-9_\-.*]/,OTHER_ITEM=/^(?:-?\d{1,15}|-?\d{1,12}\.\d{1,3}|\?[01]|:[A-Za-z0-9+/=]*:)$/;function sfString(value){if(!/^[\x20-\x7e]*$/.test(value))throw new InvalidProfileHeader("an avatar URL is printable ASCII: percent-encode the rest");return`"${value.replace(/[\\"]/g,char=>`\\${char}`)}"`}function formatProfileHeader(profile){if(!profile.avatar)return profile.name;let avatar=/^[\x20-\x7e]*$/.test(profile.avatar)?profile.avatar:URL.parse(profile.avatar)?.href??profile.avatar;return`${profile.name};avatar=${sfString(avatar)}`}function parseProfileHeader(value){let at=0,fail=why=>{throw new InvalidProfileHeader(`x-board-profile is a structured header, like fixer;avatar="https://example.com/fixer.png": ${why}`)},spaces=()=>{for(;value[at]===" ";)at++},string=()=>{at++;let out="";for(;at<value.length;){let char=value[at++];if(char==="\\"){let next=value[at++];next!=='"'&&next!=="\\"&&fail('a string escapes only " and \\'),out+=next}else{if(char==='"')return out;char<" "||char>"~"?fail("a string is printable ASCII"):out+=char}}return fail('a string is missing its closing "')},token=()=>{let start=at;for(;at<value.length&&TCHAR.test(value[at]);)at++;return value.slice(start,at)},bare2=()=>{let char=value[at];if(char==='"')return{kind:"string",value:string()};if(char!==void 0&&TOKEN_START.test(char))return{kind:"token",value:token()};let start=at;for(;at<value.length&&value[at]!==";"&&value[at]!==" ";)at++;let item=value.slice(start,at);return OTHER_ITEM.test(item)||fail(item===""?"a parameter has no value after its =":`${item} isn't a value`),{kind:"other",value:item}};spaces();let name=bare2();name.kind==="other"&&fail(name.value===""?"it names no profile":`${name.value} isn't a profile's name`);let avatar=null;for(;value[at]===";";){at++,spaces(),KEY_START.test(value[at]??"")||fail("a parameter starts with a lowercase letter");let start=at;for(;at<value.length&&KEY_CHAR.test(value[at]);)at++;let key=value.slice(start,at),param={kind:"boolean",value:"?1"};value[at]==="="&&(at++,param=bare2()),key==="avatar"&&(param.kind!=="string"&&fail("avatar is a string, in quotes"),avatar=param.value)}return spaces(),at<value.length&&fail(`${JSON.stringify(value.slice(at,at+20))} follows the profile`),{name:name.value,avatar}}var CHANNEL_PATH_MAX=2048,CHANNEL_PATTERN_MAX=2049,MESSAGE_TEXT_MAX=1e4,CAN_MAX=4e3,RESERVED_LABEL_PREFIX="board.",TASK_LABEL="board.task",TASK_NOTE_MAX=1e3,segment="[a-z0-9][a-z0-9_-]*",ChannelPath=external_exports.string().max(CHANNEL_PATH_MAX).regex(new RegExp(`^${segment}(?:/${segment})*$`),"invalid channel path"),storable=value=>!value.includes("\0")&&value.isWellFormed(),toStorable=value=>value.replaceAll("\0","").toWellFormed(),SentText=external_exports.string().refine(text=>text.trim().length>0,"message text is empty").refine(storable,"message text has a NUL character or a lone surrogate"),MessageText=external_exports.string().max(MESSAGE_TEXT_MAX).refine(text=>text.trim().length>0,"message text is empty").refine(storable,"message text has a NUL character or a lone surrogate"),MessageId=external_exports.number().int().positive(),INHERITED=new Set([...Object.getOwnPropertyNames(Object.prototype),"prototype"]),notInherited=name=>!INHERITED.has(name),notALabelKey=issue=>`${JSON.stringify(String(issue.input))} isn't a label key: one is 1 to 64 lowercase letters, numbers, ., _, and -, starting with a letter or number`,LabelKey=external_exports.string().max(64,{error:notALabelKey}).regex(/^[a-z0-9][a-z0-9_.-]*$/,{error:notALabelKey}).refine(notInherited,"label key is a reserved name"),LabelValue=external_exports.string().max(256,{error:issue=>`a label value is at most 256 characters, and this one has ${String(issue.input).length}`}).refine(storable,"label value has a NUL character or a lone surrogate"),Labels=external_exports.record(LabelKey,LabelValue),NewLabelValue=LabelValue.refine(value=>!/\p{Cc}/u.test(value),"label value has a control character"),NewLabels=external_exports.record(LabelKey,NewLabelValue),Emoji=external_exports.string().max(64).regex(/^[a-z0-9_+-]+$/,"invalid emoji name").refine(notInherited,"emoji name is a reserved name"),ActorId=external_exports.string().min(1).max(256),ActorKind=external_exports.enum(["person","agent","deployment","workflow","external"]),SeenActorKind=external_exports.union([ActorKind,external_exports.literal("profile")]);var Handle=external_exports.string().min(1).max(128).refine(storable,"handle has a NUL character or a lone surrogate");function platformAvatar(avatar){if(avatar===null)return null;try{return new URL(avatar).protocol==="https:"?avatar:null}catch{return null}}var Author=external_exports.object({actor:ActorId,principal:external_exports.string().min(1),profile:external_exports.string().nullable()});var AttachmentId=external_exports.string().regex(/^(?:[A-Za-z0-9_-]{22}|att_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/,"invalid attachment id"),Attachment=external_exports.object({id:AttachmentId,name:external_exports.string().min(1).max(255),type:external_exports.string().min(1).max(255),size:external_exports.number().int().nonnegative()}),TaskState=external_exports.enum(["waiting","ready","claimed","blocked","completed","failed","canceled"]);var TaskNote=external_exports.string().max(TASK_NOTE_MAX).refine(text=>text.trim().length>0,"it is empty").refine(storable,"it has a NUL character or a lone surrogate"),SentTaskNote=external_exports.string().refine(text=>text.trim().length>0,"it is empty").refine(storable,"it has a NUL character or a lone surrogate"),SentTaskHoldKind=external_exports.string().regex(/^[a-z0-9][a-z0-9_.-]*$/,"a kind is lowercase letters, numbers, and _.-"),EDITED_HOLD="edited",TaskHoldKind=external_exports.string().regex(/^[a-z0-9][a-z0-9_.-]{0,63}$/,"a kind is up to 64 lowercase letters, numbers, and _.-"),RemoteWatcherId=external_exports.string().regex(/^[A-Za-z][A-Za-z0-9-]{0,31}$/,"ids start with a letter and use up to 32 letters, numbers, and hyphens");var EMOJI_TABLE={100:{characters:["\u{1F4AF}"],aliases:[]},thumbs_up:{characters:["\u{1F44D}"],aliases:["+1","thumbsup"]},thumbs_down:{characters:["\u{1F44E}"],aliases:["-1","thumbsdown"]},clap:{characters:["\u{1F44F}"],aliases:[]},wave:{characters:["\u{1F44B}"],aliases:[]},pray:{characters:["\u{1F64F}"],aliases:[]},muscle:{characters:["\u{1F4AA}"],aliases:[]},ok_hand:{characters:["\u{1F44C}"],aliases:[]},point_up:{characters:["\u{1F446}"],aliases:[]},point_down:{characters:["\u{1F447}"],aliases:[]},point_left:{characters:["\u{1F448}"],aliases:[]},point_right:{characters:["\u{1F449}"],aliases:[]},raised_hands:{characters:["\u{1F64C}"],aliases:[]},shrug:{characters:["\u{1F937}"],aliases:[]},facepalm:{characters:["\u{1F926}"],aliases:[]},heart:{characters:["\u2764\uFE0F","\u2764"],aliases:[]},smile:{characters:["\u{1F60A}"],aliases:["slightly_smiling_face"]},laugh:{characters:["\u{1F602}","\u{1F606}"],aliases:["laughing","satisfied","joy"]},thinking:{characters:["\u{1F914}"],aliases:["thinking_face"]},sad:{characters:["\u{1F622}"],aliases:["cry","white_frowning_face"]},cry:{characters:["\u{1F62D}"],aliases:["sob"]},angry:{characters:["\u{1F620}"],aliases:[]},love_eyes:{characters:["\u{1F60D}"],aliases:["heart_eyes"]},cool:{characters:["\u{1F60E}"],aliases:["sunglasses"]},wink:{characters:["\u{1F609}"],aliases:[]},surprised:{characters:["\u{1F62E}"],aliases:["open_mouth"]},worried:{characters:["\u{1F61F}"],aliases:[]},confused:{characters:["\u{1F615}"],aliases:[]},neutral:{characters:["\u{1F610}"],aliases:["neutral_face"]},sleeping:{characters:["\u{1F634}"],aliases:[]},sick:{characters:["\u{1F922}"],aliases:["nauseated_face"]},mind_blown:{characters:["\u{1F92F}"],aliases:["exploding_head"]},relieved:{characters:["\u{1F60C}"],aliases:[]},grimace:{characters:["\u{1F62C}"],aliases:["grimacing"]},rolling_eyes:{characters:["\u{1F644}"],aliases:[]},hug:{characters:["\u{1F917}"],aliases:["hugging_face"]},zany:{characters:["\u{1F92A}"],aliases:["zany_face"]},check:{characters:["\u2705","\u2714\uFE0F"],aliases:["white_check_mark","heavy_check_mark"]},x:{characters:["\u274C","\u2716\uFE0F"],aliases:["heavy_multiplication_x"]},question:{characters:["\u2753","?"],aliases:[]},exclamation:{characters:["\u2757"],aliases:[]},warning:{characters:["\u26A0\uFE0F"],aliases:[]},stop:{characters:["\u{1F6D1}"],aliases:["octagonal_sign"]},info:{characters:["\u2139\uFE0F"],aliases:["information_source"]},fire:{characters:["\u{1F525}"],aliases:[]},star:{characters:["\u2B50"],aliases:[]},sparkles:{characters:["\u2728"],aliases:[]},lightning:{characters:["\u26A1"],aliases:["zap"]},boom:{characters:["\u{1F4A5}"],aliases:[]},eyes:{characters:["\u{1F440}"],aliases:[]},green_circle:{characters:["\u{1F7E2}"],aliases:["large_green_circle"]},yellow_circle:{characters:["\u{1F7E1}"],aliases:["large_yellow_circle"]},red_circle:{characters:["\u{1F534}"],aliases:[]},blue_circle:{characters:["\u{1F535}"],aliases:["large_blue_circle"]},white_circle:{characters:["\u26AA"],aliases:[]},black_circle:{characters:["\u26AB"],aliases:[]},rocket:{characters:["\u{1F680}"],aliases:[]},party:{characters:["\u{1F389}","\u{1F973}"],aliases:["tada","partying_face"]},confetti:{characters:["\u{1F38A}"],aliases:["confetti_ball"]},balloon:{characters:["\u{1F388}"],aliases:[]},gift:{characters:["\u{1F381}"],aliases:[]},trophy:{characters:["\u{1F3C6}"],aliases:[]},medal:{characters:["\u{1F947}"],aliases:["first_place_medal"]},lightbulb:{characters:["\u{1F4A1}"],aliases:["bulb"]},gear:{characters:["\u2699\uFE0F"],aliases:[]},wrench:{characters:["\u{1F527}"],aliases:[]},hammer:{characters:["\u{1F528}"],aliases:[]},bug:{characters:["\u{1F41B}"],aliases:[]},link:{characters:["\u{1F517}"],aliases:[]},lock:{characters:["\u{1F512}"],aliases:[]},unlock:{characters:["\u{1F513}"],aliases:[]},key:{characters:["\u{1F511}"],aliases:[]},pin:{characters:["\u{1F4CC}"],aliases:["pushpin"]},memo:{characters:["\u{1F4DD}"],aliases:[]},clipboard:{characters:["\u{1F4CB}"],aliases:[]},calendar:{characters:["\u{1F4C5}"],aliases:[]},clock:{characters:["\u{1F550}"],aliases:["clock1"]},hourglass:{characters:["\u23F3"],aliases:[]},bell:{characters:["\u{1F514}"],aliases:[]},megaphone:{characters:["\u{1F4E2}"],aliases:["mega"]},speech_bubble:{characters:["\u{1F4AC}"],aliases:["speech_balloon"]},email:{characters:["\u{1F4E7}"],aliases:[]},inbox:{characters:["\u{1F4E5}"],aliases:["inbox_tray"]},outbox:{characters:["\u{1F4E4}"],aliases:["outbox_tray"]},package:{characters:["\u{1F4E6}"],aliases:[]},folder:{characters:["\u{1F4C1}"],aliases:["file_folder"]},file:{characters:["\u{1F4C4}"],aliases:["page_facing_up"]},chart_up:{characters:["\u{1F4C8}"],aliases:["chart_with_upwards_trend"]},chart_down:{characters:["\u{1F4C9}"],aliases:["chart_with_downwards_trend"]},coffee:{characters:["\u2615"],aliases:[]},pizza:{characters:["\u{1F355}"],aliases:[]},beer:{characters:["\u{1F37A}"],aliases:[]},arrow_up:{characters:["\u2B06\uFE0F"],aliases:[]},arrow_down:{characters:["\u2B07\uFE0F"],aliases:[]},arrow_left:{characters:["\u2B05\uFE0F"],aliases:[]},arrow_right:{characters:["\u27A1\uFE0F"],aliases:[]},refresh:{characters:["\u{1F504}"],aliases:["arrows_counterclockwise"]},sun:{characters:["\u2600\uFE0F"],aliases:["sunny"]},cloud:{characters:["\u2601\uFE0F"],aliases:[]},rain:{characters:["\u{1F327}\uFE0F"],aliases:["rain_cloud"]},snow:{characters:["\u2744\uFE0F"],aliases:["snowflake"]},rainbow:{characters:["\u{1F308}"],aliases:[]}},CANONICAL=new Map,SHOWN=new Map,BY_CHARACTER=new Map,bare=character=>character.replace(/️/g,"");function add(name,characters,aliases){CANONICAL.set(name,name);for(let alias of aliases)CANONICAL.has(alias)||CANONICAL.set(alias,name);characters[0]&&SHOWN.set(name,characters[0]);for(let character of characters)BY_CHARACTER.has(bare(character))||BY_CHARACTER.set(bare(character),name)}for(let[name,entry]of Object.entries(EMOJI_TABLE))add(name,entry.characters,entry.aliases);add("rotating_light",["\u{1F6A8}"],[]);add("ship",["\u{1F6A2}"],[]);var canonicalEmoji=name=>CANONICAL.get(name)??name;function normalizeEmoji(input){let trimmed=input.trim(),named=trimmed.match(/^:?([a-z0-9_+-]+):?$/i);if(named)return canonicalEmoji(named[1].toLowerCase());let name=BY_CHARACTER.get(bare(trimmed));if(name)return name;throw new Error(`unknown emoji: ${input} (use a short name like eyes or thumbs_up)`)}var displayEmoji=name=>SHOWN.get(canonicalEmoji(name))??`:${name}:`;async function*parseSse(body,signal){let reader=body.getReader(),decoder=new TextDecoder,buffer="",onAbort=()=>void reader.cancel().catch(()=>{});signal?.addEventListener("abort",onAbort,{once:!0});try{for(;;){let{value,done}=await reader.read();if(done)return;buffer+=decoder.decode(value,{stream:!0});let boundary;for(;(boundary=buffer.search(/\r?\n\r?\n/))!==-1;){let block=buffer.slice(0,boundary);buffer=buffer.slice(boundary).replace(/^\r?\n\r?\n/,"");let message={},data=[];for(let line of block.split(/\r?\n/)){if(line===""||line.startsWith(":"))continue;let colon=line.indexOf(":"),field=colon===-1?line:line.slice(0,colon),value2=colon===-1?"":line.slice(colon+1).replace(/^ /,"");field==="data"?data.push(value2):field==="id"?message.id=value2:field==="event"&&(message.event=value2)}data.length>0&&(message.data=data.join(`
8
- `)),(message.id!==void 0||message.data!==void 0)&&(yield message)}}}finally{signal?.removeEventListener("abort",onAbort),reader.releaseLock()}}var BoardError=class extends Error{code;status;hint;origin;retryAfter;constructor(code,message,status,options={}){super(message),this.name="BoardError",this.code=code,this.status=status,this.hint=options.hint,this.origin=options.origin??"handle",this.retryAfter=options.retryAfter}},handleErrors=new WeakSet,resolve=async value=>typeof value=="function"?await value():value,scheduleBody=input=>{let{at,until,...rest}=messageBody(input);return{...rest,...at!==void 0?{at:at instanceof Date?at.toISOString():at}:{},...until!==void 0?{until:until instanceof Date?until.toISOString():until}:{}}},messageBody=input=>{if(typeof input=="string")return{text:input};let{attachments,...rest}=input;return attachments?.length?{...rest,attachments:attachments.map(a=>typeof a=="string"?a:a.id)}:rest};function eventsState(onState){let current=null,tell=next=>{next!==current&&(current=next,onState?.(next))};return{answered:()=>tell("live"),failed:()=>tell("retrying")}}var CLAIM_WAIT_S=25,CLAIM_AGAIN_MS=1e3,UNITS={ms:1,s:1e3,m:6e4,h:36e5,d:864e5};function duration(value){if(typeof value=="number")return value;let match=value.trim().match(/^(\d+(?:\.\d+)?)(ms|s|m|h|d)?$/);if(!match)throw new BoardError("invalid_duration",`${value} isn't a duration like 30s, 10m, or 1h.`,0);return Number(match[1])*UNITS[match[2]??"ms"]}var path=id=>encodeURIComponent(id);function queryString(query){let params=new URLSearchParams;for(let[key,value]of Object.entries(query))if(value!=null)if(key==="label"){let labels=Array.isArray(value)?value:typeof value=="object"?Object.entries(value).map(([k,v])=>`${k}=${String(v)}`):[value];for(let label of labels)params.append("label",String(label))}else params.set(key,String(value));let text=params.toString();return text?`?${text}`:""}function wireCan(can){return can===null||typeof can!="object"||Array.isArray(can)?can:Object.fromEntries(Object.entries(can).map(([pattern,grant])=>[pattern,grant==="none"?[]:grant]))}var withEnvironments=principal=>(principal.kind==="project"||principal.kind==="all-projects")&&principal.environments===void 0?{...principal,environments:["production"]}:principal,wireGrant=input=>({principals:input.principals.map(withEnvironments),can:wireCan(input.can)}),goAhead=({lockMeOut})=>lockMeOut?{lockMeOut:!0}:{};function creatorOf(me,path2){let[source,kind,id,environment]=me.principal.split(":");if((source==="vercel"||source==="local")&&kind==="user"&&id)return{kind:"user",userId:me.principal.split(":").slice(2).join(":")};if(source==="vercel"&&kind==="project"&&id&&environment)return{kind:"project",project:id,environments:[environment]};throw new BoardError("no_own_principal",`A private channel lets its creator in, as a person or a project's deployment, and ${me.principal} is neither, so ${path2} wasn't made.`,400,{hint:"Make it as a person or a deployment, or make it and its grants yourself."})}function createBoardClient(options){let base=options.url.replace(/\/+$/,""),doFetch=options.fetch??((input,init)=>globalThis.fetch(input,init)),storeFetch=options.storeFetch??((input,init)=>globalThis.fetch(input,init));async function headers(auth,as){let out={...options.headers?await resolve(options.headers):{}};if(!auth)return out;options.token!==void 0&&(out.authorization=`Bearer ${await resolve(options.token)}`);let profile=as!==void 0?as:options.profile===void 0?null:await resolve(options.profile);return profile!==null&&(out["x-board-profile"]=formatProfileHeader(typeof profile=="string"?{name:profile}:profile)),out}async function raw(method,path2,init={}){let response=await doFetch(`${base}${path2}`,{method,headers:{...await headers(init.auth??!0),...init.body===void 0?{}:{"content-type":"application/json"},...init.headers},...init.body===void 0?{}:{body:JSON.stringify(init.body)},...init.signal?{signal:init.signal}:{}});if(!response.ok)throw await toError(response);return response}async function call(method,path2,init){return await(await raw(method,path2,init)).json()}let filtersQuery=(filters={})=>filters;async function poll(query={},signal){return call("GET",`/events${queryString(query)}`,signal?{signal}:{})}let taskWrite=async(id,verb,body={})=>(await call("POST",`/tasks/${path(id)}/${verb}`,{body})).task,held=(id,proof)=>{let{epoch,token}=proof;return{async renew(lease){let{task,until}=await call("POST",`/tasks/${path(id)}/renew`,{body:{epoch,token,...lease!==void 0?{lease}:{}}});return claimed(task,{epoch,token,until})},release:()=>taskWrite(id,"release",{epoch,token}),complete:result=>taskWrite(id,"complete",{epoch,token,...result!==void 0?{result}:{}}),fail:reason=>taskWrite(id,"fail",{epoch,token,reason}),block:(reason,opts={})=>taskWrite(id,"block",{epoch,token,reason,...opts})}},claimed=(task,claim)=>({task,...claim,...held(task.id,claim)});async function createTask(target,input={}){let where=typeof target=="string"?{channel:target}:{re:target.re},made=typeof input=="string"?{text:input}:"attachments"in input&&input.attachments?.length?{...input,attachments:input.attachments.map(file=>typeof file=="string"?file:file.id)}:input,{task,claim,mentions}=await call("POST","/tasks",{body:{...where,...made}});return{task,...claim?{claim:claimed(task,claim)}:{},...mentions?{mentions}:{}}}async function createTasks(channel,tasks,opts={}){return(await call("POST","/tasks/batch",{body:{channel,tasks:tasks.map(task=>task.attachments?.length?{...task,attachments:task.attachments.map(file=>typeof file=="string"?file:file.id)}:task),...opts.id!==void 0?{id:opts.id}:{}}})).tasks}async function claimTask(target,opts={}){let signal=opts.signal?{signal:opts.signal}:{};if(typeof target=="string"){let{task,claim}=await call("POST",`/tasks/${path(target)}/claim`,{body:opts.lease!==void 0?{lease:opts.lease}:{},...signal});return claimed(task,claim)}let{wait,...ready}=target,deadline=Date.now()+(wait??0)*1e3;for(;;){let asked=Date.now(),hold=Math.max(0,Math.min(CLAIM_WAIT_S,(deadline-asked)/1e3)),answer=await call("POST","/tasks/claim",{body:{...ready,...hold>0?{wait:hold}:{}},...signal});if(answer.task)return claimed(answer.task,answer.claim);if(Date.now()>=deadline||opts.signal?.aborted)return null;let pause=Math.min(CLAIM_AGAIN_MS-(Date.now()-asked),deadline-Date.now());pause>0&&await new Promise(resolve2=>setTimeout(resolve2,pause))}}return{url:base,request:async(path2,init={})=>doFetch(`${base}${path2}`,{method:init.method??"GET",headers:{...init.headers,...await headers(!0,init.as)},...init.body?{body:init.body}:{},...init.signal?{signal:init.signal}:{}}),discovery:()=>call("GET","/",{auth:!1}),me:()=>call("GET","/me"),channels:async(query={})=>{let page=await call("GET",`/channels${queryString(query)}`);return{...page,next:page.next??null}},createChannel:async(path2,options2={})=>{if(!options2.private)return call("POST","/channels",{body:{path:path2}});let creator=creatorOf(await call("GET","/me"),path2),pattern=`${path2}/`,reaching=async()=>(await call("GET","/grants")).grants.filter(grant=>Object.keys(grant.can).some(at=>at===path2||at.startsWith(pattern))),granted=(grants,mine=[])=>{let changed=grants.filter(grant=>mine.some(ours=>ours.id===grant.id)).map(grant=>grant.id);if(changed.length===grants.length)return new BoardError("channel_granted",`${changed.join(" and ")} changed while ${path2} was being made, so a private ${path2} wouldn't be yours alone: nothing was made.`,409);let named=grants.filter(grant=>!changed.includes(grant.id)).map(grant=>grant.id);return new BoardError("channel_granted",`${named.length===1?named[0]:`${named.slice(0,-1).join(", ")} and ${named.at(-1)}`} already ${named.length===1?"grants":"grant"} in ${path2}, so a private ${path2} wouldn't be yours alone: nothing was made.`,409,{hint:named.length===1?`Revoke it first: vb grants revoke ${named[0]}`:"Revoke them first, each with vb grants revoke <id>."})},before=await reaching();if(before.length>0)throw granted(before);let first=async prefix=>(await call("GET",`/channels${queryString({prefix,limit:1})}`)).channels.find(channel=>channel.path===path2||channel.path.startsWith(pattern)),there=await first(path2)??await first(pattern);if(there)throw new BoardError("channel_exists",there.path===path2?`${path2} is a channel already, so it stays as it is.`:`${there.path} is a channel already, and a private ${path2} would close it too, so nothing was made.`,409,{hint:`Close it with a grant: everyone at ${pattern} with 'none'.`});let own=await call("POST","/grants",{body:{principals:[creator],can:{[pattern]:"all"}}}),takeBack=id=>{let revoke=body=>call("POST",`/grants/${encodeURIComponent(id)}/revoke`,{body});return revoke({}).catch(error=>{if(error instanceof BoardError&&error.code==="grant_lockout")return revoke({lockMeOut:!0});throw error})},others=(grants,mine)=>grants.filter(grant=>{let made=mine.find(ours=>ours.id===grant.id);return made===void 0||JSON.stringify([grant.principals,grant.can])!==JSON.stringify([made.principals,made.can])}),raced=others(await reaching(),[own.grant]);if(raced.length>0)throw await takeBack(own.grant.id),granted(raced,[own.grant]);let closed=await call("POST","/grants",{body:{principals:[{kind:"everyone"}],can:{[pattern]:[]}}}),late=others(await reaching(),[own.grant,closed.grant]);if(late.length>0){for(let id of[closed.grant.id,own.grant.id])await takeBack(id);throw granted(late,[own.grant,closed.grant])}return{...await call("POST","/channels",{body:{path:path2}}),grants:[own.grant,closed.grant]}},actors:async()=>(await call("GET","/actors")).actors,channel:name=>({messages:(query={})=>call("GET",`/messages${queryString({channel:name,...query})}`)}),thread:(id,range={})=>call("GET",`/messages/${path(id)}${queryString(range)}`),posted:async id=>(await call("GET",`/posts/${path(id)}`)).message,threads:(query={})=>call("GET",`/threads${queryString(query)}`),async post(channel,input){let{message,mentions}=await call("POST","/messages",{body:{channel,...messageBody(input)}});return mentions?{...message,mentions}:message},async reply(id,input){let{message,mentions}=await call("POST","/messages",{body:{re:id,...messageBody(input)}});return mentions?{...message,mentions}:message},async schedule(target,input){let{schedule,mentions}=await call("POST","/schedules",{body:{...typeof target=="string"?{channel:target}:{re:target.re},...scheduleBody(input)}});return mentions?{...schedule,mentions}:schedule},schedules:async(query={})=>(await call("GET",`/schedules${queryString(query)}`)).schedules,cancelSchedule:id=>call("POST",`/schedules/${path(id)}/cancel`,{body:{}}),tasks:{list:(query={})=>call("GET",`/tasks${queryString(query)}`),create:createTask,createMany:createTasks,claim:claimTask,held,block:(id,reason,opts={})=>taskWrite(id,"block",{reason,...opts}),unblock:id=>taskWrite(id,"unblock"),reopen:id=>taskWrite(id,"reopen"),assign:(id,actor)=>taskWrite(id,"assign",{for:actor}),needs:(id,needs)=>taskWrite(id,"needs",{needs}),cancel:(id,reason)=>taskWrite(id,"cancel",{reason})},createGrant:(input,options2={})=>call("POST","/grants",{body:{...wireGrant(input),...goAhead(options2)}}),createGrants:(inputs,options2={})=>call("POST","/grants/batch",{body:{grants:inputs.map(wireGrant),...goAhead(options2)}}),updateGrant:(id,{add:add2,remove,can},options2={})=>call("PATCH",`/grants/${path(id)}`,{body:{...add2?{add:add2.map(withEnvironments)}:{},...remove?{remove}:{},...can?{can:wireCan(can)}:{},...goAhead(options2)}}),explain:(channel,principal={})=>{let{claims,...rest}=principal,params=new URLSearchParams({channel});for(let[name,value]of Object.entries(rest))value!==void 0&&params.set(name,value);for(let[name,value]of Object.entries(claims??{}))params.append("claim",`${name}=${value}`);return call("GET",`/grants/explain?${params}`)},grants:async()=>(await call("GET","/grants")).grants,revokeGrant:(id,options2={})=>call("POST",`/grants/${path(id)}/revoke`,{body:goAhead(options2)}),schemas:async()=>(await call("GET","/schemas")).schemas,schema:async id=>(await call("GET",`/schemas/${path(id)}`)).schema,createSchema:input=>call("POST","/schemas",{body:input}),async upload(input){let type=input.type||(input.data instanceof Blob?input.data.type:"")||typeOf(input.name),size=input.data instanceof Blob?input.data.size:input.data.byteLength;if(size>4194304){if(size>104857600)throw new BoardError("too_large",`Attachments are at most ${104857600/1024/1024} MB.`,413);let bytes=input.data instanceof Blob?await input.data.arrayBuffer():input.data,sha256=btoa(String.fromCharCode(...new Uint8Array(await crypto.subtle.digest("SHA-256",bytes)))),ticket=await call("POST","/attachments/uploads",{body:{name:input.name,type,size,sha256}}).catch(error=>{throw error instanceof BoardError&&error.status===404&&error.code==="not_found"?new BoardError("too_large",`This board takes files of at most ${4194304/1024/1024} MB.`,413):error}),put=await storeFetch(ticket.url,{method:"PUT",headers:ticket.headers,body:input.data});if(!put.ok)throw new BoardError("upload_failed",`The blob store refused the file: ${put.status} ${(await put.text().catch(()=>"")).slice(0,300)||put.statusText}`,put.status);return(await call("POST",`/attachments/uploads/${encodeURIComponent(ticket.id)}`,{body:{}})).attachment}let response=await doFetch(`${base}/attachments`,{method:"POST",headers:{...await headers(!0),"content-type":type,"x-board-filename":encodeURIComponent(input.name)},body:input.data});if(!response.ok)throw await toError(response);return(await response.json()).attachment},download:(id,opts={})=>raw("GET",`/attachments/${encodeURIComponent(id)}`,opts.signal?{signal:opts.signal}:{}),edit:(id,text,opts={})=>call("POST",`/messages/${path(id)}/edit`,{body:{text,...opts}}),delete:(id,opts={})=>call("POST",`/messages/${path(id)}/delete`,{body:{...opts}}),react:(id,emoji,opts={})=>call("POST",`/messages/${path(id)}/reactions`,{body:{emoji:normalizeEmoji(emoji),...opts}}),label:(id,change)=>call("POST",`/messages/${path(id)}/labels`,{body:change}),typing:async(id,status)=>(await call("POST",`/messages/${path(id)}/typing`,{body:status?{status}:{}})).targets,sync:(id,target)=>target===void 0?call("GET",`/messages/${path(id)}/sync`):call("POST",`/messages/${path(id)}/sync`,{body:{target}}),linked:url=>call("GET",`/links${queryString({url})}`),inbox:async(key,opts={})=>(await call("GET",`/inbox/${key}${queryString(opts)}`)).events,register:input=>call("POST","/watchers",{body:input}),watchers:async()=>(await call("GET","/watchers")).watchers,matches:async(opts={})=>{let{signal,...query}=opts;return(await call("GET",`/watchers/matches${queryString(query)}`,signal?{signal}:{})).matches},ack:(id,body)=>call("POST",`/watchers/matches/${encodeURIComponent(id)}/ack`,{body}),readSource:(key,target,opts={})=>call("GET",`/sources/${key}/read${queryString({target,...opts})}`),joinSource:(key,target)=>call("POST",`/sources/${key}/join`,{body:{target}}),poll,syncImport:body=>call("POST","/sync/imports",{body}),syncReceipt:body=>call("POST","/sync/receipts",{body}),syncThread:thread=>call("GET",`/sync/threads/${path(thread)}`),syncFind:(query,opts={})=>call("GET",`/sync/find${queryString(query)}`,opts.signal?{signal:opts.signal}:{}),syncCopies:async messages=>(await call("GET",`/sync/copies?${messages.map(id=>`message=${encodeURIComponent(id)}`).join("&")}`)).copies,inboxPush:(key,events)=>call("POST",`/inbox/${path(key)}`,{body:{events}}),inboxNext:async(key,opts={})=>(await call("GET",`/inbox/${path(key)}/next${queryString(opts)}`)).items,inboxAck:(key,id,body)=>call("POST",`/inbox/${path(key)}/${path(id)}/ack`,{body}),async*events(query={},opts={}){let{last,...rest}=query,after=query.after,failures=0,state=eventsState(opts.onState);for(;!opts.signal?.aborted;){let response;try{response=await raw("GET",`/events${queryString({...filtersQuery(rest),...after===void 0&&last!==void 0?{last}:{},after})}`,{headers:{accept:"text/event-stream"},...opts.signal?{signal:opts.signal}:{}})}catch(error){if(opts.signal?.aborted)return;if(error instanceof BoardError&&(error.status===501||error.status>=400&&error.status<500))throw error;state.failed(),await new Promise(r=>setTimeout(r,Math.min(3e4,500*2**failures++)));continue}failures=0,state.answered();try{for await(let message of parseSse(response.body,opts.signal))message.id!==void 0&&(after=message.id),message.event==="board"&&message.data&&(yield JSON.parse(message.data))}catch{if(opts.signal?.aborted)return;state.failed(),await new Promise(r=>setTimeout(r,Math.min(3e4,500*2**failures++)))}}},async wait(query={},opts={}){let deadline=Date.now()+duration(opts.timeout??"30m"),after=query.after??(await poll({...query,after:void 0,wait:0},opts.signal)).cursor;for(;Date.now()<deadline&&!opts.signal?.aborted;){let wait=Math.max(0,Math.min(25,Math.ceil((deadline-Date.now())/1e3))),page=await poll({...query,after,wait},opts.signal);if(page.events.length>0)return page.events[0];after=page.cursor}return null}}}async function toError(response){try{let body=await response.json(),retryAfter=response.status===429?/^\d{1,6}$/.exec(response.headers.get("retry-after")??"")?.[0]:void 0;if(body.error?.message)return new BoardError(body.error.code??"error",body.error.message,response.status,{...typeof body.error.hint=="string"?{hint:body.error.hint}:{},origin:handleErrors.has(response)?"handle":"board",...retryAfter!==void 0?{retryAfter:Number(retryAfter)}:{}})}catch{}return new BoardError("http_error",`The board answered ${`${response.status} ${response.statusText}`.trim()}.`,response.status)}var HttpError=class extends Error{status;code;hint;origin;retryAfter;constructor(status,code,message,options={}){super(message),this.status=status,this.code=code,this.hint=options.hint,this.origin=options.origin??"board",this.retryAfter=options.retryAfter}},RejectedError=class extends HttpError{response;constructor(response){super(response.status,"rejected",`rejected with ${response.status}`),this.response=response}},badRequest=(message,code="invalid_request")=>new HttpError(400,code,message),unauthorized=message=>new HttpError(401,"unauthorized",message),forbidden=message=>new HttpError(403,"forbidden",message),notFound=(message,code="not_found")=>new HttpError(404,code,message),textTooLong=()=>new HttpError(400,"text_too_long",`A message's text is at most ${MESSAGE_TEXT_MAX.toLocaleString("en-US")} characters.`,{hint:"Put the long part in a file and attach it to a message, with a short summary as the text."}),duplicateId=()=>new HttpError(409,"duplicate_id","that id was already used for a different write"),batchTooLarge=(tasks,most)=>new HttpError(400,"batch_too_large",`a batch makes ${most} tasks at most, and this one has ${tasks}: send it in parts`),json=(body,status=200,headers)=>new Response(JSON.stringify(body),{status,headers:{"content-type":"application/json",...headers}});function reported(issue){if(issue.code==="invalid_key"&&issue.issues[0])return reported({...issue.issues[0],path:issue.path.slice(0,-1)});if(issue.code!=="invalid_union"||issue.errors.length===0)return issue;let first=issue.errors.reduce((best,option)=>option.length<best.length?option:best)[0];return first?reported({...first,path:[...issue.path,...first.path]}):issue}function toErrorResponse(error){if(error instanceof RejectedError)return error.response;if(error instanceof HttpError){let response=json({error:{code:error.code,message:error.message,...error.hint!==void 0?{hint:error.hint}:{}}},error.status,error.retryAfter!==void 0?{"retry-after":String(error.retryAfter)}:void 0);return error.origin==="handle"&&handleErrors.add(response),response}if(error instanceof ZodError){let issue=error.issues[0]&&reported(error.issues[0]);if(issue?.code==="too_big"&&issue.origin==="string"&&issue.maximum===1e4&&issue.path.length===1&&issue.path[0]==="text")return toErrorResponse(textTooLong());let path2=issue?.path.length?`${issue.path.join(".")}: `:"";return json({error:{code:"invalid_request",message:`${path2}${issue?.message??"invalid request"}`}},400)}let code=error?.code;return code==="INVALID_PAYLOAD"?json({error:{code:"invalid_request",message:error.message}},400):code==="PARTIAL_DUPLICATE_BATCH"||code==="DUPLICATE_EVENT_ID"?toErrorResponse(duplicateId()):code==="STORE_UNAVAILABLE"||code==="STORE_NOT_CONFIGURED"?json({error:{code:"unavailable",message:error.message}},503):(console.error("[board]",error),json({error:{code:"internal",message:"internal error"}},500))}export{fileSize,typeOf,fileName,fileNameProblem,importedFileName,mediaType,formatProfileHeader,parseProfileHeader,CHANNEL_PATTERN_MAX,MESSAGE_TEXT_MAX,CAN_MAX,RESERVED_LABEL_PREFIX,TASK_LABEL,ChannelPath,storable,toStorable,SentText,MessageText,MessageId,LabelKey,LabelValue,Labels,NewLabels,Emoji,ActorId,platformAvatar,AttachmentId,TaskState,SentTaskNote,SentTaskHoldKind,EDITED_HOLD,RemoteWatcherId,canonicalEmoji,normalizeEmoji,displayEmoji,BoardError,eventsState,duration,createBoardClient,HttpError,RejectedError,badRequest,unauthorized,forbidden,notFound,duplicateId,batchTooLarge,json,toErrorResponse};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{require_lib}from"./chunk-Z2KANBOU.js";import{packageName}from"./chunk-B4KA3ZH2.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1);import{join as join2,sep}from"path";import{execFile,spawnSync}from"child_process";var SAFE_ARGUMENT=/^[\w@./:=+-]+$/;function envValue(env,name){let key=Object.keys(env).find(key2=>key2.toLowerCase()===name.toLowerCase());return key?env[key]:void 0}function packageManagerInvocation(command,args,env=process.env,platform=process.platform){if(platform!=="win32")return{file:command,args};for(let arg of[command,...args])if(!SAFE_ARGUMENT.test(arg))throw new Error(`Refusing to pass ${JSON.stringify(arg)} to cmd.exe for ${command}`);let systemRoot=envValue(env,"SystemRoot");return{file:envValue(env,"ComSpec")||(systemRoot?`${systemRoot}\\System32\\cmd.exe`:"cmd.exe"),args:["/d","/s","/c",`"${[command,...args].join(" ")}"`],windowsVerbatimArguments:!0}}function execPackageManager(command,args,{cwd,env,timeout,signal},platform=process.platform){return new Promise((resolve2,reject)=>{let invocation=packageManagerInvocation(command,args,env,platform),windows=platform==="win32",timer,stop=()=>stopProcessTree(child,env),child=execFile(invocation.file,invocation.args,{encoding:"utf8",windowsHide:!0,windowsVerbatimArguments:invocation.windowsVerbatimArguments,cwd,env:{...env},...windows?{}:{timeout,signal}},(error,stdout)=>{clearTimeout(timer),signal?.removeEventListener("abort",stop),error?reject(error):resolve2(String(stdout))});windows&&(timer=setTimeout(stop,timeout),signal?.aborted?stop():signal?.addEventListener("abort",stop,{once:!0}))})}function stopProcessTree(child,env){if(!child?.pid)return;let systemRoot=envValue(env,"SystemRoot");spawnSync(systemRoot?`${systemRoot}\\System32\\taskkill.exe`:"taskkill.exe",["/pid",String(child.pid),"/T","/F"],{stdio:"ignore",windowsHide:!0})}import{tmpdir}from"node:os";import{resolve}from"node:path";var trustedUpgradeEnvironment=Object.freeze({...process.env}),trustedUpgradeDirectory=resolve(tmpdir());import{join}from"path";var packageManagers={npm:{metadataArgs:specifier=>["view",specifier,"version","--json","--global"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--min-release-age=0"],globalDetection:{args:["root","-g"],packageDir:(root,pkg)=>join(root,pkg)}},pnpm:{metadataArgs:specifier=>["view",specifier,"version","--json"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--config.minimumReleaseAge=0"],globalDetection:{args:pkg=>["list","-g",pkg,"--depth=0","--json"],packageDir:(output,pkg)=>{try{let projects=JSON.parse(output),path=(Array.isArray(projects)?projects[0]:projects)?.dependencies?.[pkg]?.path;return typeof path=="string"?path:void 0}catch{return}}}},yarn:{metadataArgs:specifier=>["info",specifier.endsWith("@latest")?specifier.slice(0,-7):specifier,"version","--json"],installArgs:specifier=>["global","add",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["--silent","global","dir"],packageDir:(root,pkg)=>join(root,"node_modules",pkg)}},bun:{metadataArgs:specifier=>["info",specifier,"version","--json","--global"],installArgs:specifier=>["add","-g",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["pm","bin","-g"],binaryNames:["vercel","vc"]}}};function getUpgradePackageManager(name){return packageManagers[name]}var UnsupportedUpgradeInstallError=class extends Error{constructor(){super(...arguments);this.code="unsupported_install"}},HOMEBREW_UPGRADE_COMMAND="brew upgrade vercel",HomebrewInstallError=class extends UnsupportedUpgradeInstallError{constructor(){super(`This Vercel CLI was installed with Homebrew. Update it with \`${HOMEBREW_UPGRADE_COMMAND}\`.`);this.code="homebrew_install"}};async function isHomebrewInstall(){return isNativeBinaryInstall()?(await(0,import_fs_extra.realpath)(process.execPath).catch(()=>process.execPath)).includes(`${sep}Caskroom${sep}vercel${sep}`):!1}var globalCliTypes=["npm","pnpm","yarn","bun"];function throwIfAborted(signal){if(signal?.aborted)throw signal.reason instanceof Error?signal.reason:new Error("Package manager detection was aborted")}async function getPackageManagerGlobalRoot(cliType,pkg,env=trustedUpgradeEnvironment,signal){try{let detectionArgs=getUpgradePackageManager(cliType).globalDetection.args;return(await execPackageManager(cliType,typeof detectionArgs=="function"?detectionArgs(pkg):detectionArgs,{cwd:trustedUpgradeDirectory,env,timeout:15e3,signal})).trim()||null}catch{return throwIfAborted(signal),null}}async function detectGlobalPackageManager(installPath,pkg,cliTypes=globalCliTypes,env=trustedUpgradeEnvironment,signal){for(let cliType of cliTypes){throwIfAborted(signal);let root=await getPackageManagerGlobalRoot(cliType,pkg,env,signal);if(!root)continue;let detection=getUpgradePackageManager(cliType).globalDetection;if(detection.packageDir)try{let packageDir=detection.packageDir(root,pkg);if(!packageDir)continue;let resolvedPackageDir=await(0,import_fs_extra.realpath)(packageDir);if(installPath===resolvedPackageDir||installPath.startsWith(resolvedPackageDir+sep))return cliType}catch{}for(let binary of detection.binaryNames||[])try{let target=await(0,import_fs_extra.realpath)(join2(root,binary));if(target===installPath||target.startsWith(installPath+sep)||installPath.startsWith(target+sep))return cliType;let entrypoint=await(0,import_fs_extra.realpath)(process.argv[1]);if(!isNativeBinaryInstall()&&target===entrypoint)return cliType}catch{}}return null}async function resolveInstall(env=trustedUpgradeEnvironment,signal){if(throwIfAborted(signal),await isHomebrewInstall())throw new HomebrewInstallError;let nativeExecutable=isNativeBinaryInstall()&&env.VERCEL_CLI_PACKAGE_EXECUTABLE,resolvedNativeExecutable=nativeExecutable&&await(0,import_fs_extra.realpath)(nativeExecutable).catch(()=>null),entrypoint=resolvedNativeExecutable&&resolvedNativeExecutable===await(0,import_fs_extra.realpath)(process.execPath).catch(()=>null)?env.VERCEL_CLI_PACKAGE_ENTRYPOINT:process.argv[1],installPath=entrypoint&&await(0,import_fs_extra.realpath)(entrypoint).catch(()=>null);if(!installPath)throw new UnsupportedUpgradeInstallError("Could not resolve this Vercel CLI installation. Update it with the package manager that installed it.");let packageManager=await detectGlobalPackageManager(installPath,packageName,globalCliTypes,env,signal);if(!packageManager)throw new UnsupportedUpgradeInstallError("Could not detect a supported global npm, pnpm, Yarn, or Bun installation of Vercel CLI. Update it with the package manager that installed it.");return{packageManager,global:!0,assumed:!1}}async function isGlobal(){if(await isHomebrewInstall())return!0;try{return await resolveInstall(),!0}catch{return!1}}async function getUpdateCommandInfo(env=trustedUpgradeEnvironment,signal){let{packageManager}=await resolveInstall(env,signal),args=getUpgradePackageManager(packageManager).installArgs(`${packageName}@latest`),allowBuild=pnpmAllowBuildFlag(packageManager,"esbuild");return{command:`${packageManager} ${args.join(" ")}${allowBuild}`,global:!0,packageManager,assumed:!1}}function pnpmAllowBuildFlag(cliType,pkg){return cliType==="pnpm"?` --allow-build=${pkg}`:""}async function getUpdateCommand(){return await isHomebrewInstall()?HOMEBREW_UPGRADE_COMMAND:(await getUpdateCommandInfo()).command}export{packageManagerInvocation,execPackageManager,trustedUpgradeEnvironment,trustedUpgradeDirectory,getUpgradePackageManager,HOMEBREW_UPGRADE_COMMAND,isHomebrewInstall,isGlobal,getUpdateCommandInfo,getUpdateCommand};
@@ -1,10 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{agentErrorMetadata,getExitCodeForReason,trackAgentError}from"./chunk-4SS6W6JK.js";import{recordCliError}from"./chunk-AP6DZGTK.js";import{require_strip_ansi}from"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_strip_ansi=__toESM(require_strip_ansi(),1);function recordLine(type,data){return`${JSON.stringify({type,data})}
8
- `}function summaryLine(progress){return`${JSON.stringify({type:"summary",...progress})}
9
- `}function writeJsonError(client,payload,exitCode=getExitCodeForReason(payload.reason)){let{status,reason,message,...rest}=payload,document={status,reason,message:(0,import_strip_ansi.default)(message),...rest,...rest.hint?{hint:(0,import_strip_ansi.default)(rest.hint)}:{},...agentErrorMetadata(client)};return recordCliError({code:payload.reason,reportOnSuccess:!0}),trackAgentError(client,document),client.stderr.write(`${JSON.stringify(document)}
10
- `),exitCode}export{recordLine,summaryLine,writeJsonError};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{assertOrgIdMatchesAppTeam,findProjectsFromPath,getConfigFilePath,getLinkFromDir,getOrgSlug,getRepoLink,getUser,getVercelDirectory,introspectToken,isOwnerLookupUnavailableError,resolveAppFromToken}from"./chunk-Z2KANBOU.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{getTeamByIdOrSlug}from"./chunk-4SS6W6JK.js";import{require_cli_config}from"./chunk-4SAVH3H7.js";import{InvalidToken,TeamDeleted}from"./chunk-GOI2VVI7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_cli_config=__toESM(require_cli_config(),1),import_ms=__toESM(require_ms(),1);var TEAM_SLUG_TTL_MS=(0,import_ms.default)("1d");function getCachedTeamSlug(config,teamId,now=Date.now()){let saved=config.cachedTeamSlugs?.[teamId];if(!isSavedTeamSlug(saved))return;let age=now-saved.savedAt;return age>=0&&age<TEAM_SLUG_TTL_MS?saved.slug:void 0}function setCachedTeamSlug(client,teamId,slug){if(getCachedTeamSlug(client.config,teamId)===slug)return;let saved={slug,savedAt:Date.now()};updateCachedTeamSlugs(client,slugs=>({...slugs,[teamId]:saved}))}function forgetCachedTeamSlug(client,teamId){let slugs=client.config.cachedTeamSlugs;!slugs||!(teamId in slugs)||updateCachedTeamSlugs(client,saved=>{let rest={...saved};return delete rest[teamId],rest})}function isSavedTeamSlug(value){return typeof value=="object"&&value!==null&&typeof value.slug=="string"&&typeof value.savedAt=="number"}function updateCachedTeamSlugs(client,update){try{let configPath=getConfigFilePath(),savedConfig=(0,import_cli_config.readGlobalConfigFile)(configPath),cachedTeamSlugs=update(savedConfig.cachedTeamSlugs??{}),config={...savedConfig,cachedTeamSlugs};(0,import_cli_config.writeGlobalConfigFile)(configPath,config),client.config.cachedTeamSlugs=cachedTeamSlugs}catch{output_manager_default.debug("Failed to persist cached team slugs.")}}var import_build_utils=__toESM(require_build_utils(),1);import{relative}from"path";async function getScope(client,opts={}){let{user,app,token}=await getPrincipal(client),defaultTeamId=user?.version==="northstar"&&!client.ignoresSavedTeam?user.defaultTeamId:void 0,appTeamId=!user&&app?token?.team?.id:void 0;if(!user&&app&&opts.getTeam===!1)throw new Error("App principal scope resolution requires a team lookup.");!user&&app&&(client.ignoresSavedTeam&&appTeamId&&assertOrgIdMatchesAppTeam(client,appTeamId),client.config.currentTeam=appTeamId),!client.config.currentTeam&&defaultTeamId&&(client.config.currentTeam=defaultTeamId),client.isTeamUnchosen()&&await client.chooseTeam({ask:opts.chooseTeam!==!1});let teamId=client.config.currentTeam||defaultTeamId,team=teamId&&opts.getTeam!==!1?await getTeam(client,teamId).catch(err=>{let appTeam=token?.team;if(opts.allowOwnerLookupFallback&&!user&&app&&appTeam?.id===teamId&&isOwnerLookupUnavailableError(err))return output_manager_default.debug(`Can't read team ${teamId}; using its token's team`),{id:appTeam.id,slug:appTeam.slug||appTeam.id,name:appTeam.name};throw err}):null,contextName=team?.slug||user?.username||user?.email;if(!contextName)throw new Error("Unable to determine context name");return opts.resolveLocalScope?resolveLocalScopeContext(client,{user,app,team}):{contextName,team,user,app}}async function getContextName(client,opts={}){let teamId=client.config.currentTeam,cachedSlug=teamId&&!client.authConfig.tokenSource?getCachedTeamSlug(client.config,teamId):void 0;if(cachedSlug&&!(opts.resolveLocalScope&&await hasLocalScope(client)))return output_manager_default.debug(`Using saved name "${cachedSlug}" for team ${teamId}`),cachedSlug;let scope;try{scope=opts.resolveLocalScope?await getScope(client,{resolveLocalScope:!0}):await getScope(client)}catch(err){let currentTeam=client.config.currentTeam;if(opts.allowOwnerLookupFallback&&currentTeam&&isOwnerLookupUnavailableError(err))return output_manager_default.debug(`Can't read team ${currentTeam}; using its token's name`),getOrgSlug(client,{id:currentTeam});throw err}let{contextName,team}=scope;return team&&!client.authConfig.tokenSource&&setCachedTeamSlug(client,team.id,team.slug),contextName}async function hasLocalScope(client){if(detectExplicitScope(client))return!1;let{localOrgId,isCrossTeamRepo}=await findLocalLink(client);return!!localOrgId||isCrossTeamRepo}async function getPrincipal(client){try{return{user:await getUser(client),app:null,token:null}}catch(err){if(!(err instanceof InvalidToken))throw err;let token=await introspectToken(client).catch(()=>null),app=token?resolveAppFromToken(token):null;if(!app)throw err;return{user:null,app,token}}}async function resolveLocalScopeContext(client,{user,app,team}){let explicitScopeProvided=detectExplicitScope(client)||client.ignoresSavedTeam&&!!(0,import_build_utils.getPlatformEnv)("ORG_ID"),globalTeamId=client.config.currentTeam,{localOrgId,linkedRepo,isCrossTeamRepo}=await findLocalLink(client),isAppPrincipal=!user&&!!app,effectiveLocalOrgId=isAppPrincipal?void 0:localOrgId,scopeMismatch=!!(effectiveLocalOrgId&&globalTeamId&&globalTeamId!==effectiveLocalOrgId);!isAppPrincipal&&!explicitScopeProvided&&!effectiveLocalOrgId&&isCrossTeamRepo&&output_manager_default.warn("This repository has projects across multiple teams. Use `--scope` to specify which team, or `cd` into a project directory.");let resolvedTeam=!explicitScopeProvided&&effectiveLocalOrgId?await applyLocalOrg(client,effectiveLocalOrgId):team,{org,contextName}=resolveOrg(resolvedTeam,user);return{org,contextName,user,team:resolvedTeam,app,globalTeam:team,linkedRepo,isCrossTeamRepo,localOrgId:effectiveLocalOrgId,scopeMismatch,explicitScopeProvided}}async function applyLocalOrg(client,localOrgId){return client.config.currentTeam=localOrgId.startsWith("team_")?localOrgId:void 0,client.config.currentTeam?await getTeamByIdOrSlug(client,client.config.currentTeam):null}async function getTeam(client,teamId){let team=await getTeamByIdOrSlug(client,teamId);if(!team)throw new TeamDeleted;return team}function resolveOrg(team,user){if(team)return{org:{type:"team",id:team.id,slug:team.slug},contextName:team.slug};if(user)return{org:{type:"user",id:user.id,slug:user.username},contextName:user.username||user.email};throw new Error("Unable to determine scope: no team or personal account is available for this token. Use `--scope` to specify a team.")}async function getLocalOrgId(client){return(await findLocalLink(client)).localOrgId}async function findLocalLink(client){let[projectLink,repoLink]=await Promise.all([findProjectLink(client),findRepoLink(client)]);return{localOrgId:findLocalOrgId(client.cwd,projectLink,repoLink),linkedRepo:repoLink?.repoConfig?{repoConfig:repoLink.repoConfig,rootPath:repoLink.rootPath}:null,isCrossTeamRepo:detectCrossTeamRepo(repoLink?.repoConfig)}}async function findProjectLink(client){try{return await getLinkFromDir(getVercelDirectory(client.cwd))}catch{return null}}async function findRepoLink(client){try{return await getRepoLink(client,client.cwd)}catch{return null}}function findLocalOrgId(cwd,projectLink,repoLink){if(projectLink)return projectLink.orgId;if(repoLink?.repoConfig)return findRepoOrgId(repoLink.repoConfig,relative(repoLink.rootPath,cwd))}function findRepoOrgId(repoConfig,pathFromRepoRoot){let matchedProjects=findProjectsFromPath(repoConfig.projects,pathFromRepoRoot),projects=matchedProjects.length===0&&pathFromRepoRoot===""?repoConfig.projects:matchedProjects,orgIds=new Set(projects.map(p=>p.orgId??repoConfig.orgId??""));if(orgIds.size!==1)return;let[orgId]=orgIds;return orgId||void 0}function scopeFlagPassed(argv){for(let index=0;index<argv.length;index++){let arg=argv[index];if(arg==="--")break;if(arg==="--scope"||arg==="--team"||arg.startsWith("--scope=")||arg.startsWith("--team=")||arg==="-S"||arg==="-T"||isGroupedScopeFlag(argv,index))return!0}return!1}function isGroupedScopeFlag(argv,index){let value=argv[index+1];return/^-[A-Za-z]+[ST]$/.test(argv[index])&&argv[index].length>2&&value!==void 0&&value!==""&&!value.startsWith("-")}function detectExplicitScope(client){return scopeFlagPassed(client.argv)||!!client.localConfig?.scope}function detectCrossTeamRepo(repoConfig){if(!repoConfig?.projects||repoConfig.projects.length<2)return!1;let orgIds=new Set;for(let project of repoConfig.projects){let orgId=project.orgId??repoConfig.orgId;orgId&&orgIds.add(orgId)}return orgIds.size>1}export{getCachedTeamSlug,forgetCachedTeamSlug,getScope,getContextName,resolveOrg,getLocalOrgId,scopeFlagPassed,isGroupedScopeFlag,detectExplicitScope};
@@ -1,10 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{__commonJS}from"./chunk-BZENIQ7N.js";var require_balanced_match=__commonJS({"../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(exports,module){"use strict";module.exports=balanced;function balanced(a,b,str){a instanceof RegExp&&(a=maybeMatch(a,str)),b instanceof RegExp&&(b=maybeMatch(b,str));var r=range(a,b,str);return r&&{start:r[0],end:r[1],pre:str.slice(0,r[0]),body:str.slice(r[0]+a.length,r[1]),post:str.slice(r[1]+b.length)}}function maybeMatch(reg,str){var m=str.match(reg);return m?m[0]:null}balanced.range=range;function range(a,b,str){var begs,beg,left,right,result,ai=str.indexOf(a),bi=str.indexOf(b,ai+1),i=ai;if(ai>=0&&bi>0){if(a===b)return[ai,bi];for(begs=[],left=str.length;i>=0&&!result;)i==ai?(begs.push(i),ai=str.indexOf(a,i+1)):begs.length==1?result=[begs.pop(),bi]:(beg=begs.pop(),beg<left&&(left=beg,right=bi),bi=str.indexOf(b,i+1)),i=ai<bi&&ai>=0?ai:bi;begs.length&&(result=[left,right])}return result}}});var require_path=__commonJS({"../../node_modules/.pnpm/minimatch@5.0.1/node_modules/minimatch/lib/path.js"(exports,module){var isWindows=typeof process=="object"&&process&&process.platform==="win32";module.exports=isWindows?{sep:"\\"}:{sep:"/"}}});var require_brace_expansion=__commonJS({"../../node_modules/.pnpm/brace-expansion@2.1.1/node_modules/brace-expansion/index.js"(exports,module){var balanced=require_balanced_match();module.exports=expandTop;var escSlash="\0SLASH"+Math.random()+"\0",escOpen="\0OPEN"+Math.random()+"\0",escClose="\0CLOSE"+Math.random()+"\0",escComma="\0COMMA"+Math.random()+"\0",escPeriod="\0PERIOD"+Math.random()+"\0";function numeric(str){return parseInt(str,10)==str?parseInt(str,10):str.charCodeAt(0)}function escapeBraces(str){return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod)}function unescapeBraces(str){return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".")}function parseCommaParts(str){if(!str)return[""];var parts=[],m=balanced("{","}",str);if(!m)return str.split(",");var pre=m.pre,body=m.body,post=m.post,p=pre.split(",");p[p.length-1]+="{"+body+"}";var postParts=parseCommaParts(post);return post.length&&(p[p.length-1]+=postParts.shift(),p.push.apply(p,postParts)),parts.push.apply(parts,p),parts}function expandTop(str,options){if(!str)return[];options=options||{};var max=options.max==null?1/0:options.max;return str.substr(0,2)==="{}"&&(str="\\{\\}"+str.substr(2)),expand(escapeBraces(str),max,!0).map(unescapeBraces)}function embrace(str){return"{"+str+"}"}function isPadded(el){return/^-?0\d/.test(el)}function lte(i,y){return i<=y}function gte(i,y){return i>=y}function expand(str,max,isTop){var expansions=[],m=balanced("{","}",str);if(!m)return[str];var pre=m.pre,post=m.post.length?expand(m.post,max,!1):[""];if(/\$$/.test(m.pre))for(var k=0;k<post.length&&k<max;k++){var expansion=pre+"{"+m.body+"}"+post[k];expansions.push(expansion)}else{var isNumericSequence=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body),isAlphaSequence=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body),isSequence=isNumericSequence||isAlphaSequence,isOptions=m.body.indexOf(",")>=0;if(!isSequence&&!isOptions)return m.post.match(/,(?!,).*\}/)?(str=m.pre+"{"+m.body+escClose+m.post,expand(str,max,!0)):[str];var n;if(isSequence)n=m.body.split(/\.\./);else if(n=parseCommaParts(m.body),n.length===1&&(n=expand(n[0],max,!1).map(embrace),n.length===1))return post.map(function(p){return m.pre+n[0]+p});var N;if(isSequence){var x=numeric(n[0]),y=numeric(n[1]),width=Math.max(n[0].length,n[1].length),incr=n.length==3?Math.max(Math.abs(numeric(n[2])),1):1,test=lte,reverse=y<x;reverse&&(incr*=-1,test=gte);var pad=n.some(isPadded);N=[];for(var i=x;test(i,y)&&N.length<max;i+=incr){var c;if(isAlphaSequence)c=String.fromCharCode(i),c==="\\"&&(c="");else if(c=String(i),pad){var need=width-c.length;if(need>0){var z=new Array(need+1).join("0");i<0?c="-"+z+c.slice(1):c=z+c}}N.push(c)}}else{N=[];for(var j=0;j<n.length;j++)N.push.apply(N,expand(n[j],max,!1))}for(var j=0;j<N.length;j++)for(var k=0;k<post.length&&expansions.length<max;k++){var expansion=pre+N[j]+post[k];(!isTop||isSequence||expansion)&&expansions.push(expansion)}}return expansions}}});var require_minimatch=__commonJS({"../../node_modules/.pnpm/minimatch@5.0.1/node_modules/minimatch/minimatch.js"(exports,module){var minimatch=module.exports=(p,pattern,options={})=>(assertValidPattern(pattern),!options.nocomment&&pattern.charAt(0)==="#"?!1:new Minimatch(pattern,options).match(p));module.exports=minimatch;var path=require_path();minimatch.sep=path.sep;var GLOBSTAR=Symbol("globstar **");minimatch.GLOBSTAR=GLOBSTAR;var expand=require_brace_expansion(),plTypes={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},qmark="[^/]",star=qmark+"*?",twoStarDot="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",twoStarNoDot="(?:(?!(?:\\/|^)\\.).)*?",charSet=s=>s.split("").reduce((set,c)=>(set[c]=!0,set),{}),reSpecials=charSet("().*{}+?[]^$\\!"),addPatternStartSet=charSet("[.("),slashSplit=/\/+/;minimatch.filter=(pattern,options={})=>(p,i,list)=>minimatch(p,pattern,options);var ext=(a,b={})=>{let t={};return Object.keys(a).forEach(k=>t[k]=a[k]),Object.keys(b).forEach(k=>t[k]=b[k]),t};minimatch.defaults=def=>{if(!def||typeof def!="object"||!Object.keys(def).length)return minimatch;let orig=minimatch,m=(p,pattern,options)=>orig(p,pattern,ext(def,options));return m.Minimatch=class extends orig.Minimatch{constructor(pattern,options){super(pattern,ext(def,options))}},m.Minimatch.defaults=options=>orig.defaults(ext(def,options)).Minimatch,m.filter=(pattern,options)=>orig.filter(pattern,ext(def,options)),m.defaults=options=>orig.defaults(ext(def,options)),m.makeRe=(pattern,options)=>orig.makeRe(pattern,ext(def,options)),m.braceExpand=(pattern,options)=>orig.braceExpand(pattern,ext(def,options)),m.match=(list,pattern,options)=>orig.match(list,pattern,ext(def,options)),m};minimatch.braceExpand=(pattern,options)=>braceExpand(pattern,options);var braceExpand=(pattern,options={})=>(assertValidPattern(pattern),options.nobrace||!/\{(?:(?!\{).)*\}/.test(pattern)?[pattern]:expand(pattern)),MAX_PATTERN_LENGTH=1024*64,assertValidPattern=pattern=>{if(typeof pattern!="string")throw new TypeError("invalid pattern");if(pattern.length>MAX_PATTERN_LENGTH)throw new TypeError("pattern is too long")},SUBPARSE=Symbol("subparse");minimatch.makeRe=(pattern,options)=>new Minimatch(pattern,options||{}).makeRe();minimatch.match=(list,pattern,options={})=>{let mm=new Minimatch(pattern,options);return list=list.filter(f=>mm.match(f)),mm.options.nonull&&!list.length&&list.push(pattern),list};var globUnescape=s=>s.replace(/\\(.)/g,"$1"),regExpEscape=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Minimatch=class{constructor(pattern,options){assertValidPattern(pattern),options||(options={}),this.options=options,this.set=[],this.pattern=pattern,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!options.partial,this.make()}debug(){}make(){let pattern=this.pattern,options=this.options;if(!options.nocomment&&pattern.charAt(0)==="#"){this.comment=!0;return}if(!pattern){this.empty=!0;return}this.parseNegate();let set=this.globSet=this.braceExpand();options.debug&&(this.debug=(...args)=>console.error(...args)),this.debug(this.pattern,set),set=this.globParts=set.map(s=>s.split(slashSplit)),this.debug(this.pattern,set),set=set.map((s,si,set2)=>s.map(this.parse,this)),this.debug(this.pattern,set),set=set.filter(s=>s.indexOf(!1)===-1),this.debug(this.pattern,set),this.set=set}parseNegate(){if(this.options.nonegate)return;let pattern=this.pattern,negate=!1,negateOffset=0;for(let i=0;i<pattern.length&&pattern.charAt(i)==="!";i++)negate=!negate,negateOffset++;negateOffset&&(this.pattern=pattern.substr(negateOffset)),this.negate=negate}matchOne(file,pattern,partial){var options=this.options;this.debug("matchOne",{this:this,file,pattern}),this.debug("matchOne",file.length,pattern.length);for(var fi=0,pi=0,fl=file.length,pl=pattern.length;fi<fl&&pi<pl;fi++,pi++){this.debug("matchOne loop");var p=pattern[pi],f=file[fi];if(this.debug(pattern,p,f),p===!1)return!1;if(p===GLOBSTAR){this.debug("GLOBSTAR",[pattern,p,f]);var fr=fi,pr=pi+1;if(pr===pl){for(this.debug("** at the end");fi<fl;fi++)if(file[fi]==="."||file[fi]===".."||!options.dot&&file[fi].charAt(0)===".")return!1;return!0}for(;fr<fl;){var swallowee=file[fr];if(this.debug(`
8
- globstar while`,file,fr,pattern,pr,swallowee),this.matchOne(file.slice(fr),pattern.slice(pr),partial))return this.debug("globstar found match!",fr,fl,swallowee),!0;if(swallowee==="."||swallowee===".."||!options.dot&&swallowee.charAt(0)==="."){this.debug("dot detected!",file,fr,pattern,pr);break}this.debug("globstar swallow a segment, and continue"),fr++}return!!(partial&&(this.debug(`
9
- >>> no match, partial?`,file,fr,pattern,pr),fr===fl))}var hit;if(typeof p=="string"?(hit=f===p,this.debug("string match",p,f,hit)):(hit=f.match(p),this.debug("pattern match",p,f,hit)),!hit)return!1}if(fi===fl&&pi===pl)return!0;if(fi===fl)return partial;if(pi===pl)return fi===fl-1&&file[fi]==="";throw new Error("wtf?")}braceExpand(){return braceExpand(this.pattern,this.options)}parse(pattern,isSub){assertValidPattern(pattern);let options=this.options;if(pattern==="**")if(options.noglobstar)pattern="*";else return GLOBSTAR;if(pattern==="")return"";let re="",hasMagic=!!options.nocase,escaping=!1,patternListStack=[],negativeLists=[],stateChar,inClass=!1,reClassStart=-1,classStart=-1,cs,pl,sp,patternStart=pattern.charAt(0)==="."?"":options.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",clearStateChar=()=>{if(stateChar){switch(stateChar){case"*":re+=star,hasMagic=!0;break;case"?":re+=qmark,hasMagic=!0;break;default:re+="\\"+stateChar;break}this.debug("clearStateChar %j %j",stateChar,re),stateChar=!1}};for(let i=0,c;i<pattern.length&&(c=pattern.charAt(i));i++){if(this.debug("%s %s %s %j",pattern,i,re,c),escaping){if(c==="/")return!1;reSpecials[c]&&(re+="\\"),re+=c,escaping=!1;continue}switch(c){case"/":return!1;case"\\":clearStateChar(),escaping=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",pattern,i,re,c),inClass){this.debug(" in class"),c==="!"&&i===classStart+1&&(c="^"),re+=c;continue}this.debug("call clearStateChar %j",stateChar),clearStateChar(),stateChar=c,options.noext&&clearStateChar();continue;case"(":if(inClass){re+="(";continue}if(!stateChar){re+="\\(";continue}patternListStack.push({type:stateChar,start:i-1,reStart:re.length,open:plTypes[stateChar].open,close:plTypes[stateChar].close}),re+=stateChar==="!"?"(?:(?!(?:":"(?:",this.debug("plType %j %j",stateChar,re),stateChar=!1;continue;case")":if(inClass||!patternListStack.length){re+="\\)";continue}clearStateChar(),hasMagic=!0,pl=patternListStack.pop(),re+=pl.close,pl.type==="!"&&negativeLists.push(pl),pl.reEnd=re.length;continue;case"|":if(inClass||!patternListStack.length){re+="\\|";continue}clearStateChar(),re+="|";continue;case"[":if(clearStateChar(),inClass){re+="\\"+c;continue}inClass=!0,classStart=i,reClassStart=re.length,re+=c;continue;case"]":if(i===classStart+1||!inClass){re+="\\"+c;continue}cs=pattern.substring(classStart+1,i);try{RegExp("["+cs+"]")}catch{sp=this.parse(cs,SUBPARSE),re=re.substr(0,reClassStart)+"\\["+sp[0]+"\\]",hasMagic=hasMagic||sp[1],inClass=!1;continue}hasMagic=!0,inClass=!1,re+=c;continue;default:clearStateChar(),reSpecials[c]&&!(c==="^"&&inClass)&&(re+="\\"),re+=c;break}}for(inClass&&(cs=pattern.substr(classStart+1),sp=this.parse(cs,SUBPARSE),re=re.substr(0,reClassStart)+"\\["+sp[0],hasMagic=hasMagic||sp[1]),pl=patternListStack.pop();pl;pl=patternListStack.pop()){let tail;tail=re.slice(pl.reStart+pl.open.length),this.debug("setting tail",re,pl),tail=tail.replace(/((?:\\{2}){0,64})(\\?)\|/g,(_,$1,$2)=>($2||($2="\\"),$1+$1+$2+"|")),this.debug(`tail=%j
10
- %s`,tail,tail,pl,re);let t=pl.type==="*"?star:pl.type==="?"?qmark:"\\"+pl.type;hasMagic=!0,re=re.slice(0,pl.reStart)+t+"\\("+tail}clearStateChar(),escaping&&(re+="\\\\");let addPatternStart=addPatternStartSet[re.charAt(0)];for(let n=negativeLists.length-1;n>-1;n--){let nl=negativeLists[n],nlBefore=re.slice(0,nl.reStart),nlFirst=re.slice(nl.reStart,nl.reEnd-8),nlAfter=re.slice(nl.reEnd),nlLast=re.slice(nl.reEnd-8,nl.reEnd)+nlAfter,openParensBefore=nlBefore.split("(").length-1,cleanAfter=nlAfter;for(let i=0;i<openParensBefore;i++)cleanAfter=cleanAfter.replace(/\)[+*?]?/,"");nlAfter=cleanAfter;let dollar=nlAfter===""&&isSub!==SUBPARSE?"$":"";re=nlBefore+nlFirst+nlAfter+dollar+nlLast}if(re!==""&&hasMagic&&(re="(?=.)"+re),addPatternStart&&(re=patternStart+re),isSub===SUBPARSE)return[re,hasMagic];if(!hasMagic)return globUnescape(pattern);let flags=options.nocase?"i":"";try{return Object.assign(new RegExp("^"+re+"$",flags),{_glob:pattern,_src:re})}catch{return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let set=this.set;if(!set.length)return this.regexp=!1,this.regexp;let options=this.options,twoStar=options.noglobstar?star:options.dot?twoStarDot:twoStarNoDot,flags=options.nocase?"i":"",re=set.map(pattern=>(pattern=pattern.map(p=>typeof p=="string"?regExpEscape(p):p===GLOBSTAR?GLOBSTAR:p._src).reduce((set2,p)=>(set2[set2.length-1]===GLOBSTAR&&p===GLOBSTAR||set2.push(p),set2),[]),pattern.forEach((p,i)=>{p!==GLOBSTAR||pattern[i-1]===GLOBSTAR||(i===0?pattern.length>1?pattern[i+1]="(?:\\/|"+twoStar+"\\/)?"+pattern[i+1]:pattern[i]=twoStar:i===pattern.length-1?pattern[i-1]+="(?:\\/|"+twoStar+")?":(pattern[i-1]+="(?:\\/|\\/"+twoStar+"\\/)"+pattern[i+1],pattern[i+1]=GLOBSTAR))}),pattern.filter(p=>p!==GLOBSTAR).join("/"))).join("|");re="^(?:"+re+")$",this.negate&&(re="^(?!"+re+").*$");try{this.regexp=new RegExp(re,flags)}catch{this.regexp=!1}return this.regexp}match(f,partial=this.partial){if(this.debug("match",f,this.pattern),this.comment)return!1;if(this.empty)return f==="";if(f==="/"&&partial)return!0;let options=this.options;path.sep!=="/"&&(f=f.split(path.sep).join("/")),f=f.split(slashSplit),this.debug(this.pattern,"split",f);let set=this.set;this.debug(this.pattern,"set",set);let filename;for(let i=f.length-1;i>=0&&(filename=f[i],!filename);i--);for(let i=0;i<set.length;i++){let pattern=set[i],file=f;if(options.matchBase&&pattern.length===1&&(file=[filename]),this.matchOne(file,pattern,partial))return options.flipNegate?!0:!this.negate}return options.flipNegate?!1:this.negate}static defaults(def){return minimatch.defaults(def).Minimatch}};minimatch.Minimatch=Minimatch}});export{require_balanced_match,require_minimatch};
@@ -1,30 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{createDetectEntrypoint,getServicesConfigWriteBlocker,writeServicesConfig}from"./chunk-5J4E2W4F.js";import{detectProjects}from"./chunk-W2L24GM7.js";import{require_dist as require_dist2}from"./chunk-KSGN5OCV.js";import{validateRootDirectory}from"./chunk-7W565DJB.js";import{require_slugify}from"./chunk-COD3WAUI.js";import{createProject}from"./chunk-ANIA2G6F.js";import{compileVercelConfig,findSourceVercelConfigFile}from"./chunk-O7GNYVVM.js";import{readJSONFile}from"./chunk-FFN3EGSF.js";import{checkExistsAndConnect,parseRepoUrl,selectAndParseRemoteUrl}from"./chunk-L75A5BMY.js";import{Separator}from"./chunk-YTRKHRL3.js";import{selectOrg}from"./chunk-EFP3LK4G.js";import{require_dist}from"./chunk-VPSR2O55.js";import{pull}from"./chunk-YI7NKOCU.js";import{require_frameworks}from"./chunk-ZKNEIE44.js";import{table}from"./chunk-CJZE7647.js";import{printError}from"./chunk-33HVDSWP.js";import{VERCEL_DIR_PROJECT,VERCEL_DIR_README,fetchProjectsForRepoUrl,findProjectsFromPath,findRepoRoot,getGitConfigPath,getLinkedProject,getLocalPathConfig,getRemoteUrls,getVercelDirectory,humanizePath,isDirectory,isPromptBackError,isPromptCanceledError,linkFolderToProject,linkRepoProject,localConfigFlagPath,parseGitConfig,pluckRemoteUrls,require_lib,resolveGitRemote}from"./chunk-Z2KANBOU.js";import{printAlignedLabel}from"./chunk-M7FED5YP.js";import{getProjectByNameOrId}from"./chunk-DJZBJC2A.js";import{CantParseJSONFile,ProjectNotFound,isAPIError}from"./chunk-GOI2VVI7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1),import_build_utils4=__toESM(require_build_utils(),1),import_fs_detectors2=__toESM(require_dist(),1);import{join as join4,basename}from"path";var import_chalk=__toESM(require_source(),1);var import_slugify=__toESM(require_slugify(),1);var SEARCH_ALL_PROJECTS="search-all-projects",CREATE_NEW_PROJECT="create-new-project",BACK_TO_PROJECT_SELECTION=Symbol("back-to-project-selection"),BACK_TO_TEAM_SELECTION=Symbol("back-to-team-selection"),SWITCH_GIT_REMOTE=Symbol("switch-git-remote"),NO_EXISTING_PROJECTS=Symbol("no-existing-projects");async function inputProjectDecision(client,defaultDecision){let createChoice={name:"Create new project",value:"create"},existingChoice={name:"Link existing project",value:"existing"};return await client.input.select({message:"Project?",choices:defaultDecision==="existing"?[existingChoice,createChoice]:[createChoice,existingChoice]})}function randomNameSuffix(){return Math.random().toString(36).slice(2,6).padEnd(4,"0")}async function suggestNewProjectName(client,org,slugifiedName,knownTaken){let taken=knownTaken;if(!taken)try{taken=!(await getProjectByNameOrId(client,slugifiedName,org.id)instanceof ProjectNotFound)}catch{taken=!1}return taken?`${slugifiedName}-${randomNameSuffix()}`:slugifiedName}function promptForProjectName(client,org,defaultName,message="Name?"){return client.input.text({message,default:defaultName,validate:async val=>val?await getProjectByNameOrId(client,val,org.id)instanceof ProjectNotFound?!0:"Project already exists":"Project name cannot be empty"})}async function promptForProjectNameWithBack(client,org,defaultName){try{return await client.withPromptBackNavigation(()=>promptForProjectName(client,org,defaultName,`Name? ${import_chalk.default.dim("Press \u2191 to return to project options")}`))}catch(error){if(isPromptBackError(error))return BACK_TO_PROJECT_SELECTION;throw error}}async function searchExistingProjects(client,org,allowBack){let firstPage=await client.fetch("/v9/projects?limit=100",{accountId:org.id}),projects=firstPage.projects,hasMoreProjects=firstPage.pagination.next!=null;if(projects.length===0)return output_manager_default.log(`No existing projects found under ${import_chalk.default.bold(org.slug)}. Creating new project.`),NO_EXISTING_PROJECTS;let pageSize=15,countHint=projects.length>pageSize?` ${import_chalk.default.dim(`(${hasMoreProjects?"100+":projects.length} projects)`)}`:"";return await client.input.search({message:`Which project?${countHint}`,pageSize,source:async(term,{signal})=>{let searchTerm=term?.trim(),matchingProjects=projects;if(searchTerm)if(hasMoreProjects)matchingProjects=(await client.fetch(`/v9/projects?search=${encodeURIComponent(searchTerm)}&limit=20`,{accountId:org.id,signal})).projects;else{let normalizedSearchTerm=searchTerm.toLowerCase();matchingProjects=projects.filter(project=>project.name.toLowerCase().includes(normalizedSearchTerm)||project.id===searchTerm)}let choices=matchingProjects.slice().sort((a,b)=>b.updatedAt-a.updatedAt).map(project=>({name:project.name,value:project}));if(!allowBack)return choices;let backChoice={name:"Back to project options",value:BACK_TO_PROJECT_SELECTION};return choices.length===0?[backChoice]:searchTerm?choices:[...choices,new Separator,backChoice]}})}async function inputProject(client,org,detectedProjectName,autoConfirm=!1,skipAutoDetect=!1,showProjectSuggestions=!1,allowTeamSelectionBack=!1,repoMatches=[],gitRemoteOptions){let slugifiedName=(0,import_slugify.default)(detectedProjectName),canSwitchGitRemote=(gitRemoteOptions?.remoteNames.length??0)>1,detectedProject=null;if(!skipAutoDetect&&repoMatches.length===0){output_manager_default.spinner("Searching for existing projects\u2026",1e3);let[project,slugifiedProject]=await Promise.all([getProjectByNameOrId(client,detectedProjectName,org.id),slugifiedName!==detectedProjectName?getProjectByNameOrId(client,slugifiedName,org.id):null]);if(detectedProject=project instanceof ProjectNotFound?slugifiedProject instanceof ProjectNotFound?null:slugifiedProject:project,detectedProject&&!detectedProject.id)throw new Error('Detected linked project does not have "id".');output_manager_default.stopSpinner()}if(autoConfirm)return repoMatches.length===1?repoMatches[0]:detectedProject||detectedProjectName;if(client.nonInteractive){if(detectedProject)return detectedProject;let err=new Error("Confirmation required");throw err.code="HEADLESS",err}let slugifiedNameKnownFree=!skipAutoDetect&&repoMatches.length===0&&!detectedProject,memoizedDefaultName;async function defaultNewProjectName(){return memoizedDefaultName===void 0&&(memoizedDefaultName=slugifiedNameKnownFree?slugifiedName:await suggestNewProjectName(client,org,slugifiedName,detectedProject?.name===slugifiedName)),memoizedDefaultName}let shouldLinkProject;if(showProjectSuggestions&&!skipAutoDetect)for(;;){let choices=[];if(repoMatches.length>0?choices.push(...repoMatches.map(match=>({name:`${match.project.name} ${import_chalk.default.gray("(linked by git)")}`,value:match})),new Separator):detectedProject&&choices.push({name:`${detectedProject.name} ${import_chalk.default.gray("(folder name)")}`,value:detectedProject},new Separator),choices.push({name:"Search all projects",value:SEARCH_ALL_PROJECTS,description:"Browse or search every project in this team"},{name:"Create a new project",value:CREATE_NEW_PROJECT,description:`Create it under ${org.slug}`}),canSwitchGitRemote){let current=gitRemoteOptions?.currentRemoteName;choices.push({name:"Switch Git remote",value:SWITCH_GIT_REMOTE,description:current?`Suggestions are from ${current}`:"Search projects linked to a different remote"})}allowTeamSelectionBack&&choices.push({name:"Choose a different team",value:BACK_TO_TEAM_SELECTION,description:"Return to team selection"});let selected=await client.input.select({message:"Which project?",choices});if(selected===BACK_TO_TEAM_SELECTION)return BACK_TO_TEAM_SELECTION;if(selected===SWITCH_GIT_REMOTE)return SWITCH_GIT_REMOTE;if(selected===CREATE_NEW_PROJECT){let projectName=await promptForProjectNameWithBack(client,org,await defaultNewProjectName());if(projectName===BACK_TO_PROJECT_SELECTION)continue;return projectName}if(selected!==SEARCH_ALL_PROJECTS)return selected;let existingProject=await searchExistingProjects(client,org,!0);if(existingProject!==BACK_TO_PROJECT_SELECTION){if(existingProject===NO_EXISTING_PROJECTS){let projectName=await promptForProjectNameWithBack(client,org,slugifiedName);if(projectName===BACK_TO_PROJECT_SELECTION)continue;return projectName}return existingProject}}else if(!detectedProject)shouldLinkProject=await inputProjectDecision(client,skipAutoDetect?"existing":"create")==="existing";else{if(output_manager_default.print(` ${import_chalk.default.bold("Found existing project")}
8
- `),printAlignedLabel("Project",`${org.slug}/${detectedProject.name}`),await client.input.confirm("Link directory to project?",!0))return detectedProject;shouldLinkProject=await inputProjectDecision(client,"existing")==="existing"}if(shouldLinkProject){let existingProject=await searchExistingProjects(client,org,!1);if(existingProject!==NO_EXISTING_PROJECTS&&existingProject!==BACK_TO_PROJECT_SELECTION)return existingProject}return await promptForProjectName(client,org,await defaultNewProjectName())}var import_build_utils=__toESM(require_build_utils(),1),import_chalk2=__toESM(require_source(),1);import path from"path";async function inputRootDirectory(client,cwd,autoConfirm=!1){if(autoConfirm)return null;for(;;){let rootDirectory=await client.input.text({message:"Code directory?",transformer:input=>`${import_chalk2.default.dim("./")}${input}`});if(!rootDirectory)return null;let normal=path.normalize(rootDirectory);if(normal==="."||normal==="./")return null;let fullPath=path.join(cwd,normal);if(await validateRootDirectory(cwd,fullPath,"Please choose a different one.")!==!1)return(0,import_build_utils.normalizePath)(normal)}}var import_chalk3=__toESM(require_source(),1),import_frameworks=__toESM(require_frameworks(),1);function isSettingValue(setting){return setting&&typeof setting.value=="string"}var settingMap={buildCommand:"Build Command",devCommand:"Development Command",commandForIgnoringBuildStep:"Ignore Command",installCommand:"Install Command",outputDirectory:"Output Directory",framework:"Framework"},settingKeys=Object.keys(settingMap).sort();async function editProjectSettings(client,projectSettings,framework,autoConfirm,localConfigurationOverrides,configFileName="vercel.json",staticSite=null){let settings=Object.assign({buildCommand:null,devCommand:null,framework:null,commandForIgnoringBuildStep:null,installCommand:null,outputDirectory:null},projectSettings);if(localConfigurationOverrides&&Object.values(localConfigurationOverrides??{}).some(Boolean)){for(let setting of settingKeys){let localConfigValue=localConfigurationOverrides[setting];localConfigValue&&(settings[setting]=localConfigValue)}output_manager_default.print(` Local settings detected in ${configFileName}:
9
- `);for(let setting of settingKeys){let override=localConfigurationOverrides[setting];override&&output_manager_default.print(` ${import_chalk3.default.dim(`${import_chalk3.default.bold(`${settingMap[setting]}:`)} ${override}`)}
10
- `)}if(localConfigurationOverrides.framework){let overrideFramework=import_frameworks.frameworkList.find(f=>f.slug===localConfigurationOverrides.framework);overrideFramework&&(framework=overrideFramework,output_manager_default.print(` Merging default Project Settings for ${framework.name}. Previously listed overrides are prioritized.
11
- `))}}if(!framework)return settings.framework=null,settings;if(output_manager_default.print(`
12
- `),!framework.slug&&staticSite){let detail=staticSite.outputDirectory==="public"?import_chalk3.default.dim(` (${settingMap.outputDirectory}: public)`):"";output_manager_default.print(` ${import_chalk3.default.bold("Detected")} static site${detail}
13
- `)}else if(!framework.slug)output_manager_default.print(` No framework detected. Default Project Settings:
14
- `);else{let buildCmd=framework.settings.buildCommand?.value??null,outputSetting=framework.settings.outputDirectory,outputDir=outputSetting?isSettingValue(outputSetting)?outputSetting.value:outputSetting.placeholder:null,inline=[buildCmd?`${settingMap.buildCommand}: ${buildCmd}`:null,outputDir?`${settingMap.outputDirectory}: ${outputDir}`:null].filter(Boolean),detail=inline.length?import_chalk3.default.dim(` (${inline.join(", ")})`):"";output_manager_default.print(` ${import_chalk3.default.bold("Detected")} ${framework.name}${detail}
15
- `)}if(settings.framework=framework.slug,!framework.slug&&!staticSite)for(let setting of settingKeys){if(setting==="framework"||setting==="commandForIgnoringBuildStep")continue;let defaultSetting=framework.settings[setting];!localConfigurationOverrides?.[setting]&&defaultSetting&&output_manager_default.print(` ${import_chalk3.default.dim(`${import_chalk3.default.bold(`${settingMap[setting]}:`)} ${isSettingValue(defaultSetting)?defaultSetting.value:import_chalk3.default.italic(`${defaultSetting.placeholder}`)}`)}
16
- `)}if(autoConfirm||!await client.input.confirm("Customize settings?",!1))return settings;let choices=settingKeys.reduce((acc,setting)=>setting==="framework"||setting==="commandForIgnoringBuildStep"||setting==="installCommand"||localConfigurationOverrides?.[setting]?acc:[...acc,{name:settingMap[setting],value:setting}],[]),settingFields=await client.input.checkbox({message:"Which settings would you like to overwrite (select multiple)?",choices});for(let setting of settingFields){let field=settingMap[setting];settings[setting]=await client.input.text({message:`${import_chalk3.default.bold(field)}?`})}return settings}import{access,readdir}from"fs/promises";import{join}from"path";async function readConfig(dir){let pkgFilePath;try{let localConfigPath=localConfigFlagPath();localConfigPath?pkgFilePath=localConfigPath:pkgFilePath=(await compileVercelConfig(dir)).configPath||getLocalPathConfig(dir)}catch(err){if(err instanceof Error)return err;throw err}let result=await readJSONFile(pkgFilePath);return result instanceof CantParseJSONFile||result?result:null}async function detectStaticSite(dir){let entries=await readEntries(dir);if(!entries)return null;let has=(name,isDir)=>entries.some(e=>e.name===name&&e.isDirectory()===isDir);if(has("package.json",!1)||has("api",!0))return null;let outputDirectory=has("public",!0)?"public":".";return!(outputDirectory==="public"?await readEntries(join(dir,"public")):entries)?.some(e=>e.isFile()&&/\.html?$/i.test(e.name))||await hasSubfolderApp(dir,entries)||await configBuildsOrMovesOutput(dir)?null:{outputDirectory}}async function hasSubfolderApp(dir,entries){let folders=entries.filter(e=>e.isDirectory()&&!e.name.startsWith(".")&&e.name!=="node_modules"&&e.name!=="public");return(await Promise.all(folders.map(e=>access(join(dir,e.name,"package.json")).then(()=>!0,()=>!1)))).includes(!0)}async function configBuildsOrMovesOutput(dir){let config=await readConfig(dir);return config instanceof Error?!0:!!(config&&(config.builds?.length||config.framework||config.buildCommand||config.installCommand||config.outputDirectory))}async function readEntries(dir){try{return await readdir(dir,{withFileTypes:!0})}catch{return null}}var import_frameworks3=__toESM(require_frameworks(),1);var import_chalk4=__toESM(require_source(),1),DEFAULT_VERCEL_AUTH_SETTING="standard",OPTIONS={message:"What setting do you want to use for Vercel Authentication?",default:DEFAULT_VERCEL_AUTH_SETTING,choices:[{description:"Standard Protection (recommended)",name:"standard",value:"standard"},{description:"No Protection (all deployments will be public)",name:"none",value:"none"}]};async function vercelAuth(client,{autoConfirm=!1}){return autoConfirm||await client.input.confirm(`Want to use the default Deployment Protection settings? ${import_chalk4.default.dim("(Vercel Authentication: Standard Protection)")}`,!0)?DEFAULT_VERCEL_AUTH_SETTING:await client.input.select(OPTIONS)}var import_build_utils3=__toESM(require_build_utils(),1),import_fs_detectors=__toESM(require_dist(),1),import_service_topology=__toESM(require_dist2(),1);import{join as join2,relative}from"path";var import_frameworks2=__toESM(require_frameworks(),1),import_build_utils2=__toESM(require_build_utils(),1);var chalk5=require_source(),frameworksBySlug=new Map(import_frameworks2.frameworkList.map(f=>[f.slug,f])),frameworkColors={nextjs:chalk5.white,vite:chalk5.magenta,nuxtjs:chalk5.green,remix:chalk5.cyan,astro:chalk5.magenta,gatsby:chalk5.magenta,svelte:chalk5.red,sveltekit:chalk5.red,solidstart:chalk5.blue,angular:chalk5.red,vue:chalk5.green,ember:chalk5.red,preact:chalk5.magenta,fastapi:chalk5.green,flask:chalk5.cyan,express:chalk5.yellow,nest:chalk5.red,hono:chalk5.yellowBright},runtimeColors={node:chalk5.green,python:chalk5.blue,go:chalk5.cyan,ruby:chalk5.red,rust:chalk5.yellowBright};function getFrameworkName(slug){if(slug)return frameworksBySlug.get(slug)?.name}function formatRoutePrefix(routePrefix){return routePrefix==="/"?"/":`${routePrefix.startsWith("/")?routePrefix:`/${routePrefix}`}/*`}var jobTriggerLabels={queue:"Job/Queue",schedule:"Job/Schedule",workflow:"Job/Workflow"};function getServiceDescriptionInfo(service){if(service.type==="worker"||service.type==="job"||service.type==="cron"){let typeLabel=service.type==="worker"?"Worker":jobTriggerLabels[service.trigger??""]??"Job",typeColorFn=service.type==="worker"?chalk5.magenta:chalk5.cyan;if(service.runtime){let runtimeName=service.runtime.charAt(0).toUpperCase()+service.runtime.slice(1),runtimeColorFn=runtimeColors[service.runtime]||chalk5.yellow;return{label:`${typeLabel}${chalk5.white("/")}${runtimeColorFn(runtimeName)}`,colorFn:typeColorFn}}return{label:typeLabel,colorFn:typeColorFn}}return getFrameworkRuntimeBuilderInfo(service)}function getFrameworkRuntimeBuilderInfo(service){let frameworkName=getFrameworkName(service.framework);if(frameworkName&&service.framework){let colorFn=frameworkColors[service.framework]||chalk5.cyan;return{label:frameworkName,colorFn}}else if(service.runtime){let normalizedRuntime=service.runtime.toLowerCase().replace(/@.*$/,""),colorFn=runtimeColors[normalizedRuntime]||chalk5.yellow;return{label:service.runtime,colorFn}}else if(service.builder?.use)return{label:service.builder.use,colorFn:chalk5.magenta};return{label:"unknown",colorFn:chalk5.dim}}function getServiceTarget(service){return(0,import_build_utils2.isScheduleTriggeredService)(service)?`schedule: ${service.schedule??"none"}`:(0,import_build_utils2.isQueueTriggeredService)(service)?`topics: ${(0,import_build_utils2.getServiceQueueTopics)(service).join(", ")}`:(0,import_build_utils2.isWorkflowTriggeredService)(service)?"workflow":service.routePrefix?formatRoutePrefix(service.routePrefix):"no route"}function displayDetectedServices(services,nameWidth=0){output_manager_default.print(`Detected services:
17
- `);let rows=services.some(import_build_utils2.isExperimentalServiceV2)?buildServiceRowsV2(services.filter(import_build_utils2.isExperimentalServiceV2),nameWidth):buildServiceRowsV1(services,nameWidth),tableOutput=table(rows,{align:["l","l","l","l"],hsep:2});output_manager_default.print(`${tableOutput}
18
- `)}function displayDetectedDaemons(daemons,nameWidth=0){output_manager_default.print(`Detected daemons:
19
- `);let rows=daemons.map(daemon=>[formatName(daemon.name,nameWidth),daemon.entrypoint?chalk5.blue(`[${daemon.entrypoint}]`):chalk5.dim("[unknown]")]),tableOutput=table(rows,{align:["l","l"],hsep:2});output_manager_default.print(`${tableOutput}
20
- `)}function formatName(name,nameWidth=0){return`\u2022 ${name}`.padEnd(nameWidth)}function getNameColumnWidth(names){return Math.max(0,...names.map(name=>formatName(name).length))}function buildServiceRowsV1(services,nameWidth){let outputOrder={web:0,cron:1,job:1,worker:2};return[...services].sort((a,b)=>(outputOrder[a.type]??3)-(outputOrder[b.type]??3)).map(service=>{let descInfo=getServiceDescriptionInfo(service),target=getServiceTarget(service);return[formatName(service.name,nameWidth),descInfo.colorFn(`[${descInfo.label}]`),chalk5.dim("\u2192"),target]})}function buildServiceRowsV2(services,nameWidth){return services.map(service=>{let descInfo=getFrameworkRuntimeBuilderInfo(service);return[formatName(service.name,nameWidth),descInfo.colorFn(`[${descInfo.label}]`)]})}function displayServicesConfigNote(configFileName="vercel.json",hasDaemons=!1){let subject=hasDaemons?"Services and daemons":"Services";output_manager_default.print(`
21
- ${chalk5.dim(`${subject} are configured via ${configFileName}.`)}
22
- `)}function displayServiceErrors(errors){for(let error of errors)output_manager_default.warn(error.message)}var SERVICES_DOCS_URL="https://vercel.com/docs/services",INFERRED_SERVICES_PROMPT="Multiple services were detected. How would you like to set up this project?";async function getServicesSetupState(workPath){let fs=new import_fs_detectors.LocalFileSystemDetector(workPath),detectServicesResult=await(0,import_service_topology.detectServices)({fs,detectEntrypoint:createDetectEntrypoint(workPath)}),hasConfiguredServices=detectServicesResult.resolved?.source==="configured",inferredServices=hasConfiguredServices?null:detectServicesResult.inferred,inferredServicesWriteBlocker=inferredServices?await getServicesConfigWriteBlocker(workPath,inferredServices.config):null,daemons=hasConfiguredServices?await(0,import_service_topology.detectDaemons)({fs}):[];return{detectServicesResult,hasConfiguredServices,daemons,inferredServices,inferredServicesWriteBlocker}}function displayConfiguredServicesSetup({detectServicesResult,daemons},configFileName="vercel.json"){let{services}=detectServicesResult,nameWidth=getNameColumnWidth([...services,...daemons].map(({name})=>name));services.length>0&&displayDetectedServices(services,nameWidth),daemons.length>0&&(services.length>0&&output_manager_default.print(`
23
- `),displayDetectedDaemons(daemons,nameWidth)),detectServicesResult.errors.length>0&&displayServiceErrors(detectServicesResult.errors),displayServicesConfigNote(configFileName,daemons.length>0)}function formatDetectedServicesSummary(services){if(services.length===0)return"";if(services.length===1)return`"${services[0].name}"`;if(services.length===2)return`"${services[0].name}" + "${services[1].name}"`;let othersCount=services.length-2;return`"${services[0].name}" + "${services[1].name}" + ${othersCount} ${othersCount===1?"other":"others"}`}function toProjectRootDirectory(projectPath,selectedPath){let rootDirectory=(0,import_build_utils3.normalizePath)(relative(projectPath,selectedPath));return rootDirectory===""?null:rootDirectory}async function promptForInferredServicesSetup({client,autoConfirm,nonInteractive,workPath,inferred,inferredWriteBlocker,allowChooseDifferentProjectDirectory=!1}){if(!inferred)return null;if(inferredWriteBlocker)return output_manager_default.warn(`Multiple services were detected, but your existing project config uses \`${inferredWriteBlocker}\`. To deploy multiple services in one project, see ${output_manager_default.link("Services",SERVICES_DOCS_URL)}.`),null;displayDetectedServices(inferred.services);let choice=null;if(autoConfirm)choice={type:"services"};else if(!nonInteractive){let webServices=inferred.services.filter(service=>(0,import_build_utils3.isExperimentalService)(service)?service.type==="web":!0),choices=[{name:`Set up project with all detected services: ${formatDetectedServicesSummary(inferred.services)}`,value:"services"},...webServices.map((service,index)=>({name:`Set up project with "${service.name}"`,value:`single-app:${index}`})),...allowChooseDifferentProjectDirectory?[{name:"Choose a different root directory",value:"project-directory"}]:[]],selected=await client.input.select({message:INFERRED_SERVICES_PROMPT,choices});if(selected==="services")choice={type:"services"};else if(selected==="project-directory")choice={type:"project-directory"};else if(typeof selected=="string"&&selected.startsWith("single-app:")){let index=Number.parseInt(selected.slice(11),10),service=webServices[index];if(service){let serviceRoot=(0,import_build_utils3.isExperimentalServiceV2)(service)?service.root:service.workspace;choice={type:"single-app",selectedPath:serviceRoot==="."?workPath:join2(workPath,serviceRoot)}}}}if(choice?.type!=="services")return choice;let{configFileName}=await writeServicesConfig(workPath,inferred.config);return output_manager_default.print(` Added services configuration to ${configFileName}.
24
- `),{type:"services"}}var import_slugify2=__toESM(require_slugify(),1);import{join as join3,relative as relative2}from"path";async function searchProjectsByRepoRoot({client,cwd,gitProjectName,orgs,remoteName}){let empty={matches:[],remoteNames:[]},rootPath=await findRepoRoot(cwd);if(!rootPath)return empty;let gitConfigPath=getGitConfigPath({cwd:rootPath})??join3(rootPath,".git/config"),remoteUrls=await getRemoteUrls(gitConfigPath),remoteNames=remoteUrls?Object.keys(remoteUrls).sort():[],remote;try{remote=await resolveGitRemote(client,rootPath,{yes:!0,existingRemoteName:remoteName})}catch(error){if(isPromptCanceledError(error))throw error;return output_manager_default.debug(`Failed to resolve Git remote for project search: ${error}`),{matches:[],remoteNames}}if(!remote)return{matches:[],remoteNames};let relativePath=relative2(rootPath,cwd);return{matches:(await Promise.all(orgs.map(async org=>{try{let projects=await fetchProjectsForRepoUrl(client,remote.repoUrl,org.id),repoProjectConfigs=projects.filter(project=>!gitProjectName||project.id===gitProjectName||project.name===gitProjectName).map(project=>({id:project.id,name:project.name,directory:project.rootDirectory||".",orgId:org.id}));return findProjectsFromPath(repoProjectConfigs,relativePath).map(match=>{let project=projects.find(p=>p.id===match.id);return project?{project,org,reason:"repo-root",repo:{...remote,directory:match.directory}}:null}).filter(Boolean)}catch(error){if(isPromptCanceledError(error))throw error;return output_manager_default.debug(`Failed to search Git-linked projects under ${org.slug}: ${error}`),[]}}))).flat(),remote,remoteNames}}function isCrossTeamMatch(value){return typeof value=="object"&&value!==null&&"project"in value&&"org"in value&&"reason"in value}async function selectOrgForLink(client,autoConfirm,searchable=!1,meta){try{return await selectOrg(client,"Which team?",autoConfirm,searchable,meta)}catch(err){if(isAPIError(err)){if(err.code==="NOT_AUTHORIZED")return output_manager_default.prettyError(err),{status:"error",exitCode:1,reason:"NOT_AUTHORIZED"};if(err.code==="TEAM_DELETED")return output_manager_default.prettyError(err),{status:"error",exitCode:1,reason:"TEAM_DELETED"}}throw err}}function isErrnoException(err){return err instanceof Error&&typeof err.code=="string"}async function hasWorkspaces(cwd){try{let fs=new import_fs_detectors2.LocalFileSystemDetector(cwd);return(await(0,import_fs_detectors2.getWorkspaces)({fs})).length>0}catch(err){if(isErrnoException(err)&&err.code&&["ENOENT","EACCES","ENOTDIR"].includes(err.code))return output_manager_default.debug(`getWorkspaces failed for ${cwd}: ${err}`),!1;throw err}}async function shouldPromptForRootDirectory(opts){if(opts.servicesChoice?.type==="project-directory"||await hasWorkspaces(opts.path))return!0;try{return((await detectProjects(opts.path)).get("")??[]).length===0&&!await detectStaticSite(opts.path)}catch(err){return output_manager_default.debug(`detectProjects failed at root: ${err}`),!0}}async function maybePullEnvAfterLink(client,path2,autoConfirm,pullEnv){if(!pullEnv||!client.stdin.isTTY||client.nonInteractive||(output_manager_default.print(`
25
- `),!(autoConfirm||await client.input.confirm("Pull development environment variables into .env.local?",!0))))return;let originalCwd=client.cwd;try{client.cwd=path2,await pull(client,autoConfirm?["--yes"]:[],"vercel-cli:link")!==0&&output_manager_default.error("Failed to pull environment variables. You can run `vc env pull` manually.")}catch{output_manager_default.error("Failed to pull environment variables. You can run `vc env pull` manually.")}finally{client.cwd=originalCwd}}async function linkCrossTeamMatch({client,path:path2,match,successEmoji,autoConfirm,pullEnv}){return client.config.currentTeam=match.org.type==="team"?match.org.id:void 0,match.reason==="repo-root"&&match.repo?(await linkRepoProject(client,path2,{project:match.project,orgId:match.org.id,orgSlug:match.org.slug,remoteName:match.repo.remoteName,successEmoji}),await maybePullEnvAfterLink(client,path2,autoConfirm,pullEnv),{status:"linked",org:match.org,project:match.project,repoRoot:match.repo.rootPath}):(await linkFolderToProject(client,path2,{projectId:match.project.id,orgId:match.org.id},match.project.name,match.org.slug,successEmoji,autoConfirm,pullEnv),{status:"linked",org:match.org,project:match.project})}async function setupAndLink(client,path2,{autoConfirm=!1,forceDelete=!1,link,selectedOrg,successEmoji="link",projectName,nonInteractive=!1,pullEnv=!0,v0,expiration,createIfNotFound=!1,beforeCreateProject}){let{config}=client,gitProjectName=projectName;if(projectName=projectName??basename(path2),!isDirectory(path2))return output_manager_default.error(`Expected directory but found file: ${path2}`),{status:"error",exitCode:1,reason:"PATH_IS_FILE"};link||(link=await getLinkedProject(client,{cwd:path2}));let isTTY=client.stdin.isTTY,rootDirectory=null,newProjectName,org=selectedOrg;if(!forceDelete&&link.status==="linked")return link;if((0,import_build_utils4.getPlatformEnv)("ORG_ID")&&(0,import_build_utils4.getPlatformEnv)("PROJECT_ID")){let envLink=await getLinkedProject(client,{cwd:path2});if(envLink.status==="error")return envLink;if(envLink.status==="linked")return config.currentTeam=envLink.org.type==="team"?envLink.org.id:void 0,output_manager_default.print(`
26
- `),printAlignedLabel("Directory",humanizePath(path2)),printAlignedLabel("Source","VERCEL_ORG_ID and VERCEL_PROJECT_ID"),output_manager_default.print(`
27
- `),printAlignedLabel("Linked",`${envLink.org.slug}/${envLink.project.name}`,{gutter:"\u2713"}),envLink}if(!isTTY&&!autoConfirm&&!nonInteractive)return{status:"error",exitCode:1,reason:"HEADLESS"};if(!org&&(nonInteractive||!isTTY)){let resolved=await selectOrgForLink(client,autoConfirm);if("status"in resolved)return resolved;org=resolved}if(forceDelete){let vercelDir=getVercelDirectory(path2);await(0,import_fs_extra.remove)(join4(vercelDir,VERCEL_DIR_README)),await(0,import_fs_extra.remove)(join4(vercelDir,VERCEL_DIR_PROJECT))}output_manager_default.print(`
28
- `),printAlignedLabel("Directory",humanizePath(path2)),output_manager_default.print(`
29
- `);let interactive=isTTY&&!nonInteractive,searchableTeamPicker=interactive,showProjectSuggestions=interactive&&!gitProjectName,projectOrNewProjectName,teamAutoSelected=!1,selectedGitRemoteName;for(;;){if(!org){let orgMeta={},resolved=await selectOrgForLink(client,autoConfirm,searchableTeamPicker,orgMeta);if("status"in resolved)return resolved;org=resolved,teamAutoSelected=orgMeta.choiceCount===1}if(createIfNotFound){let existing=await getProjectByNameOrId(client,projectName,org.id);projectOrNewProjectName=existing instanceof ProjectNotFound?projectName:existing;break}let repoMatches=[],gitRemoteNames=[],currentGitRemoteName;if(showProjectSuggestions){output_manager_default.spinner("Searching for existing projects\u2026",1e3);try{let repoSearch=await searchProjectsByRepoRoot({client,cwd:path2,gitProjectName,orgs:[org],remoteName:selectedGitRemoteName});repoMatches=repoSearch.matches,gitRemoteNames=repoSearch.remoteNames,currentGitRemoteName=repoSearch.remote?.remoteName}catch(err){if(isPromptCanceledError(err))throw err;output_manager_default.debug(`Git-linked project search failed: ${err}`)}finally{output_manager_default.stopSpinner()}}try{projectOrNewProjectName=await inputProject(client,org,projectName,autoConfirm,!1,showProjectSuggestions,searchableTeamPicker&&!selectedOrg&&!teamAutoSelected,repoMatches,{remoteNames:gitRemoteNames,currentRemoteName:currentGitRemoteName})}catch(err){if(err instanceof Error&&err.code==="HEADLESS")return{status:"error",exitCode:1,reason:"HEADLESS"};throw err}if(projectOrNewProjectName===BACK_TO_TEAM_SELECTION){org=void 0,selectedGitRemoteName=void 0;continue}if(projectOrNewProjectName===SWITCH_GIT_REMOTE){let rootPath=await findRepoRoot(path2);if(!rootPath)continue;try{selectedGitRemoteName=(await resolveGitRemote(client,rootPath,{yes:!1}))?.remoteName}catch(err){if(isPromptCanceledError(err))throw err;output_manager_default.debug(`Failed to switch Git remote: ${err}`)}continue}break}if(typeof projectOrNewProjectName=="string")newProjectName=projectOrNewProjectName;else{if(isCrossTeamMatch(projectOrNewProjectName))return await linkCrossTeamMatch({client,path:path2,match:projectOrNewProjectName,successEmoji,autoConfirm,pullEnv});{let project=projectOrNewProjectName;return createIfNotFound||await linkFolderToProject(client,path2,{projectId:project.id,orgId:org.id},project.name,org.slug,successEmoji,autoConfirm,pullEnv),{status:"linked",org,project}}}let refusedExitCode=beforeCreateProject?.();if(refusedExitCode!==void 0)return{status:"error",exitCode:refusedExitCode};config.currentTeam=org.type==="team"?org.id:void 0;let gitConnectIntent=createIfNotFound?null:await resolveGitConnectIntent(client,path2,autoConfirm),rootServicesSetup=await getServicesSetupState(path2),configFileName=await findSourceVercelConfigFile(path2)??"vercel.json";try{let settings={},pathWithRootDirectory=path2,rootInferredServicesChoice=null;if(rootServicesSetup.hasConfiguredServices||(rootInferredServicesChoice=await promptForInferredServicesSetup({client,autoConfirm,nonInteractive,workPath:path2,inferred:rootServicesSetup.inferredServices,inferredWriteBlocker:rootServicesSetup.inferredServicesWriteBlocker,allowChooseDifferentProjectDirectory:!0})),rootServicesSetup.hasConfiguredServices)displayConfiguredServicesSetup(rootServicesSetup,configFileName),settings.framework="services";else if(rootInferredServicesChoice?.type==="services")settings.framework="services";else{let skipSelectedRootInferredServicesPrompt=rootInferredServicesChoice?.type==="single-app";if(rootInferredServicesChoice?.type==="single-app")rootDirectory=toProjectRootDirectory(path2,rootInferredServicesChoice.selectedPath);else if(await shouldPromptForRootDirectory({path:path2,servicesChoice:rootInferredServicesChoice})&&(rootDirectory=await inputRootDirectory(client,path2,autoConfirm),rootDirectory&&!await validateRootDirectory(path2,join4(path2,rootDirectory))))return{status:"error",exitCode:1,reason:"INVALID_ROOT_DIRECTORY"};pathWithRootDirectory=rootDirectory?join4(path2,rootDirectory):path2;let selectedRootServicesSetup=pathWithRootDirectory===path2?null:await getServicesSetupState(pathWithRootDirectory),selectedRootInferredServicesChoice=null;if(skipSelectedRootInferredServicesPrompt||(selectedRootInferredServicesChoice=await promptForInferredServicesSetup({client,autoConfirm,nonInteractive,workPath:pathWithRootDirectory,inferred:selectedRootServicesSetup?.inferredServices??null,inferredWriteBlocker:selectedRootServicesSetup?.inferredServicesWriteBlocker??null})),selectedRootServicesSetup?.hasConfiguredServices)displayConfiguredServicesSetup(selectedRootServicesSetup,configFileName),settings.framework="services";else if(selectedRootInferredServicesChoice?.type==="services")settings.framework="services";else{selectedRootInferredServicesChoice?.type==="single-app"&&(rootDirectory=toProjectRootDirectory(path2,selectedRootInferredServicesChoice.selectedPath),pathWithRootDirectory=rootDirectory?join4(path2,rootDirectory):path2);let localConfig=await readConfig(pathWithRootDirectory);if(localConfig instanceof CantParseJSONFile)return output_manager_default.prettyError(localConfig),{status:"error",exitCode:1};if(!localConfig||!localConfig.builds||localConfig.builds.length===0){let localConfigurationOverrides={buildCommand:localConfig?.buildCommand,devCommand:localConfig?.devCommand,framework:localConfig?.framework,commandForIgnoringBuildStep:localConfig?.ignoreCommand,installCommand:localConfig?.installCommand,outputDirectory:localConfig?.outputDirectory},detectedProjects=(await detectProjects(pathWithRootDirectory)).get("")||[],framework=detectedProjects[0]??import_frameworks3.frameworkList.find(f=>f.slug===null),staticSite=detectedProjects.length===0?await detectStaticSite(pathWithRootDirectory):null;settings=await editProjectSettings(client,{},framework,autoConfirm,localConfigurationOverrides,configFileName,staticSite)}}}let changeAdditionalSettings=!1,vercelAuthSetting=DEFAULT_VERCEL_AUTH_SETTING;changeAdditionalSettings&&(vercelAuthSetting=await vercelAuth(client,{autoConfirm})),rootDirectory&&(settings.rootDirectory=rootDirectory);let project=await createProject(client,{...settings,name:newProjectName,vercelAuth:vercelAuthSetting,v0,expiration});return createIfNotFound?(output_manager_default.print(`
30
- `),printAlignedLabel("Created",`${org.slug}/${project.name}`,{gutter:"\u2713"})):await linkFolderToProject(client,path2,{projectId:project.id,orgId:org.id},project.name,org.slug,successEmoji,autoConfirm,!1,"Created"),await applyGitConnectIntent(client,gitConnectIntent,project,autoConfirm,org),{status:"linked",org,project,...gitConnectIntent?.offered&&{gitConnectOffered:!0},projectCreated:!0}}catch(err){if(isPromptCanceledError(err))throw err;return isAPIError(err)&&err.code==="too_many_projects"?(output_manager_default.prettyError(err),{status:"error",exitCode:1,reason:"TOO_MANY_PROJECTS"}):err instanceof Error&&err.code==="HEADLESS"?{status:"error",exitCode:1,reason:"HEADLESS"}:(printError(err),{status:"error",exitCode:1})}}async function resolveGitConnectIntent(client,path2,autoConfirm){try{let gitConfigPath=getGitConfigPath({cwd:path2})??join4(path2,".git/config"),gitConfig=await parseGitConfig(gitConfigPath);if(!gitConfig)return null;let remoteUrls=pluckRemoteUrls(gitConfig);if(!remoteUrls||Object.keys(remoteUrls).length===0)return null;let skipPrompts=autoConfirm||client.nonInteractive;if(!(skipPrompts||await client.input.confirm("Connect this Git repository to automatically deploy changes on every push?",!1)))return{offered:!0};let repoInfo=skipPrompts?parseRepoUrl(remoteUrls.origin??Object.values(remoteUrls)[0]):await selectAndParseRemoteUrl(client,remoteUrls);return repoInfo?{repoInfo,offered:!skipPrompts}:null}catch(error){if(isPromptCanceledError(error))throw error;return output_manager_default.debug(`Failed to detect git repository: ${error}`),null}}async function applyGitConnectIntent(client,intent,project,autoConfirm,org){if(!intent?.repoInfo)return;let{repoInfo}=intent;try{await checkExistsAndConnect({client,confirm:autoConfirm,gitProviderLink:project.link,org,gitOrg:repoInfo.org,project,provider:repoInfo.provider,repo:repoInfo.repo,repoPath:`${repoInfo.org}/${repoInfo.repo}`})}catch(error){if(isPromptCanceledError(error))return;output_manager_default.debug(`Failed to connect git repository: ${error}`)}}async function connectGitRepository(client,path2,project,autoConfirm,org){let intent;try{intent=await resolveGitConnectIntent(client,path2,autoConfirm)}catch(error){if(isPromptCanceledError(error))return;throw error}await applyGitConnectIntent(client,intent,project,autoConfirm,org)}export{readConfig,displayDetectedServices,shouldPromptForRootDirectory,setupAndLink,resolveGitConnectIntent,applyGitConnectIntent,connectGitRepository};
@@ -1,12 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{getScope}from"./chunk-NLK7NGVP.js";import{getOrgById}from"./chunk-Z2KANBOU.js";import{suggestCorrection}from"./chunk-CINNNQDJ.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithGlobalFlags,outputAgentError,shouldEmitNonInteractiveCommandError}from"./chunk-4SS6W6JK.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";async function findSimilarProjectName(client,name,orgId){try{let{projects}=await client.fetch("/v9/projects?limit=100",{accountId:orgId});return suggestCorrection(name,projects.map(project=>project.name).filter(projectName=>/^[a-z0-9._-]+$/i.test(projectName)))}catch(err){output_manager_default.debug(`Project suggestion lookup failed: ${err}`);return}}async function printProjectNotFoundError(client,projectNameOrId,commandName,orgId,{createCommand}={}){let contextName;try{orgId?contextName=(await getOrgById(client,orgId))?.slug??orgId:contextName=(await getScope(client)).contextName}catch(err){contextName=orgId,output_manager_default.debug(`Scope lookup failed during error reporting: ${err}`)}let scopeClause=contextName?` (${contextName})`:"",headline=`Project "${projectNameOrId}" was not found in the current scope${scopeClause}.`,suggestion=createCommand?await findSimilarProjectName(client,projectNameOrId,orgId):void 0,suggestionLine=suggestion?` Did you mean ${suggestion}?`:"",createNote=createCommand?.note;if(output_manager_default.error(`${headline}${suggestionLine}
8
-
9
- `+(createCommand?`To create it${createNote?`, ${createNote}`:""}:
10
- ${createCommand.command}
11
-
12
- `:"")+"If it lives in a different team or account:\n \u2022 Retry with `--scope <team-slug|your-username>`, or\n \u2022 Run `vercel switch <team-slug|your-username>` to change scope.\n\nList accessible teams with `vercel teams ls`."),!shouldEmitNonInteractiveCommandError(client))return;let retryWithScope=buildCommandWithGlobalFlags(client.argv,`${commandName} --project ${projectNameOrId} --scope <team-slug>`);outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.PROJECT_NOT_FOUND,message:`${headline}${suggestionLine}${createCommand?` To create it, retry with --create-if-missing${createNote?`, and ${createNote}`:""}.`:""} If it lives in a different team or account, retry with --scope <team-slug|your-username> or run \`vercel switch <team-slug|your-username>\` to change scope.`,...contextName?{scope:contextName}:{},...suggestion?{data:{suggestion}}:{},next:[...createCommand?[{command:createCommand.command,when:`create the project${createNote?`; ${createNote}`:""}`}]:[],{command:"vercel teams ls",when:"list accessible teams"},{command:retryWithScope,when:"retry with a specific team"},{command:"vercel switch <team-slug>",when:"change the default scope"}]},1)}export{printProjectNotFoundError};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{pull}from"./chunk-YI7NKOCU.js";import{indent_default}from"./chunk-GZNDA6SV.js";import{getLinkedProject}from"./chunk-Z2KANBOU.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";async function createBlobStore(client,input,accountId,requestOptions){let result=await client.fetch("/v1/storage/stores/blob",{...requestOptions,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(input),accountId});if(!result.store?.id)throw new Error("Blob creation returned no store ID.");return{id:result.store.id,region:result.store.region}}async function connectResourceToProject(client,projectId,storeId,environments,options){let path=`/v1/storage/stores/${encodeURIComponent(storeId)}/connections`;return client.fetch(path,{retry:options?.retry,bailOn429:options?.bailOn429,signal:options?.signal,json:!0,method:"POST",body:{envVarEnvironments:environments,projectId,type:"integration",...options?.envVarPrefix!==void 0?{envVarPrefix:options.envVarPrefix}:{}},accountId:options?.accountId})}var import_chalk=__toESM(require_source(),1);var VALID_ENVIRONMENTS=["production","preview","development"],ENV_PULL_FAILED_MESSAGE="Failed to pull environment variables. You can run `vercel env pull` manually.";function validateEnvironments(environments){let invalid=environments.filter(env=>!VALID_ENVIRONMENTS.includes(env));return invalid.length>0?{valid:!1,invalid}:{valid:!0}}async function postProvisionSetup(client,resourceName,resourceId,contextName,options={}){let dashboardUrl=options.integrationSlug&&options.installationId?`https://vercel.com/d/dashboard/integrations/${options.integrationSlug}/${options.installationId}/resources/${resourceId}`:`https://vercel.com/${contextName}/~/stores/integration/${resourceId}`;output_manager_default.log(indent_default(`Dashboard: ${output_manager_default.link(dashboardUrl,dashboardUrl,{fallback:!1})}`,4));let baseResult={exitCode:0,dashboardUrl,connected:!1,environments:[],envPulled:!1};if(options.noConnect)return baseResult;let linkedProject=await getLinkedProject(client);if(linkedProject.status==="error")return{...baseResult,exitCode:linkedProject.exitCode};if(linkedProject.status==="not_linked")return baseResult;let{project}=linkedProject,environments=[...new Set(options.environments&&options.environments.length>0?options.environments:[...VALID_ENVIRONMENTS])];output_manager_default.debug(`Selected environments: ${JSON.stringify(environments)}`),output_manager_default.spinner(`Connecting ${import_chalk.default.bold(resourceName)} to ${import_chalk.default.bold(project.name)}...`),output_manager_default.debug(`Connecting resource ${resourceId} to project ${project.id}`);try{await connectResourceToProject(client,project.id,resourceId,environments,options.prefix?{envVarPrefix:options.prefix}:void 0)}catch(error){return output_manager_default.stopSpinner(),options.onProjectConnectFailed?.(project.id,error),output_manager_default.error(`Failed to connect: ${error.message}`),{...baseResult,exitCode:1,project:{id:project.id,name:project.name},environments,connectError:error.message}}output_manager_default.stopSpinner(),output_manager_default.log(`${import_chalk.default.bold(resourceName)} successfully connected to ${import_chalk.default.bold(project.name)}`),options.onProjectConnected?.(project.id);let envPulled=!1;return options.noEnvPull||(await pull(client,["--yes"],"vercel-cli:integration:add")!==0?output_manager_default.warn(ENV_PULL_FAILED_MESSAGE):envPulled=!0),{...baseResult,project:{id:project.id,name:project.name},connected:!0,environments,envPulled}}async function getLinkedProjectField(client,noConnect,field="name"){if(noConnect)return{value:void 0};let linkedProject=await getLinkedProject(client);return linkedProject.status==="error"?{value:void 0,exitCode:linkedProject.exitCode}:linkedProject.status==="linked"?{value:linkedProject.project[field]}:{value:void 0}}export{createBlobStore,connectResourceToProject,VALID_ENVIRONMENTS,ENV_PULL_FAILED_MESSAGE,validateEnvironments,postProvisionSetup,getLinkedProjectField};
@@ -1,10 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{printProjectNotFoundError}from"./chunk-QGHAD5A5.js";import{param}from"./chunk-3G3FQYMW.js";import{detectExplicitScope}from"./chunk-NLK7NGVP.js";import{getLinkedProject,resolveProjectCwd}from"./chunk-Z2KANBOU.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithYes,outputActionRequired,outputAgentError}from"./chunk-4SS6W6JK.js";import{getCommandName,getCommandNamePlain}from"./chunk-B4KA3ZH2.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_build_utils=__toESM(require_build_utils(),1);async function ensureLink(commandName,client,cwd,opts={}){cwd=await resolveProjectCwd(cwd);let link=opts.link,nonInteractive=opts.nonInteractive??client.nonInteractive??!1;if(opts.nonInteractive=nonInteractive,link||(opts.forceDelete?link={status:"not_linked",org:null,project:null}:link=await getLinkedProject(client,{cwd,projectName:opts.projectName,projectNameIsExplicit:!!(opts.projectName&&opts.failIfNotFound),scopeIsExplicit:detectExplicitScope(client),allowOwnerLookupFallback:opts.allowOwnerLookupFallback,skipOwnerLookup:opts.skipOwnerLookup,skipRemoteLookup:opts.skipRemoteLookup}),opts.link=link),link.status==="linked"&&opts.forceDelete||link.status==="not_linked"){if(link.status==="not_linked"&&opts.failIfNotFound&&opts.projectName){let pinnedProjectId=(0,import_build_utils.getPlatformEnv)("PROJECT_ID"),creatable=!opts.projectName.startsWith("prj_")&&!pinnedProjectId;if(!opts.createIfNotFound||opts.projectName.startsWith("prj_")||pinnedProjectId===opts.projectName)return await printProjectNotFoundError(client,opts.projectName,commandName,link.orgId,{createCommand:creatable?opts.createCommand:void 0}),1;if(pinnedProjectId){let message=`Can't use --project with VERCEL_PROJECT_ID. --project is "${opts.projectName}" and VERCEL_PROJECT_ID is "${pinnedProjectId}". Remove one of them.`,helpCommand=getCommandNamePlain(`${commandName} --help`);return output_manager_default.error(`${message}
8
-
9
- See all options:
10
- ${helpCommand}`),outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message,next:[{command:helpCommand,when:"see all options"}]}),2}}if(link.status==="not_linked"&&opts.requireExistingLink)return output_manager_default.error(opts.notLinkedMessage??`Project is not linked. Run ${getCommandName("link")} first.`),1;let{default:setupAndLink}=await import("./setup-and-link-5TPDTJIN.js");if(link=await setupAndLink(client,cwd,opts),link.status==="not_linked")return 0}return link.status==="error"?(link.reason==="HEADLESS"&&(nonInteractive?outputActionRequired(client,{status:"action_required",reason:"confirmation_required",message:`Command ${getCommandNamePlain(commandName)} requires confirmation. Use option --yes to confirm.`,next:[{command:buildCommandWithYes(client.argv),when:"Confirm and run"}]},link.exitCode):output_manager_default.error(`Command ${getCommandName(commandName)} requires confirmation. Use option ${param("--yes")} to confirm.`)),nonInteractive&&!client.jsonMode&&process.exit(link.exitCode),link.exitCode):link}export{ensureLink};
@@ -1,8 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{external_exports}from"./chunk-2AMO2VMV.js";import{recordLine}from"./chunk-KRP4EMD2.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import{require_strip_ansi}from"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var MAX_PAGE_SIZE=1e3,QUERY_REASON_HEADER="x-vercel-observability-query-reason",responseSchema=external_exports.object({events:external_exports.array(external_exports.record(external_exports.string(),external_exports.unknown())),pagination:external_exports.object({hasMore:external_exports.boolean(),nextCursor:external_exports.string().nullable()}),meta:external_exports.object({excludedIntervals:external_exports.array(external_exports.object({start:external_exports.string(),end:external_exports.string()})).optional()}).passthrough().optional()}),InvalidEventsResponseError=class extends Error{constructor(){super("The Observability API returned an invalid events response."),this.name="InvalidEventsResponseError"}},RecordTooLargeError=class extends Error{constructor(){super("A single record exceeds the API response size limit and cannot be returned."),this.name="RecordTooLargeError"}};function isResultTooLarge(err){return isAPIError(err)&&err.status===413&&err.code==="result_too_large"}async function fetchEventsPage(client,request,limit,cursor){let body={event:request.event,scope:{ownerId:request.ownerId,...request.projectIds?{projectIds:[...request.projectIds]}:{}},timeRange:{start:request.timeRange.start,end:request.timeRange.end},select:[...request.select],order:"desc",limit};request.filter&&(body.filter=request.filter),cursor&&(body.cursor=cursor);let params=new URLSearchParams({teamId:request.ownerId}),response=await client.fetch(`/v1/observability/events?${params}`,{method:"POST",headers:{[QUERY_REASON_HEADER]:request.queryReason},body,useCurrentTeam:!1,...request.bailOn429?{bailOn429:!0}:{},...request.gatewayTimeoutRetries!==void 0?{gatewayTimeoutRetries:request.gatewayTimeoutRetries}:{}}),parsed=responseSchema.safeParse(response);if(!parsed.success)throw new InvalidEventsResponseError;return parsed.data}async function*fetchEventPages(client,request,limit,startCursor){let remaining=limit,maxPageSize=MAX_PAGE_SIZE,cursor=startCursor,lastNextCursor=null;for(;remaining>0;){let pageSize=Math.min(remaining,maxPageSize),response;for(;;)try{response=await fetchEventsPage(client,request,pageSize,cursor);break}catch(err){if(!isResultTooLarge(err))throw err;if(pageSize===1)throw new RecordTooLargeError;pageSize=Math.max(1,Math.floor(pageSize/2)),maxPageSize=pageSize}let events=response.events.slice(0,remaining);remaining-=events.length;let{hasMore,nextCursor}=response.pagination,continues=hasMore&&!!nextCursor&&nextCursor!==cursor;if(lastNextCursor=continues?nextCursor:null,yield{events,excludedIntervals:response.meta?.excludedIntervals??[],nextCursor:lastNextCursor},!continues)return{hasMore,nextCursor:null};cursor=nextCursor??void 0}return{hasMore:!0,nextCursor:lastNextCursor}}function sortIntervals(intervals){return[...intervals].sort((a,b)=>Date.parse(a.start)-Date.parse(b.start)||Date.parse(a.end)-Date.parse(b.end))}var import_strip_ansi=__toESM(require_strip_ansi(),1);function recordLine2(type,event){return recordLine(type,event)}function warningLine(warning){let line={type:"warning",reason:warning.reason,message:(0,import_strip_ansi.default)(warning.message),...warning.data?{data:warning.data}:{}};return`${JSON.stringify(line)}
8
- `}function serializeTimeRange(range){return{start:range.start.toISOString(),end:range.end.toISOString()}}var CONTINUATION_VERSION=1,continuationSchema=external_exports.object({v:external_exports.literal(CONTINUATION_VERSION),event:external_exports.string().min(1),ownerId:external_exports.string().min(1),projectIds:external_exports.array(external_exports.string().min(1)).optional(),timeRange:external_exports.object({start:external_exports.string().min(1),end:external_exports.string().min(1)}),filter:external_exports.string().optional(),order:external_exports.enum(["asc","desc"]),cursor:external_exports.string().min(1)});function encodeContinuation(continuation){let payload={v:CONTINUATION_VERSION,event:continuation.event,ownerId:continuation.ownerId,...continuation.projectIds?{projectIds:[...continuation.projectIds]}:{},timeRange:{start:continuation.timeRange.start,end:continuation.timeRange.end},...continuation.filter!==void 0?{filter:continuation.filter}:{},order:continuation.order,cursor:continuation.cursor};return Buffer.from(JSON.stringify(payload),"utf8").toString("base64url")}function decodeContinuation(token){if(!/^[A-Za-z0-9_-]+$/.test(token))return;let raw;try{raw=JSON.parse(Buffer.from(token,"base64url").toString("utf8"))}catch{return}let parsed=continuationSchema.safeParse(raw);if(!parsed.success)return;let{v:_version,...continuation}=parsed.data;return continuation}export{InvalidEventsResponseError,RecordTooLargeError,fetchEventPages,sortIntervals,recordLine2 as recordLine,warningLine,serializeTimeRange,encodeContinuation,decodeContinuation};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- var options={re:{type:"string",value:"id",description:"in a thread: its root's ID"},by:{type:"string",value:"handle",description:"by an author: a handle, me, or an actor ID"},mentions:{type:"string",value:"@handle",optionalValue:!0,description:"mentioning a handle or email, or you without one"},label:{type:"string",multiple:!0,value:"k[=v|w]",description:"with a label on the message or its thread's root"},source:{type:"string",value:"source",description:"from a source: a sync key such as slack, or board"},text:{type:"string",value:"words",description:"containing this text, as one phrase (a substring, not word search)"},after:{type:"string",value:"id",description:"only what came after a message or a cursor (read and wait print one)"},url:{type:"string",value:"url",description:"the board at this URL, not the one the environment points at"},scope:{type:"string",value:"team",description:"a team's board in Vercel's API, by its slug or ID"},name:{type:"string",value:"board",description:"the team's board with this name, on --scope's team"},ensure:{type:"boolean",description:"with --name: make that board if the team has none by that name"},team:{type:"string",value:"team",description:"the same as --scope",hidden:!0},as:{type:"string",value:"profile",description:"write as a profile, such as an agent's name"},avatar:{type:"string",value:"url",description:"the profile's avatar, with --as"},json:{type:"boolean",description:"JSON, for programs"},help:{type:"boolean",short:"h",description:"this help, or a command's"},version:{type:"boolean",short:"v",description:"the CLI's version"},limit:{type:"string",short:"n",value:"N",description:"how many"},last:{type:"string",value:"N",description:"start with the feed's newest N events (1 to 100)"},before:{type:"string",value:"older",description:"a channel's threads before a page: the older its read printed"},"idempotency-key":{type:"string",value:"key",description:"sending the same one again posts once"},sync:{type:"string",multiple:!0,value:"target",description:"sync the new thread to a target too, e.g. slack:#incidents"},"no-sync":{type:"boolean",description:"keep it on the board: sync it nowhere"},attach:{type:"string",multiple:!0,value:"file",description:"attach a file: up to 10 per message, each up to 100 MB (4 MB on some boards)"},file:{type:"string",value:"path",description:"from a file: - reads stdin"},data:{type:"string",value:"json",description:"as JSON, written inline"},unset:{type:"string",multiple:!0,value:"k",description:"remove a label"},if:{type:"string",multiple:!0,value:"k=v",description:"only while the message has this label now"},"if-unset":{type:"string",multiple:!0,value:"k",description:"only while the message doesn't have this label"},"if-revision":{type:"string",value:"N",description:"only if it is still at this revision, as read --json shows it"},channel:{type:"string",value:"c",description:"in a channel"},remove:{type:"boolean",description:"take the reaction back"},all:{type:"boolean",short:"a",description:"everything, not only what most want"},timeout:{type:"string",value:"duration",description:"how long to wait: 30s, 10m, or a bare number of seconds (default: 30m)"},"no-open":{type:"boolean",description:"don't open the browser"},"allow-host":{type:"string",multiple:!0,value:"host",description:"also answer requests for this host, from a proxy in front: whoever reaches it there acts as you"},tailscale:{type:"string",multiple:!0,value:"host",description:"also answer requests for this host, the board's name on your tailnet behind tailscale serve: whoever Tailscale says is calling is a person on the board"},in:{type:"string",value:"duration",description:"once, this long from now, e.g. 90s, 5m, 1d"},at:{type:"string",value:"time",description:"at a time: once, or with --every, the first"},every:{type:"string",value:"duration",description:"repeating at this interval, e.g. 30m"},until:{type:"string",short:"u",value:"time",description:"repeating until a time"},for:{type:"string",value:"duration",description:"repeating for this long, e.g. 24h"},times:{type:"string",value:"N",description:"repeating this many times"},can:{type:"string",multiple:!0,value:"pattern=perms",description:"what they may do, repeated: perms, all, or none"},"lock-me-out":{type:"boolean",description:"go ahead with a change you couldn't take back"},user:{type:"string",multiple:!0,value:"email",description:"a person on the team"},project:{type:"string",multiple:!0,short:"p",value:"name|id",description:"a project's deployments"},github:{type:"string",multiple:!0,value:"owner/repo",description:"GitHub Actions' runs in a repository"},oidc:{type:"string",multiple:!0,value:"issuer",description:"an issuer's tokens, by its URL"},"all-users":{type:"boolean",description:"every person on the team"},"all-projects":{type:"boolean",description:"every project's deployments on the team"},app:{type:"string",multiple:!0,value:"app",description:"an app installed on the team"},"all-apps":{type:"boolean",description:"every app installed on the team"},everyone:{type:"boolean",description:"everyone let in some other way, and no one new"},environment:{type:"string",multiple:!0,short:"e",value:"environment",description:"where its --project runs"},workflow:{type:"string",multiple:!0,value:"file",description:"its --github's workflow, e.g. ci.yml"},"git-branch":{type:"string",multiple:!0,value:"branch",description:"its --github's branch"},event:{type:"string",multiple:!0,value:"event",description:"its --github's event, e.g. push"},claim:{type:"string",multiple:!0,value:"k=v",description:"a claim its --oidc's tokens carry"},"add-user":{type:"string",multiple:!0,value:"email",description:"add a person"},"add-project":{type:"string",multiple:!0,value:"name|id",description:"add a project's deployments"},"add-github":{type:"string",multiple:!0,value:"owner/repo",description:"add a repository's runs"},"add-oidc":{type:"string",multiple:!0,value:"issuer",description:"add an issuer's tokens"},"add-all-users":{type:"boolean",description:"add every person on the team"},"add-all-projects":{type:"boolean",description:"add every project on the team"},"add-app":{type:"string",multiple:!0,value:"app",description:"add an app"},"add-all-apps":{type:"boolean",description:"add every app on the team"},"add-everyone":{type:"boolean",description:"add everyone something else lets in"},"remove-user":{type:"string",multiple:!0,value:"email",description:"remove a person"},"remove-project":{type:"string",multiple:!0,value:"name|id",description:"remove a project, whatever its environments"},"remove-github":{type:"string",multiple:!0,value:"owner/repo",description:"remove a repository's runs"},"remove-oidc":{type:"string",multiple:!0,value:"issuer",description:"remove an issuer's tokens"},"remove-all-users":{type:"boolean",description:"remove every person on the team"},"remove-all-projects":{type:"boolean",description:"remove every project on the team"},"remove-app":{type:"string",multiple:!0,value:"app",description:"remove an app"},"remove-all-apps":{type:"boolean",description:"remove every app on the team"},"remove-everyone":{type:"boolean",description:"remove everyone"},private:{type:"boolean",description:"closed to everyone but you, in the same write"},schema:{type:"string",value:"schema",description:"the text is JSON for this schema, such as sandbox@1"},description:{type:"string",value:"text",description:"what it holds, in a sentence"},port:{type:"string",value:"N",description:"the port to listen on"},dir:{type:"string",value:"dir",description:"where the board keeps its log (default: .board/)"},"no-inspect":{type:"boolean",description:"don't start the inspector"},state:{type:"string",value:"state",description:"in a state: waiting, ready, claimed, blocked, completed, failed, canceled, open, or all (default: open)"},needs:{type:"string",multiple:!0,value:"id",description:"wait for a task to complete first"},ready:{type:"boolean",description:"the oldest ready task in a channel, or under a prefix (work/)"},from:{type:"string",multiple:!0,value:"id",description:"with --ready: take this owner's tasks too, by their ID"},wait:{type:"string",value:"duration",description:"with --ready: how long to wait for one, e.g. 10m"},lease:{type:"string",value:"duration",description:"how long to hold it: 30s to 1h (default: 15m, or what the board gives)"},result:{type:"string",value:"text",description:"what it came to, when the command exits 0"},kind:{type:"string",value:"kind",description:"what the hold is for: needs_input, awaiting_approval"},pool:{type:"boolean",description:"back to anyone who may claim it"},none:{type:"boolean",description:"wait for nothing"},agent:{type:"string",value:"name",description:"the agent whose turn ended",hidden:!0}},option=(name,description,value)=>({name,...options[name],...description?{description}:{},...value?{value}:{}}),filters=["re","by","source","label","text","mentions","after"].map(name=>option(name)),globalOptions=["url","scope","name","ensure","team","as","avatar","json","help","version"].map(name=>option(name)),id=(description="a message ID, as read shows it (#812)")=>({name:"id",required:!0,description}),text=(description="what it says: - reads it from stdin, and it may be left out when you --attach or --file")=>({name:"text",required:!1,description}),task=(description="a task's ID, as tasks shows it (#812)")=>({name:"id",required:!0,description}),claimNow={name:"claim",type:"boolean",description:"claim it in the same write"},AFTER="a reply only while this is the thread's newest message",groups=["you","the board","messages","agents","live"],commands=[{group:"you",name:"whoami",description:"who am I, on which board, with which credential, and what I can do",arguments:[],options:[],examples:[{name:"see who you are on the board",value:"whoami"}]},{group:"the board",name:"grants",description:"who may do what where, grant by grant",arguments:[],options:[],runsWithoutSubcommand:!0,examples:[{name:"list the grants",value:"grants"}],subcommands:[{name:"list",default:!0,description:"the board's grants",arguments:[],options:[],examples:[{name:"list the grants",value:"grants list"}]},{name:"create",description:"let principals do what --can says, where it says",arguments:[],options:[...["user","project","github","oidc","app","all-users","all-projects","all-apps","everyone"].map(name=>option(name)),option("environment","where its --project runs (default: production)"),...["workflow","git-branch","event","claim"].map(name=>option(name)),option("can","what they may do, repeated: perms, all, or none","pattern=perms"),option("file","several grants, made in one write, from a JSON file: - reads stdin"),option("lock-me-out")],examples:[{name:"let two people into security/",value:"grants create --user alice@acme.com --user bob@acme.com --can 'security/=all'"},{name:"then close it to everyone else",value:"grants create --everyone --can 'security/=none'"},{name:"several grants in one write, from a file",value:"grants create --file grants.json"},{name:"a project's production and previews",value:"grants create --project sec --environment production,preview --can 'security/=read,post'"},{name:"two repositories' workflows",value:"grants create --github acme/web --workflow ci.yml --git-branch main --github acme/api --workflow deploy.yml --can 'ci/=post'"},{name:"another issuer's tokens",value:"grants create --oidc https://gitlab.com --claim project_id=42 --can 'ci/=post'"}]},{name:"update",description:"add or remove principals, or replace its --can",arguments:[{name:"grant",required:!0,description:"its ID, as grants shows it (g3)"}],options:[...["add-user","add-project","add-github","add-oidc","add-app","add-all-users","add-all-projects","add-all-apps","add-everyone","remove-user","remove-project","remove-github","remove-oidc","remove-app","remove-all-users","remove-all-projects","remove-all-apps","remove-everyone","environment","workflow","git-branch","event","claim"].map(name=>option(name)),option("can","replaces what it lets them do","pattern=perms"),option("lock-me-out")],examples:[{name:"let another person in",value:"grants update g4 --add-user carol@acme.com"},{name:"drop a project, and narrow it",value:"grants update g5 --remove-project sec --can 'security/=read'"}]},{name:"explain",description:"which grant decides a channel, for you or anyone",arguments:[{name:"channel",required:!0,description:"a channel, such as security/incidents"}],options:[...["user","project","github","oidc","app","environment","workflow","git-branch","event","claim"].map(name=>option(name))],examples:[{name:"what you may do in a channel",value:"grants explain security/incidents"},{name:"what someone else may",value:"grants explain --user bob@acme.com security/incidents"}]},{name:"revoke",description:"stop letting them in",arguments:[{name:"grant",required:!0,description:"its ID, as grants shows it (g3)"}],options:[option("lock-me-out")],examples:[{name:"revoke a grant",value:"grants revoke g3"}]}]},{group:"the board",name:"channels",description:"channels, a page at a time, grouped by path prefix: a first post makes one, and so does create",arguments:[{name:"prefix",required:!1,description:"only the channels whose path starts with it: dev/"}],options:[option("limit"),option("after")],runsWithoutSubcommand:!0,examples:[{name:"list the channels",value:"channels"},{name:"the ones under dev",value:"channels dev/"}],subcommands:[{name:"list",default:!0,description:"channels, a page at a time, grouped by path prefix",arguments:[{name:"prefix",required:!1,description:"only the channels whose path starts with it: dev/"}],options:[option("limit"),option("after")],examples:[{name:"list the channels",value:"channels list"},{name:"the next page, from the cursor a page ends with",value:"channels list dev/ --after c.8f2a.2"}]},{name:"create",description:"a channel, before anything posts to it (one that exists stays as it is)",arguments:[{name:"channel",required:!0,description:"its path, such as dev/alerts"}],options:[option("private")],examples:[{name:"make a channel for alerts",value:"channels create dev/alerts"},{name:"one only you can see, until you grant others",value:"channels create security --private"}]}]},{group:"the board",name:"schemas",description:"schemas for structured data: versions that never change",arguments:[],options:[],runsWithoutSubcommand:!0,examples:[{name:"list the schemas",value:"schemas"}],subcommands:[{name:"list",default:!0,description:"the built-in schemas, then the board's own",arguments:[],options:[],examples:[{name:"list the schemas",value:"schemas list"}]},{name:"inspect",description:"one version, with its JSON Schema",arguments:[{name:"schema",required:!0,description:"its ID, as schemas shows it (sandbox@1)"}],options:[],examples:[{name:"see what a sandbox event holds",value:"schemas inspect sandbox@1"}]},{name:"create",description:"register a version, for good: the same definition again changes nothing",arguments:[{name:"schema",required:!0,description:"its name and version, such as sandbox@1"}],options:[option("file","its JSON Schema, from a file: - reads stdin"),option("data","its JSON Schema, written inline"),option("description")],examples:[{name:"register a version from a file",value:"schemas create sandbox@1 --file sandbox.schema.json --description 'What a sandbox did.'"},{name:"or inline",value:`schemas create ping@1 --data '{"type":"object","required":["at"],"properties":{"at":{"type":"string","format":"date-time"}}}'`}]}]},{group:"the board",name:"actors",description:"actors and their handles",arguments:[],options:[],examples:[{name:"list who has written here",value:"actors"}]},{group:"messages",name:"read",description:"the latest threads, one each (root, replies, latest reply), or one thread, every message",arguments:[{name:"channel|id|link",required:!1,description:"a channel (every channel without one), a message's ID, or a Slack or GitHub link the board synced"}],options:[option("limit","threads to list (default: 50, at most 500)"),option("before")],filters:!0,examples:[{name:"list a channel's latest threads",value:"read dev"},{name:"read one thread, every message",value:"read 812"},{name:"list the open bugs",value:"read dev --label kind=bug --label state=open"},{name:"only what's new since the cursor an earlier read printed",value:"read dev --after 1042"},{name:"the page before one, by the older it printed",value:"read dev --before 1031.1024"}]},{group:"messages",name:"post",brief:"[--label k=v]... [--attach file]...",description:"a new thread in a channel, or with an ID, a reply in its thread",arguments:[{name:"channel|id",required:!0,description:"a channel, or a message ID to reply in its thread"},text()],options:[option("label","label it","k=v"),option("file","the text, from a file: - reads stdin"),option("schema"),option("attach"),option("sync"),option("no-sync"),option("idempotency-key"),option("after",AFTER)],examples:[{name:"start a thread",value:'post dev "deploys are green again"'},{name:"start a labeled thread",value:'post dev "checkout times out" --label kind=bug'},{name:"post data that matches a schema",value:`post deploys --schema sandbox@1 '{"id":"sbx-123","action":"started"}'`}]},{group:"messages",name:"reply",description:"a reply in a thread",arguments:[id("the ID of a message in the thread"),text()],options:[option("label","label it","k=v"),option("file","the text, from a file: - reads stdin"),option("schema"),option("attach"),option("idempotency-key"),option("no-sync"),option("after",AFTER)],examples:[{name:"reply in a thread",value:'reply 812 "on it"'},{name:"reply with a label",value:'reply 812 "fixed in a1b2c3" --label step=fix'},{name:"reply only if #815 is still the thread's newest",value:'reply 812 "on it" --after 815'}]},{group:"messages",name:"schedule",brief:"(--in 5m | --at time | --every 30m)",description:"post later, as you: once (--in or --at), or repeating (--every) until a stop or until canceled",arguments:[{name:"channel|id",required:!0,description:"a channel, or a message ID to reply in its thread"},text()],options:[option("in"),option("at"),option("every"),option("until"),option("for"),option("times"),option("label","label it","k=v"),option("file","the text, from a file: - reads stdin"),option("schema"),option("attach"),option("no-sync")],examples:[{name:"reply in a thread tomorrow",value:'schedule 812 "still broken?" --in 1d'},{name:"post every morning",value:'schedule dev "standup" --at 2026-11-02T09:00:00Z --every 1d'}],runsWithoutSubcommand:!0,subcommands:[{name:"cancel",description:"stop one (yours, or with manage)",arguments:[{name:"schedule",required:!0,description:"its ID, as schedules shows it (s12)"}],options:[],examples:[{name:"cancel a schedule",value:"schedule cancel s12"}]}]},{group:"messages",name:"schedules",brief:"[--by handle] [--all]",description:"pending schedules, a thread's with a message ID, or one by its own ID",arguments:[{name:"id",required:!1,description:"a message in the thread, or a schedule (s12): sent, canceled, or pending"}],options:[option("by","scheduled by a handle"),option("channel","posting in a channel"),option("all","done and canceled ones too")],examples:[{name:"list pending schedules",value:"schedules"}]},{group:"messages",name:"edit",description:"change a message's text",arguments:[id(),{name:"text",required:!1,description:"its new text: - reads it from stdin, and it may be left out when you --file"}],options:[option("file","the text, from a file: - reads stdin"),option("schema"),option("if-revision")],examples:[{name:"fix a typo",value:'edit 812 "deploys are green again"'},{name:"only if no one changed it since you read it",value:'edit 812 "step 3 of 5" --if-revision 820'}]},{group:"messages",name:"delete",aliases:["rm","del"],description:"delete a message, leaving a tombstone",arguments:[id()],options:[option("if-revision")],examples:[{name:"delete a message",value:"delete 812"}]},{group:"messages",name:"react",description:"react to a message",arguments:[id(),{name:"emoji",required:!0,description:"its name or the emoji itself: eyes, \u{1F440}"}],options:[option("remove")],examples:[{name:"react with eyes",value:"react 812 eyes"}]},{group:"messages",name:"label",brief:"[--if-unset k] [--unset k]",description:"set labels on a message, or remove them",arguments:[id(),{name:"k=v",required:!1,multiple:!0,description:"a label to set: a key of up to 64 lowercase letters, numbers, ., _, and -, starting with a letter or number, and a value of up to 256 characters"}],options:[option("unset"),option("if"),option("if-unset")],examples:[{name:"mark a bug fixed",value:"label 812 state=fixed --unset wip"},{name:"claim a thread, unless someone has",value:"label 812 owner=claude --if-unset owner"},{name:"move it on from open only",value:"label 812 state=fixing --if state=open"}]},{group:"messages",name:"typing",description:"show typing in the thread's synced platform threads",arguments:[id(),{name:"status",required:!1,description:'what Slack shows instead of "Typing\u2026"'}],options:[],examples:[{name:"show typing while you work",value:'typing 812 "looking into it"'}]},{group:"messages",name:"sync",description:"where the thread is synced, or with a target, attach it there (backfilling it)",arguments:[id(),{name:"target",required:!1,description:"where to sync it, e.g. slack:#incidents"}],options:[],examples:[{name:"list where a thread is synced",value:"sync 812"},{name:"sync a thread to a Slack channel",value:"sync 812 slack:#incidents"}]},{group:"messages",name:"inbox",description:"raw platform events, for debugging sync",arguments:[{name:"key",required:!0,description:"the sync entry, e.g. slack"},{name:"channel",required:!1,description:"the board channel its events went to"}],options:[option("limit","events to list")],examples:[{name:"list Slack's latest events",value:"inbox slack"}]},{group:"messages",name:"sources",description:"the board's sources: its sync entries (slack, github, \u2026)",arguments:[{name:"key",required:!1,description:"a sync entry, e.g. slack"}],options:[],runsWithoutSubcommand:!0,argumentsBeforeSubcommand:!0,examples:[{name:"list the board's sources",value:"sources"}],subcommands:[{name:"read",description:"read a source's channel, thread, or message link without syncing it (full access only)",arguments:[{name:"target",required:!0,description:"a channel ('#general'), a thread, or a message link"}],options:[option("limit","messages to read"),option("after","where the last read left off: the cursor it printed")],examples:[{name:"read a Slack channel",value:"sources slack read '#general'"},{name:"read a Linear project's issues",value:"sources linear read https://linear.app/acme/project/checkout-a1b2c3"}]},{name:"join",description:"add the app to a public channel so it can be read, where the board opted in (full access only)",arguments:[{name:"channel",required:!0,description:"a channel or its link"}],options:[],examples:[{name:"join a Slack channel",value:"sources slack join '#general'"}]}]},{group:"messages",name:"download",description:"save an attachment (its name, here, by default; - for stdout)",arguments:[{name:"attachment-id",required:!0,description:"the ID at the end of a file line when you read its thread, not the file's name"},{name:"path",required:!1,description:"where to save it, or - for stdout"}],options:[],examples:[{name:"save an attachment",value:"download Yt2mR8vQ1x0pLk3sF7dA9w"}]},{group:"messages",name:"conformance",description:"check that a board you name speaks the protocol (1 if a check fails): it posts, and deletes what it posted",arguments:[],options:[option("channel","the channel to check in (default: conformance)")],examples:[{name:"check the board",value:"conformance"}]},{group:"agents",name:"tasks",description:"open tasks, oldest first: threads agents are to do, each with a state the board keeps",arguments:[{name:"channel",required:!1,description:"a channel, or a path prefix (work/); every channel without one"}],options:[option("state"),option("label","with a label on its root","k[=v|w]"),option("by","whose root a handle wrote"),option("for","assigned to a profile of yours","profile"),option("after","after a cursor an earlier page printed","cursor"),option("limit","tasks to list (default: 50)")],runsWithoutSubcommand:!0,examples:[{name:"list a queue's open tasks",value:"tasks work/"},{name:"list what is ready to fix",value:"tasks work/ --state ready --label step=fix"}],subcommands:[{name:"create",description:"start a thread as a task, or with an ID, make that thread one: you own it. With --file, a plan of them",arguments:[{name:"channel|id",required:!0,description:"a channel, or a thread's ID to make a task of it as it is"},{name:"text",required:!1,description:"what to do, for a new thread: - reads it from stdin, and --file takes its place"}],options:[option("label","label it, to route it","k=v"),option("needs"),option("for","only this profile of yours claims it","profile"),claimNow,option("lease","with --claim: how long to hold it"),option("file","a plan, from a JSON file (- reads stdin): an array of tasks, each { key?, text, labels?, needs?, for?, noSync?, attachments? }, all made, in as many writes as it takes"),option("no-sync"),option("idempotency-key","sending the same one again makes it once")],examples:[{name:"hand a fix to whoever takes fixes",value:'tasks create work "fix CVE-123 in acme/web" --label step=fix'},{name:"a review that waits for it",value:'tasks create work "review the fix for CVE-123" --label step=review --needs 812'},{name:"make a task of a thread that is there",value:"tasks create 812"},{name:"a plan of tasks that wait for each other",value:"tasks create work --file plan.json --idempotency-key migration-7"}]},{name:"claim",description:"hold a task for a lease, by its ID, or with --ready the oldest ready one in a channel",arguments:[{name:"id|channel",required:!0,description:"a task's ID, or with --ready a channel or a path prefix (work/)"}],options:[option("ready"),option("label","with --ready: one whose root has this label","k=v"),option("from"),option("wait"),option("lease")],examples:[{name:"claim a task",value:"tasks claim 812"},{name:"claim the next fix, waiting for one",value:"tasks claim --ready work/ --label step=fix --wait 10m"}]},{name:"run",description:"claim a task and run a command on it: renew while it runs, complete on exit 0, fail otherwise",arguments:[{name:"id|channel",required:!0,description:"a task's ID, or with --ready a channel or a path prefix"},{name:"cmd",required:!0,multiple:!0,description:"the command, after --: it gets BOARD_TASK, the task's ID"}],options:[option("result"),option("ready"),option("label","with --ready: one whose root has this label","k=v"),option("from"),option("wait"),option("lease")],examples:[{name:"run the tests as a task",value:'tasks run 812 --result "tests pass" -- make test'},{name:"work the next fix",value:"tasks run --ready work/ --label step=fix -- ./fix.sh"}]},{name:"renew",description:"extend the lease of a task you hold, from now",arguments:[task()],options:[option("lease")],examples:[{name:"hold it for another 30 minutes",value:"tasks renew 812 --lease 30m"}]},{name:"release",description:"give a task you hold back: it is ready again",arguments:[task()],options:[],examples:[{name:"give a task back",value:"tasks release 812"}]},{name:"complete",description:"finish a task you hold: what waits only for it is ready",arguments:[task(),{name:"result",required:!1,description:"what it came to, in a line"}],options:[],examples:[{name:"complete a task",value:'tasks complete 812 "fixed in a1b2c3, tests pass"'}]},{name:"fail",description:"give up on a task you hold: what waits for it keeps waiting, until it's reopened",arguments:[task(),{name:"reason",required:!0,description:"why, in a line"}],options:[],examples:[{name:"fail a task",value:'tasks fail 812 "the tests need a database"'}]},{name:"block",description:"hold a task for a person: with your claim, which it ends, or as its owner",arguments:[task(),{name:"reason",required:!0,description:"what you need from them"}],options:[option("kind")],examples:[{name:"ask for approval",value:'tasks block 813 "approve the prod deploy?" --kind awaiting_approval'}]},{name:"unblock",description:"lift a hold, as its owner: ready again, or waiting while a task it needs has not completed",arguments:[task()],options:[],examples:[{name:"lift a hold",value:"tasks unblock 813"}]},{name:"reopen",description:"make a failed task ready again, as its owner",arguments:[task()],options:[],examples:[{name:"retry a failed task",value:"tasks reopen 812"}]},{name:"assign",description:"keep a task for one of its owner's profiles, or with --pool, for anyone who may claim it",arguments:[task(),{name:"profile",required:!1,description:"a profile of the task's owner, such as fixer"}],options:[option("pool")],examples:[{name:"keep it for the fixer",value:"tasks assign 812 fixer"},{name:"back to the pool",value:"tasks assign 812 --pool"}]},{name:"needs",description:"set what a task waits for, as its owner: the tasks named, in place of what it waited for",arguments:[task(),{name:"needs",required:!1,multiple:!0,description:"the tasks it waits for now, by ID"}],options:[option("none")],examples:[{name:"wait for two tasks",value:"tasks needs 814 812 813"},{name:"wait for nothing",value:"tasks needs 814 --none"}]},{name:"cancel",description:"cancel a task that has not completed, as its owner: any claim ends",arguments:[task(),{name:"reason",required:!0,description:"why, in a line"}],options:[],examples:[{name:"cancel a task",value:'tasks cancel 812 "superseded by #820"'}]}]},{group:"agents",name:"hooks",description:"the turn-end hooks an earlier board installed",arguments:[],options:[],examples:[],subcommands:[{name:"uninstall",description:"remove the turn-end hooks an earlier board installed, from every agent or the ones named",arguments:[{name:"agent",required:!1,multiple:!0,description:"claude, codex, cursor, or pi"}],options:[],examples:[{name:"remove every hook",value:"hooks uninstall"}]}]},{group:"agents",name:"hook",description:"what an earlier turn-end hook runs: it does nothing now",arguments:[{name:"event",required:!1,multiple:!0}],options:[option("agent")],examples:[],hidden:!0},{group:"live",name:"tail",description:"what happens, live, until Ctrl-C",arguments:[{name:"channel",required:!1,description:"a channel, or a path prefix (dev/)"}],options:[option("all","delivery receipts too"),option("last")],filters:!0,examples:[{name:"follow the bugs",value:"tail dev --label kind=bug"},{name:"start with a channel's newest 20 events, then follow",value:"tail dev --last 20"}]},{group:"live",name:"wait",brief:"[--after id] [--timeout 10m]",description:"block for the next match and print it",arguments:[{name:"channel|id",required:!1,description:"a channel, a path prefix (dev/), or a message's ID: what comes after it in its thread"}],options:[option("timeout")],filters:!0,examples:[{name:'wait for a mention: when none comes in time it says "Nothing matched" and exits 1',value:"wait dev --mentions --timeout 10m"},{name:"wait for a reply in a thread, from the last message you read so none is missed",value:"wait --re 812 --after 815 --timeout 10m"}]},{group:"live",name:"help",description:"this help, or a command's",arguments:[{name:"command",required:!1,multiple:!0}],options:[],examples:[],hidden:!0}];function usage(path){let words=[];return path.forEach((command,at)=>{let last=at===path.length-1;if(words.push(command.name),last||command.argumentsBeforeSubcommand)for(let argument of command.arguments){let required=argument.required||!last;words.push(`${required?`<${argument.name}>`:`[${argument.name}]`}${argument.multiple?"...":""}`)}}),path.at(-1)?.filters&&words.push("[filters]"),words.join(" ")}export{options,filters,globalOptions,groups,commands,usage};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{parseArguments}from"./chunk-CINNNQDJ.js";import{require_cli_config}from"./chunk-4SAVH3H7.js";import{__toESM}from"./chunk-BZENIQ7N.js";var config=__toESM(require_cli_config(),1);import path from"node:path";function getGlobalPathConfig2(argvSlice=process.argv.slice(2),cwd=process.cwd()){let confFlag=parseArguments(argvSlice,{},{permissive:!0}).flags["--global-config"];return confFlag?path.resolve(cwd,confFlag):config.getGlobalPathConfig()}export{getGlobalPathConfig2 as getGlobalPathConfig};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{printProjectNotFoundError}from"./chunk-QGHAD5A5.js";import{detectExplicitScope}from"./chunk-NLK7NGVP.js";import{getLinkedProject}from"./chunk-Z2KANBOU.js";import{omitGlobalFlagsFromArgs}from"./chunk-4SS6W6JK.js";function getInvokingCommandFromArgv(argv){let args=omitGlobalFlagsFromArgs(argv.slice(2)),positionals=[];for(let arg of args){if(arg.startsWith("-"))break;positionals.push(arg)}return positionals.join(" ")}async function resolveProjectContext({client,cwd=client.cwd,projectNameOrId,commandName="",projectNotFoundHandling="report",skipOwnerLookup,allowOwnerLookupFallback,allowProjectLookupFallback,quiet}){let context=await getLinkedProject(client,{cwd,projectName:projectNameOrId,projectNameIsExplicit:!!projectNameOrId,scopeIsExplicit:detectExplicitScope(client),skipOwnerLookup,allowOwnerLookupFallback,allowProjectLookupFallback,quiet});return context.status==="not_linked"&&projectNameOrId&&projectNotFoundHandling==="report"?(await printProjectNotFoundError(client,projectNameOrId,commandName||getInvokingCommandFromArgv(client.argv),context.orgId),{status:"error",exitCode:1,orgId:context.orgId}):context}export{resolveProjectContext};