@depup/vercel 59.11.7-depup.0 → 59.23.2-depup.0

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 (466) hide show
  1. package/README.md +4 -4
  2. package/changes.json +3 -3
  3. package/dist/chunks/add-JVSHQKWC.js +8 -0
  4. package/dist/chunks/add-UKFIETLE.js +8 -0
  5. package/dist/chunks/add-Z3CJT63N.js +8 -0
  6. package/dist/chunks/build-SMQYQX23.js +7 -0
  7. package/dist/chunks/chunk-2H77IRPI.js +9 -0
  8. package/dist/chunks/chunk-2HEC5TDU.js +9 -0
  9. package/dist/chunks/chunk-2I64AYHG.js +7 -0
  10. package/dist/chunks/chunk-2S6PE6GB.js +7 -0
  11. package/dist/chunks/chunk-2SLHYWMC.js +7 -0
  12. package/dist/chunks/chunk-32QBGZ2Z.js +7 -0
  13. package/dist/chunks/chunk-3GUBYJN6.js +20 -0
  14. package/dist/chunks/chunk-3QHJYVCY.js +7 -0
  15. package/dist/chunks/chunk-4MZK6JT6.js +7 -0
  16. package/dist/chunks/chunk-4WSAOLBH.js +15 -0
  17. package/dist/chunks/chunk-4YVA7TSY.js +25 -0
  18. package/dist/chunks/chunk-5XJNPXQK.js +7 -0
  19. package/dist/chunks/chunk-5YA32S6K.js +7 -0
  20. package/dist/chunks/chunk-64NJHVA3.js +44 -0
  21. package/dist/chunks/chunk-65JYSI26.js +7 -0
  22. package/dist/chunks/chunk-66RYR2GI.js +7 -0
  23. package/dist/chunks/chunk-6BZCSVH6.js +7 -0
  24. package/dist/chunks/chunk-6C7LA5RA.js +9 -0
  25. package/dist/chunks/chunk-6L236MNA.js +7 -0
  26. package/dist/chunks/chunk-6LE3FU2P.js +7 -0
  27. package/dist/chunks/chunk-6LE44WCK.js +8 -0
  28. package/dist/chunks/chunk-6OI6SRHZ.js +7 -0
  29. package/dist/chunks/chunk-6PFC3KWQ.js +7 -0
  30. package/dist/chunks/chunk-6QKS6QK7.js +7 -0
  31. package/dist/chunks/chunk-6SA6SOHU.js +7 -0
  32. package/dist/chunks/chunk-6TAQ6OWD.js +13 -0
  33. package/dist/chunks/chunk-73G2MHUX.js +14 -0
  34. package/dist/chunks/chunk-7B5NNJ2P.js +28 -0
  35. package/dist/chunks/chunk-7HL2RPUO.js +7 -0
  36. package/dist/chunks/chunk-7PNYOSDU.js +9 -0
  37. package/dist/chunks/chunk-7RR7MIMT.js +7 -0
  38. package/dist/chunks/chunk-7T6TL3GQ.js +7 -0
  39. package/dist/chunks/chunk-A5VLP25I.js +25 -0
  40. package/dist/chunks/chunk-ABSRS5KC.js +9 -0
  41. package/dist/chunks/chunk-AM46JVVN.js +7 -0
  42. package/dist/chunks/chunk-AVSPFBLM.js +7 -0
  43. package/dist/chunks/chunk-AZ6NRDHG.js +7 -0
  44. package/dist/chunks/chunk-B4ATVYZW.js +7 -0
  45. package/dist/chunks/{chunk-A3NYPUKZ.js → chunk-BRK4OB4B.js} +1 -11
  46. package/dist/chunks/chunk-BVH2AEFE.js +7 -0
  47. package/dist/chunks/chunk-BX5KDMLT.js +10 -0
  48. package/dist/chunks/chunk-CJPM2DXZ.js +7 -0
  49. package/dist/chunks/chunk-COQGD2EI.js +8 -0
  50. package/dist/chunks/chunk-CVKB54WW.js +7 -0
  51. package/dist/chunks/{chunk-O26N2UPI.js → chunk-CZSOZKHX.js} +1 -9
  52. package/dist/chunks/chunk-D4MW3RDW.js +7 -0
  53. package/dist/chunks/chunk-DFVNL5ML.js +7 -0
  54. package/dist/chunks/chunk-DL665Q3Z.js +7 -0
  55. package/dist/chunks/chunk-DQ2KI6FO.js +9 -0
  56. package/dist/chunks/chunk-E4X2DH4K.js +18 -0
  57. package/dist/chunks/{chunk-KJBZ5ZST.js → chunk-EHTHHCNG.js} +11 -32
  58. package/dist/chunks/chunk-EIXOJUNN.js +7 -0
  59. package/dist/chunks/chunk-EQ52F4LH.js +7 -0
  60. package/dist/chunks/chunk-EQP3SW72.js +7 -0
  61. package/dist/chunks/chunk-ETV3C2CV.js +7 -0
  62. package/dist/chunks/chunk-EWWFNMPZ.js +24 -0
  63. package/dist/chunks/chunk-F2ZWW2IO.js +8 -0
  64. package/dist/chunks/chunk-FA6O7FPC.js +8 -0
  65. package/dist/chunks/chunk-FAW6NBLQ.js +7 -0
  66. package/dist/chunks/chunk-FB5TMOLQ.js +7 -0
  67. package/dist/chunks/chunk-FI772UVH.js +7 -0
  68. package/dist/chunks/chunk-FZH7RIRX.js +18 -0
  69. package/dist/chunks/chunk-GGNZLN4R.js +9 -0
  70. package/dist/chunks/chunk-GHAY4PSD.js +7 -0
  71. package/dist/chunks/chunk-GHM7V3GG.js +7 -0
  72. package/dist/chunks/chunk-GHULCYAR.js +7 -0
  73. package/dist/chunks/chunk-GL2AUBAI.js +10 -0
  74. package/dist/chunks/chunk-GR3DLKYP.js +13 -0
  75. package/dist/chunks/chunk-GRDPI246.js +29 -0
  76. package/dist/chunks/chunk-GTJ2OLYI.js +11 -0
  77. package/dist/chunks/chunk-GU6VIFR5.js +7 -0
  78. package/dist/chunks/{constants-WEQVJSYS.js → chunk-GZNDA6SV.js} +2 -9
  79. package/dist/chunks/chunk-HEGJZJO7.js +7 -0
  80. package/dist/chunks/chunk-HOYHUMBD.js +16 -0
  81. package/dist/chunks/chunk-HWWHR7H3.js +10 -0
  82. package/dist/chunks/chunk-IVSSTHB6.js +7 -0
  83. package/dist/chunks/chunk-IVWPQYIH.js +7 -0
  84. package/dist/chunks/{chunk-64IF634X.js → chunk-J3U3L45Y.js} +1 -12
  85. package/dist/chunks/chunk-J5X5YRBH.js +16 -0
  86. package/dist/chunks/chunk-JAJW3P42.js +7 -0
  87. package/dist/chunks/chunk-JGPECEYY.js +23 -0
  88. package/dist/chunks/chunk-JKTQV2QJ.js +7 -0
  89. package/dist/chunks/chunk-JZRMH5UA.js +7 -0
  90. package/dist/chunks/chunk-KBKN7EI7.js +7 -0
  91. package/dist/chunks/chunk-KK4AJES5.js +36 -0
  92. package/dist/chunks/chunk-KKS7XWEX.js +7 -0
  93. package/dist/chunks/chunk-KUVMCIR4.js +7 -0
  94. package/dist/chunks/chunk-KXYR43H5.js +86 -0
  95. package/dist/chunks/chunk-L3JDEHCQ.js +7 -0
  96. package/dist/chunks/chunk-LKI6FRNM.js +19 -0
  97. package/dist/chunks/chunk-LQBC5QPO.js +7 -0
  98. package/dist/chunks/chunk-M2W3HKV3.js +23 -0
  99. package/dist/chunks/chunk-M5AV545M.js +7 -0
  100. package/dist/chunks/chunk-M6A7UH4U.js +27 -0
  101. package/dist/chunks/chunk-MBL6TXEJ.js +7 -0
  102. package/dist/chunks/chunk-MEAY2K5Z.js +11 -0
  103. package/dist/chunks/chunk-MY4MONOH.js +7 -0
  104. package/dist/chunks/chunk-N3N5UHIL.js +7 -0
  105. package/dist/chunks/chunk-N3ZZ7FHQ.js +7 -0
  106. package/dist/chunks/chunk-N6CNMMSZ.js +7 -0
  107. package/dist/chunks/chunk-NBVY237X.js +7 -0
  108. package/dist/chunks/chunk-NYOQMU3P.js +20 -0
  109. package/dist/chunks/chunk-NZKBBY2A.js +24 -0
  110. package/dist/chunks/chunk-O7G3CZ42.js +7 -0
  111. package/dist/chunks/chunk-OAKO6LVS.js +7 -0
  112. package/dist/chunks/chunk-OHDEHZLX.js +7 -0
  113. package/dist/chunks/chunk-OI263FBO.js +21 -0
  114. package/dist/chunks/chunk-OSCCYU74.js +7 -0
  115. package/dist/chunks/chunk-OUHPDA7Q.js +7 -0
  116. package/dist/chunks/chunk-P2O5DOYE.js +7 -0
  117. package/dist/chunks/chunk-PHW54NU5.js +13 -0
  118. package/dist/chunks/chunk-PPCFQQSU.js +7 -0
  119. package/dist/chunks/chunk-PS645CWM.js +32 -0
  120. package/dist/chunks/chunk-QGIQK47P.js +7 -0
  121. package/dist/chunks/chunk-QHJLRTVY.js +7 -0
  122. package/dist/chunks/chunk-QI3JSWD6.js +12 -0
  123. package/dist/chunks/chunk-QR7QPUFN.js +7 -0
  124. package/dist/chunks/chunk-QTKJC2O5.js +7 -0
  125. package/dist/chunks/chunk-R3B67TKQ.js +7 -0
  126. package/dist/chunks/chunk-RCTYVKM5.js +16 -0
  127. package/dist/chunks/chunk-RRQTVE2P.js +31 -0
  128. package/dist/chunks/chunk-S5CEIACD.js +7 -0
  129. package/dist/chunks/chunk-SFTXBTMI.js +7 -0
  130. package/dist/chunks/chunk-SOJCELXH.js +7 -0
  131. package/dist/chunks/chunk-SOQ5DE44.js +39 -0
  132. package/dist/chunks/chunk-SXUEGVWB.js +7 -0
  133. package/dist/chunks/{pkg-56KRLZ5K.js → chunk-T3GQAMBJ.js} +1 -7
  134. package/dist/chunks/chunk-T4AZ3U7O.js +7 -0
  135. package/dist/chunks/chunk-T52FMXWC.js +7 -0
  136. package/dist/chunks/chunk-TBBU37TD.js +9 -0
  137. package/dist/chunks/{chunk-2473DUBR.js → chunk-TG2RCYTH.js} +1 -9
  138. package/dist/chunks/chunk-TJKM3345.js +7 -0
  139. package/dist/chunks/chunk-TOGR3HUB.js +8 -0
  140. package/dist/chunks/chunk-TRTEXGVN.js +7 -0
  141. package/dist/chunks/chunk-U56NHYAH.js +7 -0
  142. package/dist/chunks/chunk-U6N2RNDI.js +7 -0
  143. package/dist/chunks/chunk-U7KCDTCH.js +12 -0
  144. package/dist/chunks/chunk-UED2PPFP.js +11 -0
  145. package/dist/chunks/chunk-UGXNE4YE.js +7 -0
  146. package/dist/chunks/chunk-ULLWCOYC.js +7 -0
  147. package/dist/chunks/chunk-UUM2N6IG.js +21 -0
  148. package/dist/chunks/chunk-UWZ5VIIQ.js +7 -0
  149. package/dist/chunks/chunk-UXCTETFN.js +7 -0
  150. package/dist/chunks/chunk-V5DCSHYJ.js +7 -0
  151. package/dist/chunks/chunk-V6IKQCOT.js +8 -0
  152. package/dist/chunks/chunk-V6MR45PD.js +15 -0
  153. package/dist/chunks/chunk-VIR3KDCQ.js +7 -0
  154. package/dist/chunks/chunk-VOZEB6PD.js +7 -0
  155. package/dist/chunks/chunk-WDVSYGZS.js +7 -0
  156. package/dist/chunks/chunk-WHYH7DVI.js +20 -0
  157. package/dist/chunks/chunk-WKZ6JSGZ.js +7 -0
  158. package/dist/chunks/chunk-WPS6JZF6.js +7 -0
  159. package/dist/chunks/chunk-WRILLB46.js +7 -0
  160. package/dist/chunks/chunk-WUZD4KBL.js +7 -0
  161. package/dist/chunks/chunk-X4X5RB2V.js +7 -0
  162. package/dist/chunks/chunk-XCJDGQO7.js +7 -0
  163. package/dist/chunks/{update-route-version-E3V47KNI.js → chunk-XD2LZRBS.js} +1 -7
  164. package/dist/chunks/chunk-XPXOV5UO.js +7 -0
  165. package/dist/chunks/chunk-YGJO25LP.js +45 -0
  166. package/dist/chunks/chunk-YMM3VY3J.js +8 -0
  167. package/dist/chunks/chunk-YMVDWVMO.js +7 -0
  168. package/dist/chunks/chunk-YPTLSODC.js +7 -0
  169. package/dist/chunks/chunk-Z4VR6CQ2.js +7 -0
  170. package/dist/chunks/chunk-Z6LKARXP.js +8 -0
  171. package/dist/chunks/chunk-Z7PBDQNR.js +65 -0
  172. package/dist/chunks/chunk-ZDORSGCG.js +8 -0
  173. package/dist/chunks/chunk-ZDX75YNZ.js +7 -0
  174. package/dist/chunks/chunk-ZKWM4JBE.js +7 -0
  175. package/dist/chunks/chunk-ZKYS7EAB.js +7 -0
  176. package/dist/chunks/chunk-ZXE4XYIV.js +7 -0
  177. package/dist/chunks/cjs-GOQHXIHX.js +54 -0
  178. package/dist/chunks/clear-6IXTTZO6.js +8 -0
  179. package/dist/chunks/compile-vercel-config-ZFMPTU47.js +7 -0
  180. package/dist/chunks/config-HLVJQKP7.js +7 -0
  181. package/dist/chunks/config-XXHMPW46.js +8 -0
  182. package/dist/chunks/config-validator.mjs +1 -1
  183. package/dist/chunks/connect-git-provider-P3SGOW6X.js +7 -0
  184. package/dist/chunks/constants-G4UYVLOF.js +7 -0
  185. package/dist/chunks/create-project-SRQGD4JY.js +7 -0
  186. package/dist/chunks/delete-52QKO73X.js +10 -0
  187. package/dist/chunks/delete-6VOUZDIR.js +9 -0
  188. package/dist/chunks/detect-projects-WLAFT5HC.js +7 -0
  189. package/dist/chunks/detect-services-YYT3LUUX.js +7 -0
  190. package/dist/chunks/disable-7FGR2S56.js +7 -0
  191. package/dist/chunks/discard-XKPTY3DC.js +14 -0
  192. package/dist/chunks/edit-A3HJCNPW.js +8 -0
  193. package/dist/chunks/edit-A7WGTO6K.js +9 -0
  194. package/dist/chunks/enable-NGKLGHJ2.js +7 -0
  195. package/dist/chunks/esm-7HVUFWMN.js +7 -0
  196. package/dist/chunks/esm-BZBEM7YA.js +7 -0
  197. package/dist/chunks/esm-CXICLFA3.js +9 -0
  198. package/dist/chunks/esm-HDEHVK7I.js +9 -0
  199. package/dist/chunks/esm-NQRLKALI.js +20 -0
  200. package/dist/chunks/esm-SZZI53W7.js +7 -0
  201. package/dist/chunks/esm-WGJFGCLK.js +7 -0
  202. package/dist/chunks/exec-YH5WUJ4C.js +16372 -0
  203. package/dist/chunks/export-QCBAQNTT.js +19 -0
  204. package/dist/chunks/fetch-proxy-AEAWC6MD.js +7 -0
  205. package/dist/chunks/future-BB7OE645.js +7 -0
  206. package/dist/chunks/generate-cert-for-deploy-U7JF3HF3.js +7 -0
  207. package/dist/chunks/image-DU7GJZR2.js +7 -0
  208. package/dist/chunks/import-builders-IFZM44NL.js +7 -0
  209. package/dist/chunks/inspect-CPOFKE4X.js +19 -0
  210. package/dist/chunks/inspect-EMWJLBAW.js +15 -0
  211. package/dist/chunks/inspect-IVJOEZC4.js +20 -0
  212. package/dist/chunks/inspect-PHUMEO4A.js +9 -0
  213. package/dist/chunks/inspect-Q7OVSWFO.js +13 -0
  214. package/dist/chunks/list-G4JM2TYX.js +11 -0
  215. package/dist/chunks/list-KYZNCXBM.js +16 -0
  216. package/dist/chunks/list-ZE2VPPXI.js +10 -0
  217. package/dist/chunks/login-AVVJFLSC.js +9 -0
  218. package/dist/chunks/login-RMAISH4F.js +7 -0
  219. package/dist/chunks/logs-3LTU2N25.js +7 -0
  220. package/dist/chunks/ls-4M2OBNG6.js +8 -0
  221. package/dist/chunks/ls-7O63WIES.js +12 -0
  222. package/dist/chunks/ls-AKGRKWHM.js +12 -0
  223. package/dist/chunks/ls-DU5QTKKA.js +12 -0
  224. package/dist/chunks/ls-HWUYP3XY.js +8 -0
  225. package/dist/chunks/ls-P6LKMT33.js +12 -0
  226. package/dist/chunks/ls-Y4QR3I6O.js +11 -0
  227. package/dist/chunks/mutate-KOAALPIL.js +9 -0
  228. package/dist/chunks/notifications-3RDFNJSD.js +7 -0
  229. package/dist/chunks/open-VD4F6MAO.js +7 -0
  230. package/dist/chunks/openapi-DKMCRF2V.js +7 -0
  231. package/dist/chunks/permissions-AE5JO26V.js +7 -0
  232. package/dist/chunks/pkg-YFU67U7I.js +7 -0
  233. package/dist/chunks/prompt-missing-credentials-QY4MZDT6.js +7 -0
  234. package/dist/chunks/publish-YXVJXBQT.js +15 -0
  235. package/dist/chunks/pull-QLC2CV4J.js +7 -0
  236. package/dist/chunks/purchase-domain-if-available-74ZYVVBE.js +7 -0
  237. package/dist/chunks/push-TMPPU5NU.js +7 -0
  238. package/dist/chunks/query-PHAGR43V.js +12 -0
  239. package/dist/chunks/reauthenticate-O6C2AW3J.js +7 -0
  240. package/dist/chunks/reorder-OAJ3NXQQ.js +10 -0
  241. package/dist/chunks/reply-Q3JFRFA3.js +9 -0
  242. package/dist/chunks/repo-info-to-url-SK3VX6UL.js +7 -0
  243. package/dist/chunks/resolve-XXJVOXNE.js +12 -0
  244. package/dist/chunks/resolve-deployment-framework-preset-XF3NJIDS.js +7 -0
  245. package/dist/chunks/restore-MO4B2EQV.js +16 -0
  246. package/dist/chunks/rm-63LFH6NA.js +8 -0
  247. package/dist/chunks/rm-F2XD2XKB.js +8 -0
  248. package/dist/chunks/rm-GMG2DZOV.js +8 -0
  249. package/dist/chunks/rm-P6KA5RSP.js +8 -0
  250. package/dist/chunks/rm-SZ4HWA4R.js +8 -0
  251. package/dist/chunks/routes-IPGKJ2E4.js +7 -0
  252. package/dist/chunks/rule-inspect-JKAXOBII.js +8 -0
  253. package/dist/chunks/rules-6TZ6GSKT.js +7 -0
  254. package/dist/chunks/schema-5CZLK6NI.js +44 -0
  255. package/dist/chunks/schema-S2ZAREKF.js +14 -0
  256. package/dist/chunks/select-org-F2A5JJFH.js +7 -0
  257. package/dist/chunks/set-PIKLGKT6.js +7 -0
  258. package/dist/chunks/setup-and-link-O5QSQ5K2.js +7 -0
  259. package/dist/chunks/slugify-O5DBATYT.js +7 -0
  260. package/dist/chunks/stamp-OX4YO3KY.js +7 -0
  261. package/dist/chunks/tags-C3HWJLJ4.js +7 -0
  262. package/dist/chunks/types-H3B56MH6.js +14 -0
  263. package/dist/chunks/update-5HE4X45O.js +8 -0
  264. package/dist/chunks/update-route-version-XZAFPQJC.js +7 -0
  265. package/dist/chunks/utils-5BFO5HC4.js +86 -0
  266. package/dist/chunks/vlt-builder-graph-B4DFIUS6.js +7 -0
  267. package/dist/chunks/vlt-builder-importer-YVCYYRVV.js +11 -0
  268. package/dist/commands/build/index.js +24 -4918
  269. package/dist/commands/deploy/index.js +43 -2875
  270. package/dist/commands/dev/index.js +58 -23857
  271. package/dist/commands/env/index.js +26 -3411
  272. package/dist/commands/link/index.js +4 -284
  273. package/dist/commands/list/index.js +6 -566
  274. package/dist/commands-bulk.js +1358 -79710
  275. package/dist/help.js +1 -8
  276. package/dist/index.js +19 -2581
  277. package/dist/runtime-assets/node-preloads/next-dev-websocket.cjs +6 -0
  278. package/dist/version.mjs +1 -1
  279. package/package.json +66 -60
  280. package/dist/chunks/add-KSJQYR5C.js +0 -196
  281. package/dist/chunks/add-PERLOALD.js +0 -233
  282. package/dist/chunks/add-WU2QYHYL.js +0 -145
  283. package/dist/chunks/build-F3J6FLPD.js +0 -251
  284. package/dist/chunks/chunk-26CU4Q3C.js +0 -598
  285. package/dist/chunks/chunk-2HSQ7YUK.js +0 -93
  286. package/dist/chunks/chunk-2JIX6UMI.js +0 -4626
  287. package/dist/chunks/chunk-2TSBB22D.js +0 -14059
  288. package/dist/chunks/chunk-332LMJLZ.js +0 -16014
  289. package/dist/chunks/chunk-3HZLXCVL.js +0 -137
  290. package/dist/chunks/chunk-3VM7HWF6.js +0 -104
  291. package/dist/chunks/chunk-3ZE5CFVM.js +0 -346
  292. package/dist/chunks/chunk-4IALDGB7.js +0 -22
  293. package/dist/chunks/chunk-4IVSM24H.js +0 -522
  294. package/dist/chunks/chunk-4KD5BYHB.js +0 -127
  295. package/dist/chunks/chunk-57RHXXXG.js +0 -150
  296. package/dist/chunks/chunk-5AJPMLDV.js +0 -28
  297. package/dist/chunks/chunk-5GGUB4EO.js +0 -31
  298. package/dist/chunks/chunk-5NF5HOBJ.js +0 -1854
  299. package/dist/chunks/chunk-6E6KPBXY.js +0 -43
  300. package/dist/chunks/chunk-7KROIXQM.js +0 -59
  301. package/dist/chunks/chunk-7MRDIPJY.js +0 -107
  302. package/dist/chunks/chunk-7Q45OKWR.js +0 -149
  303. package/dist/chunks/chunk-A5JZS6ZN.js +0 -92
  304. package/dist/chunks/chunk-AHU7WNL2.js +0 -24
  305. package/dist/chunks/chunk-AINIBIP4.js +0 -39
  306. package/dist/chunks/chunk-AKLTIZCU.js +0 -46
  307. package/dist/chunks/chunk-ARU7VBKR.js +0 -144
  308. package/dist/chunks/chunk-B5XLQKHI.js +0 -849
  309. package/dist/chunks/chunk-BEQV3X2L.js +0 -86
  310. package/dist/chunks/chunk-C762AAVU.js +0 -137
  311. package/dist/chunks/chunk-CEDN47PH.js +0 -233
  312. package/dist/chunks/chunk-CJV7J7B5.js +0 -314
  313. package/dist/chunks/chunk-CNDPIHY5.js +0 -3490
  314. package/dist/chunks/chunk-CV5YC2EN.js +0 -867
  315. package/dist/chunks/chunk-DBYHS3CK.js +0 -257
  316. package/dist/chunks/chunk-DSTNNQVV.js +0 -253
  317. package/dist/chunks/chunk-DWIC7MRV.js +0 -152
  318. package/dist/chunks/chunk-E336ZXPP.js +0 -43
  319. package/dist/chunks/chunk-EFYMIIER.js +0 -40
  320. package/dist/chunks/chunk-EKPSCRJZ.js +0 -26
  321. package/dist/chunks/chunk-EOZFDJSY.js +0 -18
  322. package/dist/chunks/chunk-EPOLDWRA.js +0 -90
  323. package/dist/chunks/chunk-EZKW5YJ2.js +0 -177
  324. package/dist/chunks/chunk-EZQDYIVB.js +0 -506
  325. package/dist/chunks/chunk-FGDKMNEN.js +0 -21
  326. package/dist/chunks/chunk-FL4JLNT2.js +0 -559
  327. package/dist/chunks/chunk-FRVG4OW3.js +0 -7438
  328. package/dist/chunks/chunk-FVNJTRCE.js +0 -577
  329. package/dist/chunks/chunk-FVT74RZ5.js +0 -1536
  330. package/dist/chunks/chunk-G3PXSXIB.js +0 -18188
  331. package/dist/chunks/chunk-G5FBSUL4.js +0 -822
  332. package/dist/chunks/chunk-GCVXKRR5.js +0 -817
  333. package/dist/chunks/chunk-GGP5R3FU.js +0 -129
  334. package/dist/chunks/chunk-GHKJAK5V.js +0 -1288
  335. package/dist/chunks/chunk-GUU4Z2AQ.js +0 -2099
  336. package/dist/chunks/chunk-GVNCVKCI.js +0 -68
  337. package/dist/chunks/chunk-GY5I4AYD.js +0 -122
  338. package/dist/chunks/chunk-GZLPFESR.js +0 -48
  339. package/dist/chunks/chunk-HB4UKFDO.js +0 -1295
  340. package/dist/chunks/chunk-HRXRELD3.js +0 -338
  341. package/dist/chunks/chunk-IB5L4LKZ.js +0 -1082
  342. package/dist/chunks/chunk-IIMSID24.js +0 -104
  343. package/dist/chunks/chunk-JSD4EZL3.js +0 -34
  344. package/dist/chunks/chunk-K3RED3VO.js +0 -566
  345. package/dist/chunks/chunk-KEKR7OCB.js +0 -140
  346. package/dist/chunks/chunk-KFWQ3EFH.js +0 -151
  347. package/dist/chunks/chunk-KW7BS25T.js +0 -466
  348. package/dist/chunks/chunk-KXDWXXJH.js +0 -70
  349. package/dist/chunks/chunk-MXLA3VQS.js +0 -20
  350. package/dist/chunks/chunk-N4QHMXOO.js +0 -162
  351. package/dist/chunks/chunk-ND5CF2H3.js +0 -53
  352. package/dist/chunks/chunk-NFU4XJIR.js +0 -120
  353. package/dist/chunks/chunk-NSOYO6JQ.js +0 -2399
  354. package/dist/chunks/chunk-NW34PW6V.js +0 -1772
  355. package/dist/chunks/chunk-OAMU5QO6.js +0 -18
  356. package/dist/chunks/chunk-OIH6FP5Y.js +0 -231
  357. package/dist/chunks/chunk-P3SKP5WM.js +0 -27
  358. package/dist/chunks/chunk-P4QNYOFB.js +0 -96
  359. package/dist/chunks/chunk-P7VSBDR4.js +0 -827
  360. package/dist/chunks/chunk-PEC3CQSK.js +0 -90
  361. package/dist/chunks/chunk-PFM75KY3.js +0 -255
  362. package/dist/chunks/chunk-PJXMXMCO.js +0 -81
  363. package/dist/chunks/chunk-PMSMUMUO.js +0 -30
  364. package/dist/chunks/chunk-PNGVSHR3.js +0 -40
  365. package/dist/chunks/chunk-POOO7W47.js +0 -916
  366. package/dist/chunks/chunk-PRWJUY5U.js +0 -848
  367. package/dist/chunks/chunk-Q2DGFCO7.js +0 -579
  368. package/dist/chunks/chunk-QHS645AZ.js +0 -11441
  369. package/dist/chunks/chunk-QKX7WKIN.js +0 -98
  370. package/dist/chunks/chunk-QOPTXV4G.js +0 -417
  371. package/dist/chunks/chunk-RBIFXFZX.js +0 -52
  372. package/dist/chunks/chunk-RN6V5ODW.js +0 -114
  373. package/dist/chunks/chunk-RVBZ64EQ.js +0 -52
  374. package/dist/chunks/chunk-S7KYDPEM.js +0 -1564
  375. package/dist/chunks/chunk-SHFNEZVI.js +0 -49
  376. package/dist/chunks/chunk-SLPSPYVR.js +0 -334
  377. package/dist/chunks/chunk-TGNEG57M.js +0 -1612
  378. package/dist/chunks/chunk-TO7QZGYK.js +0 -105
  379. package/dist/chunks/chunk-TZ2YI2VH.js +0 -87
  380. package/dist/chunks/chunk-UARGTFCT.js +0 -875
  381. package/dist/chunks/chunk-UG2WOB5L.js +0 -150
  382. package/dist/chunks/chunk-V4RMJKQP.js +0 -36
  383. package/dist/chunks/chunk-VGIMO3ZK.js +0 -17
  384. package/dist/chunks/chunk-VP5Y3SZG.js +0 -106
  385. package/dist/chunks/chunk-VT3Z7HF6.js +0 -233
  386. package/dist/chunks/chunk-VUS2JQB2.js +0 -121
  387. package/dist/chunks/chunk-VXYGCOKL.js +0 -28
  388. package/dist/chunks/chunk-VYC45Q4Z.js +0 -1892
  389. package/dist/chunks/chunk-WGGABYO5.js +0 -31
  390. package/dist/chunks/chunk-WL6QYSGD.js +0 -12868
  391. package/dist/chunks/chunk-X7DBBZQD.js +0 -242
  392. package/dist/chunks/chunk-XD4DCYMX.js +0 -61
  393. package/dist/chunks/chunk-XDGOOW3K.js +0 -60
  394. package/dist/chunks/chunk-XFF5TGRA.js +0 -303
  395. package/dist/chunks/chunk-XIFATBH5.js +0 -2914
  396. package/dist/chunks/chunk-XM3LOQIX.js +0 -262
  397. package/dist/chunks/chunk-XNIZGCN5.js +0 -58
  398. package/dist/chunks/chunk-XPJLPUKO.js +0 -117
  399. package/dist/chunks/chunk-XUAWTW4W.js +0 -467
  400. package/dist/chunks/chunk-YPQSDAEW.js +0 -29
  401. package/dist/chunks/chunk-YS76T533.js +0 -270
  402. package/dist/chunks/chunk-Z7JWYFOY.js +0 -58
  403. package/dist/chunks/chunk-ZBEECGFD.js +0 -174
  404. package/dist/chunks/chunk-ZDU2NODC.js +0 -104
  405. package/dist/chunks/chunk-ZW6HETRE.js +0 -97
  406. package/dist/chunks/cjs-DV4RM7XU.js +0 -20743
  407. package/dist/chunks/clear-XUQO4ZTK.js +0 -141
  408. package/dist/chunks/compile-vercel-config-D3ARNHTN.js +0 -33
  409. package/dist/chunks/config-37OAE7QJ.js +0 -127
  410. package/dist/chunks/config-MEDLXUVM.js +0 -168
  411. package/dist/chunks/delete-3N3YZZOF.js +0 -159
  412. package/dist/chunks/delete-VSWDZ2SW.js +0 -226
  413. package/dist/chunks/detect-projects-ODNU4PK2.js +0 -18
  414. package/dist/chunks/detect-services-TESZCQWG.js +0 -40
  415. package/dist/chunks/disable-A4FLFMC7.js +0 -198
  416. package/dist/chunks/discard-CHGFULBZ.js +0 -145
  417. package/dist/chunks/edit-JZ63AJYQ.js +0 -162
  418. package/dist/chunks/edit-MHSYAPDR.js +0 -647
  419. package/dist/chunks/enable-KD46SEC5.js +0 -204
  420. package/dist/chunks/exec-4IPHZ55G.js +0 -1291
  421. package/dist/chunks/export-42QZLBSN.js +0 -177
  422. package/dist/chunks/fetch-proxy-R3JZNXBZ.js +0 -99
  423. package/dist/chunks/image-GP4H73A2.js +0 -75
  424. package/dist/chunks/import-builders-6TBLMPL2.js +0 -39
  425. package/dist/chunks/inspect-5FMWMY3C.js +0 -596
  426. package/dist/chunks/inspect-MUVK6MMT.js +0 -145
  427. package/dist/chunks/inspect-Q3DWW7MC.js +0 -216
  428. package/dist/chunks/inspect-QFXAOUL4.js +0 -175
  429. package/dist/chunks/inspect-RNTSYM6O.js +0 -171
  430. package/dist/chunks/list-IHHIPXEC.js +0 -387
  431. package/dist/chunks/list-JRNWLSO5.js +0 -426
  432. package/dist/chunks/list-XHD5DLEX.js +0 -404
  433. package/dist/chunks/login-PCT6KFWY.js +0 -233
  434. package/dist/chunks/ls-GPEHEFCF.js +0 -210
  435. package/dist/chunks/ls-PF7F4PP4.js +0 -197
  436. package/dist/chunks/ls-PQZ2RIDX.js +0 -188
  437. package/dist/chunks/ls-SVOHC3XW.js +0 -223
  438. package/dist/chunks/ls-TGHCCARZ.js +0 -175
  439. package/dist/chunks/ls-VRIH5WA3.js +0 -183
  440. package/dist/chunks/open-E7DEKYDU.js +0 -116
  441. package/dist/chunks/permissions-JKOONWVL.js +0 -99
  442. package/dist/chunks/publish-EDDELDE5.js +0 -155
  443. package/dist/chunks/pull-646WEVDE.js +0 -45
  444. package/dist/chunks/push-LTNW5OVD.js +0 -191
  445. package/dist/chunks/query-LU4N6KPO.js +0 -725
  446. package/dist/chunks/reorder-22PKJMZP.js +0 -412
  447. package/dist/chunks/reply-SF2EZMVZ.js +0 -176
  448. package/dist/chunks/resolve-ZCZGXTOT.js +0 -237
  449. package/dist/chunks/resolve-deployment-framework-preset-NPE6RLV3.js +0 -36
  450. package/dist/chunks/restore-VJAWZXB4.js +0 -252
  451. package/dist/chunks/rm-KN2QFCKO.js +0 -195
  452. package/dist/chunks/rm-KVEAJPRE.js +0 -147
  453. package/dist/chunks/rm-OSZ5FZUM.js +0 -322
  454. package/dist/chunks/rm-W722Q2AO.js +0 -173
  455. package/dist/chunks/rm-WNPGTUBH.js +0 -148
  456. package/dist/chunks/routes-QVMBXOSX.js +0 -24
  457. package/dist/chunks/rule-inspect-25Z6SNX3.js +0 -285
  458. package/dist/chunks/rules-65LKAQ35.js +0 -89
  459. package/dist/chunks/schema-7D6IGJEJ.js +0 -429
  460. package/dist/chunks/schema-NXCW4M75.js +0 -237
  461. package/dist/chunks/set-FYJVKMPV.js +0 -250
  462. package/dist/chunks/setup-and-link-KXPZE32P.js +0 -65
  463. package/dist/chunks/stamp-AA7R3MZS.js +0 -16
  464. package/dist/chunks/tags-ANIRP5E3.js +0 -69
  465. package/dist/chunks/types-4GAJ7XQQ.js +0 -116
  466. package/dist/chunks/update-UT6CTKVG.js +0 -246
package/README.md CHANGED
@@ -13,8 +13,8 @@ npm install @depup/vercel
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [vercel](https://www.npmjs.com/package/vercel) @ 59.11.7 |
17
- | Processed | 2026-09-06 |
16
+ | Original | [vercel](https://www.npmjs.com/package/vercel) @ 59.23.2 |
17
+ | Processed | 2026-09-20 |
18
18
  | Smoke test | failed |
19
19
  | Deps updated | 11 |
20
20
 
@@ -28,11 +28,11 @@ npm install @depup/vercel
28
28
  | esbuild | 0.27.0 | ^0.28.2 |
29
29
  | jose | 5.9.6 | ^6.2.12 |
30
30
  | luxon | ^3.4.0 | ^3.7.2 |
31
- | sandbox | 4.1.0 | ^4.2.1 |
31
+ | sandbox | 4.1.0 | ^4.4.0 |
32
32
  | smol-toml | 1.5.2 | ^1.8.0 |
33
33
  | undici | 5.29.0 | ^8.10.2 |
34
34
  | uuid | 14.0.1 | ^14.0.2 |
35
- | zod | 4.1.11 | ^4.5.4 |
35
+ | zod | 4.1.11 | ^4.6.5 |
36
36
 
37
37
  ---
38
38
 
package/changes.json CHANGED
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "sandbox": {
28
28
  "from": "4.1.0",
29
- "to": "^4.2.1"
29
+ "to": "^4.4.0"
30
30
  },
31
31
  "smol-toml": {
32
32
  "from": "1.5.2",
@@ -42,9 +42,9 @@
42
42
  },
43
43
  "zod": {
44
44
  "from": "4.1.11",
45
- "to": "^4.5.4"
45
+ "to": "^4.6.5"
46
46
  }
47
47
  },
48
- "timestamp": "2026-09-06T01:01:07.921Z",
48
+ "timestamp": "2026-09-20T00:59:47.412Z",
49
49
  "totalUpdated": 11
50
50
  }
@@ -0,0 +1,8 @@
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{parseTeamRefs,require_async_sema,teamRefBody}from"./chunk-S5CEIACD.js";import{repositoryPermissionsPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,resolveVcrScope,validateVcrJsonOutput}from"./chunk-GL2AUBAI.js";import{outputError}from"./chunk-FA6O7FPC.js";import"./chunk-D4MW3RDW.js";import{permissionsAddSubcommand}from"./chunk-YMVDWVMO.js";import"./chunk-HWWHR7H3.js";import"./chunk-2I64AYHG.js";import"./chunk-QTKJC2O5.js";import{AGENT_REASON}from"./chunk-EQP3SW72.js";import"./chunk-SOJCELXH.js";import"./chunk-32QBGZ2Z.js";import"./chunk-5XJNPXQK.js";import{printError}from"./chunk-TBBU37TD.js";import{parseArguments}from"./chunk-T4AZ3U7O.js";import"./chunk-MY4MONOH.js";import"./chunk-64NJHVA3.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import{buildCommandWithGlobalFlags,outputAgentError}from"./chunk-BX5KDMLT.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import"./chunk-YMM3VY3J.js";import"./chunk-V5DCSHYJ.js";import"./chunk-VOZEB6PD.js";import{isAPIError}from"./chunk-LKI6FRNM.js";import{packageName}from"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-BRK4OB4B.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import{__toESM}from"./chunk-6L236MNA.js";var import_async_sema=__toESM(require_async_sema(),1);var USAGE="vcr permissions <repository> add <team>[,<team>...]";async function add(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(permissionsAddSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,USAGE),printError(err),1}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let repository=parsedArgs.args[0],teamRefs=parseTeamRefs(parsedArgs.args.slice(2)),project=parsedArgs.flags["--project"];if(telemetry.trackCliOptionProject(project),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),teamRefs.length===0)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing team. Example: ${packageName} vcr permissions ${repository} add team_1a2b3c4d`,next:[{command:buildCommandWithGlobalFlags(client.argv,USAGE),when:"Replace <team> with a team id or slug (comma-separate multiple teams)"}]},1),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS",`Usage: \`vercel ${USAGE}\``);let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=repositoryPermissionsPath(scope,repository),added=[],failed=[];output_manager_default.spinner(`Sharing ${repository} with ${teamRefs.length===1?teamRefs[0]:`${teamRefs.length} teams`}...`);let sema=new import_async_sema.default(10),results;try{results=await Promise.all(teamRefs.map(async team=>{await sema.acquire();try{let result=await client.fetch(path,{method:"POST",body:teamRefBody(team)});return{ok:!0,team,permission:result.permission}}catch(err){if(!isAPIError(err))throw err;let message=err.serverMessage||`API error (${err.status}).`;return{ok:!1,team,failure:{team,code:err.code||"API_ERROR",message}}}finally{sema.release()}}))}finally{output_manager_default.stopSpinner()}for(let result of results)result.ok?(added.push(result.permission),fr.jsonOutput||output_manager_default.success(`Shared ${repository} with ${result.permission?.teamSlug??result.team}`)):(failed.push(result.failure),fr.jsonOutput||output_manager_default.error(`Failed to share ${repository} with ${result.team}: ${result.failure.message}`));return failed.length>0&&outputAgentError(client,{status:"error",reason:AGENT_REASON.API_ERROR,message:`Failed to share ${repository} with ${failed.map(f=>`${f.team} (${f.message})`).join(", ")}`},1),fr.jsonOutput&&client.stdout.write(`${JSON.stringify({permissions:added,failed},null,2)}
8
+ `),failed.length>0?1:0}export{add as default};
@@ -0,0 +1,8 @@
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{emitVcrArgParseError,handleVcrApiError,resolveVcrScope,validateVcrJsonOutput}from"./chunk-GL2AUBAI.js";import{outputError}from"./chunk-FA6O7FPC.js";import"./chunk-D4MW3RDW.js";import{addSubcommand}from"./chunk-65JYSI26.js";import"./chunk-YMVDWVMO.js";import"./chunk-O7G3CZ42.js";import"./chunk-N3N5UHIL.js";import"./chunk-HWWHR7H3.js";import"./chunk-2I64AYHG.js";import"./chunk-QTKJC2O5.js";import{AGENT_REASON}from"./chunk-EQP3SW72.js";import"./chunk-SOJCELXH.js";import"./chunk-32QBGZ2Z.js";import"./chunk-5XJNPXQK.js";import{printError}from"./chunk-TBBU37TD.js";import{parseArguments}from"./chunk-T4AZ3U7O.js";import"./chunk-MY4MONOH.js";import"./chunk-64NJHVA3.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import{buildCommandWithGlobalFlags,outputAgentError}from"./chunk-BX5KDMLT.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import"./chunk-YMM3VY3J.js";import"./chunk-V5DCSHYJ.js";import"./chunk-VOZEB6PD.js";import{isAPIError}from"./chunk-LKI6FRNM.js";import{packageName}from"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-BRK4OB4B.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import"./chunk-6L236MNA.js";async function add(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(addSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr add <name> --project <name-or-id>"),printError(err),1}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let name=parsedArgs.args[0],project=parsedArgs.flags["--project"];if(telemetry.trackCliOptionProject(project),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),!name)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing repository name. Example: ${packageName} vcr add <name>`,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr add <name>"),when:"Replace <name> with the repository name to create"}]},1),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS","Usage: `vercel vcr add <name>`");let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=`/v1/vcr/repository?teamId=${encodeURIComponent(scope.teamId)}`;output_manager_default.spinner("Creating repository...");try{let created=await client.fetch(path,{method:"POST",body:{projectId:scope.projectId,name}});return fr.jsonOutput?client.stdout.write(`${JSON.stringify(created,null,2)}
8
+ `):output_manager_default.success(`Created repository ${created.repository?.name??name}`),0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput,{retry:{command:buildCommandWithGlobalFlags(client.argv,"vcr ls"),when:"List existing repositories (a name conflict means it already exists)"}});throw err}finally{output_manager_default.stopSpinner()}}export{add as default};
@@ -0,0 +1,8 @@
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{printRuleMutationReceipt}from"./chunk-SOQ5DE44.js";import{emitRulesArgParseError,getBodyType,handleRulesApiError,outputRulesError,readRuleBody,resolveRulesProject,resolveRulesTeam,rulesCollectionPath}from"./chunk-GGNZLN4R.js";import"./chunk-7PNYOSDU.js";import"./chunk-2SLHYWMC.js";import"./chunk-6PFC3KWQ.js";import"./chunk-GZNDA6SV.js";import"./chunk-WRILLB46.js";import"./chunk-FA6O7FPC.js";import"./chunk-GHAY4PSD.js";import"./chunk-NYOQMU3P.js";import"./chunk-TRTEXGVN.js";import"./chunk-T3GQAMBJ.js";import"./chunk-J3U3L45Y.js";import"./chunk-KBKN7EI7.js";import"./chunk-DL665Q3Z.js";import"./chunk-MBL6TXEJ.js";import{validateJsonOutput}from"./chunk-D4MW3RDW.js";import"./chunk-P2O5DOYE.js";import{rulesAddSubcommand}from"./chunk-OAKO6LVS.js";import"./chunk-QTKJC2O5.js";import"./chunk-GHM7V3GG.js";import"./chunk-QR7QPUFN.js";import"./chunk-EQP3SW72.js";import"./chunk-6TAQ6OWD.js";import"./chunk-WPS6JZF6.js";import"./chunk-32QBGZ2Z.js";import"./chunk-RCTYVKM5.js";import"./chunk-5XJNPXQK.js";import{printError}from"./chunk-TBBU37TD.js";import{parseArguments}from"./chunk-T4AZ3U7O.js";import"./chunk-MY4MONOH.js";import"./chunk-64NJHVA3.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import"./chunk-OSCCYU74.js";import"./chunk-BX5KDMLT.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import"./chunk-YMM3VY3J.js";import"./chunk-V5DCSHYJ.js";import"./chunk-VOZEB6PD.js";import{isAPIError}from"./chunk-LKI6FRNM.js";import"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-BRK4OB4B.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import"./chunk-6L236MNA.js";function applyScopeFlag(client,body,type,scope,flags,jsonOutput){if(Object.hasOwn(body,"ruleScope"))return flags["--project"]||flags["--all"]?outputRulesError(client,jsonOutput,"SCOPE_CONFLICT","Specify rule scope either in the body or with --project/--all, not both."):void 0;if(flags["--project"]){body.ruleScope=type==="custom"?{type:"project",projectId:scope.projectId}:{type:"include",projectIds:[scope.projectId]};return}if(flags["--all"]){if(type==="custom")return outputRulesError(client,jsonOutput,"INVALID_SCOPE","Custom alert rules must target one project. Use --project <name-or-id>.");body.ruleScope={type:"all"};return}return outputRulesError(client,jsonOutput,"MISSING_SCOPE","Missing rule scope. Add ruleScope to the body, or pass --project or --all.")}async function resolveCreateScope(client,flags,jsonOutput){return flags["--project"]&&flags["--all"]?outputRulesError(client,jsonOutput,"MUTUAL_EXCLUSIVITY","Cannot specify both --all and --project. Use one or the other."):flags["--project"]?resolveRulesProject(client,flags["--project"],jsonOutput,"alerts rules add"):resolveRulesTeam(client,jsonOutput)}async function add(client,argv){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(rulesAddSubcommand.options))}catch(error){return emitRulesArgParseError(client,error,"alerts rules add --project <name-or-id> --body <path>"),printError(error),1}let flags=parsedArgs.flags,format=validateJsonOutput(flags);if(!format.valid)return outputRulesError(client,!1,"INVALID_ARGUMENTS",format.error);if(!flags["--body"])return outputRulesError(client,format.jsonOutput,"MISSING_ARGUMENTS","Missing required flag: --body <PATH>.");let body=readRuleBody(client,flags["--body"],format.jsonOutput);if(typeof body=="number")return body;let type=getBodyType(body);if(!type)return outputRulesError(client,format.jsonOutput,"INVALID_RULE_TYPE","Create body must set a supported rule type.");if(Object.hasOwn(body,"ruleScope")&&(flags["--project"]||flags["--all"]))return outputRulesError(client,format.jsonOutput,"SCOPE_CONFLICT","Specify rule scope either in the body or with --project/--all, not both.");if(type==="custom"&&flags["--all"])return outputRulesError(client,format.jsonOutput,"INVALID_SCOPE","Custom alert rules must target one project. Use --project <name-or-id>.");let scope=await resolveCreateScope(client,flags,format.jsonOutput);if(typeof scope=="number")return scope;let scopeError=applyScopeFlag(client,body,type,scope,flags,format.jsonOutput);if(scopeError!==void 0)return scopeError;output_manager_default.spinner("Creating alert rule\u2026");try{let response=await client.fetch(rulesCollectionPath(scope.teamId),{method:"POST",body});return format.jsonOutput?client.stdout.write(`${JSON.stringify(response,null,2)}
8
+ `):printRuleMutationReceipt("Created",response.rule,client.argv),0}catch(error){if(isAPIError(error))return handleRulesApiError(client,error,format.jsonOutput);throw error}finally{output_manager_default.stopSpinner()}}export{add as default};
@@ -0,0 +1,7 @@
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{DEFAULT_TAG,buildRepositoryReference,parseNameArg,validateImageParts}from"./chunk-HEGJZJO7.js";import{VCR_ENGINES,emitVcrArgParseError,isBuildxAvailable,isEngineInstalled,pushCompressionArgs,reportEngineCommandFailure,reportEnginePushFailure,resolveRegistry,resolveVcrScope,runEngine,splitPassthrough,validateVcrChoice}from"./chunk-GL2AUBAI.js";import{outputError}from"./chunk-FA6O7FPC.js";import"./chunk-D4MW3RDW.js";import{buildSubcommand}from"./chunk-65JYSI26.js";import"./chunk-YMVDWVMO.js";import"./chunk-O7G3CZ42.js";import"./chunk-N3N5UHIL.js";import"./chunk-HWWHR7H3.js";import"./chunk-2I64AYHG.js";import"./chunk-QTKJC2O5.js";import{AGENT_REASON}from"./chunk-EQP3SW72.js";import"./chunk-SOJCELXH.js";import"./chunk-32QBGZ2Z.js";import"./chunk-5XJNPXQK.js";import{printError}from"./chunk-TBBU37TD.js";import{parseArguments}from"./chunk-T4AZ3U7O.js";import"./chunk-MY4MONOH.js";import"./chunk-64NJHVA3.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import{buildCommandWithGlobalFlags,outputAgentError}from"./chunk-BX5KDMLT.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import"./chunk-YMM3VY3J.js";import"./chunk-V5DCSHYJ.js";import"./chunk-VOZEB6PD.js";import"./chunk-LKI6FRNM.js";import"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-BRK4OB4B.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import"./chunk-6L236MNA.js";var DEFAULT_PLATFORM="linux/amd64";async function build(client,telemetry){let{own,passthrough}=splitPassthrough(client.argv),parsedArgs;try{parsedArgs=parseArguments(own,getFlagsSpecification(buildSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr build <engine> [path] [name[:tag]]"),printError(err),1}let[engineArg,pathArg,nameArg]=parsedArgs.args.slice(2),project=parsedArgs.flags["--project"],platform=parsedArgs.flags["--platform"],push=!!parsedArgs.flags["--push"];if(telemetry.trackCliArgumentEngine(engineArg),telemetry.trackCliArgumentPath(pathArg),telemetry.trackCliArgumentName(nameArg),telemetry.trackCliOptionProject(project),telemetry.trackCliOptionPlatform(platform),telemetry.trackCliFlagPush(push),!engineArg){let message=`Missing engine. Choose one of: ${VCR_ENGINES.join(", ")}.`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr build docker"),when:"Replace docker with the container tool you use"}]},1),outputError(client,!1,"MISSING_ARGUMENTS",message)}let choiceError=validateVcrChoice(client,"engine",engineArg,VCR_ENGINES,!1);if(typeof choiceError=="number")return choiceError;let engine=engineArg;if(!isEngineInstalled(engine)){let message=`\`${engine}\` is not installed or not on your PATH. Install it and try again.`;return outputAgentError(client,{status:"error",reason:"engine_not_found",message},1),outputError(client,!1,"ENGINE_NOT_FOUND",message)}let scope=await resolveVcrScope(client,{project,jsonOutput:!1});if(typeof scope=="number")return scope;let parsed=parseNameArg(nameArg,scope.projectName);if("error"in parsed)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:parsed.error},1),outputError(client,!1,"INVALID_ARGUMENTS",parsed.error);let validationError=validateImageParts(parsed);if(validationError)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:validationError},1),outputError(client,!1,"INVALID_ARGUMENTS",validationError);let ref=`${buildRepositoryReference({registry:resolveRegistry(),teamSlug:scope.teamSlug,projectName:scope.projectName,repository:parsed.repository})}:${parsed.tag??DEFAULT_TAG}`,contextPath=pathArg??".",buildPlatform=platform??DEFAULT_PLATFORM;if(push&&engine==="docker"&&await isBuildxAvailable()){let outputSpec=`type=image,name=${ref},push=true,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true`,engineArgs2=["buildx","build","--platform",buildPlatform,"--output",outputSpec,...passthrough,contextPath];output_manager_default.log(`Running: ${engine} ${engineArgs2.join(" ")}`);let result2=await runEngine(engine,engineArgs2,{cwd:client.cwd,captureStderr:!0});return result2.exitCode!==0?reportEnginePushFailure(client,engine,"buildx build",result2):(output_manager_default.success(`Built and pushed ${ref} (zstd compression)`),0)}push&&engine==="docker"&&output_manager_default.warn("Docker Buildx is not available; building and pushing without zstd compression. Install Buildx for smaller, faster image pushes.");let engineArgs=["build","--platform",buildPlatform,"--tag",ref,...passthrough,contextPath];output_manager_default.log(`Running: ${engine} ${engineArgs.join(" ")}`);let result=await runEngine(engine,engineArgs,{cwd:client.cwd});if(result.exitCode!==0)return reportEngineCommandFailure(client,engine,"build",result);if(!push)return output_manager_default.success(`Built ${ref}`),output_manager_default.log(`Push it with \`${buildCommandWithGlobalFlags(client.argv,`vcr push ${engine}${nameArg?` ${nameArg}`:""}`)}\`.`),0;let pushArgs=["push",...pushCompressionArgs(engine),ref];output_manager_default.log(`Running: ${engine} ${pushArgs.join(" ")}`);let pushResult=await runEngine(engine,pushArgs,{cwd:client.cwd,captureStderr:!0});if(pushResult.exitCode!==0)return reportEnginePushFailure(client,engine,"push",pushResult);let compressed=engine!=="docker";return output_manager_default.success(`Built and pushed ${ref}${compressed?" (zstd compression)":""}`),0}export{build as default};
@@ -0,0 +1,9 @@
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{require_figures}from"./chunk-OHDEHZLX.js";import{Separator,ValidationError,createPrompt,isBackspaceKey,isDownKey,isEnterKey,isNumberKey,isUpKey,makeTheme,require_source,useKeypress,useMemo,usePagination,usePrefix,useRef,useState}from"./chunk-M2W3HKV3.js";import{require_ansi_escapes}from"./chunk-7HL2RPUO.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1),import_figures=__toESM(require_figures(),1),import_ansi_escapes=__toESM(require_ansi_escapes(),1),selectTheme={icon:{cursor:import_figures.default.pointer},style:{disabled:text=>import_chalk.default.dim(`- ${text}`)}};function isSelectable(item){return!Separator.isSeparator(item)&&!item.disabled}var esm_default=createPrompt((config,done)=>{let{choices:items,loop=!0,pageSize=7}=config,firstRender=useRef(!0),theme=makeTheme(selectTheme,config.theme),prefix=usePrefix({theme}),[status,setStatus]=useState("pending"),searchTimeoutRef=useRef(void 0),bounds=useMemo(()=>{let first=items.findIndex(isSelectable),last=items.length-1-[...items].reverse().findIndex(isSelectable);if(first<0)throw new ValidationError("[select prompt] No selectable choices. All choices are disabled.");return{first,last}},[items]),defaultItemIndex=useMemo(()=>"default"in config?items.findIndex(item=>isSelectable(item)&&item.value===config.default):-1,[config.default,items]),[active,setActive]=useState(defaultItemIndex===-1?bounds.first:defaultItemIndex),selectedChoice=items[active];useKeypress((key,rl)=>{if(clearTimeout(searchTimeoutRef.current),isEnterKey(key))setStatus("done"),done(selectedChoice.value);else if(isUpKey(key)||isDownKey(key)){if(rl.clearLine(0),loop||isUpKey(key)&&active!==bounds.first||isDownKey(key)&&active!==bounds.last){let offset=isUpKey(key)?-1:1,next=active;do next=(next+offset+items.length)%items.length;while(!isSelectable(items[next]));setActive(next)}}else if(isNumberKey(key)){rl.clearLine(0);let position=Number(key.name)-1,item=items[position];item!=null&&isSelectable(item)&&setActive(position)}else if(isBackspaceKey(key))rl.clearLine(0);else{let searchTerm=rl.line.toLowerCase(),matchIndex=items.findIndex(item=>Separator.isSeparator(item)||!isSelectable(item)?!1:String(item.name||item.value).toLowerCase().startsWith(searchTerm));matchIndex>=0&&setActive(matchIndex),searchTimeoutRef.current=setTimeout(()=>{rl.clearLine(0)},700)}});let message=theme.style.message(config.message),helpTip;firstRender.current&&items.length<=pageSize&&(firstRender.current=!1,helpTip=theme.style.help("(Use arrow keys)"));let page=usePagination({items,active,renderItem({item,isActive}){if(Separator.isSeparator(item))return` ${item.separator}`;let line=item.name||item.value;if(item.disabled){let disabledLabel=typeof item.disabled=="string"?item.disabled:"(disabled)";return theme.style.disabled(`${line} ${disabledLabel}`)}let color=isActive?theme.style.highlight:x=>x,cursor=isActive?theme.icon.cursor:" ";return color(`${cursor} ${line}`)},pageSize,loop,theme});if(status==="done"){let answer=selectedChoice.name||String(selectedChoice.value);return`${prefix} ${message} ${theme.style.answer(answer)}`}let choiceDescription=selectedChoice.description?`
8
+ ${selectedChoice.description}`:"";return`${[prefix,message,helpTip].filter(Boolean).join(" ")}
9
+ ${page}${choiceDescription}${import_ansi_escapes.default.cursorHide}`});export{esm_default};
@@ -0,0 +1,9 @@
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{require_dist}from"./chunk-TRTEXGVN.js";import{getDeployment}from"./chunk-GHULCYAR.js";import{getScope}from"./chunk-32QBGZ2Z.js";import{toNodeReadable}from"./chunk-MY4MONOH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import{require_ansi_escapes}from"./chunk-7HL2RPUO.js";import{__commonJS,__require,__toESM}from"./chunk-6L236MNA.js";var require_parser=__commonJS({"../../node_modules/.pnpm/jsonlines@0.1.1/node_modules/jsonlines/lib/parser.js"(exports,module){var Transform=__require("stream").Transform;function Parser(options){if(!(this instanceof Parser))throw new TypeError("Cannot call a class as a function");options=options||{},Transform.call(this,{objectMode:!0}),this._memory="",this._emitInvalidLines=options.emitInvalidLines||!1}Parser.prototype=Object.create(Transform.prototype);Parser.prototype._handleLines=function(lines,cb){for(var i=0;i<lines.length;i++)if(lines[i]!==""){var err=null,json=null;try{json=JSON.parse(lines[i])}catch(_err){_err.source=lines[i],err=_err}if(err)if(this._emitInvalidLines)this.emit("invalid-line",err);else return cb(err);else this.push(json)}cb(null)};Parser.prototype._transform=function(chunk,encoding,cb){var lines=(this._memory+chunk.toString()).split(`
8
+ `);this._memory=lines.pop(),this._handleLines(lines,cb)};Parser.prototype._flush=function(cb){if(!this._memory)return cb(null);var line=this._memory;this._memory="",this._handleLines([line],cb)};module.exports=Parser}});var require_stringifier=__commonJS({"../../node_modules/.pnpm/jsonlines@0.1.1/node_modules/jsonlines/lib/stringifier.js"(exports,module){var Transform=__require("stream").Transform;function Stringifier(){if(!(this instanceof Stringifier))throw new TypeError("Cannot call a class as a function");Transform.call(this,{objectMode:!0})}Stringifier.prototype=Object.create(Transform.prototype);Stringifier.prototype._transform=function(data,_,cb){var value;try{value=JSON.stringify(data)}catch(err){return err.source=data,cb(err)}cb(null,value+`
9
+ `)};module.exports=Stringifier}});var require_jsonlines=__commonJS({"../../node_modules/.pnpm/jsonlines@0.1.1/node_modules/jsonlines/index.js"(exports){var Parser=require_parser(),Stringifier=require_stringifier();exports.parse=function(options){return new Parser(options)};exports.stringify=function(){return new Stringifier}}});var import_async_retry=__toESM(require_dist(),1),import_jsonlines=__toESM(require_jsonlines(),1),import_ansi_escapes=__toESM(require_ansi_escapes(),1);import{URLSearchParams}from"url";async function printEvents(client,urlOrDeploymentId,{mode,onEvent,onAliasAssigned,quiet,findOpts},abortController){let{log,debug}=output_manager_default,scope=mode==="deploy"?await getScope(client):null,o=0;await(0,import_async_retry.default)(async(bail,attemptNumber)=>{attemptNumber>1&&debug("Retrying events");let query=new URLSearchParams({direction:findOpts.direction,follow:findOpts.follow?"1":"",format:"lines"});findOpts.limit&&query.set("limit",String(findOpts.limit)),findOpts.since&&query.set("since",String(findOpts.since)),findOpts.until&&query.set("until",String(findOpts.until));let eventsUrl=`/v3/now/deployments/${urlOrDeploymentId}/events?${query}`;try{let eventsRes=await client.fetch(eventsUrl,{json:!1,signal:abortController?.signal});if(eventsRes.ok){let readable=toNodeReadable(eventsRes.body);return new Promise((resolve,reject)=>{let stream=readable.pipe(import_jsonlines.default.parse()),poller;mode==="deploy"&&(poller=function startPoller(){return setTimeout(async()=>{try{if((await getDeployment(client,scope.contextName,urlOrDeploymentId)).readyState==="READY"){stream.end(),finish();return}poller=startPoller()}catch(err2){stream.end(),finish(err2)}},5e3)}());let finishCalled=!1;function finish(err2){finishCalled||(finishCalled=!0,clearTimeout(poller),err2?reject(err2):resolve())}let latestLogDate=0,onData=data=>{if(data.type==="alias-assigned"){data.deploymentId===urlOrDeploymentId&&onAliasAssigned?.(data);return}let{event,payload,date}=data;event==="state"&&payload.value==="READY"?mode==="deploy"&&(stream.end(),finish()):(latestLogDate=Math.max(latestLogDate,date),onEvent(data))},onErrorCalled=!1,onError=err2=>{if(finishCalled||onErrorCalled)return;if(err2.name==="AbortError"){finish();return}onErrorCalled=!0,o++;let errorMessage=`Deployment event stream error: ${err2.message}`;if(!findOpts.follow){log(errorMessage);return}debug(errorMessage),clearTimeout(poller),stream.destroy(err2);let retryFindOpts={...findOpts,since:latestLogDate},retryTimeout=setTimeout(()=>{abortController?.signal.removeEventListener("abort",onAbort),!abortController?.signal.aborted&&printEvents(client,urlOrDeploymentId,{mode,onEvent,onAliasAssigned,quiet,findOpts:retryFindOpts},abortController).then(resolve,reject)},2e3),onAbort=()=>{clearTimeout(retryTimeout),finish()};abortController?.signal.addEventListener("abort",onAbort,{once:!0})};stream.on("end",finish),stream.on("data",onData),stream.on("error",onError),readable.on("error",onError)})}let err=new Error(`Deployment events status ${eventsRes.status}`);if(eventsRes.status<500)bail(err);else throw err}catch(err){if(err instanceof Error&&err.name==="AbortError")return;throw err}},{retries:4,unref:!!onAliasAssigned,onRetry:err=>{!quiet&&o&&(process.stdout.write((0,import_ansi_escapes.eraseLines)(o+1)),o=0),log(`Deployment events polling error: ${err.message}`)}})}var events_default=printEvents;export{require_jsonlines,events_default};
@@ -0,0 +1,7 @@
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{require_once}from"./chunk-SOJCELXH.js";import{__commonJS}from"./chunk-6L236MNA.js";var require_end_of_stream=__commonJS({"../../node_modules/.pnpm/end-of-stream@1.4.1/node_modules/end-of-stream/index.js"(exports,module){var once=require_once(),noop=function(){},isRequest=function(stream){return stream.setHeader&&typeof stream.abort=="function"},isChildProcess=function(stream){return stream.stdio&&Array.isArray(stream.stdio)&&stream.stdio.length===3},eos=function(stream,opts,callback){if(typeof opts=="function")return eos(stream,null,opts);opts||(opts={}),callback=once(callback||noop);var ws=stream._writableState,rs=stream._readableState,readable=opts.readable||opts.readable!==!1&&stream.readable,writable=opts.writable||opts.writable!==!1&&stream.writable,onlegacyfinish=function(){stream.writable||onfinish()},onfinish=function(){writable=!1,readable||callback.call(stream)},onend=function(){readable=!1,writable||callback.call(stream)},onexit=function(exitCode){callback.call(stream,exitCode?new Error("exited with error code: "+exitCode):null)},onerror=function(err){callback.call(stream,err)},onclose=function(){if(readable&&!(rs&&rs.ended))return callback.call(stream,new Error("premature close"));if(writable&&!(ws&&ws.ended))return callback.call(stream,new Error("premature close"))},onrequest=function(){stream.req.on("finish",onfinish)};return isRequest(stream)?(stream.on("complete",onfinish),stream.on("abort",onclose),stream.req?onrequest():stream.on("request",onrequest)):writable&&!ws&&(stream.on("end",onlegacyfinish),stream.on("close",onlegacyfinish)),isChildProcess(stream)&&stream.on("exit",onexit),stream.on("end",onend),stream.on("finish",onfinish),opts.error!==!1&&stream.on("error",onerror),stream.on("close",onclose),function(){stream.removeListener("complete",onfinish),stream.removeListener("abort",onclose),stream.removeListener("request",onrequest),stream.req&&stream.req.removeListener("finish",onfinish),stream.removeListener("end",onlegacyfinish),stream.removeListener("close",onlegacyfinish),stream.removeListener("finish",onfinish),stream.removeListener("exit",onexit),stream.removeListener("end",onend),stream.removeListener("error",onerror),stream.removeListener("close",onclose)}};module.exports=eos}});export{require_end_of_stream};
@@ -0,0 +1,7 @@
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
+ function parseThreadArg(arg){if(!/^https?:\/\//i.test(arg))return{id:arg};let url;try{url=new URL(arg)}catch{return}let segments=url.pathname.split("/").filter(Boolean),cIndex=segments.lastIndexOf("c");if(cIndex!==-1&&cIndex+1<segments.length){let id=safeDecode(segments[cIndex+1]);return id?{id,teamSlug:cIndex>1?safeDecode(segments[0]):void 0}:void 0}}function safeDecode(segment){try{return decodeURIComponent(segment)||void 0}catch{return}}export{parseThreadArg};
@@ -0,0 +1,7 @@
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{outputError}from"./chunk-FA6O7FPC.js";import{AGENT_REASON}from"./chunk-EQP3SW72.js";import{getScope}from"./chunk-32QBGZ2Z.js";import{getLinkedProject,getProjectByNameOrId}from"./chunk-64NJHVA3.js";import{buildCommandWithGlobalFlags,outputAgentError}from"./chunk-BX5KDMLT.js";import{ProjectNotFound,isAPIError}from"./chunk-LKI6FRNM.js";function emitAlertsScopeError(client,jsonOutput,code,message,agent){return outputAgentError(client,{status:"error",reason:agent.reason,message,hint:agent.hint,next:agent.next},1),outputError(client,jsonOutput,code,message)}async function resolveAlertsScope(client,opts){let command=opts.command??"alerts",projectCommand=`${command} --project <name_or_id>`,allCommand=`${command} --all`;if(opts.all||opts.project){let{team}=await getScope(client);if(!team){let msg="No team context found. Run `vercel switch` to select a team, or use `vercel link` in a project directory.";return emitAlertsScopeError(client,opts.jsonOutput,"NO_TEAM",msg,{reason:AGENT_REASON.MISSING_SCOPE,hint:"Select a team scope before using --project or --all with alerts.",next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"},{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Switch to a team that owns the project"}]})}if(opts.all)return{teamId:team.id};let projectResult;try{projectResult=await getProjectByNameOrId(client,opts.project,team.id)}catch(err){if(isAPIError(err)){let msg=err.serverMessage||(err.status===403?`You do not have permission to access project "${opts.project}" in team "${team.slug}".`:`API error (${err.status}).`),reason=err.status===401?"not_authorized":err.status===403?"forbidden":AGENT_REASON.API_ERROR;return emitAlertsScopeError(client,opts.jsonOutput,err.code||"API_ERROR",msg,{reason,next:[{command:buildCommandWithGlobalFlags(client.argv,projectCommand),when:"Retry with a project you can access (replace <name_or_id>)"}]})}throw err}if(projectResult instanceof ProjectNotFound){let msg=`Project "${opts.project}" was not found in team "${team.slug}".`;return emitAlertsScopeError(client,opts.jsonOutput,"PROJECT_NOT_FOUND",msg,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,projectCommand),when:"Retry with a valid project (replace <name_or_id>)"}]})}return{teamId:team.id,projectId:projectResult.id,projectName:projectResult.name}}let linkedProject=await getLinkedProject(client);if(linkedProject.status==="error")return linkedProject.exitCode;if(linkedProject.status==="not_linked"){let msg="No linked project found. Run `vercel link` to link a project, or use --project <name> or --all.";return emitAlertsScopeError(client,opts.jsonOutput,"NOT_LINKED",msg,{reason:AGENT_REASON.NOT_LINKED,hint:"Agents should pass --project or --all when no .vercel link exists in --cwd.",next:[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Link this directory to a Vercel project"},{command:buildCommandWithGlobalFlags(client.argv,projectCommand),when:"Retry with an explicit project (replace <name_or_id>)"},{command:buildCommandWithGlobalFlags(client.argv,allCommand),when:"Use team-wide scope without a linked project"}]})}return{teamId:linkedProject.org.id,projectId:linkedProject.project.id,projectName:linkedProject.project.name}}export{emitAlertsScopeError,resolveAlertsScope};
@@ -0,0 +1,7 @@
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{inspectTokenRequest,processInspectTokenResponse}from"./chunk-5XJNPXQK.js";import{findProjectsFromPath,getLinkFromDir,getRepoLink,getVercelDirectory}from"./chunk-64NJHVA3.js";import{getUser}from"./chunk-V5DCSHYJ.js";import{getTeamByIdOrSlug}from"./chunk-VOZEB6PD.js";import{InvalidToken,TeamDeleted}from"./chunk-LKI6FRNM.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";var VERCEL_API_ORIGIN="https://api.vercel.com";async function introspectToken(client){let token=client.authConfig.token;if(!token)throw new Error("No token to introspect");if(new URL(client.apiUrl).origin!==VERCEL_API_ORIGIN)throw new Error("Token introspection is unavailable for custom API origins");let[error,introspection]=await processInspectTokenResponse(await inspectTokenRequest(token));if(error)throw error;return introspection}function isAppPrincipalEnabled(){return!!process.env.APP_PRINCIPAL_ENABLED}function resolveAppFromToken(token){return!token.active||!token.client_id?null:{id:token.client_id,name:token.client_name}}async function resolveAppTokenScope(client,scope){let token=await introspectToken(client).catch(()=>null),app=token?resolveAppFromToken(token):null,team=token?.team;return!app||!team||team.id!==scope&&team.slug!==scope?!1:(client.config.currentTeam=team.id,!0)}import{relative}from"path";async function getScope(client,opts={}){let{user,app,token}=await getPrincipal(client),defaultTeamId=user?.version==="northstar"?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.config.currentTeam=appTeamId),!client.config.currentTeam&&defaultTeamId&&(client.config.currentTeam=defaultTeamId);let teamId=client.config.currentTeam||defaultTeamId,team=teamId&&opts.getTeam!==!1?await getTeam(client,teamId):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 getPrincipal(client){if(!isAppPrincipalEnabled())return{user:await getUser(client),app:null,token:null};let[userResult,tokenResult]=await Promise.allSettled([getUser(client),introspectToken(client)]),token=tokenResult.status==="fulfilled"?tokenResult.value:null,app=token?resolveAppFromToken(token):null;if(userResult.status==="rejected"&&!(app&&userResult.reason instanceof InvalidToken))throw userResult.reason;return{user:userResult.status==="fulfilled"?userResult.value:null,app,token}}async function resolveLocalScopeContext(client,{user,app,team}){let explicitScopeProvided=detectExplicitScope(client),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,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 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 projects=findProjectsFromPath(repoConfig.projects,pathFromRepoRoot),orgIds=new Set(projects.map(p=>p.orgId??repoConfig.orgId??""));if(orgIds.size!==1)return;let[orgId]=orgIds;return orgId||void 0}function detectExplicitScope(client){let argv=client.argv;for(let arg of argv){if(arg==="--")break;if(arg==="--scope"||arg==="--team"||arg.startsWith("--scope=")||arg.startsWith("--team=")||arg==="-S"||arg==="-T")return!0}return!!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{isAppPrincipalEnabled,resolveAppTokenScope,getScope,detectExplicitScope};
@@ -0,0 +1,20 @@
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{ellipsis}from"./chunk-ZDX75YNZ.js";import{require_ms}from"./chunk-QTKJC2O5.js";import{ALIGNED_LABEL_WIDTH}from"./chunk-YMM3VY3J.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1),import_ms=__toESM(require_ms(),1);function alignedRow(label,value){return` ${import_chalk.default.bold(label.padEnd(ALIGNED_LABEL_WIDTH))}${value}`}function actorLabel(actor){if(!actor)return"-";let base=actor.name||actor.username||actor.id;return actor.type==="app"?`${base} (app)`:base}function relativeAge(timestamp){if(!timestamp||!Number.isFinite(timestamp))return"-";let delta=Date.now()-timestamp;return delta<1e3?"now":(0,import_ms.default)(delta)}function displayPath(thread){let href=thread.context?.href;if(href)try{return new URL(href).pathname}catch{}return thread.context?.path||"/"}function truncate(text,max){return ellipsis(text.replace(/\s+/g," ").trim(),max)}function firstMessageText(thread){return thread.messages[0]?.text??""}function threadAge(thread){return relativeAge(thread.messages[0]?.timestamp)}function renderThreadSummary(thread,complete){let replies=thread.messageCount-1,rootAuthorId=complete?thread.messages[0]?.author.id:void 0,names=[],seen=new Set;for(let message of thread.messages){let{author}=message;author.id===rootAuthorId||seen.has(author.id)||(seen.add(author.id),names.push(actorLabel(author)))}let shown=names.slice(0,3),overflow=names.length-shown.length,participants=shown.length>0?`${shown.join(", ")}${overflow>0?` +${overflow} more`:""}`:void 0,lastTimestamp=thread.messages[thread.messages.length-1]?.timestamp,parts=[`\u2192 ${replies} ${replies===1?"reply":"replies"}`];return participants&&parts.push(participants),parts.push(`last ${relativeAge(lastTimestamp)} ago`),parts.join(" \xB7 ")}function renderThreadRow(thread,opts){let complete=thread.messageCount<=thread.messages.length,dot=thread.resolved?import_chalk.default.dim("\u25CB"):"\u25CF",author=complete?actorLabel(thread.messages[0]?.author):"\u2026",columns=[dot,thread.id,import_chalk.default.dim(threadAge(thread)),author,displayPath(thread)];opts.showBranch&&thread.branch&&columns.push(import_chalk.default.dim(thread.branch)),thread.isLocalhost&&columns.push(import_chalk.default.dim("localhost"));let lines=[` ${columns.join(" ")}`];if(complete){let excerpt=truncate(firstMessageText(thread),80);excerpt&&lines.push(` \u201C${excerpt}\u201D`)}else lines.push(import_chalk.default.dim(" (long thread \u2014 inspect for the full conversation)"));let selection=thread.context?.selection;selection&&lines.push(import_chalk.default.dim(` \u2192 selected: \u201C${truncate(selection,60)}\u201D`)),thread.messageCount>1&&lines.push(import_chalk.default.dim(` ${renderThreadSummary(thread,complete)}`));let meta=[],reactionCount=thread.messages.reduce((acc,message)=>acc+(message.reactions?.length??0),0);reactionCount>0&&meta.push(`${reactionCount} ${reactionCount===1?"reaction":"reactions"}`);let attachmentCount=thread.messages.reduce((acc,message)=>acc+(message.attachments?.length??0),0);return attachmentCount>0&&meta.push(`${attachmentCount} ${attachmentCount===1?"attachment":"attachments"}`),thread.resolved&&meta.push(`resolved by ${actorLabel(thread.resolvedBy)}`),meta.length>0&&lines.push(import_chalk.default.dim(` ${meta.join(" \xB7 ")}`)),lines.join(`
8
+ `)}function renderReactions(message){if(!(!message.reactions||message.reactions.length===0))return message.reactions.map(r=>`${r.emoji} ${r.name} \xB7 ${r.users.length}`).join(" ")}function renderMessage(message){let lines=[`${import_chalk.default.bold(actorLabel(message.author))} \xB7 ${relativeAge(message.timestamp)} ago \xB7 ${import_chalk.default.dim(message.id)}`];for(let textLine of message.text.split(`
9
+ `))lines.push(` ${textLine}`);for(let attachment of message.attachments??[]){let dimensions=attachment.width&&attachment.height?` (${attachment.width}\xD7${attachment.height})`:"";lines.push(`${import_chalk.default.dim(` \u2192 attachment ${attachment.filename}${dimensions}`)} ${import_chalk.default.cyan(attachment.url)}`)}let reactions=renderReactions(message);return reactions&&lines.push(` ${reactions}`),lines.join(`
10
+ `)}function renderThreadDetail(thread,messages,opts){let sections=[],status=thread.resolved?import_chalk.default.dim(`resolved by ${actorLabel(thread.resolvedBy)}`):"unresolved",headline=[import_chalk.default.bold(thread.id),status];thread.branch&&headline.push(import_chalk.default.dim(thread.branch)),thread.isLocalhost&&headline.push(import_chalk.default.dim("localhost")),sections.push(headline.join(" \xB7 "));let headerLines=[],path=displayPath(thread),pageTitle=thread.context?.pageTitle;headerLines.push(pageTitle?`${path} \u2014 \u201C${pageTitle}\u201D`:path),thread.context?.href&&headerLines.push(import_chalk.default.cyan(thread.context.href)),sections.push(headerLines.join(`
11
+ `));let contextLines=[];thread.context?.selection&&contextLines.push(alignedRow("Selected",`\u201C${thread.context.selection}\u201D`)),thread.context?.selector&&contextLines.push(alignedRow("Element",thread.context.selector));for(let link of thread.links??[])contextLines.push(alignedRow("Linked",`${link.label} \u2014 ${import_chalk.default.cyan(link.link)}`));if(contextLines.length>0&&sections.push(contextLines.join(`
12
+ `)),sections.push(messages.map(renderMessage).join(`
13
+
14
+ `)),opts.showContext){let extra=[];thread.context?.frameworkContext&&extra.push(`${import_chalk.default.bold("Framework context")}
15
+ ${thread.context.frameworkContext}`),thread.context?.device&&extra.push(`${import_chalk.default.bold("Device")}
16
+ ${JSON.stringify(thread.context.device,null,2)}`),extra.length>0&&sections.push(extra.join(`
17
+
18
+ `))}return thread.webUrl&&sections.push(`Open in Vercel \u2192 ${import_chalk.default.cyan(thread.webUrl)}`),sections.join(`
19
+
20
+ `)}export{actorLabel,displayPath,truncate,threadAge,renderThreadRow,renderThreadDetail};
@@ -0,0 +1,7 @@
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{projectOption,yesOption}from"./chunk-JAJW3P42.js";import{packageName}from"./chunk-FI772UVH.js";var listSubcommand={name:"list",aliases:["ls"],description:"List all routing rules for the current project. These routes apply to all deployments and environments.",arguments:[],options:[projectOption,{name:"search",description:"Search by name, description, source, or destination",shorthand:"s",type:String,argument:"QUERY",deprecated:!1},{name:"filter",description:"Filter by type: rewrite, redirect, set_status, transform",shorthand:"f",type:String,argument:"TYPE",deprecated:!1},{name:"production",description:"List routes from the live production version",shorthand:null,type:Boolean,deprecated:!1},{name:"version-id",description:"List routes from a specific version ID",shorthand:null,type:String,argument:"VERSION_ID",deprecated:!1},{name:"diff",description:"Compare staged changes against production. Use with --version-id to compare a specific version.",shorthand:null,type:Boolean,deprecated:!1},{name:"expand",description:"Show expanded details for each route",shorthand:"e",type:Boolean,deprecated:!1}],examples:[{name:"List all routes",value:`${packageName} routes list`},{name:"Search for routes",value:`${packageName} routes list --search "api"`},{name:"Filter by type",value:`${packageName} routes list --filter rewrite`},{name:"Show staged changes",value:`${packageName} routes list --diff`},{name:"Show live production routes",value:`${packageName} routes list --production`},{name:"Show expanded details",value:`${packageName} routes list --expand`}]},listVersionsSubcommand={name:"list-versions",aliases:["ls-versions"],description:"List all versions of routing rules",arguments:[],options:[projectOption,{name:"count",description:"Number of versions to fetch (default: 20, max: 100)",shorthand:null,type:Number,argument:"NUMBER",deprecated:!1}],examples:[{name:"List route versions",value:`${packageName} routes list-versions`},{name:"List more versions",value:`${packageName} routes list-versions --count 50`}]},inspectSubcommand={name:"inspect",aliases:[],description:"Show detailed information about a specific route",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,{name:"diff",description:"Compare staged changes against production for this route",shorthand:null,type:Boolean,deprecated:!1}],examples:[{name:"Inspect a route by name",value:`${packageName} routes inspect "API rewrite"`},{name:"Inspect a route by ID",value:`${packageName} routes inspect abc123`},{name:"Show staged changes for a route",value:`${packageName} routes inspect "My route" --diff`}]},addSubcommand={name:"add",aliases:[],description:"Add a new routing rule to the project",arguments:[{name:"name",required:!1}],options:[projectOption,{name:"src",description:"Path pattern (required in non-interactive mode)",shorthand:null,type:String,argument:"PATTERN",deprecated:!1},{name:"src-syntax",description:"Path syntax: regex (default), path-to-regexp, equals",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"action",description:"Action type: rewrite, redirect, or set-status (required with --dest/--status)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"dest",description:"Destination URL for rewrite or redirect",shorthand:null,type:String,argument:"URL",deprecated:!1},{name:"status",description:"Status code (301/302/307/308 for redirect, or any for set-status)",shorthand:null,type:Number,argument:"CODE",deprecated:!1},{name:"set-response-header",description:"Set response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-response-header",description:"Append to response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-response-header",description:"Delete response header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-header",description:"Set request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-request-header",description:"Append to request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-request-header",description:"Delete request header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-query",description:"Set query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"append-request-query",description:"Append to query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"delete-request-query",description:"Delete query parameter: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"has",description:"Condition that must match: type:key or type:key:value (repeatable)",shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"missing",description:'"Does not have" condition: type:key or type:key:value (repeatable)',shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"description",description:"Route description (max 1024 chars)",shorthand:null,type:String,argument:"TEXT",deprecated:!1},{name:"disabled",description:"Create route in disabled state",shorthand:null,type:Boolean,deprecated:!1},{name:"ai",description:"Generate route from a natural language description (AI-powered)",shorthand:null,type:String,argument:"PROMPT",deprecated:!1},{name:"position",description:"Position: start, end, after:<id>, before:<id>",shorthand:null,type:String,argument:"POSITION",deprecated:!1},{name:"yes",description:"Skip confirmation prompts",shorthand:"y",type:Boolean,deprecated:!1}],examples:[{name:"Interactive mode",value:`${packageName} routes add`},{name:"Create with AI",value:`${packageName} routes add --ai "Rewrite /api/* to https://backend.internal/*"`},{name:"Add a rewrite",value:`${packageName} routes add "API Proxy" --src "/api/:path*" --src-syntax path-to-regexp --action rewrite --dest "https://api.example.com/:path*" --yes`},{name:"Add a redirect",value:`${packageName} routes add "Old Blog" --src "/blog" --src-syntax equals --action redirect --dest "/articles" --status 301 --yes`},{name:"Add CORS headers",value:`${packageName} routes add "CORS" --src "^/api/.*$" --set-response-header "Access-Control-Allow-Origin=*" --yes`},{name:"Block access (set status)",value:`${packageName} routes add "Block Admin" --src "^/admin/.*$" --action set-status --status 403 --yes`},{name:"Conditional redirect",value:`${packageName} routes add "Auth Required" --src "/protected/:path*" --src-syntax path-to-regexp --action redirect --dest "/login" --status 307 --missing "cookie:session" --yes`},{name:"Rewrite with request headers",value:`${packageName} routes add "Backend Proxy" --src "/backend/:path*" --src-syntax path-to-regexp --action rewrite --dest "https://internal.example.com/:path*" --set-request-header "X-Forwarded-Host=myapp.com" --yes`},{name:"Add route at start",value:`${packageName} routes add "Priority Route" --src "/priority" --src-syntax equals --action rewrite --dest "/handler" --position start --yes`}]},publishSubcommand={name:"publish",aliases:[],description:"Publish staged routing changes to production",arguments:[],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when publishing"}],examples:[{name:"Publish staged changes",value:`${packageName} routes publish`},{name:"Publish without confirmation",value:`${packageName} routes publish --yes`}]},restoreSubcommand={name:"restore",aliases:[],description:"Restore a previous routing version to production",arguments:[{name:"version-id",required:!0}],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when restoring"}],examples:[{name:"Restore a previous version",value:`${packageName} routes restore <version-id>`},{name:"Restore without confirmation",value:`${packageName} routes restore <version-id> --yes`}]},discardSubcommand={name:"discard-staging",aliases:[],description:"Discard staged routing changes",arguments:[],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when discarding"}],examples:[{name:"Discard staged changes",value:`${packageName} routes discard-staging`},{name:"Discard without confirmation",value:`${packageName} routes discard-staging --yes`}]},deleteSubcommand={name:"delete",aliases:["rm"],description:"Delete one or more routing rules",arguments:[{name:"name-or-id",required:!0,multiple:!0}],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when deleting"}],examples:[{name:"Delete a route by name",value:`${packageName} routes delete "Old Redirect"`},{name:"Delete a route by ID",value:`${packageName} routes delete abc123`},{name:"Delete multiple routes",value:`${packageName} routes delete "Route A" "Route B"`},{name:"Delete without confirmation",value:`${packageName} routes delete "Old Route" --yes`}]},enableSubcommand={name:"enable",aliases:[],description:"Enable a disabled routing rule",arguments:[{name:"name-or-id",required:!0}],options:[projectOption],examples:[{name:"Enable a route by name",value:`${packageName} routes enable "API Proxy"`},{name:"Enable a route by ID",value:`${packageName} routes enable abc123`}]},disableSubcommand={name:"disable",aliases:[],description:"Disable a routing rule without deleting it",arguments:[{name:"name-or-id",required:!0}],options:[projectOption],examples:[{name:"Disable a route by name",value:`${packageName} routes disable "API Proxy"`},{name:"Disable a route by ID",value:`${packageName} routes disable abc123`}]},reorderSubcommand={name:"reorder",aliases:["move"],description:"Move a routing rule to a different position",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,{name:"position",description:"Target position: start, end, a number (1-based), before:<id>, after:<id>",shorthand:null,type:String,argument:"POSITION",deprecated:!1},{name:"first",description:"Move to the first position (highest priority)",shorthand:null,type:Boolean,deprecated:!1},{name:"last",description:"Move to the last position (lowest priority)",shorthand:null,type:Boolean,deprecated:!1},{...yesOption,description:"Skip the confirmation prompt when reordering"}],examples:[{name:"Move to first position",value:`${packageName} routes reorder "Catch All" --first`},{name:"Move to last position",value:`${packageName} routes reorder "Catch All" --last`},{name:"Move to a specific position",value:`${packageName} routes reorder "API Proxy" --position 3`},{name:"Move after another route",value:`${packageName} routes reorder "API Proxy" --position after:route-id-123`},{name:"Interactive reorder (prompts for position)",value:`${packageName} routes reorder "API Proxy"`}]},editSubcommand={name:"edit",aliases:[],description:"Edit an existing routing rule",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,{name:"name",description:"Change route name",shorthand:null,type:String,argument:"NAME",deprecated:!1},{name:"description",description:'Change description (use "" to clear)',shorthand:null,type:String,argument:"TEXT",deprecated:!1},{name:"src",description:"Change source path pattern",shorthand:null,type:String,argument:"PATTERN",deprecated:!1},{name:"src-syntax",description:"Change path syntax: regex, path-to-regexp, equals",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"action",description:"Set action type: rewrite, redirect, or set-status (required when switching types)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"dest",description:"Set destination URL",shorthand:null,type:String,argument:"URL",deprecated:!1},{name:"status",description:"Set status code",shorthand:null,type:Number,argument:"CODE",deprecated:!1},{name:"no-dest",description:"Remove destination",shorthand:null,type:Boolean,deprecated:!1},{name:"no-status",description:"Remove status code",shorthand:null,type:Boolean,deprecated:!1},{name:"set-response-header",description:"Set response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-response-header",description:"Append to response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-response-header",description:"Delete response header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-header",description:"Set request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-request-header",description:"Append to request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-request-header",description:"Delete request header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-query",description:"Set query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"append-request-query",description:"Append to query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"delete-request-query",description:"Delete query parameter: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"has",description:"Add a has condition: type:key or type:key:value (repeatable)",shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"missing",description:'Add a "does not have" condition: type:key or type:key:value (repeatable)',shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"clear-conditions",description:"Remove all has/does-not-have conditions",shorthand:null,type:Boolean,deprecated:!1},{name:"clear-headers",description:"Remove all response headers",shorthand:null,type:Boolean,deprecated:!1},{name:"clear-transforms",description:"Remove all transforms (request headers, request query)",shorthand:null,type:Boolean,deprecated:!1},{name:"ai",description:"Describe changes using natural language (AI-powered)",shorthand:null,type:String,argument:"PROMPT",deprecated:!1},{...yesOption,description:"Skip confirmation prompts"}],examples:[{name:"Interactive mode",value:`${packageName} routes edit "API Proxy"`},{name:"Edit with AI",value:`${packageName} routes edit "API Proxy" --ai "Add CORS headers and change status to 308"`},{name:"Change destination",value:`${packageName} routes edit "API Proxy" --dest "https://new-api.example.com/:path*"`},{name:"Switch to redirect",value:`${packageName} routes edit "Old Route" --action redirect --dest "/new" --status 301`},{name:"Add a response header",value:`${packageName} routes edit "My Route" --set-response-header "Cache-Control=public, max-age=3600"`},{name:"Clear all conditions and add new ones",value:`${packageName} routes edit "My Route" --clear-conditions --has "header:Authorization"`}]},exportSubcommand={name:"export",aliases:[],description:"Export routes to a vercel.json or vercel.ts file",arguments:[{name:"name-or-id",required:!1}],options:[projectOption,{name:"output",description:"Output file format: .json (default) or .ts",shorthand:"o",type:String,argument:"json|ts",deprecated:!1}],examples:[{name:"Export as vercel.json format",value:`${packageName} routes export`},{name:"Export as vercel.ts format",value:`${packageName} routes export --output ts`},{name:"Export a specific route",value:`${packageName} routes export "API Proxy"`},{name:"Export to a file",value:`${packageName} routes export > routes.json`}]},routesCommand={name:"routes",aliases:[],description:"Manage routing rules for a project. Routes managed at the project level apply to all deployments and environments.",arguments:[],subcommands:[listSubcommand,listVersionsSubcommand,inspectSubcommand,addSubcommand,editSubcommand,deleteSubcommand,enableSubcommand,disableSubcommand,reorderSubcommand,exportSubcommand,publishSubcommand,restoreSubcommand,discardSubcommand],options:[],examples:[]};export{listSubcommand,listVersionsSubcommand,inspectSubcommand,addSubcommand,publishSubcommand,restoreSubcommand,discardSubcommand,deleteSubcommand,enableSubcommand,disableSubcommand,reorderSubcommand,editSubcommand,exportSubcommand,routesCommand};
@@ -0,0 +1,7 @@
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-6L236MNA.js";var require_fast_deep_equal=__commonJS({"../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports,module){"use strict";module.exports=function equal(a,b){if(a===b)return!0;if(a&&b&&typeof a=="object"&&typeof b=="object"){if(a.constructor!==b.constructor)return!1;var length,i,keys;if(Array.isArray(a)){if(length=a.length,length!=b.length)return!1;for(i=length;i--!==0;)if(!equal(a[i],b[i]))return!1;return!0}if(a.constructor===RegExp)return a.source===b.source&&a.flags===b.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===b.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===b.toString();if(keys=Object.keys(a),length=keys.length,length!==Object.keys(b).length)return!1;for(i=length;i--!==0;)if(!Object.prototype.hasOwnProperty.call(b,keys[i]))return!1;for(i=length;i--!==0;){var key=keys[i];if(!equal(a[key],b[key]))return!1}return!0}return a!==a&&b!==b}}});export{require_fast_deep_equal};
@@ -0,0 +1,15 @@
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{Separator}from"./chunk-M2W3HKV3.js";import{require_strip_ansi}from"./chunk-OSCCYU74.js";import{isAPIError}from"./chunk-LKI6FRNM.js";import{eraseLines,link_default,output_manager_default}from"./chunk-EWWFNMPZ.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1);import{URL}from"url";var import_strip_ansi=__toESM(require_strip_ansi(),1);function getLength(input){let biggestLength=0;for(let line of input.split(`
8
+ `)){let str=(0,import_strip_ansi.default)(line);str.length>biggestLength&&(biggestLength=str.length)}return biggestLength}async function list(client,{message="the question",choices:_choices=[{name:`something
9
+ description
10
+ details
11
+ etc`,value:"something unique",short:"generally the first line of `name`"}],pageSize=15,separator=!1,cancel="end",eraseFinalAnswer=!1}){let biggestLength=0,selected;for(let choice of _choices)if("name"in choice){let length=getLength(choice.name);length>biggestLength&&(biggestLength=length)}else if(choice&&typeof choice=="object"&&"separator"in choice){let length=getLength(`\u2500\u2500 ${choice.separator} `);length>biggestLength&&(biggestLength=length)}let choices=_choices.map(choice=>{if(choice instanceof Separator)return choice;if("separator"in choice){let prefix=`\u2500\u2500 ${choice.separator} `,suffix="\u2500".repeat(Math.max(0,biggestLength-getLength(prefix)));return new Separator(`${prefix}${suffix}`)}if("short"in choice){if(choice.selected){if(selected)throw new Error("Only one choice may be selected");selected=choice.short}return choice}throw new Error("Invalid choice")});if(separator)for(let i=0;i<choices.length;i+=2)choices.splice(i,0,new Separator(" "));let cancelSeparator=new Separator("\u2500".repeat(biggestLength)),_cancel={name:"Cancel",value:"",short:""};cancel==="start"?choices.unshift(_cancel,cancelSeparator):choices.push(cancelSeparator,_cancel);let answer=await client.input.select({message,choices,pageSize,default:selected});return eraseFinalAnswer===!0&&process.stdout.write(eraseLines(2)),answer}async function disconnectGitProvider(client,org,projectId){let fetchUrl=`/v9/projects/${projectId}/link`;return client.fetch(fetchUrl,{method:"DELETE",headers:{"Content-Type":"application/json"}})}async function connectGitProvider(client,projectId,type,repo){let fetchUrl=`/v9/projects/${projectId}/link`;try{return await client.fetch(fetchUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type,repo})})}catch(err){let apiError=isAPIError(err);if(apiError&&(err.action==="Install GitHub App"||err.code==="repo_not_found"))output_manager_default.error(`Failed to connect ${import_chalk.default.cyan(repo)} to project. Make sure there aren't any typos and that you have access to the repository if it's private.`);else if(apiError&&err.code==="repo_links_exceeded_limit"){let ctaLabel,ctaUrl;typeof err.ctaLabel=="string"&&typeof err.ctaUrl=="string"?(ctaLabel=err.ctaLabel,ctaUrl=err.ctaUrl):typeof err.action=="string"&&typeof err.link=="string"&&(ctaLabel=err.action,ctaUrl=err.link);let message=err.message;ctaLabel&&ctaUrl&&(message+=`
12
+ ${ctaLabel}: ${link_default(ctaUrl)}`),output_manager_default.error(message)}else apiError&&err.action==="Add a Login Connection"?output_manager_default.error(err.message.replace(repo,import_chalk.default.cyan(repo))+`
13
+ Visit ${link_default(err.link)} for more information.`):output_manager_default.error(`Failed to connect the ${formatProvider(type)} repository ${repo}.
14
+ ${err}`);return 1}}function formatProvider(type){switch(type){case"github":return"GitHub";case"gitlab":return"GitLab";case"bitbucket":return"Bitbucket";default:return type}}function buildRepoUrl(provider,org,repo){switch(provider){case"github":return`https://github.com/${org}/${repo}`;case"gitlab":return`https://gitlab.com/${org}/${repo}`;case"bitbucket":return`https://bitbucket.org/${org}/${repo}`;default:return null}}function getURL(input){let url=null;try{url=new URL(input)}catch{}if(!url)try{url=new URL(`ssh://${input.replace(":","/")}`)}catch{}return url}function parseRepoUrl(originUrl){let url=getURL(originUrl);if(!url)return null;let hostParts=url.hostname.split(".");if(hostParts.length<2)return null;let provider=hostParts[hostParts.length-2],pathParts=url.pathname.split("/").filter(Boolean);if(pathParts.length<2)return null;let repo=pathParts.pop()?.replace(/\.git$/,"");if(!repo)return null;let org=pathParts.join("/");return{url:originUrl,provider,org,repo}}function printRemoteUrls(remoteUrls){for(let[name,url]of Object.entries(remoteUrls))output_manager_default.print(` \u2022 ${name}: ${import_chalk.default.cyan(url)}
15
+ `)}async function selectRemoteUrl(client,remoteUrls){let choices=[];for(let[urlKey,urlValue]of Object.entries(remoteUrls))choices.push({name:`${urlValue} ${import_chalk.default.gray(`(${urlKey})`)}`,value:urlValue,short:urlKey});return await list(client,{message:"Which remote do you want to connect?",choices})}async function selectAndParseRemoteUrl(client,remoteUrls){let remoteUrl;if(Object.keys(remoteUrls).length>1?(output_manager_default.log("Found multiple remote URLs."),remoteUrl=await selectRemoteUrl(client,remoteUrls)):remoteUrl=Object.values(remoteUrls)[0],remoteUrl==="")return output_manager_default.log("Canceled"),null;let repoInfo=parseRepoUrl(remoteUrl);return repoInfo||(output_manager_default.log(`Connecting Git repository: ${import_chalk.default.cyan(remoteUrl)}`),output_manager_default.error(`Failed to parse Git repo data from the following remote URL: ${link_default(remoteUrl)}`),null)}async function checkExistsAndConnect({client,confirm,org,project,gitProviderLink,provider,repoPath,gitOrg,repo}){let displayUrl=buildRepoUrl(provider,gitOrg,repo)||repoPath;if(output_manager_default.log(`Connecting ${formatProvider(provider)} repository: ${import_chalk.default.cyan(displayUrl)}`),gitProviderLink){let connectedProvider=gitProviderLink.type,connectedOrg=gitProviderLink.org,connectedRepo=gitProviderLink.repo,connectedRepoPath=`${connectedOrg}/${connectedRepo}`;if(connectedProvider===provider&&connectedOrg===gitOrg&&connectedRepo===repo)return output_manager_default.log(`${import_chalk.default.cyan(connectedRepoPath)} is already connected to your project.`),1;if(!await confirmRepoConnect(client,confirm,connectedProvider,connectedRepoPath))return 0;await disconnectGitProvider(client,org,project.id);let connect=await connectGitProvider(client,project.id,provider,repoPath);if(typeof connect=="number")return connect}else{let connect=await connectGitProvider(client,project.id,provider,repoPath);if(typeof connect=="number")return connect}output_manager_default.log("Connected")}async function confirmRepoConnect(client,yes,connectedProvider,connectedRepoPath){let shouldReplaceProject=yes;return shouldReplaceProject||(shouldReplaceProject=await client.input.confirm(`Looks like you already have a ${formatProvider(connectedProvider)} repository connected: ${import_chalk.default.cyan(connectedRepoPath)}. Do you want to replace it?`,!0),shouldReplaceProject||output_manager_default.log("Canceled. Repo not connected.")),shouldReplaceProject}export{list,disconnectGitProvider,connectGitProvider,formatProvider,buildRepoUrl,parseRepoUrl,printRemoteUrls,selectRemoteUrl,selectAndParseRemoteUrl,checkExistsAndConnect};
@@ -0,0 +1,25 @@
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-QI3JSWD6.js";import{detectProjects}from"./chunk-WDVSYGZS.js";import{require_slugify}from"./chunk-7RR7MIMT.js";import{selectOrg}from"./chunk-6LE44WCK.js";import{createProject}from"./chunk-QHJLRTVY.js";import{validateRootDirectory}from"./chunk-Z6LKARXP.js";import{checkExistsAndConnect,parseRepoUrl,selectAndParseRemoteUrl}from"./chunk-4WSAOLBH.js";import{Separator}from"./chunk-M2W3HKV3.js";import{getLocalPathConfig}from"./chunk-DL665Q3Z.js";import{isPromptBackError,isPromptCanceledError}from"./chunk-P2O5DOYE.js";import{readJSONFile}from"./chunk-TJKM3345.js";import{require_dist as require_dist2}from"./chunk-FB5TMOLQ.js";import{require_dist2 as require_dist}from"./chunk-Z7PBDQNR.js";import{compileVercelConfig,findSourceVercelConfigFile}from"./chunk-73G2MHUX.js";import{pull}from"./chunk-JGPECEYY.js";import{require_frameworks}from"./chunk-KK4AJES5.js";import{table}from"./chunk-6TAQ6OWD.js";import{printError}from"./chunk-TBBU37TD.js";import{VERCEL_DIR_PROJECT,VERCEL_DIR_README,fetchProjectsForRepoUrl,findProjectsFromPath,findRepoRoot,getGitConfigPath,getLinkedProject,getProjectByNameOrId,getRemoteUrls,getVercelDirectory,isDirectory,linkFolderToProject,linkRepoProject,parseGitConfig,pluckRemoteUrls,require_lib,resolveGitRemote}from"./chunk-64NJHVA3.js";import{humanizePath}from"./chunk-PPCFQQSU.js";import{printAlignedLabel}from"./chunk-YMM3VY3J.js";import{CantParseJSONFile,ProjectNotFound,isAPIError}from"./chunk-LKI6FRNM.js";import{output_manager_default,require_build_utils}from"./chunk-EWWFNMPZ.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.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 join3,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"){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)output_manager_default.print(` No framework detected. Default Project Settings:
13
+ `);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}
14
+ `)}if(settings.framework=framework.slug,!framework.slug)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}`)}`)}
15
+ `)}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}async function readConfig(dir){let pkgFilePath;try{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}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,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){output_manager_default.print(`Detected services:
16
+ `);let rows=services.some(import_build_utils2.isExperimentalServiceV2)?buildServiceRowsV2(services.filter(import_build_utils2.isExperimentalServiceV2)):buildServiceRowsV1(services),tableOutput=table(rows,{align:["l","l","l","l"],hsep:2});output_manager_default.print(`${tableOutput}
17
+ `)}function buildServiceRowsV1(services){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[`\u2022 ${service.name}`,descInfo.colorFn(`[${descInfo.label}]`),chalk5.dim("\u2192"),target]})}function buildServiceRowsV2(services){return services.map(service=>{let descInfo=getFrameworkRuntimeBuilderInfo(service);return[`\u2022 ${service.name}`,descInfo.colorFn(`[${descInfo.label}]`)]})}function displayServicesConfigNote(configFileName="vercel.json"){output_manager_default.print(`
18
+ ${chalk5.dim(`Services are configured via ${configFileName}.`)}
19
+ `)}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 detectServicesResult=await(0,import_service_topology.detectServices)({fs:new import_fs_detectors.LocalFileSystemDetector(workPath),detectEntrypoint:createDetectEntrypoint(workPath)}),hasConfiguredServices=detectServicesResult.resolved?.source==="configured",inferredServices=hasConfiguredServices?null:detectServicesResult.inferred,inferredServicesWriteBlocker=inferredServices?await getServicesConfigWriteBlocker(workPath,inferredServices.config):null;return{detectServicesResult,hasConfiguredServices,inferredServices,inferredServicesWriteBlocker}}function displayConfiguredServicesSetup(detectServicesResult,configFileName="vercel.json"){detectServicesResult.services.length>0&&displayDetectedServices(detectServicesResult.services),detectServicesResult.errors.length>0&&displayServiceErrors(detectServicesResult.errors),displayServicesConfigNote(configFileName)}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:join(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}.
20
+ `),{type:"services"}}var import_slugify2=__toESM(require_slugify(),1);import{join as join2,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})??join2(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}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(`
21
+ `),!(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}){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(`
22
+ `),printAlignedLabel("Directory",humanizePath(path2)),printAlignedLabel("Source","VERCEL_ORG_ID and VERCEL_PROJECT_ID"),output_manager_default.print(`
23
+ `),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);(0,import_fs_extra.remove)(join3(vercelDir,VERCEL_DIR_README)),(0,import_fs_extra.remove)(join3(vercelDir,VERCEL_DIR_PROJECT))}output_manager_default.print(`
24
+ `),printAlignedLabel("Directory",humanizePath(path2)),output_manager_default.print(`
25
+ `);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}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 await linkFolderToProject(client,path2,{projectId:project.id,orgId:org.id},project.name,org.slug,successEmoji,autoConfirm,pullEnv),{status:"linked",org,project}}}config.currentTeam=org.type==="team"?org.id:void 0;let gitConnectIntent=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.detectServicesResult,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,join3(path2,rootDirectory))))return{status:"error",exitCode:1,reason:"INVALID_ROOT_DIRECTORY"};pathWithRootDirectory=rootDirectory?join3(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.detectServicesResult,configFileName),settings.framework="services";else if(selectedRootInferredServicesChoice?.type==="services")settings.framework="services";else{selectedRootInferredServicesChoice?.type==="single-app"&&(rootDirectory=toProjectRootDirectory(path2,selectedRootInferredServicesChoice.selectedPath),pathWithRootDirectory=rootDirectory?join3(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},framework=((await detectProjects(pathWithRootDirectory)).get("")||[])[0]??import_frameworks3.frameworkList.find(f=>f.slug===null);settings=await editProjectSettings(client,{},framework,autoConfirm,localConfigurationOverrides,configFileName)}}}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});return 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}}}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})??join3(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};
@@ -0,0 +1,7 @@
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{fetch}from"./chunk-MY4MONOH.js";import{pkg_default}from"./chunk-AVSPFBLM.js";import os from"os";var ua_default=`${pkg_default.name} ${pkg_default.version} node-${process.version} ${os.platform()} (${os.arch()})`;import{hostname}from"os";var VERCEL_ISSUER=new URL("https://vercel.com"),VERCEL_CLI_CLIENT_ID="cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp",userAgent=`${hostname()} @ ${ua_default}`,_as;async function as(){if(!_as){let discoveryResponse=await discoveryEndpointRequest(VERCEL_ISSUER),[discoveryResponseError,as2]=await processDiscoveryEndpointResponse(discoveryResponse);if(discoveryResponseError)throw discoveryResponseError;_as=as2}return _as}async function discoveryEndpointRequest(issuer){return await fetch(new URL(".well-known/openid-configuration",issuer),{headers:{"Content-Type":"application/json","user-agent":userAgent}})}async function processDiscoveryEndpointResponse(response){let json=await response.json();if(!response.ok)return[new Error("Discovery endpoint request failed")];if(typeof json!="object"||json===null||!canParseURL(json.issuer)||!canParseURL(json.device_authorization_endpoint)||!canParseURL(json.token_endpoint)||!canParseURL(json.revocation_endpoint)||!canParseURL(json.jwks_uri)||!canParseURL(json.introspection_endpoint))return[new TypeError("Invalid discovery response")];let issuer=new URL(json.issuer);return issuer.href!==VERCEL_ISSUER.href?[new Error("Issuer mismatch")]:[null,{issuer,device_authorization_endpoint:new URL(json.device_authorization_endpoint),token_endpoint:new URL(json.token_endpoint),revocation_endpoint:new URL(json.revocation_endpoint),jwks_uri:new URL(json.jwks_uri),introspection_endpoint:new URL(json.introspection_endpoint)}]}async function deviceAuthorizationRequest(options){let body=new URLSearchParams({client_id:VERCEL_CLI_CLIENT_ID});return options?.refresh_token?(body.set("refresh_token",options.refresh_token),options.acr_values&&body.set("acr_values",options.acr_values)):body.set("scope","openid offline_access"),await fetch((await as()).device_authorization_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":userAgent},body})}async function processDeviceAuthorizationResponse(response){let json=await response.json();return response.ok?typeof json!="object"||json===null?[new TypeError("Expected response to be an object")]:!("device_code"in json)||typeof json.device_code!="string"?[new TypeError("Expected `device_code` to be a string")]:!("user_code"in json)||typeof json.user_code!="string"?[new TypeError("Expected `user_code` to be a string")]:!("verification_uri"in json)||typeof json.verification_uri!="string"||!canParseURL(json.verification_uri)?[new TypeError("Expected `verification_uri` to be a string")]:!("verification_uri_complete"in json)||typeof json.verification_uri_complete!="string"||!canParseURL(json.verification_uri_complete)?[new TypeError("Expected `verification_uri_complete` to be a string")]:!("expires_in"in json)||typeof json.expires_in!="number"?[new TypeError("Expected `expires_in` to be a number")]:!("interval"in json)||typeof json.interval!="number"?[new TypeError("Expected `interval` to be a number")]:[null,{device_code:json.device_code,user_code:json.user_code,verification_uri:json.verification_uri,verification_uri_complete:json.verification_uri_complete,expiresAt:Date.now()+json.expires_in*1e3,interval:json.interval}]:[new OAuthError("Device authorization request failed",json)]}async function deviceAccessTokenRequest(options){try{return[null,await fetch((await as()).token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":userAgent},body:new URLSearchParams({client_id:VERCEL_CLI_CLIENT_ID,grant_type:"urn:ietf:params:oauth:grant-type:device_code",...options}),signal:AbortSignal.timeout(10*1e3)})]}catch(error){return error instanceof Error?[error]:[new Error("An unknown error occurred. See the logs for details.",{cause:error})]}}async function processTokenResponse(response){let json=await response.json();return response.ok?typeof json!="object"||json===null?[new TypeError("Expected response to be an object")]:!("access_token"in json)||typeof json.access_token!="string"?[new TypeError("Expected `access_token` to be a string")]:!("token_type"in json)||json.token_type!=="Bearer"?[new TypeError('Expected `token_type` to be "Bearer"')]:!("expires_in"in json)||typeof json.expires_in!="number"?[new TypeError("Expected `expires_in` to be a number")]:"refresh_token"in json&&(typeof json.refresh_token!="string"||!json.refresh_token)?[new TypeError("Expected `refresh_token` to be a string")]:"scope"in json&&typeof json.scope!="string"?[new TypeError("Expected `scope` to be a string")]:[null,json]:[new OAuthError("Device access token request failed",json)]}async function revocationRequest(options){return await fetch((await as()).revocation_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":userAgent},body:new URLSearchParams({...options,client_id:VERCEL_CLI_CLIENT_ID})})}async function processRevocationResponse(response){if(response.ok)return[null,null];let json=await response.json();return[new OAuthError("Revocation request failed",json)]}async function refreshTokenRequest(options){return await fetch((await as()).token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":userAgent},body:new URLSearchParams({client_id:VERCEL_CLI_CLIENT_ID,grant_type:"refresh_token",...options})})}function processOAuthErrorResponse(json){return typeof json!="object"||json===null?new TypeError("Expected response to be an object"):!("error"in json)||typeof json.error!="string"?new TypeError("Expected `error` to be a string"):"error_description"in json&&typeof json.error_description!="string"?new TypeError("Expected `error_description` to be a string"):"error_uri"in json&&typeof json.error_uri!="string"?new TypeError("Expected `error_uri` to be a string"):json}var OAuthError=class extends Error{constructor(message,response){var __super=(...args)=>{super(...args)};let error=processOAuthErrorResponse(response);if(error instanceof TypeError){let message2=`Unexpected server response: ${JSON.stringify(response)}`;__super(message2),this.cause=new Error(message2,{cause:error}),this.code="server_error";return}let cause=error.error;error.error_description&&(cause+=`: ${error.error_description}`),error.error_uri&&(cause+=` (${error.error_uri})`),__super(message,{cause}),this.cause=new Error(cause),this.code=error.error}};function isOAuthError(error){return error instanceof OAuthError}function canParseURL(url){try{return!!new URL(url)}catch{return!1}}async function inspectTokenRequest(token){return fetch((await as()).introspection_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":userAgent},body:new URLSearchParams({token})})}async function processInspectTokenResponse(response){try{let token=await response.json();if(!token||typeof token!="object"||!("active"in token))throw new IntrospectionError("Invalid token introspection response");return[null,token]}catch(cause){return[new IntrospectionError("Could not introspect token.",{cause})]}}var IntrospectionError=class extends Error{constructor(){super(...arguments);this.name="IntrospectionError"}};export{ua_default,deviceAuthorizationRequest,processDeviceAuthorizationResponse,deviceAccessTokenRequest,processTokenResponse,revocationRequest,processRevocationResponse,refreshTokenRequest,isOAuthError,inspectTokenRequest,processInspectTokenResponse};
@@ -0,0 +1,7 @@
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-7T6TL3GQ.js";import{require_lib}from"./chunk-64NJHVA3.js";import{packageName}from"./chunk-FI772UVH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_fs_extra=__toESM(require_lib(),1);import{join as join2,sep}from"path";import{execFile}from"child_process";import{promisify}from"util";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 nativePackageName="@vercel/vc-native",execFileAsync=promisify(execFile),UnsupportedUpgradeInstallError=class extends Error{},globalCliTypes=["npm","pnpm","yarn","bun"];async function getPackageManagerGlobalRoot(cliType,pkg,env=trustedUpgradeEnvironment){try{let detectionArgs=getUpgradePackageManager(cliType).globalDetection.args,{stdout}=await execFileAsync(cliType,typeof detectionArgs=="function"?detectionArgs(pkg):detectionArgs,{encoding:"utf8",windowsHide:!0,cwd:trustedUpgradeDirectory,timeout:15e3,env});return stdout.trim()||null}catch{return null}}async function detectGlobalPackageManager(installPath,pkg,cliTypes=globalCliTypes,env=trustedUpgradeEnvironment){for(let cliType of cliTypes){let root=await getPackageManagerGlobalRoot(cliType,pkg,env);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){let nativeInstall=isNativeBinaryInstall(),pkg=nativeInstall?nativePackageName:packageName,installPath=nativeInstall?process.execPath:process.argv[1];try{installPath=await(0,import_fs_extra.realpath)(installPath)}catch{throw new UnsupportedUpgradeInstallError("Could not resolve this Vercel CLI installation. Update it with the package manager that installed it.")}let packageManager=await detectGlobalPackageManager(installPath,pkg,globalCliTypes,env);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(){try{return await resolveInstall(),!0}catch{return!1}}async function getUpdateCommandInfo(env=trustedUpgradeEnvironment){let nativeInstall=isNativeBinaryInstall(),pkg=nativeInstall?nativePackageName:packageName,{packageManager}=await resolveInstall(env),args=getUpgradePackageManager(packageManager).installArgs(`${pkg}@latest`),force=nativeInstall&&packageManager==="npm"?" --force":"",allowBuild=pnpmAllowBuildFlag(packageManager,nativeInstall?nativePackageName:"esbuild");return{command:`${packageManager} ${args.join(" ")}${force}${allowBuild}`,global:!0,packageManager,assumed:!1}}function pnpmAllowBuildFlag(cliType,pkg){return cliType==="pnpm"?` --allow-build=${pkg}`:""}async function getUpdateCommand(){return(await getUpdateCommandInfo()).command}export{trustedUpgradeEnvironment,trustedUpgradeDirectory,getUpgradePackageManager,isGlobal,getUpdateCommandInfo,getUpdateCommand};