@vercel/cli-support 0.0.0 → 65.3.1

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 (355) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +100 -3
  3. package/dist/chunks/add-5YZQTIQM.js +8 -0
  4. package/dist/chunks/add-A524QQ2H.js +8 -0
  5. package/dist/chunks/add-V4JMUHKO.js +8 -0
  6. package/dist/chunks/build-K2PVDJZ4.js +7 -0
  7. package/dist/chunks/chunk-22FDWPWY.js +7 -0
  8. package/dist/chunks/chunk-25565AGS.js +7 -0
  9. package/dist/chunks/chunk-2ACMWVTB.js +12 -0
  10. package/dist/chunks/chunk-2EYYB6YN.js +7 -0
  11. package/dist/chunks/chunk-2GHZGOWT.js +7 -0
  12. package/dist/chunks/chunk-2H3SB5RP.js +9 -0
  13. package/dist/chunks/chunk-2NABMKFV.js +29 -0
  14. package/dist/chunks/chunk-2PKEEQ5W.js +25 -0
  15. package/dist/chunks/chunk-2S6PE6GB.js +7 -0
  16. package/dist/chunks/chunk-2U7DJZSQ.js +21 -0
  17. package/dist/chunks/chunk-2WYYGGEO.js +7 -0
  18. package/dist/chunks/chunk-3ADDGPEN.js +7 -0
  19. package/dist/chunks/chunk-3AYYFYZG.js +7 -0
  20. package/dist/chunks/chunk-3G3FQYMW.js +7 -0
  21. package/dist/chunks/chunk-3JGBBS6V.js +7 -0
  22. package/dist/chunks/chunk-3KKFLKQG.js +7 -0
  23. package/dist/chunks/chunk-3LIKVGFT.js +8 -0
  24. package/dist/chunks/chunk-3XW7N4W3.js +9 -0
  25. package/dist/chunks/chunk-43GBAKL2.js +86 -0
  26. package/dist/chunks/chunk-4CACOKMS.js +7 -0
  27. package/dist/chunks/chunk-4NTBYNFR.js +17 -0
  28. package/dist/chunks/chunk-4SAVH3H7.js +7 -0
  29. package/dist/chunks/chunk-4UGHFESV.js +8 -0
  30. package/dist/chunks/chunk-4VFYJU37.js +7 -0
  31. package/dist/chunks/chunk-5IASAERQ.js +7 -0
  32. package/dist/chunks/chunk-5RMIM4S2.js +7 -0
  33. package/dist/chunks/chunk-67GZ5REA.js +7 -0
  34. package/dist/chunks/chunk-6IDNVZZR.js +7 -0
  35. package/dist/chunks/chunk-6ISAISGD.js +16 -0
  36. package/dist/chunks/chunk-6KVHNQW4.js +17 -0
  37. package/dist/chunks/chunk-6OVX3PWM.js +7 -0
  38. package/dist/chunks/chunk-6QKS6QK7.js +7 -0
  39. package/dist/chunks/chunk-6VH56CX2.js +19 -0
  40. package/dist/chunks/chunk-6Y2ZL5XJ.js +98 -0
  41. package/dist/chunks/chunk-76KGQU2G.js +7 -0
  42. package/dist/chunks/chunk-76SVVWPH.js +7 -0
  43. package/dist/chunks/chunk-773GOZIR.js +13 -0
  44. package/dist/chunks/chunk-7BGKE3JW.js +10 -0
  45. package/dist/chunks/chunk-7EJQLVWX.js +7 -0
  46. package/dist/chunks/chunk-7HV7O6DM.js +7 -0
  47. package/dist/chunks/chunk-7L2K4OKM.js +63 -0
  48. package/dist/chunks/chunk-7Y46LB43.js +14 -0
  49. package/dist/chunks/chunk-7YKFF6CE.js +7 -0
  50. package/dist/chunks/chunk-7Z3WUAO5.js +10 -0
  51. package/dist/chunks/chunk-A2RZZQEP.js +7 -0
  52. package/dist/chunks/chunk-ABZEMNDR.js +7 -0
  53. package/dist/chunks/chunk-ADLBLGT3.js +8 -0
  54. package/dist/chunks/chunk-AM46JVVN.js +7 -0
  55. package/dist/chunks/chunk-ANMDN3EG.js +9 -0
  56. package/dist/chunks/chunk-APZULWJC.js +8 -0
  57. package/dist/chunks/chunk-AWMQGOS2.js +7 -0
  58. package/dist/chunks/chunk-B4UE4LVE.js +7 -0
  59. package/dist/chunks/chunk-B4YYOSPY.js +7 -0
  60. package/dist/chunks/chunk-BBKEP7RO.js +7 -0
  61. package/dist/chunks/chunk-BL3HBRF6.js +12 -0
  62. package/dist/chunks/chunk-BLUPZPAS.js +7 -0
  63. package/dist/chunks/chunk-BPUANOGW.js +7 -0
  64. package/dist/chunks/chunk-BRQUZ5NC.js +7 -0
  65. package/dist/chunks/chunk-BS32OUOC.js +7 -0
  66. package/dist/chunks/chunk-BTI5TG6Q.js +7 -0
  67. package/dist/chunks/chunk-BUJITHGZ.js +8 -0
  68. package/dist/chunks/chunk-BVH2AEFE.js +7 -0
  69. package/dist/chunks/chunk-BZENIQ7N.js +7 -0
  70. package/dist/chunks/chunk-C6GY2G73.js +7 -0
  71. package/dist/chunks/chunk-CEMPU323.js +7 -0
  72. package/dist/chunks/chunk-COD3WAUI.js +7 -0
  73. package/dist/chunks/chunk-COM5YCHF.js +9 -0
  74. package/dist/chunks/chunk-CZSOZKHX.js +7 -0
  75. package/dist/chunks/chunk-D2BZMGHP.js +7 -0
  76. package/dist/chunks/chunk-D3AHZ5LI.js +7 -0
  77. package/dist/chunks/chunk-D6REP5QQ.js +15 -0
  78. package/dist/chunks/chunk-DFVNL5ML.js +7 -0
  79. package/dist/chunks/chunk-DGYHWXD2.js +10 -0
  80. package/dist/chunks/chunk-DUT4U5YY.js +7 -0
  81. package/dist/chunks/chunk-DWZBL4NK.js +7 -0
  82. package/dist/chunks/chunk-E2SADN6I.js +7 -0
  83. package/dist/chunks/chunk-E6CO6TUM.js +7 -0
  84. package/dist/chunks/chunk-EAUDC24V.js +9 -0
  85. package/dist/chunks/chunk-ECQIO5K3.js +7 -0
  86. package/dist/chunks/chunk-ETV3C2CV.js +7 -0
  87. package/dist/chunks/chunk-F2SWJEYV.js +8 -0
  88. package/dist/chunks/chunk-F4KY2TOK.js +7 -0
  89. package/dist/chunks/chunk-F53OKXYI.js +7 -0
  90. package/dist/chunks/chunk-F7AVGV4Y.js +7 -0
  91. package/dist/chunks/chunk-FBYA6LLM.js +7 -0
  92. package/dist/chunks/chunk-FDNYYENK.js +11 -0
  93. package/dist/chunks/chunk-FGFLTLEA.js +7 -0
  94. package/dist/chunks/chunk-FUX6LKNP.js +7 -0
  95. package/dist/chunks/chunk-G4T7VBGN.js +9 -0
  96. package/dist/chunks/chunk-GA277JFB.js +20 -0
  97. package/dist/chunks/chunk-GD7AV7BO.js +9 -0
  98. package/dist/chunks/chunk-GG5RME4X.js +7 -0
  99. package/dist/chunks/chunk-GHAY4PSD.js +7 -0
  100. package/dist/chunks/chunk-GVTXA6HG.js +7 -0
  101. package/dist/chunks/chunk-GYVJIIYL.js +7 -0
  102. package/dist/chunks/chunk-GZNDA6SV.js +8 -0
  103. package/dist/chunks/chunk-HCRD3JFL.js +7 -0
  104. package/dist/chunks/chunk-HEGJZJO7.js +7 -0
  105. package/dist/chunks/chunk-HRR57QNP.js +7 -0
  106. package/dist/chunks/chunk-IA3MXJRC.js +8 -0
  107. package/dist/chunks/chunk-ID663OJ7.js +7 -0
  108. package/dist/chunks/chunk-IEPW2YRH.js +7 -0
  109. package/dist/chunks/chunk-IGDG5CWT.js +7 -0
  110. package/dist/chunks/chunk-IKQTP764.js +7 -0
  111. package/dist/chunks/chunk-IQ7FPAI4.js +7 -0
  112. package/dist/chunks/chunk-IQKGQ2Y2.js +15 -0
  113. package/dist/chunks/chunk-ISWW3DKF.js +7 -0
  114. package/dist/chunks/chunk-IUXSJWL3.js +7 -0
  115. package/dist/chunks/chunk-IVSC7ZFJ.js +7 -0
  116. package/dist/chunks/chunk-IVSSTHB6.js +7 -0
  117. package/dist/chunks/chunk-J24BABG4.js +21 -0
  118. package/dist/chunks/chunk-JALVF3C2.js +7 -0
  119. package/dist/chunks/chunk-JELLVPCM.js +8 -0
  120. package/dist/chunks/chunk-JESNVRVR.js +7 -0
  121. package/dist/chunks/chunk-JLEJB6KM.js +7 -0
  122. package/dist/chunks/chunk-KH6565YH.js +8 -0
  123. package/dist/chunks/chunk-KNLGWGUE.js +57 -0
  124. package/dist/chunks/chunk-KRPY5FHJ.js +7 -0
  125. package/dist/chunks/chunk-KW6GSQXV.js +7 -0
  126. package/dist/chunks/chunk-L4NSF346.js +22 -0
  127. package/dist/chunks/chunk-LCHECISY.js +7 -0
  128. package/dist/chunks/chunk-LJBUJ23M.js +7 -0
  129. package/dist/chunks/chunk-LKLH6DZP.js +9 -0
  130. package/dist/chunks/chunk-LRYGNQ6C.js +8 -0
  131. package/dist/chunks/chunk-LSF7FY6X.js +7 -0
  132. package/dist/chunks/chunk-LSQREJXO.js +11 -0
  133. package/dist/chunks/chunk-LT3UK4K6.js +10 -0
  134. package/dist/chunks/chunk-LUBUI5GF.js +7 -0
  135. package/dist/chunks/chunk-MCRKBVZA.js +7 -0
  136. package/dist/chunks/chunk-MVGTMPMI.js +23 -0
  137. package/dist/chunks/chunk-MXTC4ZAQ.js +7 -0
  138. package/dist/chunks/chunk-NB2WLB3J.js +12 -0
  139. package/dist/chunks/chunk-NEFDNROD.js +7 -0
  140. package/dist/chunks/chunk-NQWGRKF4.js +7 -0
  141. package/dist/chunks/chunk-NTZ5WWYV.js +7 -0
  142. package/dist/chunks/chunk-NWGBDBZI.js +7 -0
  143. package/dist/chunks/chunk-NZ2TFADV.js +7 -0
  144. package/dist/chunks/chunk-OAM5NJCU.js +9 -0
  145. package/dist/chunks/chunk-OCQPXOTX.js +11 -0
  146. package/dist/chunks/chunk-OCR5CRTH.js +10 -0
  147. package/dist/chunks/chunk-OFDTADPQ.js +7 -0
  148. package/dist/chunks/chunk-OGPENBY2.js +7 -0
  149. package/dist/chunks/chunk-OKEBIUKZ.js +7 -0
  150. package/dist/chunks/chunk-OMCGXRSA.js +21 -0
  151. package/dist/chunks/chunk-OO572JUC.js +7 -0
  152. package/dist/chunks/chunk-OPORM35X.js +7 -0
  153. package/dist/chunks/chunk-OQCMRU3J.js +10 -0
  154. package/dist/chunks/chunk-OQPXJCMK.js +32 -0
  155. package/dist/chunks/chunk-OWOWPOIE.js +23 -0
  156. package/dist/chunks/chunk-PADL3C6Z.js +7 -0
  157. package/dist/chunks/chunk-PFD7LETF.js +7 -0
  158. package/dist/chunks/chunk-PFNYWWLI.js +7 -0
  159. package/dist/chunks/chunk-PFPJLIFF.js +33 -0
  160. package/dist/chunks/chunk-PSOVLGHP.js +7 -0
  161. package/dist/chunks/chunk-PUKYAALC.js +7 -0
  162. package/dist/chunks/chunk-PVASGBEF.js +7 -0
  163. package/dist/chunks/chunk-Q5ODLDCU.js +7 -0
  164. package/dist/chunks/chunk-Q7D7RGXM.js +7 -0
  165. package/dist/chunks/chunk-QB7F3UAP.js +7 -0
  166. package/dist/chunks/chunk-QHJLRTVY.js +7 -0
  167. package/dist/chunks/chunk-QMCHGGDX.js +10 -0
  168. package/dist/chunks/chunk-QZX7VG2V.js +9 -0
  169. package/dist/chunks/chunk-R6BEOVTU.js +7 -0
  170. package/dist/chunks/chunk-RLKS5G6C.js +12 -0
  171. package/dist/chunks/chunk-RM3ZDRYE.js +7 -0
  172. package/dist/chunks/chunk-RRDNKB2X.js +7 -0
  173. package/dist/chunks/chunk-RRREFECI.js +7 -0
  174. package/dist/chunks/chunk-RUXO73ON.js +7 -0
  175. package/dist/chunks/chunk-RW3X523R.js +8 -0
  176. package/dist/chunks/chunk-S3L2OHPO.js +7 -0
  177. package/dist/chunks/chunk-S4SJ7GIZ.js +7 -0
  178. package/dist/chunks/chunk-S5IWVPYT.js +32 -0
  179. package/dist/chunks/chunk-SACGQMVQ.js +13 -0
  180. package/dist/chunks/chunk-SCV7XEEO.js +7 -0
  181. package/dist/chunks/chunk-SF4E3AQ3.js +7 -0
  182. package/dist/chunks/chunk-SKYDLHEZ.js +7 -0
  183. package/dist/chunks/chunk-SLI2O5X7.js +63 -0
  184. package/dist/chunks/chunk-SXOSF4O6.js +39 -0
  185. package/dist/chunks/chunk-TAAWMNNL.js +7 -0
  186. package/dist/chunks/chunk-TG2RCYTH.js +7 -0
  187. package/dist/chunks/chunk-TKBORMUF.js +7 -0
  188. package/dist/chunks/chunk-TO5PJDEN.js +7 -0
  189. package/dist/chunks/chunk-TPNOSQZ3.js +15 -0
  190. package/dist/chunks/chunk-TZFDVQ72.js +27 -0
  191. package/dist/chunks/chunk-U4Z2MMOF.js +301 -0
  192. package/dist/chunks/chunk-U56NHYAH.js +7 -0
  193. package/dist/chunks/chunk-UJSW56GS.js +9 -0
  194. package/dist/chunks/chunk-UKQMYTWW.js +9 -0
  195. package/dist/chunks/chunk-ULHNMQ7C.js +7 -0
  196. package/dist/chunks/chunk-UNEGQPD3.js +7 -0
  197. package/dist/chunks/chunk-URPEIX6M.js +7 -0
  198. package/dist/chunks/chunk-UVHKXCR5.js +11 -0
  199. package/dist/chunks/chunk-V6Y6UK6B.js +43 -0
  200. package/dist/chunks/chunk-V7BEC3E4.js +10 -0
  201. package/dist/chunks/chunk-VMMMBWD3.js +7 -0
  202. package/dist/chunks/chunk-VOCZ34ON.js +7 -0
  203. package/dist/chunks/chunk-VQSLPYAF.js +7 -0
  204. package/dist/chunks/chunk-VT6RIZJH.js +7 -0
  205. package/dist/chunks/chunk-WBF36MYT.js +16 -0
  206. package/dist/chunks/chunk-WCWP4GBR.js +7 -0
  207. package/dist/chunks/chunk-WGXKX24Q.js +7 -0
  208. package/dist/chunks/chunk-X4762EE4.js +7 -0
  209. package/dist/chunks/chunk-XB4SKARZ.js +29 -0
  210. package/dist/chunks/chunk-XGTKHQTT.js +7 -0
  211. package/dist/chunks/chunk-XOETL6DB.js +96 -0
  212. package/dist/chunks/chunk-XP3FT56R.js +27 -0
  213. package/dist/chunks/chunk-XR6QY7RR.js +7 -0
  214. package/dist/chunks/chunk-XXXRTHTP.js +8 -0
  215. package/dist/chunks/chunk-XZV4BFM5.js +7 -0
  216. package/dist/chunks/chunk-Y6AGOERS.js +8 -0
  217. package/dist/chunks/chunk-YHPPP3SF.js +7 -0
  218. package/dist/chunks/chunk-YHQ7PPXP.js +7 -0
  219. package/dist/chunks/chunk-YK7XLFU2.js +24 -0
  220. package/dist/chunks/chunk-YN3C5BL5.js +7 -0
  221. package/dist/chunks/chunk-ZF27J6FQ.js +7 -0
  222. package/dist/chunks/chunk-ZFRNVIHI.js +7 -0
  223. package/dist/chunks/chunk-ZH6KHD55.js +20 -0
  224. package/dist/chunks/cjs-2SMN43VH.js +54 -0
  225. package/dist/chunks/clear-ZS4KQ7OT.js +8 -0
  226. package/dist/chunks/compile-vercel-config-3IYM2CHC.js +7 -0
  227. package/dist/chunks/config-N2SBVW4T.js +8 -0
  228. package/dist/chunks/config-ZFIC7N4D.js +7 -0
  229. package/dist/chunks/config-validator.mjs +1 -0
  230. package/dist/chunks/connect-git-provider-FS5Q2HO4.js +7 -0
  231. package/dist/chunks/constants-ICJL2EO5.js +7 -0
  232. package/dist/chunks/create-project-IKCB6MB2.js +7 -0
  233. package/dist/chunks/delete-2ZE2NVHI.js +10 -0
  234. package/dist/chunks/delete-AL57HZDQ.js +9 -0
  235. package/dist/chunks/detect-projects-OD4JEAW2.js +7 -0
  236. package/dist/chunks/detect-services-MOXTX5XG.js +7 -0
  237. package/dist/chunks/disable-MKI3BKNH.js +7 -0
  238. package/dist/chunks/discard-SI4H7ST3.js +14 -0
  239. package/dist/chunks/dist-33WTJLVQ.js +7 -0
  240. package/dist/chunks/dist-RXYNZPEA.js +7 -0
  241. package/dist/chunks/edit-DNWH6SPE.js +8 -0
  242. package/dist/chunks/edit-WYNWDFUJ.js +9 -0
  243. package/dist/chunks/enable-J6MMYPYF.js +7 -0
  244. package/dist/chunks/esm-33752ISR.js +7 -0
  245. package/dist/chunks/esm-4JKEE7PC.js +7 -0
  246. package/dist/chunks/esm-BYG5BWYH.js +9 -0
  247. package/dist/chunks/esm-DFFBNKNU.js +20 -0
  248. package/dist/chunks/esm-IF453UWS.js +7 -0
  249. package/dist/chunks/esm-LABWDJ72.js +7 -0
  250. package/dist/chunks/esm-TG37FXTU.js +9 -0
  251. package/dist/chunks/exec-OZSY46V6.js +16372 -0
  252. package/dist/chunks/export-MHSH7QCX.js +19 -0
  253. package/dist/chunks/fetch-proxy-45DGILKR.js +67 -0
  254. package/dist/chunks/future-FFOGTKMF.js +7 -0
  255. package/dist/chunks/generate-cert-for-deploy-YZKNGAEQ.js +7 -0
  256. package/dist/chunks/image-7METSS6F.js +7 -0
  257. package/dist/chunks/import-builders-GM2SERWV.js +7 -0
  258. package/dist/chunks/inspect-A7WJQQZO.js +15 -0
  259. package/dist/chunks/inspect-DI434TAM.js +19 -0
  260. package/dist/chunks/inspect-H2Q7XOWN.js +13 -0
  261. package/dist/chunks/inspect-H5JC2XKI.js +9 -0
  262. package/dist/chunks/inspect-IAWVHJXQ.js +20 -0
  263. package/dist/chunks/list-ELEUTZWJ.js +12 -0
  264. package/dist/chunks/list-INRPH25K.js +10 -0
  265. package/dist/chunks/list-WWU734RK.js +16 -0
  266. package/dist/chunks/login-R5NQRPQC.js +7 -0
  267. package/dist/chunks/login-ZF2TLCQB.js +9 -0
  268. package/dist/chunks/logs-UD7FEXZ7.js +7 -0
  269. package/dist/chunks/ls-5ZEAKKPQ.js +8 -0
  270. package/dist/chunks/ls-IXRLAJ4L.js +11 -0
  271. package/dist/chunks/ls-LIGIBVAT.js +12 -0
  272. package/dist/chunks/ls-MCQ2NS65.js +8 -0
  273. package/dist/chunks/ls-S5E2NQMI.js +12 -0
  274. package/dist/chunks/ls-V2ZSIVO3.js +12 -0
  275. package/dist/chunks/ls-VXH4QYF5.js +12 -0
  276. package/dist/chunks/mutate-OQWOKLIW.js +9 -0
  277. package/dist/chunks/notifications-KFZ333V5.js +7 -0
  278. package/dist/chunks/open-HH6K7ZRC.js +7 -0
  279. package/dist/chunks/openapi-JGYEFJJV.js +7 -0
  280. package/dist/chunks/permissions-ZSHKMXBZ.js +7 -0
  281. package/dist/chunks/pkg-EDJQLCNP.js +7 -0
  282. package/dist/chunks/plugin-offer-Z6FCPQFD.js +9 -0
  283. package/dist/chunks/prompt-missing-credentials-KOA7C4QC.js +7 -0
  284. package/dist/chunks/publish-FPNQ2US4.js +15 -0
  285. package/dist/chunks/pull-7OGOIKB3.js +7 -0
  286. package/dist/chunks/purchase-domain-if-available-F4LKHVBD.js +7 -0
  287. package/dist/chunks/push-NY3SIK2C.js +7 -0
  288. package/dist/chunks/query-JGPO7TNY.js +12 -0
  289. package/dist/chunks/reauthenticate-OZRQFR66.js +7 -0
  290. package/dist/chunks/reorder-4J2STFUS.js +10 -0
  291. package/dist/chunks/reply-EO4NTTPW.js +9 -0
  292. package/dist/chunks/repo-info-to-url-XQSULSEO.js +7 -0
  293. package/dist/chunks/resolve-RPHHRPNM.js +12 -0
  294. package/dist/chunks/resolve-agent-team-KX77HEAF.js +7 -0
  295. package/dist/chunks/resolve-deployment-framework-preset-AXXYBFCL.js +7 -0
  296. package/dist/chunks/restore-TEA6TSVK.js +16 -0
  297. package/dist/chunks/rm-BPILSPUI.js +8 -0
  298. package/dist/chunks/rm-F6XVUDBM.js +8 -0
  299. package/dist/chunks/rm-JCPXV2FN.js +8 -0
  300. package/dist/chunks/rm-LPQRGX7N.js +8 -0
  301. package/dist/chunks/rm-WHUGT6TE.js +8 -0
  302. package/dist/chunks/routes-P6LKQCWH.js +7 -0
  303. package/dist/chunks/rule-inspect-BOETGPFO.js +8 -0
  304. package/dist/chunks/schema-BEUO7G52.js +44 -0
  305. package/dist/chunks/schema-YOEAK4VX.js +14 -0
  306. package/dist/chunks/select-org-OMLGQEKK.js +7 -0
  307. package/dist/chunks/set-5XY27S7R.js +7 -0
  308. package/dist/chunks/setup-and-link-A7M3QT52.js +7 -0
  309. package/dist/chunks/skills-4J2NC2QI.js +590 -0
  310. package/dist/chunks/slugify-NMMUASYK.js +7 -0
  311. package/dist/chunks/stamp-TKONNIJ5.js +7 -0
  312. package/dist/chunks/tags-ZXZQEXOV.js +7 -0
  313. package/dist/chunks/token-W6P2KNI5.js +7 -0
  314. package/dist/chunks/token-util-JDQI37VN.js +7 -0
  315. package/dist/chunks/types-SK6J2HFE.js +14 -0
  316. package/dist/chunks/update-25CKNOY5.js +8 -0
  317. package/dist/chunks/update-route-version-KWK5S4UW.js +7 -0
  318. package/dist/chunks/utils-IQZEE4DT.js +86 -0
  319. package/dist/chunks/vlt-builder-graph-XL2XRO4V.js +7 -0
  320. package/dist/chunks/vlt-builder-importer-RBUPAB6J.js +11 -0
  321. package/dist/chunks/zod-2C2SXNIK.js +7 -0
  322. package/dist/commands/build/builder-worker.cjs +281 -0
  323. package/dist/commands/build/index.js +34 -0
  324. package/dist/commands/deploy/index.js +72 -0
  325. package/dist/commands/dev/builder-worker.cjs +110 -0
  326. package/dist/commands/dev/index.js +157 -0
  327. package/dist/commands/env/index.js +40 -0
  328. package/dist/commands/link/index.js +10 -0
  329. package/dist/commands/list/index.js +14 -0
  330. package/dist/commands/project/index.js +113 -0
  331. package/dist/commands-account.js +209 -0
  332. package/dist/commands-ai.js +200 -0
  333. package/dist/commands-blob.js +107 -0
  334. package/dist/commands-core.js +222 -0
  335. package/dist/commands-deployments.js +84 -0
  336. package/dist/commands-flags.js +377 -0
  337. package/dist/commands-integrations.js +143 -0
  338. package/dist/commands-observability.js +122 -0
  339. package/dist/commands-routing.js +273 -0
  340. package/dist/fetch-dist-tags.cjs +60 -0
  341. package/dist/get-latest-worker.cjs +222 -0
  342. package/dist/help.js +7 -0
  343. package/dist/index.js +25 -0
  344. package/dist/internal-build-worker.js +10 -0
  345. package/dist/internal-build.js +11 -0
  346. package/dist/package.json +265 -0
  347. package/dist/root-help-commands.mjs +1 -0
  348. package/dist/runtime-assets/dev-tunnel/api/tunnel.ts +443 -0
  349. package/dist/runtime-assets/dev-tunnel/lib/env.ts +25 -0
  350. package/dist/runtime-assets/dev-tunnel/lib/tunnel_pb.ts +505 -0
  351. package/dist/runtime-assets/node-preloads/next-dev-websocket.cjs +220 -0
  352. package/dist/vc.js +393 -0
  353. package/dist/version.mjs +2 -0
  354. package/package.json +224 -14
  355. package/index.js +0 -1
@@ -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{loadEmbeddedBuilderGraphs,loadEmbeddedBuilderIndex}from"./chunk-4CACOKMS.js";import{readJSONFile}from"./chunk-OGPENBY2.js";import{require_semver}from"./chunk-BPUANOGW.js";import{require_execa}from"./chunk-BUJITHGZ.js";import{require_dist2,require_minimatch}from"./chunk-7L2K4OKM.js";import{isManagedBuildersInstall}from"./chunk-NWGBDBZI.js";import{VERCEL_CONFIG_EXTENSIONS,VERCEL_DIR,require_lib,require_pluralize}from"./chunk-KNLGWGUE.js";import{CantParseJSONFile,code}from"./chunk-6VH56CX2.js";import{cmd}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{pkg_default}from"./chunk-OO572JUC.js";import{__commonJS,__export,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_builtins=__commonJS({"../../node_modules/.pnpm/builtins@1.0.3/node_modules/builtins/builtins.json"(exports,module){module.exports=["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","tty","url","util","v8","vm","zlib"]}});var require_validate_npm_package_name=__commonJS({"../../node_modules/.pnpm/validate-npm-package-name@3.0.0/node_modules/validate-npm-package-name/index.js"(exports,module){"use strict";var scopedPackagePattern=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),builtins=require_builtins(),blacklist=["node_modules","favicon.ico"],validate=module.exports=function(name){var warnings=[],errors=[];if(name===null)return errors.push("name cannot be null"),done(warnings,errors);if(name===void 0)return errors.push("name cannot be undefined"),done(warnings,errors);if(typeof name!="string")return errors.push("name must be a string"),done(warnings,errors);if(name.length||errors.push("name length must be greater than zero"),name.match(/^\./)&&errors.push("name cannot start with a period"),name.match(/^_/)&&errors.push("name cannot start with an underscore"),name.trim()!==name&&errors.push("name cannot contain leading or trailing spaces"),blacklist.forEach(function(blacklistedName){name.toLowerCase()===blacklistedName&&errors.push(blacklistedName+" is a blacklisted name")}),builtins.forEach(function(builtin){name.toLowerCase()===builtin&&warnings.push(builtin+" is a core module name")}),name.length>214&&warnings.push("name can no longer contain more than 214 characters"),name.toLowerCase()!==name&&warnings.push("name can no longer contain capital letters"),/[~'!()*]/.test(name.split("/").slice(-1)[0])&&warnings.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(name)!==name){var nameMatch=name.match(scopedPackagePattern);if(nameMatch){var user=nameMatch[1],pkg=nameMatch[2];if(encodeURIComponent(user)===user&&encodeURIComponent(pkg)===pkg)return done(warnings,errors)}errors.push("name can only contain URL-friendly characters")}return done(warnings,errors)};validate.scopedPackagePattern=scopedPackagePattern;var done=function(warnings,errors){var result={validForNewPackages:errors.length===0&&warnings.length===0,validForOldPackages:errors.length===0,warnings,errors};return result.warnings.length||delete result.warnings,result.errors.length||delete result.errors,result}}});var require_git_host_info=__commonJS({"../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/git-host-info.js"(exports,module){"use strict";var gitHosts=module.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^[/]([^/]+)[/]((?!.*(\/-\/|\/repository\/archive\.tar\.gz\?=.*|\/repository\/[^/]+\/archive.tar.gz$)).*?)(?:[.]git|[/])?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{32,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(fragment){return"file-"+formatHashFragment(fragment)}}},gitHostDefaults={sshtemplate:"git@{domain}:{user}/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{user}/{project}.git{#committish}",browsetemplate:"https://{domain}/{user}/{project}{/tree/committish}",browsefiletemplate:"https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",docstemplate:"https://{domain}/{user}/{project}{/tree/committish}#readme",httpstemplate:"git+https://{auth@}{domain}/{user}/{project}.git{#committish}",filetemplate:"https://{domain}/{user}/{project}/raw/{committish}/{path}",shortcuttemplate:"{type}:{user}/{project}{#committish}",pathtemplate:"{user}/{project}{#committish}",pathmatch:/^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,hashformat:formatHashFragment};Object.keys(gitHosts).forEach(function(name){Object.keys(gitHostDefaults).forEach(function(key){gitHosts[name][key]||(gitHosts[name][key]=gitHostDefaults[key])}),gitHosts[name].protocols_re=RegExp("^("+gitHosts[name].protocols.map(function(protocol){return protocol.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function formatHashFragment(fragment){return fragment.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}}});var require_git_host=__commonJS({"../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/git-host.js"(exports,module){"use strict";var gitHosts=require_git_host_info(),extend=Object.assign||function(target,source){if(source===null||typeof source!="object")return target;for(var keys=Object.keys(source),i=keys.length;i--;)target[keys[i]]=source[keys[i]];return target};module.exports=GitHost;function GitHost(type,user,auth,project,committish,defaultRepresentation,opts){var gitHostInfo=this;gitHostInfo.type=type,Object.keys(gitHosts[type]).forEach(function(key){gitHostInfo[key]=gitHosts[type][key]}),gitHostInfo.user=user,gitHostInfo.auth=auth,gitHostInfo.project=project,gitHostInfo.committish=committish,gitHostInfo.default=defaultRepresentation,gitHostInfo.opts=opts||{}}GitHost.prototype.hash=function(){return this.committish?"#"+this.committish:""};GitHost.prototype._fill=function(template,opts){if(template){var vars=extend({},opts);vars.path=vars.path?vars.path.replace(/^[/]+/g,""):"",opts=extend(extend({},this.opts),opts);var self=this;Object.keys(this).forEach(function(key){self[key]!=null&&vars[key]==null&&(vars[key]=self[key])});var rawAuth=vars.auth,rawcommittish=vars.committish,rawFragment=vars.fragment,rawPath=vars.path,rawProject=vars.project;Object.keys(vars).forEach(function(key){var value=vars[key];(key==="path"||key==="project")&&typeof value=="string"?vars[key]=value.split("/").map(function(pathComponent){return encodeURIComponent(pathComponent)}).join("/"):vars[key]=encodeURIComponent(value)}),vars["auth@"]=rawAuth?rawAuth+"@":"",vars["#fragment"]=rawFragment?"#"+this.hashformat(rawFragment):"",vars.fragment=vars.fragment?vars.fragment:"",vars["#path"]=rawPath?"#"+this.hashformat(rawPath):"",vars["/path"]=vars.path?"/"+vars.path:"",vars.projectPath=rawProject.split("/").map(encodeURIComponent).join("/"),opts.noCommittish?(vars["#committish"]="",vars["/tree/committish"]="",vars["/committish"]="",vars.committish=""):(vars["#committish"]=rawcommittish?"#"+rawcommittish:"",vars["/tree/committish"]=vars.committish?"/"+vars.treepath+"/"+vars.committish:"",vars["/committish"]=vars.committish?"/"+vars.committish:"",vars.committish=vars.committish||"master");var res=template;return Object.keys(vars).forEach(function(key){res=res.replace(new RegExp("[{]"+key+"[}]","g"),vars[key])}),opts.noGitPlus?res.replace(/^git[+]/,""):res}};GitHost.prototype.ssh=function(opts){return this._fill(this.sshtemplate,opts)};GitHost.prototype.sshurl=function(opts){return this._fill(this.sshurltemplate,opts)};GitHost.prototype.browse=function(P,F,opts){return typeof P=="string"?(typeof F!="string"&&(opts=F,F=null),this._fill(this.browsefiletemplate,extend({fragment:F,path:P},opts))):this._fill(this.browsetemplate,P)};GitHost.prototype.docs=function(opts){return this._fill(this.docstemplate,opts)};GitHost.prototype.bugs=function(opts){return this._fill(this.bugstemplate,opts)};GitHost.prototype.https=function(opts){return this._fill(this.httpstemplate,opts)};GitHost.prototype.git=function(opts){return this._fill(this.gittemplate,opts)};GitHost.prototype.shortcut=function(opts){return this._fill(this.shortcuttemplate,opts)};GitHost.prototype.path=function(opts){return this._fill(this.pathtemplate,opts)};GitHost.prototype.tarball=function(opts_){var opts=extend({},opts_,{noCommittish:!1});return this._fill(this.tarballtemplate,opts)};GitHost.prototype.file=function(P,opts){return this._fill(this.filetemplate,extend({path:P},opts))};GitHost.prototype.getDefaultRepresentation=function(){return this.default};GitHost.prototype.toString=function(opts){return this.default&&typeof this[this.default]=="function"?this[this.default](opts):this.sshurl(opts)}}});var require_hosted_git_info=__commonJS({"../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/index.js"(exports,module){"use strict";var url=__require("url"),gitHosts=require_git_host_info(),GitHost=module.exports=require_git_host(),protocolToRepresentationMap={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function protocolToRepresentation(protocol){return protocolToRepresentationMap[protocol]||protocol.slice(0,-1)}var authProtocols={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0},cache={};module.exports.fromUrl=function(giturl,opts){if(typeof giturl=="string"){var key=giturl+JSON.stringify(opts||{});return key in cache||(cache[key]=fromUrl(giturl,opts)),cache[key]}};function fromUrl(giturl,opts){if(!(giturl==null||giturl==="")){var url2=fixupUnqualifiedGist(isGitHubShorthand(giturl)?"github:"+giturl:giturl),parsed=parseGitUrl(url2),shortcutMatch=url2.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),matches=Object.keys(gitHosts).map(function(gitHostName){try{var gitHostInfo=gitHosts[gitHostName],auth=null;parsed.auth&&authProtocols[parsed.protocol]&&(auth=parsed.auth);var committish=parsed.hash?decodeURIComponent(parsed.hash.substr(1)):null,user=null,project=null,defaultRepresentation=null;if(shortcutMatch&&shortcutMatch[1]===gitHostName)user=shortcutMatch[2]&&decodeURIComponent(shortcutMatch[2]),project=decodeURIComponent(shortcutMatch[3].replace(/\.git$/,"")),defaultRepresentation="shortcut";else{if(parsed.host&&parsed.host!==gitHostInfo.domain&&parsed.host.replace(/^www[.]/,"")!==gitHostInfo.domain||!gitHostInfo.protocols_re.test(parsed.protocol)||!parsed.path)return;var pathmatch=gitHostInfo.pathmatch,matched=parsed.path.match(pathmatch);if(!matched)return;matched[1]!==null&&matched[1]!==void 0&&(user=decodeURIComponent(matched[1].replace(/^:/,""))),project=decodeURIComponent(matched[2]),defaultRepresentation=protocolToRepresentation(parsed.protocol)}return new GitHost(gitHostName,user,auth,project,committish,defaultRepresentation,opts)}catch(ex){if(!(ex instanceof URIError))throw ex}}).filter(function(gitHostInfo){return gitHostInfo});if(matches.length===1)return matches[0]}}function isGitHubShorthand(arg){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(arg)}function fixupUnqualifiedGist(giturl){var parsed=url.parse(giturl);return parsed.protocol==="gist:"&&parsed.host&&!parsed.path?parsed.protocol+"/"+parsed.host:giturl}function parseGitUrl(giturl){var matched=giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!matched){var legacy=url.parse(giturl);if(legacy.auth&&typeof url.URL=="function"){var authmatch=giturl.match(/[^@]+@[^:/]+/);if(authmatch){var whatwg=new url.URL(authmatch[0]);legacy.auth=whatwg.username||"",whatwg.password&&(legacy.auth+=":"+whatwg.password)}}return legacy}return{protocol:"git+ssh:",slashes:!0,auth:matched[1],host:matched[2],port:null,hostname:matched[2],hash:matched[4],search:null,query:null,pathname:"/"+matched[3],path:"/"+matched[3],href:"git+ssh://"+matched[1]+"@"+matched[2]+"/"+matched[3]+(matched[4]||"")}}}});var require_os_tmpdir=__commonJS({"../../node_modules/.pnpm/os-tmpdir@1.0.2/node_modules/os-tmpdir/index.js"(exports,module){"use strict";var isWindows=process.platform==="win32",trailingSlashRe=isWindows?/[^:]\\$/:/.\/$/;module.exports=function(){var path;return isWindows?path=process.env.TEMP||process.env.TMP||(process.env.SystemRoot||process.env.windir)+"\\temp":path=process.env.TMPDIR||process.env.TMP||process.env.TEMP||"/tmp",trailingSlashRe.test(path)&&(path=path.slice(0,-1)),path}}});var require_os_homedir=__commonJS({"../../node_modules/.pnpm/os-homedir@1.0.2/node_modules/os-homedir/index.js"(exports,module){"use strict";var os=__require("os");function homedir(){var env=process.env,home=env.HOME,user=env.LOGNAME||env.USER||env.LNAME||env.USERNAME;return process.platform==="win32"?env.USERPROFILE||env.HOMEDRIVE+env.HOMEPATH||home||null:process.platform==="darwin"?home||(user?"/Users/"+user:null):process.platform==="linux"?home||(process.getuid()===0?"/root":user?"/home/"+user:null):home||null}module.exports=typeof os.homedir=="function"?os.homedir:homedir}});var require_osenv=__commonJS({"../../node_modules/.pnpm/osenv@0.1.5/node_modules/osenv/osenv.js"(exports){var isWindows=process.platform==="win32",path=__require("path"),exec=__require("child_process").exec,osTmpdir=require_os_tmpdir(),osHomedir=require_os_homedir();function memo(key,lookup,fallback){var fell=!1,falling=!1;exports[key]=function(cb){var val=lookup();return!val&&!fell&&!falling&&fallback&&(fell=!0,falling=!0,exec(fallback,function(er,output,stderr){falling=!1,!er&&(val=output.trim())})),exports[key]=function(cb2){return cb2&&process.nextTick(cb2.bind(null,null,val)),val},cb&&!falling&&process.nextTick(cb.bind(null,null,val)),val}}memo("user",function(){return isWindows?process.env.USERDOMAIN+"\\"+process.env.USERNAME:process.env.USER},"whoami");memo("prompt",function(){return isWindows?process.env.PROMPT:process.env.PS1});memo("hostname",function(){return isWindows?process.env.COMPUTERNAME:process.env.HOSTNAME},"hostname");memo("tmpdir",function(){return osTmpdir()});memo("home",function(){return osHomedir()});memo("path",function(){return(process.env.PATH||process.env.Path||process.env.path).split(isWindows?";":":")});memo("editor",function(){return process.env.EDITOR||process.env.VISUAL||(isWindows?"notepad.exe":"vi")});memo("shell",function(){return isWindows?process.env.ComSpec||"cmd":process.env.SHELL||"bash"})}});var require_npa=__commonJS({"../../node_modules/.pnpm/npm-package-arg@6.1.0/node_modules/npm-package-arg/npa.js"(exports,module){"use strict";module.exports=npa2;module.exports.resolve=resolve;module.exports.Result=Result;var url,HostedGit,semver,path,validatePackageName,osenv,isWindows=process.platform==="win32"||global.FAKE_WINDOWS,hasSlashes=isWindows?/\\|[/]/:/[/]/,isURL=/^(?:git[+])?[a-z]+:/i,isFilename=/[.](?:tgz|tar.gz|tar)$/i;function npa2(arg,where){let name,spec;if(typeof arg=="object")return arg instanceof Result&&(!where||where===arg.where)?arg:arg.name&&arg.rawSpec?npa2.resolve(arg.name,arg.rawSpec,where||arg.where):npa2(arg.raw,where||arg.where);let nameEndsAt=arg[0]==="@"?arg.slice(1).indexOf("@")+1:arg.indexOf("@"),namePart=nameEndsAt>0?arg.slice(0,nameEndsAt):arg;return isURL.test(arg)||namePart[0]!=="@"&&(hasSlashes.test(namePart)||isFilename.test(namePart))?spec=arg:nameEndsAt>0?(name=namePart,spec=arg.slice(nameEndsAt+1)):(validatePackageName||(validatePackageName=require_validate_npm_package_name()),validatePackageName(arg).validForOldPackages?name=arg:spec=arg),resolve(name,spec,where,arg)}var isFilespec=isWindows?/^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/:/^(?:[.]|~[/]|[/]|[a-zA-Z]:)/;function resolve(name,spec,where,arg){let res=new Result({raw:arg,name,rawSpec:spec,fromArgument:arg!=null});if(name&&res.setName(name),spec&&(isFilespec.test(spec)||/^file:/i.test(spec)))return fromFile(res,where);if(spec&&/^npm:/i.test(spec))return fromAlias(res,where);HostedGit||(HostedGit=require_hosted_git_info());let hosted=HostedGit.fromUrl(spec,{noGitPlus:!0,noCommittish:!0});return hosted?fromHostedGit(res,hosted):spec&&isURL.test(spec)?fromURL(res):spec&&(hasSlashes.test(spec)||isFilename.test(spec))?fromFile(res,where):fromRegistry(res)}function invalidPackageName(name,valid){let err=new Error(`Invalid package name "${name}": ${valid.errors.join("; ")}`);return err.code="EINVALIDPACKAGENAME",err}function invalidTagName(name){let err=new Error(`Invalid tag name "${name}": Tags may not have any characters that encodeURIComponent encodes.`);return err.code="EINVALIDTAGNAME",err}function Result(opts){this.type=opts.type,this.registry=opts.registry,this.where=opts.where,opts.raw==null?this.raw=opts.name?opts.name+"@"+opts.rawSpec:opts.rawSpec:this.raw=opts.raw,this.name=void 0,this.escapedName=void 0,this.scope=void 0,this.rawSpec=opts.rawSpec==null?"":opts.rawSpec,this.saveSpec=opts.saveSpec,this.fetchSpec=opts.fetchSpec,opts.name&&this.setName(opts.name),this.gitRange=opts.gitRange,this.gitCommittish=opts.gitCommittish,this.hosted=opts.hosted}Result.prototype={};Result.prototype.setName=function(name){validatePackageName||(validatePackageName=require_validate_npm_package_name());let valid=validatePackageName(name);if(!valid.validForOldPackages)throw invalidPackageName(name,valid);return this.name=name,this.scope=name[0]==="@"?name.slice(0,name.indexOf("/")):void 0,this.escapedName=name.replace("/","%2f"),this};Result.prototype.toString=function(){let full=[];this.name!=null&&this.name!==""&&full.push(this.name);let spec=this.saveSpec||this.fetchSpec||this.rawSpec;return spec!=null&&spec!==""&&full.push(spec),full.length?full.join("@"):this.raw};Result.prototype.toJSON=function(){let result=Object.assign({},this);return delete result.hosted,result};function setGitCommittish(res,committish){return committish!=null&&committish.length>=7&&committish.slice(0,7)==="semver:"?(res.gitRange=decodeURIComponent(committish.slice(7)),res.gitCommittish=null):res.gitCommittish=committish===""?null:committish,res}var isAbsolutePath=/^[/]|^[A-Za-z]:/;function resolvePath(where,spec){return isAbsolutePath.test(spec)?spec:(path||(path=__require("path")),path.resolve(where,spec))}function isAbsolute2(dir){return!!(dir[0]==="/"||/^[A-Za-z]:/.test(dir))}function fromFile(res,where){where||(where=process.cwd()),res.type=isFilename.test(res.rawSpec)?"file":"directory",res.where=where;let spec=res.rawSpec.replace(/\\/g,"/").replace(/^file:[/]*([A-Za-z]:)/,"$1").replace(/^file:(?:[/]*([~./]))?/,"$1");return/^~[/]/.test(spec)?(osenv||(osenv=require_osenv()),res.fetchSpec=resolvePath(osenv.home(),spec.slice(2)),res.saveSpec="file:"+spec):(res.fetchSpec=resolvePath(where,spec),isAbsolute2(spec)?res.saveSpec="file:"+spec:(path||(path=__require("path")),res.saveSpec="file:"+path.relative(where,res.fetchSpec))),res}function fromHostedGit(res,hosted){return res.type="git",res.hosted=hosted,res.saveSpec=hosted.toString({noGitPlus:!1,noCommittish:!1}),res.fetchSpec=hosted.getDefaultRepresentation()==="shortcut"?null:hosted.toString(),setGitCommittish(res,hosted.committish)}function unsupportedURLType(protocol,spec){let err=new Error(`Unsupported URL Type "${protocol}": ${spec}`);return err.code="EUNSUPPORTEDPROTOCOL",err}function matchGitScp(spec){let matched=spec.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i);return matched&&!matched[1].match(/:[0-9]+\/?.*$/i)&&{fetchSpec:matched[1],gitCommittish:matched[2]==null?null:matched[2]}}function fromURL(res){url||(url=__require("url"));let urlparse=url.parse(res.rawSpec);switch(res.saveSpec=res.rawSpec,urlparse.protocol){case"git:":case"git+http:":case"git+https:":case"git+rsync:":case"git+ftp:":case"git+file:":case"git+ssh:":res.type="git";let match=urlparse.protocol==="git+ssh:"&&matchGitScp(res.rawSpec);match?(setGitCommittish(res,match.gitCommittish),res.fetchSpec=match.fetchSpec):(setGitCommittish(res,urlparse.hash!=null?urlparse.hash.slice(1):""),urlparse.protocol=urlparse.protocol.replace(/^git[+]/,""),delete urlparse.hash,res.fetchSpec=url.format(urlparse));break;case"http:":case"https:":res.type="remote",res.fetchSpec=res.saveSpec;break;default:throw unsupportedURLType(urlparse.protocol,res.rawSpec)}return res}function fromAlias(res,where){let subSpec=npa2(res.rawSpec.substr(4),where);if(subSpec.type==="alias")throw new Error("nested aliases not supported");if(!subSpec.registry)throw new Error("aliases only work for registry deps");return res.subSpec=subSpec,res.registry=!0,res.type="alias",res.saveSpec=null,res.fetchSpec=null,res}function fromRegistry(res){res.registry=!0;let spec=res.rawSpec===""?"latest":res.rawSpec;res.saveSpec=null,res.fetchSpec=spec,semver||(semver=require_semver());let version2=semver.valid(spec,!0),range=semver.validRange(spec,!0);if(version2)res.type="version";else if(range)res.type="range";else{if(encodeURIComponent(spec)!==spec)throw invalidTagName(spec);res.type="tag"}return res}}});var require_import_builders=__commonJS({"../../internals/builder-orchestration/dist/import-builders.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export2=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),import_builders_exports={};__export2(import_builders_exports,{createImportBuilders:()=>createImportBuilders2,formatResolvedBuilders:()=>formatResolvedBuilders2,getBuildersDir:()=>getBuildersDir2,pinBuilderSpecs:()=>pinBuilderSpecs});module.exports=__toCommonJS(import_builders_exports);var import_npm_package_arg2=__toESM2(require_npa()),import_semver=require_semver(),import_path2=__require("path"),import_fs_extra=require_lib(),import_fs_detectors=require_dist2(),import_error_utils=require_dist();function isRemoteBuilderPin(pin){return/^https?:\/\//i.test(pin)}function isDefaultSpec(parsed){return parsed.type==="tag"&&(parsed.rawSpec===""||parsed.rawSpec==="latest")}function formatResolvedBuilders2(builders){return Array.from(builders.values(),b=>b.pkgPath?`${b.pkg.name}@${b.pkg.version}=${(0,import_path2.dirname)(b.pkgPath)}`:`${b.pkg.name}=built-in`).join(",")}function pinBuilderSpecs(specs,pins){let pinnedSpecs=new Map;for(let spec of specs){let parsed=(0,import_npm_package_arg2.default)(spec);if(parsed.name&&isDefaultSpec(parsed)){let version2=pins.get(parsed.name);version2&&pinnedSpecs.set(spec,isRemoteBuilderPin(version2)?version2:`${parsed.name}@${version2}`)}}return pinnedSpecs}function getBuildersDir2(cwd,vercelDir=".vercel"){let override=process.env.VERCEL_BUILDERS_DIR;return override?(0,import_path2.isAbsolute)(override)?override:(0,import_path2.resolve)(cwd,override):(0,import_path2.join)(cwd,vercelDir,"builders")}function createImportBuilders2(dependencies){let{buildersDir:resolveBuildersDir=getBuildersDir2,debug,installBuilders:installBuilders2,isNativeBinaryInstall,require:require2,staticBuilder,vercelDir}=dependencies,builderPins2=new Map;for(let[name,version2]of Object.entries(dependencies.builderPins))((0,import_semver.validRange)(version2)||isRemoteBuilderPin(version2))&&builderPins2.set(name,version2);let resolveDependencies={builderPins:builderPins2,debug,isNativeBinaryInstall,require:require2,staticBuilder};return async function(builderSpecs,cwd,span){let buildersDir=resolveBuildersDir(cwd,vercelDir),importResult=await resolveBuilders(buildersDir,builderSpecs,resolveDependencies);if("buildersToAdd"in importResult){let{buildersToAdd,installReasons}=importResult,pinnedSpecs=pinBuilderSpecs(buildersToAdd,builderPins2),installResult=await installBuilders2(buildersDir,new Set(Array.from(buildersToAdd,spec=>pinnedSpecs.get(spec)??spec)),span,installReasons,pinnedSpecs),allowedPinDriftSpecs=new Set(Array.from(pinnedSpecs.keys()).filter(spec=>installResult.has(spec)));if(importResult=await resolveBuilders(buildersDir,builderSpecs,resolveDependencies,installResult,allowedPinDriftSpecs),"buildersToAdd"in importResult){let{buildersToAdd:failed,installReasons:reasons}=importResult,failures=Array.from(failed,spec=>{let reason=reasons.get(spec);return reason?`${spec} (${reason})`:spec}),err=new Error(`Failed to load Builders after installing them: ${failures.join(", ")}. Retry the build. If the failure persists, contact Vercel Support.`);throw Object.assign(err,{link:"https://vercel.link/builder-dependencies-install-failed"}),err}}let resolvedBuildersDebug=[];for(let[spec,builderSpec]of importResult.builders)resolvedBuildersDebug.push(`${spec} => ${builderSpec.pkg.version}`);return debug(`Resolved builders: "${resolvedBuildersDebug.join(", ")}"`),importResult.builders}}function missingModuleId(err){let id=/Cannot find module '([^']+)'/.exec(err.message)?.[1];if(id&&!(id.startsWith("/")||id.startsWith(".")||/^[A-Za-z]:[\\/]/.test(id)))return id.replace(/[,=]/g,"_").slice(0,100)}async function resolveBuilders(buildersDir,builderSpecs,dependencies,resolvedSpecs,allowedPinDriftSpecs){let builders=new Map,buildersToAdd=new Set,installReasons=new Map;for(let spec of builderSpecs){let resolvedSpec=resolvedSpecs?.get(spec)||spec,parsed=(0,import_npm_package_arg2.default)(resolvedSpec),{name}=parsed;if(!name){buildersToAdd.add(spec),installReasons.set(spec,"url-spec");continue}if((0,import_fs_detectors.isStaticRuntime)(name)){builders.set(name,{builder:dependencies.staticBuilder,pkg:{name},path:"",pkgPath:"",dynamicallyInstalled:!1});continue}let entrypointLoadFailed=!1;try{let pkgPath,builderPkg;try{pkgPath=(0,import_path2.join)(buildersDir,"node_modules",name,"package.json"),builderPkg=await(0,import_fs_extra.readJSON)(pkgPath)}catch(error){if(!(0,import_error_utils.isErrnoException)(error)||error.code!=="ENOENT")throw error;if(dependencies.isNativeBinaryInstall()){buildersToAdd.add(spec),installReasons.set(spec,"not-installed");continue}pkgPath=dependencies.require.resolve(`${name}/package.json`),builderPkg=await(0,import_fs_extra.readJSON)(pkgPath)}if(!builderPkg||!pkgPath)throw new Error(`Failed to load \`package.json\` for "${name}"`);if(typeof builderPkg.version!="string")throw new Error(`\`package.json\` for "${name}" does not contain a "version" field`);let peerVersion=dependencies.builderPins.get(name);if(isDefaultSpec(parsed)&&peerVersion&&(0,import_semver.valid)(peerVersion)&&builderPkg.version!==peerVersion&&!allowedPinDriftSpecs?.has(spec)){dependencies.debug(`Resolved "${name}@${builderPkg.version}" does not match pin "${peerVersion}"`),buildersToAdd.add(spec),installReasons.set(spec,"pin-version-mismatch");continue}if(isDefaultSpec(parsed)&&peerVersion&&isRemoteBuilderPin(peerVersion)&&pkgPath.startsWith(buildersDir)&&!allowedPinDriftSpecs?.has(spec)){let installedSpec;try{installedSpec=(await(0,import_fs_extra.readJSON)((0,import_path2.join)(buildersDir,"package.json"))).dependencies?.[name]}catch(error){if(!(0,import_error_utils.isErrnoException)(error)||error.code!=="ENOENT")throw error}if(installedSpec!==peerVersion){if(dependencies.debug(`Installed source for "${name}@${builderPkg.version}" is "${installedSpec??"unknown"}", not pin "${peerVersion}"`),dependencies.isNativeBinaryInstall()){buildersToAdd.add(spec),installReasons.set(spec,"preview-pack-mismatch");continue}try{pkgPath=dependencies.require.resolve(`${name}/package.json`),builderPkg=await(0,import_fs_extra.readJSON)(pkgPath)}catch(resolveError){if((0,import_error_utils.isErrnoException)(resolveError)&&(resolveError.code==="MODULE_NOT_FOUND"||resolveError.code==="ENOENT")){buildersToAdd.add(spec),installReasons.set(spec,"preview-pack-mismatch");continue}throw resolveError}}}if(!builderPkg||!pkgPath)throw new Error(`Failed to load \`package.json\` for "${name}"`);if(typeof builderPkg.version!="string")throw new Error(`\`package.json\` for "${name}" does not contain a "version" field`);if(parsed.type==="version"&&parsed.rawSpec!==builderPkg.version){dependencies.debug(`Installed version "${name}@${builderPkg.version}" does not match "${parsed.rawSpec}"`),buildersToAdd.add(spec),installReasons.set(spec,"version-mismatch");continue}if(parsed.type==="range"&&!(0,import_semver.satisfies)(builderPkg.version,parsed.rawSpec)){dependencies.debug(`Installed version "${name}@${builderPkg.version}" is not compatible with "${parsed.rawSpec}"`),buildersToAdd.add(spec),installReasons.set(spec,"range-mismatch");continue}let path=(0,import_path2.join)((0,import_path2.dirname)(pkgPath),builderPkg.main||"index.js"),builder;try{builder=dependencies.require(path)}catch(requireErr){throw entrypointLoadFailed=!0,requireErr}let dynamicallyInstalled=pkgPath.startsWith(buildersDir);builders.set(spec,{builder,pkg:{name,...builderPkg},path,pkgPath,dynamicallyInstalled}),dependencies.debug(`Imported Builder "${name}" from "${(0,import_path2.dirname)(pkgPath)}"`)}catch(error){if(!(error instanceof Error))throw error;let err=error;if((err.code==="MODULE_NOT_FOUND"||err.code==="ENOENT")&&!resolvedSpecs)if(dependencies.debug(`Failed to import "${name}": ${err}`),buildersToAdd.add(spec),entrypointLoadFailed){let missing=missingModuleId(err);installReasons.set(spec,missing?`entrypoint-load-failed:${missing}`:"entrypoint-load-failed")}else installReasons.set(spec,"not-installed");else throw err.message=`Importing "${name}": ${err.message}`,err}}return buildersToAdd.size>0?{buildersToAdd,installReasons}:{builders}}}});var require_static_builder=__commonJS({"../../internals/builder-orchestration/dist/static-builder.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export2=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),static_builder_exports2={};__export2(static_builder_exports2,{createStaticBuilder:()=>createStaticBuilder2,version:()=>version2});module.exports=__toCommonJS(static_builder_exports2);var import_minimatch=__toESM2(require_minimatch()),import_path2=__require("path"),import_build_utils=__require("@vercel/build-utils"),version2=2,ALWAYS_EXCLUDED_PREFIXES=[".git/","node_modules/"],DEFAULT_EXCLUDED_FILES=[".gitignore","package.json","package-lock.json","yarn.lock","pnpm-lock.yaml","bun.lock","bun.lockb","README.md"];function createStaticBuilder2(vercelConfigExtensions){let alwaysExcludedFiles=["vercel.json","vercel.toml",...vercelConfigExtensions.map(ext=>`vercel.${ext}`),".vercelignore","now.json",".nowignore"];return{version:version2,build:async({entrypoint,files,config,workPath,meta={},service})=>{let output={},outputDirectory=config.zeroConfig?config.outputDirectory:"",canPublish=meta.daemonContext?await(0,import_build_utils.createDaemonStaticFileFilter)({context:meta.daemonContext,publishPath:(0,import_path2.resolve)(workPath,outputDirectory||"."),serviceName:service?.name}):void 0;for(let[srcFilename,fileFsRef]of Object.entries(files)){if(entrypoint&&!(entrypoint===srcFilename||(0,import_minimatch.default)(srcFilename,entrypoint,{dot:!0})))continue;let filename=srcFilename;if(outputDirectory){let outputMatch=outputDirectory+"/";filename.startsWith(outputMatch)&&(filename=filename.slice(outputMatch.length))}ALWAYS_EXCLUDED_PREFIXES.some(prefix=>filename.startsWith(prefix))||alwaysExcludedFiles.includes(filename)||DEFAULT_EXCLUDED_FILES.includes(filename)||filename.startsWith(".env")||(!canPublish||await canPublish((0,import_path2.resolve)(workPath,srcFilename)))&&(output[filename]=fileFsRef)}return{output}},shouldServe:_opts=>{let opts={..._opts},{config:{zeroConfig,outputDirectory}}=opts;return zeroConfig&&outputDirectory&&(opts.entrypoint=`${outputDirectory}/${opts.entrypoint}`,opts.requestPath=`${outputDirectory}/${opts.requestPath}`),(0,import_build_utils.shouldServe)(opts)},diagnostics:async({service})=>({[import_build_utils.MANIFEST_FILENAME]:new import_build_utils.FileBlob({data:JSON.stringify({version:import_build_utils.MANIFEST_VERSION,runtime:"static",buildType:"app",dependencies:[],serviceType:service!==void 0?(0,import_build_utils.getReportedServiceType)(service):void 0})})})}}}});var require_install_builders=__commonJS({"../../internals/builder-orchestration/dist/install-builders.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export2=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),install_builders_exports={};__export2(install_builders_exports,{createInstallBuilders:()=>createInstallBuilders2,getBuildUtilsSpec:()=>getBuildUtilsSpec,getBuildUtilsVersionForInstall:()=>getBuildUtilsVersionForInstall,shouldFallbackBuilderPins:()=>shouldFallbackBuilderPins});module.exports=__toCommonJS(install_builders_exports);var import_url=__require("url"),import_pluralize=__toESM2(require_pluralize()),import_path2=__require("path"),import_npm_package_arg2=__toESM2(require_npa()),import_semver=require_semver(),import_fs_extra=require_lib(),import_error_utils=require_dist();function getBuildUtilsVersionForInstall(dependencies,usePinnedVersion){return usePinnedVersion?dependencies.pinnedBuildUtilsVersion??dependencies.buildUtilsVersion:dependencies.buildUtilsVersion}function shouldFallbackBuilderPins(dependencies,pinnedSpecCount){return pinnedSpecCount>0&&!dependencies.strictBuilderPins}function getBuildUtilsSpec(buildUtilsVersion){if(!buildUtilsVersion)return"@vercel/build-utils";if((0,import_semver.validRange)(buildUtilsVersion))return`@vercel/build-utils@${buildUtilsVersion}`;try{if((0,import_npm_package_arg2.default)(buildUtilsVersion).type==="remote")return`@vercel/build-utils@${buildUtilsVersion}`}catch{}return"@vercel/build-utils"}function getErrorMessage(err,execaMessage){return!err||!("stderr"in err)?execaMessage:typeof err.stderr=="string"?err.stderr:execaMessage}async function untracedInstallBuilders(buildersDir,buildersToAdd,dependencies,buildUtilsVersion=dependencies.buildUtilsVersion){let{code:code2,cmd:cmd2,output,readJSONFile:readJSONFile2,run}=dependencies,resolvedSpecs=new Map,buildersPkgPath=(0,import_path2.join)(buildersDir,"package.json");try{let emptyPkgJson={private:!0,license:"UNLICENSED"};await(0,import_fs_extra.outputJSON)(buildersPkgPath,emptyPkgJson,{flag:"wx"})}catch(error){if(!(0,import_error_utils.isErrnoException)(error)||error.code!=="EEXIST")throw error}output.log(`Installing ${(0,import_pluralize.default)("Builder",buildersToAdd.size)}: ${Array.from(buildersToAdd).join(", ")}`);let installArgs=["install",getBuildUtilsSpec(buildUtilsVersion),...buildersToAdd];try{let{stderr}=await run("npm",installArgs,{cwd:buildersDir,stdio:"pipe",reject:!0});stderr.split(`/\r?
8
+ /`).filter(line=>line.includes("npm WARN deprecated")).forEach(line=>{output.warn(line)})}catch(err){if((0,import_error_utils.isError)(err)){let execaMessage=err.message,message=getErrorMessage(err,execaMessage);if(execaMessage.startsWith("Command failed with ENOENT"))message=`Please install ${cmd2("npm")} before continuing`;else{let notFoundUrl=/GET (.*) - Not found/.exec(message)?.[1];if(notFoundUrl){let url=new import_url.URL(notFoundUrl),packagePath=decodeURIComponent(url.pathname),packageName=/(@[^/]+\/[^/]+)$/.exec(packagePath)?.[1]??packagePath.split("/").filter(Boolean).at(-1)??packagePath;message=`The package ${code2(packageName)} is not published on the npm registry`}}err.message=message,Object.assign(err,{link:"https://vercel.link/builder-dependencies-install-failed"})}throw err}let nowScopePath=(0,import_path2.join)(buildersDir,"node_modules/@now");await(0,import_fs_extra.mkdirp)(nowScopePath);try{await(0,import_fs_extra.symlink)("../@vercel/build-utils",(0,import_path2.join)(nowScopePath,"build-utils"))}catch(err){if(!(0,import_error_utils.isErrnoException)(err)||err.code!=="EEXIST")throw err}let buildersPkg=await readJSONFile2(buildersPkgPath);if(dependencies.isCantParseJSONFile(buildersPkg))throw buildersPkg;if(!buildersPkg)throw new Error(`Failed to load "${buildersPkgPath}"`);for(let spec of buildersToAdd)for(let[name,version2]of Object.entries(buildersPkg.dependencies||{}))version2===spec&&(output.debug(`Resolved Builder spec "${spec}" to name "${name}"`),resolvedSpecs.set(spec,name));return resolvedSpecs}function createInstallBuilders2(dependencies){let{output}=dependencies;return async function(buildersDir,buildersToAdd,span,installReasons,pinnedSpecs){let install=async()=>{try{return await untracedInstallBuilders(buildersDir,buildersToAdd,dependencies,getBuildUtilsVersionForInstall(dependencies,!!pinnedSpecs?.size))}catch(err){let fallbackPins=pinnedSpecs;if(!fallbackPins||!shouldFallbackBuilderPins(dependencies,fallbackPins.size))throw err;let fallbackSpecs=new Set(Array.from(buildersToAdd,spec=>{for(let[originalSpec,pinnedSpec]of fallbackPins)if(pinnedSpec===spec)return originalSpec;return spec}));output.warn("Could not install the Builder versions pinned by this Vercel CLI release. Retrying with versions allowed by your npm settings.");let resolvedSpecs=await untracedInstallBuilders(buildersDir,fallbackSpecs,dependencies,dependencies.buildUtilsVersion);for(let originalSpec of fallbackPins.keys())fallbackSpecs.has(originalSpec)&&resolvedSpecs.set(originalSpec,originalSpec);return resolvedSpecs}};if(!span)return install();let attributes={packages:Array.from(buildersToAdd).join(",")};return installReasons&&installReasons.size>0&&(attributes.reasons=Array.from(installReasons).map(([spec,reason])=>`${spec}=${reason}`).join(",")),pinnedSpecs&&pinnedSpecs.size>0&&(attributes.pinned="true",attributes.pinnedPackages=Array.from(pinnedSpecs.values()).join(",")),span.child("vc.installBuilders",attributes).trace(async s=>{try{return await install()}catch(err){throw s.setAttributes({error:(0,import_error_utils.isError)(err)?err.message:String(err)}),err}})}}}});var import_import_builders=__toESM(require_import_builders(),1);var static_builder_exports={};__export(static_builder_exports,{build:()=>build,diagnostics:()=>diagnostics,shouldServe:()=>shouldServe,version:()=>version});var import_static_builder=__toESM(require_static_builder(),1);var{version,build,shouldServe,diagnostics}=(0,import_static_builder.createStaticBuilder)(VERCEL_CONFIG_EXTENSIONS);var import_install_builders=__toESM(require_install_builders(),1);var import_execa=__toESM(require_execa(),1),binaryPkg=pkg_default,installBuilders=(0,import_install_builders.createInstallBuilders)({buildUtilsVersion:pkg_default.dependencies?.["@vercel/build-utils"],pinnedBuildUtilsVersion:binaryPkg.pinnedBuildUtilsVersion,strictBuilderPins:binaryPkg.strictBuilderPins,code,cmd,isCantParseJSONFile:value=>value instanceof CantParseJSONFile,output:output_manager_default,readJSONFile,run:import_execa.default});import{createRequire}from"module";var import_npm_package_arg=__toESM(require_npa(),1);function isManagedSpec(spec,managedNames){let parsed=(0,import_npm_package_arg.default)(spec);return!!parsed.name&&managedNames.has(parsed.name)&&parsed.type==="tag"&&(parsed.rawSpec===""||parsed.rawSpec==="latest")}function partitionBuilderSpecs(specs,managedNames){let managed=new Map,legacy=new Set;for(let spec of specs)isManagedSpec(spec,managedNames)?managed.set(spec,(0,import_npm_package_arg.default)(spec).name):legacy.add(spec);return{managed,legacy}}import{isAbsolute,join}from"path";var require_=createRequire(__filename);var builderPins=pkg_default.builders??{},managedBuilderNames=new Set(Object.keys(builderPins)),legacyImportBuilders=(0,import_import_builders.createImportBuilders)({builderPins,buildersDir:(cwd,vercelDir=VERCEL_DIR)=>join(cwd,vercelDir,"builders"),debug:message=>output_manager_default.debug(message),installBuilders,isNativeBinaryInstall:isManagedBuildersInstall,require:require_,staticBuilder:static_builder_exports,vercelDir:VERCEL_DIR}),vltImports,vltPreload,vltPreloadState="notStarted";function loadVltImports(){if(!vltImports){let imports=Promise.all([import("./vlt-builder-importer-RBUPAB6J.js"),loadEmbeddedBuilderIndex()]);vltImports=imports,imports.catch(()=>{vltImports===imports&&(vltImports=void 0)})}return vltImports}function getVltPreloadState(){return vltPreloadState}function preloadVltBuilderImports(){return vltPreload??=(async()=>{vltPreloadState="inFlight";try{await loadVltImports(),vltPreloadState="done"}catch(error){throw vltPreloadState="failed",error}})(),vltPreload}async function importBuilders(builderSpecs,cwd,span){let managedBuilders=isManagedBuildersInstall(),buildersDir=managedBuilders?process.env.VERCEL_BUILDERS_DIR:void 0;if(buildersDir&&!isAbsolute(buildersDir))throw new Error("VERCEL_BUILDERS_DIR must be an absolute path.");if(!managedBuilders)return legacyImportBuilders(builderSpecs,cwd,span);let{managed,legacy}=partitionBuilderSpecs(builderSpecs,managedBuilderNames);if(buildersDir&&managed.size>0&&span?.setAttributes({"builders.directory.enabled":"true","builders.directory.path":(0,import_import_builders.getBuildersDir)(cwd)}),output_manager_default.debug(`Builder import routing: vlt=[${[...managed].map(([spec])=>spec).join(", ")}], legacy=[${[...legacy].join(", ")}]`),managed.size===0)return legacyImportBuilders(legacy,cwd,span);let preloadState=vltPreloadState,loadStartedAt=performance.now(),[{createVltBuilderImporter},index]=await loadVltImports();span?.setAttributes({"builders.vlt.preloadState":preloadState,"builders.vlt.preloadAwaitMs":String(Math.round(performance.now()-loadStartedAt))});let vltImportBuilders=createVltBuilderImporter({loadIndex:async()=>index,loadGraphs:()=>loadEmbeddedBuilderGraphs(),require:require_,cacheRoot:buildersDir?(0,import_import_builders.getBuildersDir)(cwd):void 0,debug:message=>output_manager_default.debug(message)}),[vltBuilders,legacyBuilders]=await Promise.all([vltImportBuilders(managed,span),legacy.size?legacyImportBuilders(legacy,cwd,span):Promise.resolve(new Map)]);return new Map([...vltBuilders,...legacyBuilders])}export{require_npa,import_import_builders,getVltPreloadState,preloadVltBuilderImports,importBuilders};
@@ -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 parseTeamRefs(args){let refs=[];for(let arg of args)for(let piece of arg.split(",")){let ref=piece.trim();ref&&!refs.includes(ref)&&refs.push(ref)}return refs}function teamRefBody(ref){return ref.startsWith("team_")?{teamId:ref}:{teamSlug:ref}}export{parseTeamRefs,teamRefBody};
@@ -0,0 +1,11 @@
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{table}from"./chunk-773GOZIR.js";import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var import_strip_ansi=__toESM(require_strip_ansi(),1);function strlen(str){return(0,import_strip_ansi.default)(str).length}function formatTable(header,align,blocks){let nrCols=header.length,padding=[],out=`
8
+ `;for(let i=0;i<nrCols;i++)padding[i]=blocks.reduce((acc,block)=>{let maxLen=Math.max(...block.rows.map(row=>strlen(`${row[i]}`)));return Math.max(acc,Math.ceil(maxLen/8))},1);for(let block of blocks){block.name&&(out+=`${block.name}
9
+ `);let rows=[header.map(s=>import_chalk.default.dim(s))].concat(block.rows);if(rows.length>0){rows[0][0]=` ${rows[0][0]}`;for(let i=1;i<rows.length;i++){let row=rows[i].slice(0);row[0]=` ${row[0]}`;for(let j=0;j<nrCols;j++){let col=`${row[j]}`,al=align[j]||"l",repeat=padding[j]>1?padding[j]*8-strlen(col):0,pad=repeat>0?" ".repeat(repeat):"";rows[i][j]=al==="l"?col+pad:pad+col}}out+=table(rows,{align,hsep:4})}out+=`
10
+
11
+ `}return out.slice(0,-1)}export{strlen,formatTable};
@@ -0,0 +1,10 @@
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{getOrCreateDeploymentProtectionToken}from"./chunk-F2SWJEYV.js";import{ensureLink}from"./chunk-OQCMRU3J.js";import{toHost}from"./chunk-R6BEOVTU.js";import{curlCommand}from"./chunk-TPNOSQZ3.js";import{help}from"./chunk-KH6565YH.js";import{printError}from"./chunk-G4T7VBGN.js";import{TelemetryClient}from"./chunk-2PKEEQ5W.js";import{detectExplicitScope,getScope,introspectToken,isAppPrincipalEnabled,resolveAppFromToken}from"./chunk-B4UE4LVE.js";import{getTeams}from"./chunk-FGFLTLEA.js";import{getLinkedProject,getUser}from"./chunk-KNLGWGUE.js";import{getGlobalPathConfig}from"./chunk-BBKEP7RO.js";import{parseArguments}from"./chunk-VOCZ34ON.js";import{getFlagsSpecification}from"./chunk-AWMQGOS2.js";import{InvalidToken,isAPIError}from"./chunk-6VH56CX2.js";import{getCommandName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";import{spawn as spawn2}from"child_process";var requoteArgs=arg=>arg.includes(" ")?arg.includes('"')?`'${arg}'`:`"${arg}"`:arg;var CurlTelemetryClient=class extends TelemetryClient{trackCliArgumentPath(path){if(path){let value=path.startsWith("/")?"slash":"no-slash";this.trackCliArgument({arg:"path",value})}}trackCliOptionDeployment(deploymentId){if(deploymentId){let value=deploymentId.startsWith("http://")||deploymentId.startsWith("https://")?"url":deploymentId.startsWith("dpl_")?"dpl_":"no-prefix";this.trackCliOption({option:"deployment",value})}}trackCliOptionProtectionBypass(secret){secret&&this.trackCliOption({option:"protection-bypass",value:this.redactedValue})}trackCliFlagYes(yes){yes&&this.trackCliFlag("yes")}trackCliFlagTrace(trace2){trace2&&this.trackCliFlag("trace")}trackCliFlagJson(json){json&&this.trackCliFlag("json")}trackCliFlagYesOnProduction(value){value&&this.trackCliFlag("yes-on-production")}};var import_chalk=__toESM(require_source(),1),import_error_utils=__toESM(require_dist(),1);async function getDeploymentAccounts(client){if(detectExplicitScope(client))return client.config.currentTeam?[client.config.currentTeam]:[];if(isAppPrincipalEnabled())try{await getUser(client)}catch(err){if(!(err instanceof InvalidToken))throw err;let token=await introspectToken(client).catch(()=>null);if(!token||!resolveAppFromToken(token))throw err;return token.team?[token.team.id]:[]}let currentTeam=client.config.currentTeam;try{return(await getTeams(client)).filter(team=>!team.limited).map(team=>team.id).sort((a,b)=>+(b===currentTeam)-+(a===currentTeam))}catch(err){if(err instanceof InvalidToken&&currentTeam)return[currentTeam];throw err}}async function resolveDeployment(client,selector,accountId){let hostOrId=selector.includes(".")?toHost(selector):selector,endpoint=`/v13/deployments/${encodeURIComponent(hostOrId)}`,lookup=async accountId2=>{try{let deployment2=await client.fetch(endpoint,{useCurrentTeam:!1,...accountId2?{accountId:accountId2}:{},bailOn429:!0});return deployment2?{...deployment2,ownerId:deployment2.ownerId??deployment2.team?.id}:null}catch(err){if(!isAPIError(err)||err.status!==403&&err.status!==404)throw err;return output_manager_default.debug(`Deployment lookup failed for ${hostOrId}: ${err}`),null}};if(accountId||detectExplicitScope(client))return lookup(accountId??client.config.currentTeam);let deployment=await lookup();if(deployment?.projectId&&deployment.ownerId)return deployment;let accounts;try{accounts=await getDeploymentAccounts(client)}catch(err){if(deployment?.url)return deployment;throw err}for(let account of accounts){let scoped=await lookup(account);if(scoped?.projectId&&scoped.ownerId)return scoped;deployment??=scoped}return deployment}async function getDeploymentUrlById(client,deploymentIdOrUrl,accountId){try{if(deploymentIdOrUrl.startsWith("http://")||deploymentIdOrUrl.startsWith("https://"))try{return new URL(deploymentIdOrUrl).origin}catch{return output_manager_default.debug(`Invalid deployment URL provided: ${deploymentIdOrUrl}`),null}if(deploymentIdOrUrl.includes("vercel.app"))return`https://${deploymentIdOrUrl}`;let fullDeploymentId=deploymentIdOrUrl;fullDeploymentId.startsWith("dpl_")||(fullDeploymentId=`dpl_${deploymentIdOrUrl}`);let deployment=await resolveDeployment(client,fullDeploymentId,accountId);return!deployment||!deployment.url?null:`https://${deployment.url}`}catch(error){return output_manager_default.debug(`Failed to fetch deployment by ID: ${error}`),null}}function looksLikeHostname(path){let firstSegment=path.split("/")[0];return firstSegment.includes(".")&&!firstSegment.startsWith(".")}function orgFromOwner(id,slug=id){return{type:id.startsWith("team_")?"team":"user",id,slug}}var VC_STRING_FLAGS=new Set(["--deployment","--protection-bypass"]),VC_IGNORED_STRING_FLAGS=new Set(["--scope","--team"]),VC_BOOLEAN_FLAGS=new Set(["--yes","--help","--trace","--json"]);function flagName(arg){let eqIdx=arg.indexOf("=");return eqIdx===-1?arg:arg.slice(0,eqIdx)}function flagValue(args,index){let arg=args[index],eqIdx=arg.indexOf("=");if(eqIdx!==-1)return arg.slice(eqIdx+1);let next=args[index+1];return next&&!next.startsWith("-")?next:void 0}function getCurlLikeArgs(rawArgs,commandName){if(rawArgs[0]===commandName)return rawArgs.slice(1);let commandIndex=0;for(;commandIndex<rawArgs.length;){let arg=rawArgs[commandIndex];if(!VC_IGNORED_STRING_FLAGS.has(flagName(arg)))break;commandIndex++,!arg.includes("=")&&commandIndex<rawArgs.length&&commandIndex++}return rawArgs[commandIndex]===commandName?rawArgs.slice(commandIndex+1):[...rawArgs]}function parseCurlLikeArgs(rawArgs,commandName){let result={target:void 0,deployment:void 0,protectionBypass:void 0,yes:!1,help:!1,trace:!1,json:!1,toolFlags:[]},args=getCurlLikeArgs(rawArgs,commandName),separatorIndex=args.indexOf("--"),beforeSeparator=separatorIndex===-1?args:args.slice(0,separatorIndex),afterSeparator=separatorIndex===-1?[]:args.slice(separatorIndex+1);for(let i=0;i<beforeSeparator.length;i++){let arg=beforeSeparator[i],name=flagName(arg);if(VC_STRING_FLAGS.has(name)){let value=flagValue(beforeSeparator,i);!arg.includes("=")&&value!==void 0&&i++,name==="--deployment"?result.deployment=value:result.protectionBypass=value;continue}if(VC_IGNORED_STRING_FLAGS.has(name)){let value=flagValue(beforeSeparator,i);!arg.includes("=")&&value!==void 0&&i++;continue}if(VC_BOOLEAN_FLAGS.has(name)){name==="--yes"?result.yes=!0:name==="--trace"?result.trace=!0:name==="--json"?result.json=!0:result.help=!0;continue}if(!result.target&&name==="--url"){let value=flagValue(beforeSeparator,i);!arg.includes("=")&&value!==void 0&&i++,result.target=value;continue}!result.target&&!arg.startsWith("-")?result.target=arg:result.toolFlags.push(arg)}return result.toolFlags.push(...afterSeparator),result}function setupCurlLikeCommand(client,command,telemetryClient,options={}){let{print}=output_manager_default;if(options.allowFullUrl){let parsed=parseCurlLikeArgs(options.args??client.argv.slice(2),command.name);if(parsed.help)return print(help(command,{columns:client.stderr.columns})),0;let path2=parsed.target;if(telemetryClient.trackCliArgumentPath(path2),parsed.deployment&&telemetryClient.trackCliOptionDeployment(parsed.deployment),parsed.protectionBypass&&telemetryClient.trackCliOptionProtectionBypass(parsed.protectionBypass),!path2)return output_manager_default.error(`${getCommandName(`${command.name} <url|path>`)} requires a URL or API path (e.g., 'https://example.vercel.app/api/hello' or '/api/hello')`),print(help(command,{columns:client.stderr.columns})),2;let isFullUrl2=path2.startsWith("http://")||path2.startsWith("https://");return!isFullUrl2&&looksLikeHostname(path2)&&(isFullUrl2=!0),output_manager_default.debug(`${command.name} flags (${parsed.toolFlags.length} args): ${JSON.stringify(parsed.toolFlags)}`),{path:isFullUrl2&&!path2.startsWith("http")?`https://${path2}`:path2,isFullUrl:isFullUrl2,deploymentFlag:parsed.deployment,protectionBypassFlag:parsed.protectionBypass,toolFlags:parsed.toolFlags,yes:parsed.yes,trace:parsed.trace,json:parsed.json}}let parsedArgs=null,flagsSpecification=getFlagsSpecification(command.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return printError(err),2}let{flags}=parsedArgs;if(parsedArgs.flags["--help"])return print(help(command,{columns:client.stderr.columns})),0;parsedArgs.args[0]===command.name&&parsedArgs.args.shift();let separatorIndex=process.argv.indexOf("--"),path=parsedArgs.args[0];telemetryClient.trackCliArgumentPath(path);let deploymentFlag=flags["--deployment"];deploymentFlag&&telemetryClient.trackCliOptionDeployment(deploymentFlag);let protectionBypassFlag=flags["--protection-bypass"];if(protectionBypassFlag&&telemetryClient.trackCliOptionProtectionBypass(protectionBypassFlag),!path||path==="--"||path.startsWith("-"))return options.allowFullUrl?output_manager_default.error(`${getCommandName(`${command.name} <url|path>`)} requires a URL or API path (e.g., 'https://example.vercel.app/api/hello' or '/api/hello')`):output_manager_default.error(`${getCommandName(`${command.name} <path>`)} requires an API path (e.g., '/' or '/api/hello' or 'api/hello')`),print(help(command,{columns:client.stderr.columns})),1;let isFullUrl=path.startsWith("http://")||path.startsWith("https://");if(!isFullUrl&&looksLikeHostname(path)&&(isFullUrl=!0),isFullUrl&&!options.allowFullUrl)return output_manager_default.error("The <path> argument must be a relative API path (e.g., '/' or '/api/hello'), not a full URL."),output_manager_default.print("To target a specific deployment within the currently linked project, use the --deployment <id|url> flag."),print(help(command,{columns:client.stderr.columns})),1;let toolFlags=separatorIndex!==-1?process.argv.slice(separatorIndex+1):[];return output_manager_default.debug(`${command.name} flags (${toolFlags.length} args): ${JSON.stringify(toolFlags)}`),{path:isFullUrl&&!path.startsWith("http")?`https://${path}`:path,isFullUrl,deploymentFlag,protectionBypassFlag,toolFlags,yes:!!flags["--yes"],trace:!!flags["--trace"],json:!!flags["--json"]}}async function resolveProjectFromUrl(client,url){let host=toHost(url);try{let deployment=await resolveDeployment(client,host);if(deployment){let link=await linkFromDeployment(client,deployment);if(link)return link}}catch(err){if(output_manager_default.debug(`Deployment lookup failed for ${host}: ${err}`),isAPIError(err)&&err.status===429)return null}try{let aliasUrl=`/now/aliases/${encodeURIComponent(host)}`;try{let alias=await client.fetch(aliasUrl,{useCurrentTeam:!1,...detectExplicitScope(client)?{accountId:client.config.currentTeam}:{}});if(alias.projectId&&alias.ownerId)return{status:"linked",project:await client.fetch(`/v9/projects/${encodeURIComponent(alias.projectId)}`,{accountId:alias.ownerId}),org:orgFromOwner(alias.ownerId)}}catch(err){output_manager_default.debug(`User alias lookup failed for ${host}: ${err}`)}for(let accountId of await getDeploymentAccounts(client))try{let alias=await client.fetch(aliasUrl,{accountId}),projectId=alias.projectId,ownerId=alias.ownerId||accountId;if(projectId)return{status:"linked",project:await client.fetch(`/v9/projects/${encodeURIComponent(projectId)}`,{accountId:ownerId}),org:orgFromOwner(ownerId)}}catch(err){output_manager_default.debug(`Alias lookup failed for ${host} in ${accountId}: ${err}`)}}catch(err){output_manager_default.debug(`Team lookup failed for ${host}: ${err}`)}return null}async function getFullUrlAndToken(client,fullUrl,protectionBypassFlag){if(protectionBypassFlag)return{fullUrl,deploymentProtectionToken:protectionBypassFlag,link:null};if(process.env.VERCEL_AUTOMATION_BYPASS_SECRET)return output_manager_default.debug("Using protection bypass secret from environment variable"),{fullUrl,deploymentProtectionToken:process.env.VERCEL_AUTOMATION_BYPASS_SECRET,link:null};let link=await resolveProjectFromUrl(client,fullUrl),deploymentProtectionToken=null;if(link)try{deploymentProtectionToken=await getOrCreateDeploymentProtectionToken(client,link)}catch(err){output_manager_default.debug(`Failed to get deployment protection bypass token: ${err}`)}return{fullUrl,deploymentProtectionToken,link}}async function linkFromDeployment(client,deployment){return!deployment.projectId||!deployment.ownerId?null:{status:"linked",project:await client.fetch(`/v9/projects/${encodeURIComponent(deployment.projectId)}`,{accountId:deployment.ownerId}),org:orgFromOwner(deployment.ownerId)}}async function resolveTargetProject(client,deployment,deploymentFlag){try{let link=await linkFromDeployment(client,deployment);return link||output_manager_default.warn(`Deployment "${deploymentFlag}" is missing project metadata; proceeding without an automatic protection bypass token.`),link}catch(err){return output_manager_default.debug(`Failed to resolve deployment project: ${err}`),output_manager_default.warn(`Failed to load project for deployment "${deploymentFlag}"; proceeding without an automatic protection bypass token.`),null}}async function tryGetDeployment(client,selector){try{return await resolveDeployment(client,selector)}catch(err){return output_manager_default.debug(`Failed to resolve deployment: ${err}`),null}}async function tryLinkFromSelector(client,selector){try{let deployment=await resolveDeployment(client,selector);return deployment?await linkFromDeployment(client,deployment):null}catch(err){return output_manager_default.debug(`Failed to resolve trace project context: ${err}`),null}}async function getLinkedProjectOrNull(client){try{let linked=await getLinkedProject(client,{cwd:client.cwd});return linked.status==="linked"?linked:null}catch(err){return output_manager_default.debug(`Failed to load linked project: ${err}`),null}}function hasAutomationBypassToken(project){return Object.values(project.protectionBypass??{}).some(token=>token.scope==="automation-bypass")}async function getDeploymentUrlAndToken(client,commandName,path,options){let{deploymentFlag,protectionBypassFlag,autoConfirm,resolveProjectForTrace}=options,suppliedProtectionBypass=deploymentFlag?protectionBypassFlag??(process.env.VERCEL_AUTOMATION_BYPASS_SECRET||void 0):protectionBypassFlag,link=null,createProtectionBypassIfMissing=!deploymentFlag,baseUrl;if(deploymentFlag){let requestedBaseUrl=deploymentFlag.startsWith("http://")||deploymentFlag.startsWith("https://")||deploymentFlag.includes("vercel.app")?await getDeploymentUrlById(client,deploymentFlag):null,deploymentSelector=deploymentFlag.includes(".")||deploymentFlag.startsWith("dpl_")?deploymentFlag:`dpl_${deploymentFlag}`;if(suppliedProtectionBypass!==void 0){if(baseUrl=requestedBaseUrl??await getDeploymentUrlById(client,deploymentFlag)??"",!baseUrl)return output_manager_default.error(`No deployment found for ID "${deploymentFlag}"`),1;resolveProjectForTrace&&(link=await tryLinkFromSelector(client,deploymentSelector)??await getLinkedProjectOrNull(client))}else{let deployment=await tryGetDeployment(client,deploymentSelector);if(baseUrl=requestedBaseUrl??(deployment?.url?`https://${deployment.url}`:""),!baseUrl)return output_manager_default.error(`No deployment found for ID "${deploymentFlag}"`),1;deployment?(link=await resolveTargetProject(client,deployment,deploymentFlag),link&&!hasAutomationBypassToken(link.project)&&(createProtectionBypassIfMissing=(await getLinkedProjectOrNull(client))?.project.id===link.project.id)):output_manager_default.warn(`Could not resolve project information for deployment "${deploymentFlag}"; proceeding without an automatic protection bypass token.`)}}else{try{await getScope(client)}catch(err){if((0,import_error_utils.isErrnoException)(err)&&(err.code==="NOT_AUTHORIZED"||err.code==="TEAM_DELETED"))return output_manager_default.error(err.message),1;throw err}let ensuredLink;try{ensuredLink=await ensureLink(commandName,client,client.cwd,{autoConfirm})}catch(err){if((0,import_error_utils.isErrnoException)(err)&&err.code==="NOT_AUTHORIZED")return output_manager_default.error(err.message),1;throw err}if(typeof ensuredLink=="number")return ensuredLink;link=ensuredLink;let{project}=ensuredLink;if(!project.targets&&!project.latestDeployments){let linkedProject=await getLinkedProject(client,{cwd:client.cwd});if(linkedProject.status!=="linked")return output_manager_default.error("This command requires a linked project. Please run:"),output_manager_default.print(" vercel link"),1;if(!linkedProject.project||!linkedProject.org)return output_manager_default.error("Failed to get project information"),1;project=linkedProject.project}let preferredAlias=project.targets?.production?.alias?.[0],backupAlias=project.latestDeployments?.[0]?.url,target=preferredAlias||backupAlias;if(!target)throw new Error("No deployment URL found for the project");baseUrl=`https://${target}`}let fullUrl=`${baseUrl}${path.startsWith("/")?path:`/${path}`}`;output_manager_default.debug(`${import_chalk.default.cyan("Target URL:")} ${import_chalk.default.bold(fullUrl)}`);let deploymentProtectionToken=suppliedProtectionBypass??null;if(suppliedProtectionBypass===void 0&&link?.project.id)try{deploymentProtectionToken=await getOrCreateDeploymentProtectionToken(client,link,{createIfMissing:createProtectionBypassIfMissing})}catch(err){return output_manager_default.error(`Failed to get deployment protection bypass token: ${err instanceof Error?err.message:String(err)}`),1}return{fullUrl,deploymentProtectionToken,link}}var import_error_utils2=__toESM(require_dist(),1);import{spawn}from"child_process";import{tmpdir}from"os";import{join as join2}from"path";import{mkdtemp,readFile as readFile2,rm}from"fs/promises";async function confirmProduction(client,{deploymentTarget,yes,isTTY}){return deploymentTarget!=="production"||yes?"proceed":isTTY?await client.input.confirm("You are about to capture a trace against a production deployment. Continue?",!1)?"proceed":"declined":(output_manager_default.error("Use --yes to capture traces on production from non-interactive contexts."),"non-tty-no-yes")}import{createHash}from"crypto";import{chmod,mkdir,readFile,unlink,writeFile}from"fs/promises";import{dirname,join}from"path";var FALLBACK_TTL_MS=5*60*1e3,EXPIRY_BUFFER_MS=30*1e3,CACHE_SCHEMA_VERSION=1;function resolveCacheDir(override){return override||join(getGlobalPathConfig(),"cache","traces")}function cacheFilename(teamId,host){let key=`${teamId??""}:${host}`;return`${createHash("sha256").update(key).digest("hex")}.json`}function cachePath(cacheDir,teamId,host){return join(cacheDir,cacheFilename(teamId,host))}async function readCache(path){let raw;try{raw=await readFile(path,"utf8")}catch{return null}try{let parsed=JSON.parse(raw);return!parsed||typeof parsed.token!="string"||typeof parsed.expiresAt!="number"||parsed.schemaVersion!==CACHE_SCHEMA_VERSION?null:parsed}catch{return output_manager_default.debug(`Trace cookie cache file is corrupt at ${path}; re-issuing.`),null}}async function writeCache(path,entry){await mkdir(dirname(path),{recursive:!0}),await writeFile(path,JSON.stringify(entry),{mode:384}),await chmod(path,384)}async function issueToken(client,{teamId,projectId,hostname}){let body=JSON.stringify({projectId,hostname}),response=await client.fetch("/v1/projects/traces/session",{method:"POST",body,headers:{"Content-Type":"application/json"},accountId:teamId});if(!response?.token)throw new Error("Trace session response is missing a token");let expiresAt=typeof response.expiresAt=="number"?response.expiresAt:Date.now()+FALLBACK_TTL_MS;return{token:response.token,expiresAt}}async function getTraceSessionToken({client,teamId,projectId,host,evictedToken,cacheDir}){let dir=resolveCacheDir(cacheDir),hostname=toHost(host),path=cachePath(dir,teamId,hostname),cached=await readCache(path);if(cached&&evictedToken&&cached.token===evictedToken)await unlink(path).catch(()=>{});else if(cached&&Date.now()<cached.expiresAt-EXPIRY_BUFFER_MS)return{token:cached.token,expiresAt:cached.expiresAt,fromCache:!0};let issued=await issueToken(client,{teamId,projectId,hostname});try{await writeCache(path,{token:issued.token,expiresAt:issued.expiresAt,schemaVersion:CACHE_SCHEMA_VERSION})}catch(err){output_manager_default.debug(`Failed to write trace cookie cache: ${err}`)}return{token:issued.token,expiresAt:issued.expiresAt,fromCache:!1}}var TRACE_COOKIE_NAME="_vercel_tracing",SESSION_COOKIE_NAME="_vercel_session";async function lookupDeployment(client,fullUrl,accountId){let deployment=await resolveDeployment(client,fullUrl,accountId);if(!deployment)throw new Error("Deployment not found");return deployment}function resolveTeamId(link,deployment){if(link?.org.type==="team")return link.org.id;if(deployment.ownerId?.startsWith("team_"))return deployment.ownerId}function extractVercelId(headerDump){let lines=headerDump.split(/\r?\n/),lastValue;for(let line of lines){let idx=line.indexOf(":");if(idx===-1)continue;line.slice(0,idx).trim().toLowerCase()==="x-vercel-id"&&(lastValue=line.slice(idx+1).trim())}if(!lastValue)return;let sepIdx=lastValue.lastIndexOf("::");return sepIdx===-1?lastValue:lastValue.slice(sepIdx+2)}function extractFinalStatus(headerDump){let lines=headerDump.split(/\r?\n/),lastStatus;for(let line of lines){let match=line.match(/^HTTP\/[\d.]+\s+(\d{3})/);match&&(lastStatus=Number(match[1]))}return lastStatus}async function runCurlAndCaptureHeaders(curlFlags,json){let tmpDir=await mkdtemp(join2(tmpdir(),"vc-curl-trace-")),headerFile=join2(tmpDir,"headers"),flags=["--dump-header",headerFile,...curlFlags];try{let{exitCode,capturedBody}=await new Promise(resolve=>{let child=spawn("curl",flags,{stdio:json?["inherit","pipe","inherit"]:"inherit",shell:!1}),buf="";json&&child.stdout&&(child.stdout.setEncoding("utf8"),child.stdout.on("data",chunk=>{buf+=chunk})),child.on("error",err=>{err.code==="ENOENT"?output_manager_default.error("curl command not found. Please install curl."):output_manager_default.error(`Failed to execute curl: ${err.message}`),resolve({exitCode:1,capturedBody:buf})}),child.on("close",code=>{resolve({exitCode:code??1,capturedBody:buf})})}),headerDump="";try{headerDump=await readFile2(headerFile,"utf8")}catch(err){output_manager_default.debug(`Failed to read curl header dump: ${err}`)}return{exitCode,headerDump,capturedBody}}finally{await rm(tmpDir,{recursive:!0,force:!0}).catch(()=>{})}}async function trace(client,{fullUrl,link,curlFlags,json,yes,telemetry}){telemetry.trackCliFlagTrace(!0),json&&telemetry.trackCliFlagJson(!0);let accountId=link?.org.id,deployment;try{deployment=await lookupDeployment(client,fullUrl,accountId)}catch(err){return output_manager_default.error(`Failed to look up deployment for tracing: ${err instanceof Error?err.message:String(err)}`),1}let projectId=link?.project.id??deployment.projectId;if(!projectId)return output_manager_default.error("Could not resolve project for trace session. Run `vercel link` and retry."),1;let teamId=resolveTeamId(link,deployment),userId;try{userId=client.authConfig.userId??(await getUser(client)).id}catch(err){return output_manager_default.error(`Failed to resolve user for trace session: ${(0,import_error_utils2.errorToString)(err)}`),1}let deploymentTarget=deployment.target==="production"?"production":"preview",confirmation=await confirmProduction(client,{deploymentTarget,yes,isTTY:!!client.stdin.isTTY});if(confirmation==="non-tty-no-yes")return 1;if(confirmation==="declined")return output_manager_default.log("Trace cancelled."),0;deploymentTarget==="production"&&yes&&telemetry.trackCliFlagYesOnProduction(!0);let session;try{session=await getTraceSessionToken({client,teamId,projectId,host:fullUrl})}catch(err){return output_manager_default.error(`Failed to acquire trace session: ${err instanceof Error?err.message:String(err)}`),1}let{exitCode,headerDump,capturedBody}=await runCurlWithCookie(session.token,userId,curlFlags,json);if(session.fromCache&&extractFinalStatus(headerDump)===401&&exitCode===0){output_manager_default.debug("Trace cookie returned 401; evicting cache and retrying.");let refreshed;try{refreshed=await getTraceSessionToken({client,teamId,projectId,host:fullUrl,evictedToken:session.token})}catch(err){return output_manager_default.error(`Failed to refresh trace session after 401: ${err instanceof Error?err.message:String(err)}`),1}({exitCode,headerDump,capturedBody}=await runCurlWithCookie(refreshed.token,userId,curlFlags,json))}let requestId=extractVercelId(headerDump);return json?(client.stdout.write(`${JSON.stringify({response:capturedBody,requestId:requestId??null},null,2)}
8
+ `),requestId?exitCode:exitCode===0?1:exitCode):requestId?(client.stderr.write(`
9
+ Run \`vercel traces inspect ${requestId}\` to fetch the trace.
10
+ `),exitCode):(output_manager_default.error("Trace cookie was set but the response did not include an x-vercel-id header."),exitCode===0?1:exitCode)}async function runCurlWithCookie(token,userId,curlFlags,json){let flagsWithCookie=["--header",`Cookie: ${TRACE_COOKIE_NAME}=${token}; ${SESSION_COOKIE_NAME}=${userId}`,...curlFlags];return output_manager_default.debug(`Executing: curl ${flagsWithCookie.map(requoteArgs).join(" ")}`),runCurlAndCaptureHeaders(flagsWithCookie,json)}async function curl(client){return runCurl(client,{})}async function runCurl(client,{forceTrace=!1,args}){let telemetryClient=new CurlTelemetryClient({opts:{store:client.telemetryEventStore}}),setup=setupCurlLikeCommand(client,curlCommand,telemetryClient,{allowFullUrl:!0,args});if(typeof setup=="number")return setup;let{path,isFullUrl,deploymentFlag,protectionBypassFlag,toolFlags,json:jsonFlag}=setup,traceFlag=forceTrace||setup.trace,result=isFullUrl?await getFullUrlAndToken(client,path,protectionBypassFlag):await getDeploymentUrlAndToken(client,"curl",path,{deploymentFlag,protectionBypassFlag,autoConfirm:setup.yes,resolveProjectForTrace:traceFlag});if(typeof result=="number")return result;let{fullUrl,deploymentProtectionToken}=result,curlFlags=[...toolFlags];return deploymentProtectionToken&&curlFlags.unshift("--header",`x-vercel-protection-bypass: ${deploymentProtectionToken}`),curlFlags.unshift("--url",fullUrl),traceFlag?trace(client,{fullUrl,link:result.link??null,curlFlags,json:jsonFlag,yes:setup.yes,telemetry:telemetryClient}):(output_manager_default.debug(`Executing: curl ${curlFlags.map(requoteArgs).join(" ")}`),new Promise(resolve=>{let curlProcess=spawn2("curl",curlFlags,{stdio:"inherit",shell:!1});curlProcess.on("error",err=>{"code"in err&&err.code==="ENOENT"?(output_manager_default.error("curl command not found. Please install curl."),resolve(1)):(output_manager_default.error(`Failed to execute curl: ${err.message}`),resolve(1))}),curlProcess.on("close",code=>{resolve(code??1)})}))}export{requoteArgs,setupCurlLikeCommand,getDeploymentUrlAndToken,curl,runCurl};
@@ -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{tracesConfigCommand}from"./chunk-GVTXA6HG.js";import{deploymentOption,nextCursorOption,projectOption,protectionBypassOption,sinceOption,untilOption,yesOption}from"./chunk-AWMQGOS2.js";import{packageName}from"./chunk-JESNVRVR.js";var spanQueryOptions=[{...projectOption,shorthand:"p",description:"Filter spans to one project (default: all team projects)"},{name:"environment",shorthand:"e",type:String,argument:"ENVIRONMENT",deprecated:!1,description:"Environment: production or preview (case-insensitive)"},{name:"service",shorthand:null,type:String,deprecated:!1,description:"Filter by service name"},{name:"name",shorthand:null,type:String,deprecated:!1,description:"Filter by span name"},{name:"kind",shorthand:null,type:String,deprecated:!1,description:"Filter by span kind: unspecified (0), internal (1), server (2), client (3), producer (4), consumer (5)"},{name:"status",shorthand:null,type:String,deprecated:!1,description:"Status: error, ok, or unset (case-insensitive)"},{...deploymentOption,description:"Filter by deployment ID"},{name:"deployment-id",shorthand:null,type:String,deprecated:!0},{name:"request-id",shorthand:null,type:String,deprecated:!1,description:"Filter by request ID. Some IDs return 404 in traces inspect. Reuse --scope and --project. See traces inspect --help."},{name:"trace-id",shorthand:null,type:String,deprecated:!1,description:"Filter by trace ID"},{name:"span-id",shorthand:null,type:String,deprecated:!1,description:"Filter by span ID"},{name:"root",shorthand:null,type:Boolean,deprecated:!1,description:"Show root spans only"},{...sinceOption,description:`${sinceOption.description} (default: 1h ago)`},untilOption];var requestIdLookupHelp={title:"Request-ID lookup",body:["A request ID in search results does not guarantee traces inspect can retrieve the trace. Lookup requires a matching root span in the same project within 30 minutes after the request-ID timestamp.","","If no matching root is found, lookup returns 404. Use the same --scope and --project for search and inspect."]},getSubcommand={name:"inspect",aliases:["get"],default:!0,description:"Fetch a captured trace by trace ID or request ID",helpSections:[{title:"Trace-ID lookup",body:["A 32-character hexadecimal ID selects trace-ID lookup. Other IDs select request-ID lookup.","Trace-ID lookup retrieves the trace directly within the trace retention window. Use the same --scope and --project as search."]},requestIdLookupHelp],arguments:[{name:"id",required:!0}],options:[{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Print the raw trace JSON to stdout"},{name:"project",shorthand:null,type:String,argument:"NAME|ID",deprecated:!1,description:"Project name or id to fetch the trace from (overrides the linked project)."},{name:"open",shorthand:null,type:Boolean,deprecated:!1,description:"Open the trace in the Vercel Dashboard instead of printing it."},{name:"view",shorthand:null,type:String,argument:"timeline|tree|waterfall",deprecated:!1,description:"Dashboard view to open (default: timeline). Only valid with --open."}],examples:[{name:"Fetch a trace by trace ID",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00`},{name:"Fetch a trace by request ID",value:`${packageName} traces inspect qb46r-1790847620933-1145d2891a3e`},{name:"Print the raw trace JSON",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --json`},{name:"Fetch a trace without the default inspect subcommand",value:`${packageName} traces e5c0d1efb3904155472b01692c7f2d00`},{name:"Fetch a trace from a specific team and project",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --scope my-team --project my-app`},{name:"Open the trace in the Vercel Dashboard",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --open`},{name:"Open the trace in the Vercel Dashboard with the waterfall view",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --open --view waterfall`}]},createSubcommand={name:"create",aliases:[],description:"Capture a session trace for a request (alias for `vercel curl --trace`).",arguments:[{name:"path",required:!0}],options:[deploymentOption,protectionBypassOption,{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Emit { response, requestId } as JSON on stdout"},{...yesOption,description:"Skip the production confirmation prompt (e.g. in non-interactive mode)"}],examples:[{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Target a specific deployment",value:`${packageName} traces create /api/status --deployment https://your-project-abc123.vercel.app`},{name:"Pass curl flags after the separator",value:`${packageName} traces create /api/test -- --request POST --data '{"name": "John"}'`}]},searchSubcommand={name:"search",aliases:[],description:"Search team spans. Use --project to filter one project. Results are newest first. Duration filters do not sort results.",helpSections:[{title:"Table columns",body:["Available: span.startTime, span.duration, span.name, span.status.code, service.name, environment, request.id, trace.id, span.id, parent.id, span.kind","Default: all except environment, request.id, and span.kind."]},{title:"KQL filters",body:["Fields: project.id, environment, service.name, deployment.id, request.id, user.id, session.id","Span fields: span.name, span.kind, span.id, parent.id, span.isRoot, span.status.code, span.duration","Trace fields: trace.id, trace.state","","Other fields search span attributes first, then resource attributes.","","span.duration uses milliseconds.","span.kind uses the numeric values shown under --kind.","span.status.code uses Error, Ok, or Unset.","Use field:value filters. Plain text search is not supported.","Use NOT to exclude values. End a value with * to match a prefix.","Wrap values with spaces in double quotes. Keep the full query in single quotes."]},{title:"Paging",body:["When more spans match, a Next page command is printed on stderr.","--json prints one span line per record and ends with a summary line; --non-interactive implies --json.","--next continues from the summary's pagination.next value. It keeps the original team, project, filters, and time window, so it can't be combined with them. --limit can change."]}],arguments:[],options:[...spanQueryOptions,{name:"limit",shorthand:"n",type:Number,deprecated:!1,description:"Maximum number of spans (default: 100)"},{name:"query",shorthand:"q",type:String,deprecated:!1,description:"Filter spans using KQL"},{name:"columns",shorthand:null,argument:"LIST",type:String,deprecated:!1,description:"Columns to show, in order. Separate names with commas. Cannot be used with --json or --non-interactive."},{...nextCursorOption,description:"Continue a previous search from its summary's next value"},{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Output JSON Lines ending with a summary line"}],examples:[{name:"Find production errors for one service",value:`${packageName} traces search --environment production --service checkout-api --status error --since 1h`},{name:"Use KQL and output JSON Lines",value:`${packageName} traces search --query 'http.route:"/api/checkout"' --kind server --json`},{name:"Exclude span names starting with app/lib/fetch-api",value:`${packageName} traces search --query 'NOT span.name:app/lib/fetch-api*'`},{name:"Exclude exact span names",value:`${packageName} traces search --query 'NOT span.name:("GET /screenshot/v2" OR "middleware GET")'`},{name:"Find spans longer than 2 seconds",value:`${packageName} traces search --query 'span.duration > 2000' --columns span.startTime,span.duration,span.name,span.kind,span.status.code`},{name:"Continue from the summary's next value",value:`${packageName} traces search --next <CURSOR> --json`}]},tracesCommand={name:"traces",aliases:[],description:"Fetch project traces and search spans across a Vercel team.",arguments:[{name:"id",required:!1}],subcommands:[getSubcommand,searchSubcommand,createSubcommand,tracesConfigCommand],options:[],examples:[{name:"Fetch a trace by trace ID",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00`},{name:"Fetch a trace by request ID",value:`${packageName} traces inspect qb46r-1790847620933-1145d2891a3e`},{name:"Print the raw trace JSON",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --json`},{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Search recent spans",value:`${packageName} traces search --status error`},{name:"List the trace sampling rules for a project",value:`${packageName} traces config ls`}]};export{getSubcommand,createSubcommand,searchSubcommand,tracesCommand};
@@ -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-BZENIQ7N.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,23 @@
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{esm_default,onExit,require_cli_width,require_lib,require_wrap_ansi}from"./chunk-SACGQMVQ.js";import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{require_cli_spinners}from"./chunk-2GHZGOWT.js";import{require_ansi_escapes}from"./chunk-YHPPP3SF.js";import{require_supports_color}from"./chunk-ISWW3DKF.js";import{require_ansi_styles}from"./chunk-BRQUZ5NC.js";import{__commonJS,__toESM}from"./chunk-BZENIQ7N.js";var require_util=__commonJS({"../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js"(exports,module){"use strict";var stringReplaceAll=(string,substring,replacer)=>{let index=string.indexOf(substring);if(index===-1)return string;let substringLength=substring.length,endIndex=0,returnValue="";do returnValue+=string.substr(endIndex,index-endIndex)+substring+replacer,endIndex=index+substringLength,index=string.indexOf(substring,endIndex);while(index!==-1);return returnValue+=string.substr(endIndex),returnValue},stringEncaseCRLFWithFirstIndex=(string,prefix,postfix,index)=>{let endIndex=0,returnValue="";do{let gotCR=string[index-1]==="\r";returnValue+=string.substr(endIndex,(gotCR?index-1:index)-endIndex)+prefix+(gotCR?`\r
8
+ `:`
9
+ `)+postfix,endIndex=index+1,index=string.indexOf(`
10
+ `,endIndex)}while(index!==-1);return returnValue+=string.substr(endIndex),returnValue};module.exports={stringReplaceAll,stringEncaseCRLFWithFirstIndex}}});var require_templates=__commonJS({"../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js"(exports,module){"use strict";var TEMPLATE_REGEX=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,STYLE_REGEX=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,STRING_REGEX=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,ESCAPE_REGEX=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,ESCAPES=new Map([["n",`
11
+ `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function unescape(c){let u=c[0]==="u",bracket=c[1]==="{";return u&&!bracket&&c.length===5||c[0]==="x"&&c.length===3?String.fromCharCode(parseInt(c.slice(1),16)):u&&bracket?String.fromCodePoint(parseInt(c.slice(2,-1),16)):ESCAPES.get(c)||c}function parseArguments(name,arguments_){let results=[],chunks=arguments_.trim().split(/\s*,\s*/g),matches;for(let chunk of chunks){let number=Number(chunk);if(!Number.isNaN(number))results.push(number);else if(matches=chunk.match(STRING_REGEX))results.push(matches[2].replace(ESCAPE_REGEX,(m,escape,character)=>escape?unescape(escape):character));else throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`)}return results}function parseStyle(style){STYLE_REGEX.lastIndex=0;let results=[],matches;for(;(matches=STYLE_REGEX.exec(style))!==null;){let name=matches[1];if(matches[2]){let args=parseArguments(name,matches[2]);results.push([name].concat(args))}else results.push([name])}return results}function buildStyle(chalk3,styles){let enabled={};for(let layer of styles)for(let style of layer.styles)enabled[style[0]]=layer.inverse?null:style.slice(1);let current=chalk3;for(let[styleName,styles2]of Object.entries(enabled))if(Array.isArray(styles2)){if(!(styleName in current))throw new Error(`Unknown Chalk style: ${styleName}`);current=styles2.length>0?current[styleName](...styles2):current[styleName]}return current}module.exports=(chalk3,temporary)=>{let styles=[],chunks=[],chunk=[];if(temporary.replace(TEMPLATE_REGEX,(m,escapeCharacter,inverse,style,close,character)=>{if(escapeCharacter)chunk.push(unescape(escapeCharacter));else if(style){let string=chunk.join("");chunk=[],chunks.push(styles.length===0?string:buildStyle(chalk3,styles)(string)),styles.push({inverse,styles:parseStyle(style)})}else if(close){if(styles.length===0)throw new Error("Found extraneous } in Chalk template literal");chunks.push(buildStyle(chalk3,styles)(chunk.join(""))),chunk=[],styles.pop()}else chunk.push(character)}),chunks.push(chunk.join("")),styles.length>0){let errMessage=`Chalk template literal is missing ${styles.length} closing bracket${styles.length===1?"":"s"} (\`}\`)`;throw new Error(errMessage)}return chunks.join("")}}});var require_source=__commonJS({"../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js"(exports,module){"use strict";var ansiStyles=require_ansi_styles(),{stdout:stdoutColor,stderr:stderrColor}=require_supports_color(),{stringReplaceAll,stringEncaseCRLFWithFirstIndex}=require_util(),{isArray}=Array,levelMapping=["ansi","ansi","ansi256","ansi16m"],styles=Object.create(null),applyOptions=(object,options={})=>{if(options.level&&!(Number.isInteger(options.level)&&options.level>=0&&options.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let colorLevel=stdoutColor?stdoutColor.level:0;object.level=options.level===void 0?colorLevel:options.level},ChalkClass=class{constructor(options){return chalkFactory(options)}},chalkFactory=options=>{let chalk4={};return applyOptions(chalk4,options),chalk4.template=(...arguments_)=>chalkTag(chalk4.template,...arguments_),Object.setPrototypeOf(chalk4,Chalk.prototype),Object.setPrototypeOf(chalk4.template,chalk4),chalk4.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},chalk4.template.Instance=ChalkClass,chalk4.template};function Chalk(options){return chalkFactory(options)}for(let[styleName,style]of Object.entries(ansiStyles))styles[styleName]={get(){let builder=createBuilder(this,createStyler(style.open,style.close,this._styler),this._isEmpty);return Object.defineProperty(this,styleName,{value:builder}),builder}};styles.visible={get(){let builder=createBuilder(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:builder}),builder}};var usedModels=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let model of usedModels)styles[model]={get(){let{level}=this;return function(...arguments_){let styler=createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_),ansiStyles.color.close,this._styler);return createBuilder(this,styler,this._isEmpty)}}};for(let model of usedModels){let bgModel="bg"+model[0].toUpperCase()+model.slice(1);styles[bgModel]={get(){let{level}=this;return function(...arguments_){let styler=createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_),ansiStyles.bgColor.close,this._styler);return createBuilder(this,styler,this._isEmpty)}}}}var proto=Object.defineProperties(()=>{},{...styles,level:{enumerable:!0,get(){return this._generator.level},set(level){this._generator.level=level}}}),createStyler=(open,close,parent)=>{let openAll,closeAll;return parent===void 0?(openAll=open,closeAll=close):(openAll=parent.openAll+open,closeAll=close+parent.closeAll),{open,close,openAll,closeAll,parent}},createBuilder=(self,_styler,_isEmpty)=>{let builder=(...arguments_)=>isArray(arguments_[0])&&isArray(arguments_[0].raw)?applyStyle(builder,chalkTag(builder,...arguments_)):applyStyle(builder,arguments_.length===1?""+arguments_[0]:arguments_.join(" "));return Object.setPrototypeOf(builder,proto),builder._generator=self,builder._styler=_styler,builder._isEmpty=_isEmpty,builder},applyStyle=(self,string)=>{if(self.level<=0||!string)return self._isEmpty?"":string;let styler=self._styler;if(styler===void 0)return string;let{openAll,closeAll}=styler;if(string.indexOf("\x1B")!==-1)for(;styler!==void 0;)string=stringReplaceAll(string,styler.close,styler.open),styler=styler.parent;let lfIndex=string.indexOf(`
12
+ `);return lfIndex!==-1&&(string=stringEncaseCRLFWithFirstIndex(string,closeAll,openAll,lfIndex)),openAll+string+closeAll},template,chalkTag=(chalk4,...strings)=>{let[firstString]=strings;if(!isArray(firstString)||!isArray(firstString.raw))return strings.join(" ");let arguments_=strings.slice(1),parts=[firstString.raw[0]];for(let i=1;i<firstString.length;i++)parts.push(String(arguments_[i-1]).replace(/[{}\\]/g,"\\$&"),String(firstString.raw[i]));return template===void 0&&(template=require_templates()),template(chalk4,parts.join(""))};Object.defineProperties(Chalk.prototype,styles);var chalk3=Chalk();chalk3.supportsColor=stdoutColor;chalk3.stderr=Chalk({level:stderrColor?stderrColor.level:0});chalk3.stderr.supportsColor=stderrColor;module.exports=chalk3}});var isUpKey=key=>key.name==="up"||key.name==="k"||key.ctrl&&key.name==="p",isDownKey=key=>key.name==="down"||key.name==="j"||key.ctrl&&key.name==="n",isSpaceKey=key=>key.name==="space",isBackspaceKey=key=>key.name==="backspace",isNumberKey=key=>"123456789".includes(key.name),isEnterKey=key=>key.name==="enter"||key.name==="return";var CancelPromptError=class extends Error{message="Prompt was canceled"},ExitPromptError=class extends Error{},HookError=class extends Error{},ValidationError=class extends Error{};import{AsyncLocalStorage,AsyncResource}from"node:async_hooks";var hookStorage=new AsyncLocalStorage;function createStore(rl){return{rl,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function withHooks(rl,cb){let store=createStore(rl);return hookStorage.run(store,()=>{cb(store)})}function getStore(){let store=hookStorage.getStore();if(!store)throw new HookError("[Inquirer] Hook functions can only be called from within a prompt");return store}function readline(){return getStore().rl}function withUpdates(fn){let wrapped=(...args)=>{let store=getStore(),shouldUpdate=!1,oldHandleChange=store.handleChange;store.handleChange=()=>{shouldUpdate=!0};let returnValue=fn(...args);return shouldUpdate&&oldHandleChange(),store.handleChange=oldHandleChange,returnValue};return AsyncResource.bind(wrapped)}function withPointer(cb){let store=getStore(),{index}=store,pointer={get(){return store.hooks[index]},set(value){store.hooks[index]=value},initialized:index in store.hooks},returnValue=cb(pointer);return store.index++,returnValue}function handleChange(){getStore().handleChange()}var effectScheduler={queue(cb){let store=getStore(),{index}=store;store.hooksEffect.push(()=>{store.hooksCleanup[index]?.();let cleanFn=cb(readline());if(cleanFn!=null&&typeof cleanFn!="function")throw new ValidationError("useEffect return value must be a cleanup function or nothing.");store.hooksCleanup[index]=cleanFn})},run(){let store=getStore();withUpdates(()=>{store.hooksEffect.forEach(effect=>{effect()}),store.hooksEffect.length=0})()}};function useState(defaultValue){return withPointer(pointer=>{let setFn=newValue=>{pointer.get()!==newValue&&(pointer.set(newValue),handleChange())};if(pointer.initialized)return[pointer.get(),setFn];let value=typeof defaultValue=="function"?defaultValue():defaultValue;return pointer.set(value),[value,setFn]})}var import_chalk=__toESM(require_source(),1),import_cli_spinners=__toESM(require_cli_spinners(),1),defaultTheme={prefix:import_chalk.default.green("?"),spinner:{interval:import_cli_spinners.default.dots.interval,frames:import_cli_spinners.default.dots.frames.map(frame=>import_chalk.default.yellow(frame))},style:{answer:import_chalk.default.cyan,message:import_chalk.default.bold,error:text=>import_chalk.default.red(`> ${text}`),defaultAnswer:text=>import_chalk.default.dim(`(${text})`),help:import_chalk.default.dim,highlight:import_chalk.default.cyan,key:text=>import_chalk.default.cyan.bold(`<${text}>`)}};function makeTheme(...themes){return Object.assign({},defaultTheme,...themes,{style:Object.assign({},defaultTheme.style,...themes.map(theme=>theme?.style))})}import{AsyncResource as AsyncResource2}from"node:async_hooks";function useEffect(cb,depArray){withPointer(pointer=>{let oldDeps=pointer.get();(!Array.isArray(oldDeps)||depArray.some((dep,i)=>!Object.is(dep,oldDeps[i])))&&effectScheduler.queue(cb),pointer.set(depArray)})}function usePrefix({isLoading=!1,theme}){let[tick,setTick]=useState(0),{prefix,spinner}=makeTheme(theme);if(useEffect(()=>{if(isLoading){let timeout=setTimeout(AsyncResource2.bind(()=>{setTick(tick+1)}),spinner.interval);return()=>clearTimeout(timeout)}},[isLoading,tick]),isLoading){let frame=tick%spinner.frames.length;return spinner.frames[frame]}return prefix}function useMemo(fn,dependencies){return withPointer(pointer=>{let prev=pointer.get();if(!prev||prev.dependencies.length!==dependencies.length||prev.dependencies.some((dep,i)=>dep!==dependencies[i])){let value=fn();return pointer.set({value,dependencies}),value}return prev.value})}function useRef(val){return useState({current:val})[0]}function useKeypress(userHandler){let signal=useRef(userHandler);signal.current=userHandler,useEffect(rl=>{let handler=withUpdates((_input,event)=>{signal.current(event,rl)});return rl.input.on("keypress",handler),()=>{rl.input.removeListener("keypress",handler)}},[])}var import_cli_width=__toESM(require_cli_width(),1),import_wrap_ansi=__toESM(require_wrap_ansi(),1);function breakLines(content,width){return content.split(`
13
+ `).flatMap(line=>(0,import_wrap_ansi.default)(line,width,{trim:!1,hard:!0}).split(`
14
+ `).map(str=>str.trimEnd())).join(`
15
+ `)}function readlineWidth(){return(0,import_cli_width.default)({defaultWidth:80,output:readline().output})}function split(content,width){return breakLines(content,width).split(`
16
+ `)}function rotate(count,items){let max=items.length,offset=(count%max+max)%max;return items.slice(offset).concat(items.slice(0,offset))}function lines({items,width,renderItem,active,position:requested,pageSize}){let layouts=items.map((item,index)=>({item,index,isActive:index===active})),layoutsInPage=rotate(active-requested,layouts).slice(0,pageSize),renderItemAt=index=>split(renderItem(layoutsInPage[index]),width),pageBuffer=new Array(pageSize),activeItem=renderItemAt(requested).slice(0,pageSize),position=requested+activeItem.length<=pageSize?requested:pageSize-activeItem.length;pageBuffer.splice(position,activeItem.length,...activeItem);let bufferPointer=position+activeItem.length,layoutPointer=requested+1;for(;bufferPointer<pageSize&&layoutPointer<layoutsInPage.length;){for(let line of renderItemAt(layoutPointer))if(pageBuffer[bufferPointer++]=line,bufferPointer>=pageSize)break;layoutPointer++}for(bufferPointer=position-1,layoutPointer=requested-1;bufferPointer>=0&&layoutPointer>=0;){for(let line of renderItemAt(layoutPointer).reverse())if(pageBuffer[bufferPointer--]=line,bufferPointer<0)break;layoutPointer--}return pageBuffer.filter(line=>typeof line=="string")}function finite({active,pageSize,total}){let middle=Math.floor(pageSize/2);return total<=pageSize||active<middle?active:active>=total-middle?active+pageSize-total:middle}function infinite({active,lastActive,total,pageSize,pointer}){return total<=pageSize?active:lastActive<active&&active-lastActive<pageSize?Math.min(Math.floor(pageSize/2),pointer+active-lastActive):pointer}function usePagination({items,active,renderItem,pageSize,loop=!0,theme:defaultTheme2}){let state=useRef({position:0,lastActive:0}),theme=makeTheme(defaultTheme2),position=loop?infinite({active,lastActive:state.current.lastActive,total:items.length,pageSize,pointer:state.current.position}):finite({active,total:items.length,pageSize});state.current.position=position,state.current.lastActive=active;let visibleLines=lines({items,width:readlineWidth(),renderItem,active,position,pageSize}).join(`
17
+ `);return items.length>pageSize?`${visibleLines}
18
+ ${theme.style.help("(Use arrow keys to reveal more choices)")}`:visibleLines}import*as readline2 from"node:readline";var CancelablePromise=class _CancelablePromise extends Promise{cancel=()=>{};static withResolver(){let resolve,reject;return{promise:new _CancelablePromise((res,rej)=>{resolve=res,reject=rej}),resolve,reject}}};var import_mute_stream=__toESM(require_lib(),1);var import_strip_ansi=__toESM(require_strip_ansi(),1),import_ansi_escapes=__toESM(require_ansi_escapes(),1);var height=content=>content.split(`
19
+ `).length,lastLine=content=>content.split(`
20
+ `).pop()??"",ScreenManager=class{rl;height=0;extraLinesUnderPrompt=0;cursorPos;constructor(rl){this.rl=rl,this.rl=rl,this.cursorPos=rl.getCursorPos()}render(content,bottomContent=""){let promptLine=lastLine(content),rawPromptLine=(0,import_strip_ansi.default)(promptLine),prompt=rawPromptLine;this.rl.line.length&&(prompt=prompt.slice(0,-this.rl.line.length)),this.rl.setPrompt(prompt),this.cursorPos=this.rl.getCursorPos();let width=readlineWidth();content=breakLines(content,width),bottomContent=breakLines(bottomContent,width),rawPromptLine.length%width===0&&(content+=`
21
+ `);let output=content+(bottomContent?`
22
+ `+bottomContent:""),bottomContentHeight=Math.floor(rawPromptLine.length/width)-this.cursorPos.rows+(bottomContent?height(bottomContent):0);bottomContentHeight>0&&(output+=import_ansi_escapes.default.cursorUp(bottomContentHeight)),output+=import_ansi_escapes.default.cursorTo(this.cursorPos.cols),this.clean(),this.rl.output.unmute(),this.extraLinesUnderPrompt=bottomContentHeight,this.height=height(output),this.rl.output.write(output),this.rl.output.mute()}checkCursorPos(){let cursorPos=this.rl.getCursorPos();cursorPos.cols!==this.cursorPos.cols&&(this.rl.output.unmute(),this.rl.output.write(import_ansi_escapes.default.cursorTo(cursorPos.cols)),this.rl.output.mute(),this.cursorPos=cursorPos)}clean(){this.rl.output.unmute(),this.rl.output.write([this.extraLinesUnderPrompt>0?import_ansi_escapes.default.cursorDown(this.extraLinesUnderPrompt):"",import_ansi_escapes.default.eraseLines(this.height)].join("")),this.extraLinesUnderPrompt=0,this.rl.output.mute()}clearContent(){this.rl.output.unmute(),this.rl.output.write([this.extraLinesUnderPrompt>0?import_ansi_escapes.default.cursorDown(this.extraLinesUnderPrompt):"",`
23
+ `].join("")),this.rl.output.mute()}done(){this.rl.setPrompt(""),this.rl.output.unmute(),this.rl.output.write(import_ansi_escapes.default.cursorShow),this.rl.output.end(),this.rl.close()}};function createPrompt(view){return(config,context)=>{let input=context?.input??process.stdin,output=new import_mute_stream.default;output.pipe(context?.output??process.stdout);let rl=readline2.createInterface({terminal:!0,input,output}),screen=new ScreenManager(rl),cancel=()=>{},answer=new CancelablePromise((resolve,reject)=>{withHooks(rl,store=>{function checkCursorPos(){screen.checkCursorPos()}let removeExitListener=onExit((code,signal)=>{onExit2(),reject(new ExitPromptError(`User force closed the prompt with ${code} ${signal}`))});function onExit2(){try{store.hooksCleanup.forEach(cleanFn=>{cleanFn?.()})}catch(err){reject(err)}context?.clearPromptOnDone?screen.clean():screen.clearContent(),screen.done(),removeExitListener(),store.rl.input.removeListener("keypress",checkCursorPos)}cancel=()=>{onExit2(),reject(new CancelPromptError)};function done(value){setImmediate(()=>{onExit2(),resolve(value)})}function workLoop(resolvedConfig){store.index=0,store.handleChange=()=>workLoop(resolvedConfig);try{let nextView=view(config,done),[content,bottomContent]=typeof nextView=="string"?[nextView]:nextView;screen.render(content,bottomContent),effectScheduler.run()}catch(err){onExit2(),reject(err)}}workLoop(config),store.rl.input.on("keypress",checkCursorPos)})});return answer.cancel=cancel,answer}}var import_chalk2=__toESM(require_source(),1);var Separator=class{separator=import_chalk2.default.dim(new Array(15).join(esm_default.line));type="separator";constructor(separator){separator&&(this.separator=separator)}static isSeparator(choice){return!!(choice&&choice.type==="separator")}};export{isUpKey,isDownKey,isSpaceKey,isBackspaceKey,isNumberKey,isEnterKey,ValidationError,useState,require_source,makeTheme,usePrefix,useMemo,useRef,useKeypress,usePagination,createPrompt,Separator};
@@ -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-BZENIQ7N.js";var require_ms=__commonJS({"../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js"(exports,module){var s=1e3,m=s*60,h=m*60,d=h*24,w=d*7,y=d*365.25;module.exports=function(val,options){options=options||{};var type=typeof val;if(type==="string"&&val.length>0)return parse(val);if(type==="number"&&isFinite(val))return options.long?fmtLong(val):fmtShort(val);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(val))};function parse(str){if(str=String(str),!(str.length>100)){var match=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);if(match){var n=parseFloat(match[1]),type=(match[2]||"ms").toLowerCase();switch(type){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"weeks":case"week":case"w":return n*w;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function fmtShort(ms){var msAbs=Math.abs(ms);return msAbs>=d?Math.round(ms/d)+"d":msAbs>=h?Math.round(ms/h)+"h":msAbs>=m?Math.round(ms/m)+"m":msAbs>=s?Math.round(ms/s)+"s":ms+"ms"}function fmtLong(ms){var msAbs=Math.abs(ms);return msAbs>=d?plural(ms,msAbs,d,"day"):msAbs>=h?plural(ms,msAbs,h,"hour"):msAbs>=m?plural(ms,msAbs,m,"minute"):msAbs>=s?plural(ms,msAbs,s,"second"):ms+" ms"}function plural(ms,msAbs,n,name){var isPlural=msAbs>=n*1.5;return Math.round(ms/n)+" "+name+(isPlural?"s":"")}}});export{require_ms};
@@ -0,0 +1,12 @@
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_supports_color}from"./chunk-ISWW3DKF.js";import{require_ansi_styles}from"./chunk-BRQUZ5NC.js";import{__commonJS}from"./chunk-BZENIQ7N.js";var require_util=__commonJS({"../../node_modules/.pnpm/chalk@4.1.0/node_modules/chalk/source/util.js"(exports,module){"use strict";var stringReplaceAll=(string,substring,replacer)=>{let index=string.indexOf(substring);if(index===-1)return string;let substringLength=substring.length,endIndex=0,returnValue="";do returnValue+=string.substr(endIndex,index-endIndex)+substring+replacer,endIndex=index+substringLength,index=string.indexOf(substring,endIndex);while(index!==-1);return returnValue+=string.substr(endIndex),returnValue},stringEncaseCRLFWithFirstIndex=(string,prefix,postfix,index)=>{let endIndex=0,returnValue="";do{let gotCR=string[index-1]==="\r";returnValue+=string.substr(endIndex,(gotCR?index-1:index)-endIndex)+prefix+(gotCR?`\r
8
+ `:`
9
+ `)+postfix,endIndex=index+1,index=string.indexOf(`
10
+ `,endIndex)}while(index!==-1);return returnValue+=string.substr(endIndex),returnValue};module.exports={stringReplaceAll,stringEncaseCRLFWithFirstIndex}}});var require_templates=__commonJS({"../../node_modules/.pnpm/chalk@4.1.0/node_modules/chalk/source/templates.js"(exports,module){"use strict";var TEMPLATE_REGEX=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,STYLE_REGEX=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,STRING_REGEX=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,ESCAPE_REGEX=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,ESCAPES=new Map([["n",`
11
+ `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function unescape(c){let u=c[0]==="u",bracket=c[1]==="{";return u&&!bracket&&c.length===5||c[0]==="x"&&c.length===3?String.fromCharCode(parseInt(c.slice(1),16)):u&&bracket?String.fromCodePoint(parseInt(c.slice(2,-1),16)):ESCAPES.get(c)||c}function parseArguments(name,arguments_){let results=[],chunks=arguments_.trim().split(/\s*,\s*/g),matches;for(let chunk of chunks){let number=Number(chunk);if(!Number.isNaN(number))results.push(number);else if(matches=chunk.match(STRING_REGEX))results.push(matches[2].replace(ESCAPE_REGEX,(m,escape,character)=>escape?unescape(escape):character));else throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`)}return results}function parseStyle(style){STYLE_REGEX.lastIndex=0;let results=[],matches;for(;(matches=STYLE_REGEX.exec(style))!==null;){let name=matches[1];if(matches[2]){let args=parseArguments(name,matches[2]);results.push([name].concat(args))}else results.push([name])}return results}function buildStyle(chalk,styles){let enabled={};for(let layer of styles)for(let style of layer.styles)enabled[style[0]]=layer.inverse?null:style.slice(1);let current=chalk;for(let[styleName,styles2]of Object.entries(enabled))if(Array.isArray(styles2)){if(!(styleName in current))throw new Error(`Unknown Chalk style: ${styleName}`);current=styles2.length>0?current[styleName](...styles2):current[styleName]}return current}module.exports=(chalk,temporary)=>{let styles=[],chunks=[],chunk=[];if(temporary.replace(TEMPLATE_REGEX,(m,escapeCharacter,inverse,style,close,character)=>{if(escapeCharacter)chunk.push(unescape(escapeCharacter));else if(style){let string=chunk.join("");chunk=[],chunks.push(styles.length===0?string:buildStyle(chalk,styles)(string)),styles.push({inverse,styles:parseStyle(style)})}else if(close){if(styles.length===0)throw new Error("Found extraneous } in Chalk template literal");chunks.push(buildStyle(chalk,styles)(chunk.join(""))),chunk=[],styles.pop()}else chunk.push(character)}),chunks.push(chunk.join("")),styles.length>0){let errMessage=`Chalk template literal is missing ${styles.length} closing bracket${styles.length===1?"":"s"} (\`}\`)`;throw new Error(errMessage)}return chunks.join("")}}});var require_source=__commonJS({"../../node_modules/.pnpm/chalk@4.1.0/node_modules/chalk/source/index.js"(exports,module){"use strict";var ansiStyles=require_ansi_styles(),{stdout:stdoutColor,stderr:stderrColor}=require_supports_color(),{stringReplaceAll,stringEncaseCRLFWithFirstIndex}=require_util(),{isArray}=Array,levelMapping=["ansi","ansi","ansi256","ansi16m"],styles=Object.create(null),applyOptions=(object,options={})=>{if(options.level&&!(Number.isInteger(options.level)&&options.level>=0&&options.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let colorLevel=stdoutColor?stdoutColor.level:0;object.level=options.level===void 0?colorLevel:options.level},ChalkClass=class{constructor(options){return chalkFactory(options)}},chalkFactory=options=>{let chalk2={};return applyOptions(chalk2,options),chalk2.template=(...arguments_)=>chalkTag(chalk2.template,...arguments_),Object.setPrototypeOf(chalk2,Chalk.prototype),Object.setPrototypeOf(chalk2.template,chalk2),chalk2.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},chalk2.template.Instance=ChalkClass,chalk2.template};function Chalk(options){return chalkFactory(options)}for(let[styleName,style]of Object.entries(ansiStyles))styles[styleName]={get(){let builder=createBuilder(this,createStyler(style.open,style.close,this._styler),this._isEmpty);return Object.defineProperty(this,styleName,{value:builder}),builder}};styles.visible={get(){let builder=createBuilder(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:builder}),builder}};var usedModels=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let model of usedModels)styles[model]={get(){let{level}=this;return function(...arguments_){let styler=createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_),ansiStyles.color.close,this._styler);return createBuilder(this,styler,this._isEmpty)}}};for(let model of usedModels){let bgModel="bg"+model[0].toUpperCase()+model.slice(1);styles[bgModel]={get(){let{level}=this;return function(...arguments_){let styler=createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_),ansiStyles.bgColor.close,this._styler);return createBuilder(this,styler,this._isEmpty)}}}}var proto=Object.defineProperties(()=>{},{...styles,level:{enumerable:!0,get(){return this._generator.level},set(level){this._generator.level=level}}}),createStyler=(open,close,parent)=>{let openAll,closeAll;return parent===void 0?(openAll=open,closeAll=close):(openAll=parent.openAll+open,closeAll=close+parent.closeAll),{open,close,openAll,closeAll,parent}},createBuilder=(self,_styler,_isEmpty)=>{let builder=(...arguments_)=>isArray(arguments_[0])&&isArray(arguments_[0].raw)?applyStyle(builder,chalkTag(builder,...arguments_)):applyStyle(builder,arguments_.length===1?""+arguments_[0]:arguments_.join(" "));return Object.setPrototypeOf(builder,proto),builder._generator=self,builder._styler=_styler,builder._isEmpty=_isEmpty,builder},applyStyle=(self,string)=>{if(self.level<=0||!string)return self._isEmpty?"":string;let styler=self._styler;if(styler===void 0)return string;let{openAll,closeAll}=styler;if(string.indexOf("\x1B")!==-1)for(;styler!==void 0;)string=stringReplaceAll(string,styler.close,styler.open),styler=styler.parent;let lfIndex=string.indexOf(`
12
+ `);return lfIndex!==-1&&(string=stringEncaseCRLFWithFirstIndex(string,closeAll,openAll,lfIndex)),openAll+string+closeAll},template,chalkTag=(chalk2,...strings)=>{let[firstString]=strings;if(!isArray(firstString)||!isArray(firstString.raw))return strings.join(" ");let arguments_=strings.slice(1),parts=[firstString.raw[0]];for(let i=1;i<firstString.length;i++)parts.push(String(arguments_[i-1]).replace(/[{}\\]/g,"\\$&"),String(firstString.raw[i]));return template===void 0&&(template=require_templates()),template(chalk2,parts.join(""))};Object.defineProperties(Chalk.prototype,styles);var chalk=Chalk();chalk.supportsColor=stdoutColor;chalk.stderr=Chalk({level:stderrColor?stderrColor.level:0});chalk.stderr.supportsColor=stderrColor;module.exports=chalk}});export{require_source};
@@ -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{resolveProjectContext}from"./chunk-3JGBBS6V.js";import{AGENT_REASON,AGENT_STATUS,outputAgentError}from"./chunk-DGYHWXD2.js";import{parseArguments}from"./chunk-VOCZ34ON.js";import{getFlagsSpecification,getGlobalFlagsFromArgs}from"./chunk-AWMQGOS2.js";import{getCommandName,getCommandNamePlain}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";async function requireProjectContext(client,command,projectName){let link=await resolveProjectContext({client,projectNameOrId:projectName});if(link.status==="error")return link.exitCode;if(link.status==="not_linked"){if(client.nonInteractive)if(command==="redirects"){let linkCmd=getCommandNamePlain("link");outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_LINKED,message:`Your codebase isn't linked to a project on Vercel. Run ${linkCmd} to begin.`,next:[{command:linkCmd}]},1)}else{let flags=getGlobalFlagsFromArgs(client.argv.slice(2)),cmd=getCommandNamePlain(`link ${flags.join(" ")}`.trim());return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_LINKED,userActionRequired:!0,message:`Your codebase is not linked to a Vercel project. Run link first, then retry ${command} commands.`,next:[{command:cmd,when:"to link this directory to a project"}]},1),1}return output_manager_default.error(`Your codebase isn't linked to a project on Vercel. Run ${getCommandName("link")} to begin.`),1}return client.config.currentTeam=link.org.type==="team"?link.org.id:void 0,link}function parseSubcommandArguments(argv,command){let flagsSpecification=getFlagsSpecification(command.options);return parseArguments(argv,flagsSpecification)}function validateRequiredArguments(args,required){for(let i=0;i<required.length;i++)if(!args[i])return`Missing required argument: ${required[i]}`;return null}export{requireProjectContext,parseSubcommandArguments,validateRequiredArguments};
@@ -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{formatOption,jsonOption,limitOption,projectOption,sinceOption,untilOption}from"./chunk-AWMQGOS2.js";import{packageName}from"./chunk-JESNVRVR.js";var listSubcommand={name:"ls",aliases:["list"],description:"",default:!0,hidden:!0,arguments:[],options:[],examples:[]},inspectSubcommand={name:"inspect",aliases:[],description:"Show details for a single alert group",arguments:[{name:"groupId",required:!0}],options:[formatOption,jsonOption,{...projectOption,shorthand:"p",description:"Filter by project (overrides auto-detected linked project)."},{name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"Use team-wide scope (ignore linked project auto-scoping)."}],examples:[{name:"Inspect a group in the linked project",value:`${packageName} alerts inspect grp_abc123`},{name:"Inspect as JSON",value:`${packageName} alerts inspect grp_abc123 --json`}]},alertsCommand={name:"alerts",aliases:[],description:"List alert groups or inspect a group. To manage alert rules, see `vercel monitors`.",arguments:[],subcommands:[listSubcommand,inspectSubcommand],options:[{name:"type",shorthand:null,type:[String],argument:"TYPE",deprecated:!1,description:"Filter by alert type. Repeatable and comma-separated (for example --type usage_anomaly,error_anomaly)."},{...projectOption,shorthand:"p",description:"Filter by project (overrides auto-detected linked project)."},{name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"Show team-wide alerts (ignore linked project auto-scoping)."},{name:"ai",shorthand:null,type:Boolean,deprecated:!1,description:"Print AI-focused sections (title, resolved time, summary, key findings) instead of table output."},{...sinceOption,description:`${sinceOption.description} (default: 24h ago)`},untilOption,limitOption,formatOption,jsonOption],examples:[{name:"List alerts for the linked project",value:`${packageName} alerts`},{name:"List team-wide alerts",value:`${packageName} alerts --all`},{name:"Filter by type",value:`${packageName} alerts --type usage_anomaly --type error_anomaly`},{name:"Output JSON",value:`${packageName} alerts --json`},{name:"Custom time range",value:`${packageName} alerts --since 2026-03-01T00:00:00.000Z --until 2026-03-02T00:00:00.000Z`}]};export{listSubcommand,inspectSubcommand,alertsCommand};
@@ -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_dist as require_dist2}from"./chunk-JALVF3C2.js";import{confirmOption,projectOption,yesOption}from"./chunk-AWMQGOS2.js";import{packageName}from"./chunk-JESNVRVR.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_async_listen=__toESM(require_dist2(),1),import_error_utils=__toESM(require_dist(),1),DEV_QUEUE_API_PREFIX="/api/v3/topic/",DEV_QUEUE_PROXY_PREFIX="/_svc/_queues",DEV_QUEUE_DEFAULT_PORT=4782,DEV_RUNTIME_CACHE_DEFAULT_PORT=4783,DEV_SCHEDULES_DEFAULT_PORT=4784,DEV_SCHEDULES_PROXY_PREFIX="/_svc/_schedules",DEV_RESOURCE_TOKEN="vc-dev-token";function isValidDevResourceHost(origin,host){let port=new URL(origin).port,suffix=port?`:${port}`:"",normalizedHost=host?.toLowerCase();return normalizedHost===`127.0.0.1${suffix}`||normalizedHost===`localhost${suffix}`}async function listenOnDevResourcePort(server,options){let isPinned=options.port!==void 0,reservedPorts=new Set(options.reservedPorts),port=options.port??options.defaultPort;for(;;){if(!isPinned&&reservedPorts.has(port)){if(port>=65535)throw new Error(`${options.name} could not find an available port at or above 127.0.0.1:${options.defaultPort}. Choose another port with ${options.flag}.`);port++;continue}try{let address=await(0,import_async_listen.listen)(server,port,"127.0.0.1"),url=new URL(address.toString()),serverAddress=server.address(),actualPort=serverAddress&&typeof serverAddress!="string"?serverAddress.port:Number(url.port);return{origin:url.origin,port:actualPort,...port!==options.defaultPort&&!isPinned?{defaultPort:options.defaultPort}:{}}}catch(err){if(!(0,import_error_utils.isErrnoException)(err)||err.code!=="EADDRINUSE")throw err;if(isPinned||port>=65535)throw new Error(`${options.name} could not listen on 127.0.0.1:${port} because the port is already in use. Choose another port with ${options.flag}.`);port++}}}function getDevQueueEnv(baseUrl,hasWorkerServices=!0){return{...hasWorkerServices?{VERCEL_HAS_WORKER_SERVICES:"1"}:{},VERCEL_QUEUE_BASE_URL:baseUrl,VERCEL_QUEUE_TOKEN:DEV_RESOURCE_TOKEN,VERCEL_REGION:"dev1"}}function getDevSchedulesEnv(baseUrl,container=!1){if(!baseUrl)return{};let endpoint=new URL(baseUrl);return container&&["localhost","127.0.0.1","[::1]"].includes(endpoint.hostname)&&(endpoint.hostname="host.docker.internal"),{VERCEL_SCHEDULE_BASE_URL:endpoint.toString().replace(/\/$/,""),VERCEL_SCHEDULE_TOKEN:DEV_RESOURCE_TOKEN,VERCEL_SCHEDULE_DEV_API_VERSION:"1"}}var devCommand={name:"dev",aliases:["develop"],description:`Starts the \`${packageName} dev\` server.`,arguments:[{name:"dir",required:!1}],options:[{name:"listen",description:"Specify a URI endpoint on which to listen (default: 0.0.0.0:3000)",argument:"URI",shorthand:null,deprecatedShorthand:"l",type:String,deprecated:!1},{name:"local",shorthand:null,deprecatedShorthand:"L",type:Boolean,deprecated:!1,description:"Start the dev server without linking to a Vercel project"},{name:"queue-port",description:`Specify the local Vercel Queues server port (default: ${DEV_QUEUE_DEFAULT_PORT})`,argument:"PORT",shorthand:null,type:String,deprecated:!1},{name:"runtime-cache-port",description:`Specify the local Runtime Cache server port (default: ${DEV_RUNTIME_CACHE_DEFAULT_PORT})`,argument:"PORT",shorthand:null,type:String,deprecated:!1},{name:"tunnel",shorthand:null,type:Boolean,deprecated:!1},{name:"schedules-port",description:`Specify the local Vercel Schedules server port (default: ${DEV_SCHEDULES_DEFAULT_PORT})`,argument:"PORT",shorthand:null,type:String,deprecated:!1},yesOption,{name:"port",shorthand:"p",type:String,deprecated:!0},confirmOption,projectOption],examples:[{name:`Start the \`${packageName} dev\` server on port 8080`,value:`${packageName} dev --listen 8080`},{name:"Make the `vercel dev` server bind to localhost on port 5000",value:`${packageName} dev --listen 127.0.0.1:5000 `},{name:"Pin local resource server ports",value:`${packageName} dev --queue-port 5782 --runtime-cache-port 5783 --schedules-port 5784`}]};export{DEV_QUEUE_API_PREFIX,DEV_QUEUE_PROXY_PREFIX,DEV_QUEUE_DEFAULT_PORT,DEV_RUNTIME_CACHE_DEFAULT_PORT,DEV_SCHEDULES_DEFAULT_PORT,DEV_SCHEDULES_PROXY_PREFIX,DEV_RESOURCE_TOKEN,isValidDevResourceHost,listenOnDevResourcePort,getDevQueueEnv,getDevSchedulesEnv,devCommand};
@@ -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_cli_config}from"./chunk-4SAVH3H7.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_cli_config=__toESM(require_cli_config(),1);import{resolve}from"node:path";function isNativeBinaryInstall(){return process.env.VERCEL_VC_NATIVE==="1"}function isManagedBuildersInstall(){return isNativeBinaryInstall()||process.env.VERCEL_CLI_MANAGED_BUILDERS==="1"}function getInstallRoot(){let root=process.env.VERCEL_INSTALL_DIR;return root?resolve(root):(0,import_cli_config.getDataPath)()}export{isNativeBinaryInstall,isManagedBuildersInstall,getInstallRoot};
@@ -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,__require}from"./chunk-BZENIQ7N.js";var require_deque=__commonJS({"../../node_modules/.pnpm/double-ended-queue@2.1.0-0/node_modules/double-ended-queue/js/deque.js"(exports,module){"use strict";function Deque(capacity){if(this._capacity=getCapacity(capacity),this._length=0,this._front=0,isArray(capacity)){for(var len=capacity.length,i=0;i<len;++i)this[i]=capacity[i];this._length=len}}Deque.prototype.toArray=function(){for(var len=this._length,ret=new Array(len),front=this._front,capacity=this._capacity,j=0;j<len;++j)ret[j]=this[front+j&capacity-1];return ret};Deque.prototype.push=function(item){var argsLength=arguments.length,length=this._length;if(argsLength>1){var capacity=this._capacity;if(length+argsLength>capacity){for(var i=0;i<argsLength;++i){this._checkCapacity(length+1);var j=this._front+length&this._capacity-1;this[j]=arguments[i],length++,this._length=length}return length}else{for(var j=this._front,i=0;i<argsLength;++i)this[j+length&capacity-1]=arguments[i],j++;return this._length=length+argsLength,length+argsLength}}if(argsLength===0)return length;this._checkCapacity(length+1);var i=this._front+length&this._capacity-1;return this[i]=item,this._length=length+1,length+1};Deque.prototype.pop=function(){var length=this._length;if(length!==0){var i=this._front+length-1&this._capacity-1,ret=this[i];return this[i]=void 0,this._length=length-1,ret}};Deque.prototype.shift=function(){var length=this._length;if(length!==0){var front=this._front,ret=this[front];return this[front]=void 0,this._front=front+1&this._capacity-1,this._length=length-1,ret}};Deque.prototype.unshift=function(item){var length=this._length,argsLength=arguments.length;if(argsLength>1){var capacity=this._capacity;if(length+argsLength>capacity){for(var i=argsLength-1;i>=0;i--){this._checkCapacity(length+1);var capacity=this._capacity,j=(this._front-1&capacity-1^capacity)-capacity;this[j]=arguments[i],length++,this._length=length,this._front=j}return length}else{for(var front=this._front,i=argsLength-1;i>=0;i--){var j=(front-1&capacity-1^capacity)-capacity;this[j]=arguments[i],front=j}return this._front=front,this._length=length+argsLength,length+argsLength}}if(argsLength===0)return length;this._checkCapacity(length+1);var capacity=this._capacity,i=(this._front-1&capacity-1^capacity)-capacity;return this[i]=item,this._length=length+1,this._front=i,length+1};Deque.prototype.peekBack=function(){var length=this._length;if(length!==0){var index=this._front+length-1&this._capacity-1;return this[index]}};Deque.prototype.peekFront=function(){if(this._length!==0)return this[this._front]};Deque.prototype.get=function(index){var i=index;if(i===(i|0)){var len=this._length;if(i<0&&(i=i+len),!(i<0||i>=len))return this[this._front+i&this._capacity-1]}};Deque.prototype.isEmpty=function(){return this._length===0};Deque.prototype.clear=function(){for(var len=this._length,front=this._front,capacity=this._capacity,j=0;j<len;++j)this[front+j&capacity-1]=void 0;this._length=0,this._front=0};Deque.prototype.toString=function(){return this.toArray().toString()};Deque.prototype.valueOf=Deque.prototype.toString;Deque.prototype.removeFront=Deque.prototype.shift;Deque.prototype.removeBack=Deque.prototype.pop;Deque.prototype.insertFront=Deque.prototype.unshift;Deque.prototype.insertBack=Deque.prototype.push;Deque.prototype.enqueue=Deque.prototype.push;Deque.prototype.dequeue=Deque.prototype.shift;Deque.prototype.toJSON=Deque.prototype.toArray;Object.defineProperty(Deque.prototype,"length",{get:function(){return this._length},set:function(){throw new RangeError("")}});Deque.prototype._checkCapacity=function(size){this._capacity<size&&this._resizeTo(getCapacity(this._capacity*1.5+16))};Deque.prototype._resizeTo=function(capacity){var oldCapacity=this._capacity;this._capacity=capacity;var front=this._front,length=this._length;if(front+length>oldCapacity){var moveItemsCount=front+length&oldCapacity-1;arrayMove(this,0,this,oldCapacity,moveItemsCount)}};var isArray=Array.isArray;function arrayMove(src,srcIndex,dst,dstIndex,len){for(var j=0;j<len;++j)dst[j+dstIndex]=src[j+srcIndex],src[j+srcIndex]=void 0}function pow2AtLeast(n){return n=n>>>0,n=n-1,n=n|n>>1,n=n|n>>2,n=n|n>>4,n=n|n>>8,n=n|n>>16,n+1}function getCapacity(capacity){if(typeof capacity!="number")if(isArray(capacity))capacity=capacity.length;else return 16;return pow2AtLeast(Math.min(Math.max(16,capacity),1073741824))}module.exports=Deque}});var require_async_sema=__commonJS({"../../node_modules/.pnpm/async-sema@2.1.4/node_modules/async-sema/index.js"(exports,module){var EventEmitter=__require("events"),util=__require("util"),Deque=require_deque(),ReleaseEmitter=class extends EventEmitter{};function isFn(x){return typeof x=="function"}function defaultInit(){return"1"}var Sema=class{constructor(nr,{initFn=defaultInit,pauseFn,resumeFn,capacity=10}={}){if(isFn(pauseFn)^isFn(resumeFn))throw new Error("pauseFn and resumeFn must be both set for pausing");this.nrTokens=nr,this.free=new Deque(nr),this.waiting=new Deque(capacity),this.releaseEmitter=new ReleaseEmitter,this.noTokens=initFn===defaultInit,this.pauseFn=pauseFn,this.resumeFn=resumeFn,this.releaseEmitter.on("release",token=>{let p=this.waiting.shift();p?p.resolve(token):(this.resumeFn&&this.paused&&(this.paused=!1,this.resumeFn()),this.free.push(token))});for(let i=0;i<nr;i++)this.free.push(initFn())}async acquire(){let token=this.free.pop();return token||new Promise((resolve,reject)=>{this.pauseFn&&!this.paused&&(this.paused=!0,this.pauseFn()),this.waiting.push({resolve,reject})})}async v(){return this.acquire()}release(token){this.releaseEmitter.emit("release",this.noTokens?"1":token)}p(token){return this.release(token)}drain(){let a=new Array(this.nrTokens);for(let i=0;i<this.nrTokens;i++)a[i]=this.acquire();return Promise.all(a)}nrWaiting(){return this.waiting.length}};Sema.prototype.v=util.deprecate(Sema.prototype.v,"`v()` is deperecated; use `acquire()` instead");Sema.prototype.p=util.deprecate(Sema.prototype.p,"`p()` is deprecated; use `release()` instead");module.exports=Sema}});export{require_async_sema};
@@ -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{__esm}from"./chunk-BZENIQ7N.js";import{createHash}from"crypto";import{mkdir,writeFile}from"fs/promises";import{join}from"path";function wait(ms){return new Promise(resolve=>setTimeout(resolve,ms))}function buildUserAgent(userAgentSuffix){return[`@vercel/prepare-flags-definitions/${version}`,userAgentSuffix].filter(Boolean).join(" ")}function obfuscate(sdkKey,prefixLength=18){return prefixLength>=sdkKey.length?sdkKey:sdkKey.slice(0,prefixLength)+"*".repeat(sdkKey.length-prefixLength)}function hashSdkKey(sdkKey){return createHash("sha256").update(sdkKey).digest("hex")}function getProjectIdFromOidcToken(oidcToken){let tokenParts=oidcToken.split(".");if(tokenParts.length!==3||!tokenParts[1])return;let payload=JSON.parse(Buffer.from(tokenParts[1],"base64url").toString("utf8"));if(!(typeof payload.project_id!="string"||!payload.project_id))return payload.project_id}function generateDefinitionConstants(lines,entries){let stringToConst=new Map;return entries.map(entry=>{let stringified=JSON.stringify(entry.definitions),definitionConst=stringToConst.get(stringified);return definitionConst||(definitionConst=`_d${stringToConst.size}`,stringToConst.set(stringified,definitionConst),lines.push(`const ${definitionConst} = memo(() => JSON.parse(${JSON.stringify(stringified)}));`)),{key:entry.key,value:definitionConst}})}function generateMap(lines,entries){lines.push(""),lines.push("const map = {");for(let entry of entries)lines.push(` ${JSON.stringify(entry.key)}: ${entry.value},`);lines.push("};"),lines.push(""),lines.push("export function get(key) {"),lines.push(" return map[key]?.() ?? null;"),lines.push("}")}function isRetryableStatus(status){return status===429||status>=500}async function fetchDatafile(token,env,fetchFn,userAgentSuffix,output,sourceProjectId){let headers={authorization:`Bearer ${token}`,"user-agent":buildUserAgent(userAgentSuffix)};sourceProjectId&&(headers["x-vercel-flags-project-id"]=sourceProjectId);let label=sourceProjectId?`project ${sourceProjectId}`:obfuscate(token);env.VERCEL_PROJECT_ID&&(headers["x-vercel-project-id"]=env.VERCEL_PROJECT_ID),env.VERCEL_ENV&&(headers["x-vercel-env"]=env.VERCEL_ENV),env.VERCEL_DEPLOYMENT_ID&&(headers["x-vercel-deployment-id"]=env.VERCEL_DEPLOYMENT_ID),env.VERCEL_REGION&&(headers["x-vercel-region"]=env.VERCEL_REGION);let lastError;for(let attempt=0;attempt<=FETCH_MAX_RETRIES;attempt++){if(attempt>0){let delay=FETCH_RETRY_BASE_DELAY_MS*2**(attempt-1);output?.debug(`vercel-flags: retrying datafile fetch for ${label} (attempt ${attempt}/${FETCH_MAX_RETRIES}) after ${delay}ms`),await wait(delay)}let res;try{res=await fetchFn(`${FLAGS_HOST}/v1/datafile`,{headers})}catch(error2){lastError=error2;continue}if(res.ok)return{...await res.json(),fetchedAt:Date.now()};if(res.status===404)return;let error=new Error(`Failed to fetch flag definitions for ${label}: ${res.status} ${res.statusText}`);if(!isRetryableStatus(res.status))throw error;lastError=error}throw lastError instanceof Error?lastError:new Error(`Failed to fetch flag definitions for ${label} after ${FETCH_MAX_RETRIES} retries`)}function generateDefinitionsModule(entries,output){output?.debug(`vercel-flags: writing flag definitions for "${entries.map(({key})=>obfuscate(key)).join(", ")}"`);let lines=["const memo = (fn) => { let cached; return () => (cached ??= fn()); };",""],generatedDefinitions=generateDefinitionConstants(lines,entries);return generateMap(lines,generatedDefinitions),lines.push("",`export const version = ${JSON.stringify(FLAGS_DEFINITIONS_VERSION)};`),lines.join(`
8
+ `)}async function fetchConnectedSourceProjectIds(oidcToken,fetchFn,userAgentSuffix,output){try{let res=await fetchFn(`${API_HOST}${CONNECTED_SOURCES_PATH}`,{headers:{authorization:`Bearer ${oidcToken}`,"user-agent":buildUserAgent(userAgentSuffix)},signal:AbortSignal.timeout(CONNECTED_SOURCES_TIMEOUT_MS)});if(!res.ok)return output?.debug(`vercel-flags: could not list connected projects (${res.status})`),[];let body=await res.json();return(Array.isArray(body.data)?body.data:[]).map(c=>c.sourceProjectId).filter(id=>typeof id=="string"&&PROJECT_ID_REGEX.test(id))}catch(error){return output?.debug(`vercel-flags: could not list connected projects (${error instanceof Error?error.message:String(error)})`),[]}}async function fetchSourceProjectDatafile(entry,env,fetchFn,userAgentSuffix,output){try{return await fetchDatafile(entry.key,env,fetchFn,userAgentSuffix,output,entry.projectId)}catch(error){output?.debug(`vercel-flags: skipping connected project ${entry.projectId} (${error instanceof Error?error.message:String(error)})`);return}}async function collectFlagEntries(env,fetchFn,userAgentSuffix,output){let entries=[],sdkKeys=new Set;for(let value of Object.values(env))if(typeof value=="string"){if(SDK_KEY_REGEX.test(value))sdkKeys.add(value);else if(value.startsWith("flags:")){let sdkKey=new URLSearchParams(value.slice(6)).get("sdkKey");sdkKey&&SDK_KEY_REGEX.test(sdkKey)&&sdkKeys.add(sdkKey)}}if(sdkKeys.size>0){output?.debug(`vercel-flags: found ${sdkKeys.size} SDK keys`);for(let key of Array.from(sdkKeys))entries.push({type:"sdkKey",key})}let oidcToken=env.VERCEL_OIDC_TOKEN;if(oidcToken&&oidcToken?.length>0){output?.debug("vercel-flags: found OIDC token"),entries.push({type:"oidcToken",key:oidcToken});let ownProjectId=getProjectIdFromOidcToken(oidcToken),sourceProjectIds=new Set(await fetchConnectedSourceProjectIds(oidcToken,fetchFn,userAgentSuffix,output));ownProjectId&&sourceProjectIds.delete(ownProjectId);for(let projectId of Array.from(sourceProjectIds))entries.push({type:"sourceProject",key:oidcToken,projectId});sourceProjectIds.size>0&&output?.debug(`vercel-flags: found ${sourceProjectIds.size} connected projects`)}return entries}async function prepareFlagsDefinitions(options){let{cwd,env,userAgentSuffix,fetch:fetchFn=globalThis.fetch,output}=options;output?.debug("vercel-flags: checking env vars for SDK Keys and OIDC Token");let entries=await collectFlagEntries(env,fetchFn,userAgentSuffix,output);if(entries.length===0)return{created:!1,reason:"no-flags-entries"};let validEntries=(await Promise.all(entries.map(async entry=>{if(entry.type==="sourceProject"){let definitions2=await fetchSourceProjectDatafile(entry,env,fetchFn,userAgentSuffix,output);return definitions2?{key:entry.projectId,definitions:definitions2}:void 0}let definitions=await fetchDatafile(entry.key,env,fetchFn,userAgentSuffix,output);if(definitions){if(entry.type==="oidcToken"){let projectId=getProjectIdFromOidcToken(entry.key);if(projectId)return{key:projectId,definitions}}if(entry.type==="sdkKey")return{key:hashSdkKey(entry.key),definitions}}}))).filter(entry=>!!entry),definitionsJs=generateDefinitionsModule(validEntries,output),storageDir=join(cwd,"node_modules","@vercel","flags-definitions"),indexPath=join(storageDir,"index.js"),dtsPath=join(storageDir,"index.d.ts"),packageJsonPath=join(storageDir,"package.json"),dts=["export function get(key: string): Record<string, unknown> | null;","export const version: string;",""].join(`
9
+ `),packageJson={name:"@vercel/flags-definitions",version:FLAGS_DEFINITIONS_VERSION,type:"module",main:"./index.js",types:"./index.d.ts",exports:{".":{types:"./index.d.ts",import:"./index.js"}}};return await mkdir(storageDir,{recursive:!0}),await Promise.all([writeFile(indexPath,definitionsJs),writeFile(dtsPath,dts),writeFile(packageJsonPath,JSON.stringify(packageJson,null,2))]),output?.debug("vercel-flags: created module"),output?.debug(` \u2192 ${indexPath}`),output?.debug(` \u2192 ${dtsPath}`),output?.debug(` \u2192 ${packageJsonPath}`),{created:!0,entryCount:entries.length}}var version,FLAGS_HOST,API_HOST,CONNECTED_SOURCES_PATH,FLAGS_DEFINITIONS_VERSION,FETCH_MAX_RETRIES,FETCH_RETRY_BASE_DELAY_MS,CONNECTED_SOURCES_TIMEOUT_MS,SDK_KEY_REGEX,PROJECT_ID_REGEX,init_dist=__esm({"../../node_modules/.pnpm/@vercel+prepare-flags-definitions@0.6.1/node_modules/@vercel/prepare-flags-definitions/dist/index.js"(){version="0.6.1",FLAGS_HOST="https://flags.vercel.com",API_HOST="https://api.vercel.com",CONNECTED_SOURCES_PATH="/v1/feature-flags/connections/sources",FLAGS_DEFINITIONS_VERSION="1.0.1",FETCH_MAX_RETRIES=3,FETCH_RETRY_BASE_DELAY_MS=200,CONNECTED_SOURCES_TIMEOUT_MS=5e3;SDK_KEY_REGEX=/^vf_(?:server|client)_/,PROJECT_ID_REGEX=/^[A-Za-z0-9_]{1,64}$/}});export{hashSdkKey,getProjectIdFromOidcToken,generateDefinitionsModule,prepareFlagsDefinitions,init_dist};
@@ -0,0 +1,11 @@
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{events_default}from"./chunk-UJSW56GS.js";import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var import_strip_ansi=__toESM(require_strip_ansi(),1);function displayBuildLogs(client,deployment,follow=!0,onAliasAssigned){let abortController=new AbortController;return{promise:events_default(client,deployment.id,{mode:"logs",onEvent:event=>printBuildLog(event,output_manager_default.print),onAliasAssigned,quiet:!1,findOpts:{direction:"forward",follow}},abortController),abortController}}function collectBuildLogs(client,deployment,follow=!0){let logs=[],abortController=new AbortController;return{promise:events_default(client,deployment.id,{mode:"logs",onEvent:event=>{event.created&&logs.push(event)},quiet:!0,findOpts:{direction:"forward",follow}},abortController).then(()=>logs),abortController}}async function displayBuildLogsUntilFinalError(client,deployment,error){let abortController=new AbortController;return events_default(client,deployment.id,{mode:"logs",onEvent:event=>{printBuildLog(event,output_manager_default.print),event.level==="error"&&event.text?.includes(error)&&abortController.abort()},quiet:!1,findOpts:{direction:"forward",follow:!0}},abortController)}function printBuildLog(log,print){if(!log.created)return;let date=new Date(log.created).toISOString(),cleanText=parseLogLines(log).join(`
8
+ `);for(let line of colorize(cleanText,log).split(`
9
+ `))print(`${import_chalk.default.dim(date)} ${line}
10
+ `)}function sanitize(log){return(0,import_strip_ansi.default)(log.text||"").replace(/\n$/,"").replace(/^\n/,"")}function parseLogLines(log){return sanitize(log).split(`
11
+ `).map(line=>line.replace("[now-builder-debug] ","").trim())}function colorize(text,log){return log.level==="error"?import_chalk.default.red(text):log.level==="warning"?import_chalk.default.yellow(text):text}export{displayBuildLogs,collectBuildLogs,displayBuildLogsUntilFinalError,parseLogLines};
@@ -0,0 +1,10 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import{__commonJS}from"./chunk-BZENIQ7N.js";var require_balanced_match=__commonJS({"../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(exports,module){"use strict";module.exports=balanced;function balanced(a,b,str){a instanceof RegExp&&(a=maybeMatch(a,str)),b instanceof RegExp&&(b=maybeMatch(b,str));var r=range(a,b,str);return r&&{start:r[0],end:r[1],pre:str.slice(0,r[0]),body:str.slice(r[0]+a.length,r[1]),post:str.slice(r[1]+b.length)}}function maybeMatch(reg,str){var m=str.match(reg);return m?m[0]:null}balanced.range=range;function range(a,b,str){var begs,beg,left,right,result,ai=str.indexOf(a),bi=str.indexOf(b,ai+1),i=ai;if(ai>=0&&bi>0){if(a===b)return[ai,bi];for(begs=[],left=str.length;i>=0&&!result;)i==ai?(begs.push(i),ai=str.indexOf(a,i+1)):begs.length==1?result=[begs.pop(),bi]:(beg=begs.pop(),beg<left&&(left=beg,right=bi),bi=str.indexOf(b,i+1)),i=ai<bi&&ai>=0?ai:bi;begs.length&&(result=[left,right])}return result}}});var require_path=__commonJS({"../../node_modules/.pnpm/minimatch@5.0.1/node_modules/minimatch/lib/path.js"(exports,module){var isWindows=typeof process=="object"&&process&&process.platform==="win32";module.exports=isWindows?{sep:"\\"}:{sep:"/"}}});var require_brace_expansion=__commonJS({"../../node_modules/.pnpm/brace-expansion@2.1.1/node_modules/brace-expansion/index.js"(exports,module){var balanced=require_balanced_match();module.exports=expandTop;var escSlash="\0SLASH"+Math.random()+"\0",escOpen="\0OPEN"+Math.random()+"\0",escClose="\0CLOSE"+Math.random()+"\0",escComma="\0COMMA"+Math.random()+"\0",escPeriod="\0PERIOD"+Math.random()+"\0";function numeric(str){return parseInt(str,10)==str?parseInt(str,10):str.charCodeAt(0)}function escapeBraces(str){return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod)}function unescapeBraces(str){return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".")}function parseCommaParts(str){if(!str)return[""];var parts=[],m=balanced("{","}",str);if(!m)return str.split(",");var pre=m.pre,body=m.body,post=m.post,p=pre.split(",");p[p.length-1]+="{"+body+"}";var postParts=parseCommaParts(post);return post.length&&(p[p.length-1]+=postParts.shift(),p.push.apply(p,postParts)),parts.push.apply(parts,p),parts}function expandTop(str,options){if(!str)return[];options=options||{};var max=options.max==null?1/0:options.max;return str.substr(0,2)==="{}"&&(str="\\{\\}"+str.substr(2)),expand(escapeBraces(str),max,!0).map(unescapeBraces)}function embrace(str){return"{"+str+"}"}function isPadded(el){return/^-?0\d/.test(el)}function lte(i,y){return i<=y}function gte(i,y){return i>=y}function expand(str,max,isTop){var expansions=[],m=balanced("{","}",str);if(!m)return[str];var pre=m.pre,post=m.post.length?expand(m.post,max,!1):[""];if(/\$$/.test(m.pre))for(var k=0;k<post.length&&k<max;k++){var expansion=pre+"{"+m.body+"}"+post[k];expansions.push(expansion)}else{var isNumericSequence=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body),isAlphaSequence=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body),isSequence=isNumericSequence||isAlphaSequence,isOptions=m.body.indexOf(",")>=0;if(!isSequence&&!isOptions)return m.post.match(/,(?!,).*\}/)?(str=m.pre+"{"+m.body+escClose+m.post,expand(str,max,!0)):[str];var n;if(isSequence)n=m.body.split(/\.\./);else if(n=parseCommaParts(m.body),n.length===1&&(n=expand(n[0],max,!1).map(embrace),n.length===1))return post.map(function(p){return m.pre+n[0]+p});var N;if(isSequence){var x=numeric(n[0]),y=numeric(n[1]),width=Math.max(n[0].length,n[1].length),incr=n.length==3?Math.max(Math.abs(numeric(n[2])),1):1,test=lte,reverse=y<x;reverse&&(incr*=-1,test=gte);var pad=n.some(isPadded);N=[];for(var i=x;test(i,y)&&N.length<max;i+=incr){var c;if(isAlphaSequence)c=String.fromCharCode(i),c==="\\"&&(c="");else if(c=String(i),pad){var need=width-c.length;if(need>0){var z=new Array(need+1).join("0");i<0?c="-"+z+c.slice(1):c=z+c}}N.push(c)}}else{N=[];for(var j=0;j<n.length;j++)N.push.apply(N,expand(n[j],max,!1))}for(var j=0;j<N.length;j++)for(var k=0;k<post.length&&expansions.length<max;k++){var expansion=pre+N[j]+post[k];(!isTop||isSequence||expansion)&&expansions.push(expansion)}}return expansions}}});var require_minimatch=__commonJS({"../../node_modules/.pnpm/minimatch@5.0.1/node_modules/minimatch/minimatch.js"(exports,module){var minimatch=module.exports=(p,pattern,options={})=>(assertValidPattern(pattern),!options.nocomment&&pattern.charAt(0)==="#"?!1:new Minimatch(pattern,options).match(p));module.exports=minimatch;var path=require_path();minimatch.sep=path.sep;var GLOBSTAR=Symbol("globstar **");minimatch.GLOBSTAR=GLOBSTAR;var expand=require_brace_expansion(),plTypes={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},qmark="[^/]",star=qmark+"*?",twoStarDot="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",twoStarNoDot="(?:(?!(?:\\/|^)\\.).)*?",charSet=s=>s.split("").reduce((set,c)=>(set[c]=!0,set),{}),reSpecials=charSet("().*{}+?[]^$\\!"),addPatternStartSet=charSet("[.("),slashSplit=/\/+/;minimatch.filter=(pattern,options={})=>(p,i,list)=>minimatch(p,pattern,options);var ext=(a,b={})=>{let t={};return Object.keys(a).forEach(k=>t[k]=a[k]),Object.keys(b).forEach(k=>t[k]=b[k]),t};minimatch.defaults=def=>{if(!def||typeof def!="object"||!Object.keys(def).length)return minimatch;let orig=minimatch,m=(p,pattern,options)=>orig(p,pattern,ext(def,options));return m.Minimatch=class extends orig.Minimatch{constructor(pattern,options){super(pattern,ext(def,options))}},m.Minimatch.defaults=options=>orig.defaults(ext(def,options)).Minimatch,m.filter=(pattern,options)=>orig.filter(pattern,ext(def,options)),m.defaults=options=>orig.defaults(ext(def,options)),m.makeRe=(pattern,options)=>orig.makeRe(pattern,ext(def,options)),m.braceExpand=(pattern,options)=>orig.braceExpand(pattern,ext(def,options)),m.match=(list,pattern,options)=>orig.match(list,pattern,ext(def,options)),m};minimatch.braceExpand=(pattern,options)=>braceExpand(pattern,options);var braceExpand=(pattern,options={})=>(assertValidPattern(pattern),options.nobrace||!/\{(?:(?!\{).)*\}/.test(pattern)?[pattern]:expand(pattern)),MAX_PATTERN_LENGTH=1024*64,assertValidPattern=pattern=>{if(typeof pattern!="string")throw new TypeError("invalid pattern");if(pattern.length>MAX_PATTERN_LENGTH)throw new TypeError("pattern is too long")},SUBPARSE=Symbol("subparse");minimatch.makeRe=(pattern,options)=>new Minimatch(pattern,options||{}).makeRe();minimatch.match=(list,pattern,options={})=>{let mm=new Minimatch(pattern,options);return list=list.filter(f=>mm.match(f)),mm.options.nonull&&!list.length&&list.push(pattern),list};var globUnescape=s=>s.replace(/\\(.)/g,"$1"),regExpEscape=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Minimatch=class{constructor(pattern,options){assertValidPattern(pattern),options||(options={}),this.options=options,this.set=[],this.pattern=pattern,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!options.partial,this.make()}debug(){}make(){let pattern=this.pattern,options=this.options;if(!options.nocomment&&pattern.charAt(0)==="#"){this.comment=!0;return}if(!pattern){this.empty=!0;return}this.parseNegate();let set=this.globSet=this.braceExpand();options.debug&&(this.debug=(...args)=>console.error(...args)),this.debug(this.pattern,set),set=this.globParts=set.map(s=>s.split(slashSplit)),this.debug(this.pattern,set),set=set.map((s,si,set2)=>s.map(this.parse,this)),this.debug(this.pattern,set),set=set.filter(s=>s.indexOf(!1)===-1),this.debug(this.pattern,set),this.set=set}parseNegate(){if(this.options.nonegate)return;let pattern=this.pattern,negate=!1,negateOffset=0;for(let i=0;i<pattern.length&&pattern.charAt(i)==="!";i++)negate=!negate,negateOffset++;negateOffset&&(this.pattern=pattern.substr(negateOffset)),this.negate=negate}matchOne(file,pattern,partial){var options=this.options;this.debug("matchOne",{this:this,file,pattern}),this.debug("matchOne",file.length,pattern.length);for(var fi=0,pi=0,fl=file.length,pl=pattern.length;fi<fl&&pi<pl;fi++,pi++){this.debug("matchOne loop");var p=pattern[pi],f=file[fi];if(this.debug(pattern,p,f),p===!1)return!1;if(p===GLOBSTAR){this.debug("GLOBSTAR",[pattern,p,f]);var fr=fi,pr=pi+1;if(pr===pl){for(this.debug("** at the end");fi<fl;fi++)if(file[fi]==="."||file[fi]===".."||!options.dot&&file[fi].charAt(0)===".")return!1;return!0}for(;fr<fl;){var swallowee=file[fr];if(this.debug(`
8
+ globstar while`,file,fr,pattern,pr,swallowee),this.matchOne(file.slice(fr),pattern.slice(pr),partial))return this.debug("globstar found match!",fr,fl,swallowee),!0;if(swallowee==="."||swallowee===".."||!options.dot&&swallowee.charAt(0)==="."){this.debug("dot detected!",file,fr,pattern,pr);break}this.debug("globstar swallow a segment, and continue"),fr++}return!!(partial&&(this.debug(`
9
+ >>> no match, partial?`,file,fr,pattern,pr),fr===fl))}var hit;if(typeof p=="string"?(hit=f===p,this.debug("string match",p,f,hit)):(hit=f.match(p),this.debug("pattern match",p,f,hit)),!hit)return!1}if(fi===fl&&pi===pl)return!0;if(fi===fl)return partial;if(pi===pl)return fi===fl-1&&file[fi]==="";throw new Error("wtf?")}braceExpand(){return braceExpand(this.pattern,this.options)}parse(pattern,isSub){assertValidPattern(pattern);let options=this.options;if(pattern==="**")if(options.noglobstar)pattern="*";else return GLOBSTAR;if(pattern==="")return"";let re="",hasMagic=!!options.nocase,escaping=!1,patternListStack=[],negativeLists=[],stateChar,inClass=!1,reClassStart=-1,classStart=-1,cs,pl,sp,patternStart=pattern.charAt(0)==="."?"":options.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",clearStateChar=()=>{if(stateChar){switch(stateChar){case"*":re+=star,hasMagic=!0;break;case"?":re+=qmark,hasMagic=!0;break;default:re+="\\"+stateChar;break}this.debug("clearStateChar %j %j",stateChar,re),stateChar=!1}};for(let i=0,c;i<pattern.length&&(c=pattern.charAt(i));i++){if(this.debug("%s %s %s %j",pattern,i,re,c),escaping){if(c==="/")return!1;reSpecials[c]&&(re+="\\"),re+=c,escaping=!1;continue}switch(c){case"/":return!1;case"\\":clearStateChar(),escaping=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",pattern,i,re,c),inClass){this.debug(" in class"),c==="!"&&i===classStart+1&&(c="^"),re+=c;continue}this.debug("call clearStateChar %j",stateChar),clearStateChar(),stateChar=c,options.noext&&clearStateChar();continue;case"(":if(inClass){re+="(";continue}if(!stateChar){re+="\\(";continue}patternListStack.push({type:stateChar,start:i-1,reStart:re.length,open:plTypes[stateChar].open,close:plTypes[stateChar].close}),re+=stateChar==="!"?"(?:(?!(?:":"(?:",this.debug("plType %j %j",stateChar,re),stateChar=!1;continue;case")":if(inClass||!patternListStack.length){re+="\\)";continue}clearStateChar(),hasMagic=!0,pl=patternListStack.pop(),re+=pl.close,pl.type==="!"&&negativeLists.push(pl),pl.reEnd=re.length;continue;case"|":if(inClass||!patternListStack.length){re+="\\|";continue}clearStateChar(),re+="|";continue;case"[":if(clearStateChar(),inClass){re+="\\"+c;continue}inClass=!0,classStart=i,reClassStart=re.length,re+=c;continue;case"]":if(i===classStart+1||!inClass){re+="\\"+c;continue}cs=pattern.substring(classStart+1,i);try{RegExp("["+cs+"]")}catch{sp=this.parse(cs,SUBPARSE),re=re.substr(0,reClassStart)+"\\["+sp[0]+"\\]",hasMagic=hasMagic||sp[1],inClass=!1;continue}hasMagic=!0,inClass=!1,re+=c;continue;default:clearStateChar(),reSpecials[c]&&!(c==="^"&&inClass)&&(re+="\\"),re+=c;break}}for(inClass&&(cs=pattern.substr(classStart+1),sp=this.parse(cs,SUBPARSE),re=re.substr(0,reClassStart)+"\\["+sp[0],hasMagic=hasMagic||sp[1]),pl=patternListStack.pop();pl;pl=patternListStack.pop()){let tail;tail=re.slice(pl.reStart+pl.open.length),this.debug("setting tail",re,pl),tail=tail.replace(/((?:\\{2}){0,64})(\\?)\|/g,(_,$1,$2)=>($2||($2="\\"),$1+$1+$2+"|")),this.debug(`tail=%j
10
+ %s`,tail,tail,pl,re);let t=pl.type==="*"?star:pl.type==="?"?qmark:"\\"+pl.type;hasMagic=!0,re=re.slice(0,pl.reStart)+t+"\\("+tail}clearStateChar(),escaping&&(re+="\\\\");let addPatternStart=addPatternStartSet[re.charAt(0)];for(let n=negativeLists.length-1;n>-1;n--){let nl=negativeLists[n],nlBefore=re.slice(0,nl.reStart),nlFirst=re.slice(nl.reStart,nl.reEnd-8),nlAfter=re.slice(nl.reEnd),nlLast=re.slice(nl.reEnd-8,nl.reEnd)+nlAfter,openParensBefore=nlBefore.split("(").length-1,cleanAfter=nlAfter;for(let i=0;i<openParensBefore;i++)cleanAfter=cleanAfter.replace(/\)[+*?]?/,"");nlAfter=cleanAfter;let dollar=nlAfter===""&&isSub!==SUBPARSE?"$":"";re=nlBefore+nlFirst+nlAfter+dollar+nlLast}if(re!==""&&hasMagic&&(re="(?=.)"+re),addPatternStart&&(re=patternStart+re),isSub===SUBPARSE)return[re,hasMagic];if(!hasMagic)return globUnescape(pattern);let flags=options.nocase?"i":"";try{return Object.assign(new RegExp("^"+re+"$",flags),{_glob:pattern,_src:re})}catch{return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let set=this.set;if(!set.length)return this.regexp=!1,this.regexp;let options=this.options,twoStar=options.noglobstar?star:options.dot?twoStarDot:twoStarNoDot,flags=options.nocase?"i":"",re=set.map(pattern=>(pattern=pattern.map(p=>typeof p=="string"?regExpEscape(p):p===GLOBSTAR?GLOBSTAR:p._src).reduce((set2,p)=>(set2[set2.length-1]===GLOBSTAR&&p===GLOBSTAR||set2.push(p),set2),[]),pattern.forEach((p,i)=>{p!==GLOBSTAR||pattern[i-1]===GLOBSTAR||(i===0?pattern.length>1?pattern[i+1]="(?:\\/|"+twoStar+"\\/)?"+pattern[i+1]:pattern[i]=twoStar:i===pattern.length-1?pattern[i-1]+="(?:\\/|"+twoStar+")?":(pattern[i-1]+="(?:\\/|\\/"+twoStar+"\\/)"+pattern[i+1],pattern[i+1]=GLOBSTAR))}),pattern.filter(p=>p!==GLOBSTAR).join("/"))).join("|");re="^(?:"+re+")$",this.negate&&(re="^(?!"+re+").*$");try{this.regexp=new RegExp(re,flags)}catch{this.regexp=!1}return this.regexp}match(f,partial=this.partial){if(this.debug("match",f,this.pattern),this.comment)return!1;if(this.empty)return f==="";if(f==="/"&&partial)return!0;let options=this.options;path.sep!=="/"&&(f=f.split(path.sep).join("/")),f=f.split(slashSplit),this.debug(this.pattern,"split",f);let set=this.set;this.debug(this.pattern,"set",set);let filename;for(let i=f.length-1;i>=0&&(filename=f[i],!filename);i--);for(let i=0;i<set.length;i++){let pattern=set[i],file=f;if(options.matchBase&&pattern.length===1&&(file=[filename]),this.matchOne(file,pattern,partial))return options.flipNegate?!0:!this.negate}return options.flipNegate?!1:this.negate}static defaults(def){return minimatch.defaults(def).Minimatch}};minimatch.Minimatch=Minimatch}});export{require_balanced_match,require_minimatch};
@@ -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_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1),CHECKBOX_INSTRUCTIONS=[" ",import_chalk.default.cyan("<space>"),import_chalk.default.dim(" select, "),import_chalk.default.cyan("<enter>"),import_chalk.default.dim(" confirm, "),import_chalk.default.cyan("<a>"),import_chalk.default.dim(" toggle all, "),import_chalk.default.cyan("<i>"),import_chalk.default.dim(" invert")].join("");export{CHECKBOX_INSTRUCTIONS};
@@ -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_json_parse_better_errors}from"./chunk-25565AGS.js";import{require_lib}from"./chunk-KNLGWGUE.js";import{CantParseJSONFile}from"./chunk-6VH56CX2.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1);var import_json_parse_better_errors=__toESM(require_json_parse_better_errors(),1),import_error_utils=__toESM(require_dist(),1);async function readJSONFile(file){let content=await readFileSafe(file);if(content===null)return content;try{return(0,import_json_parse_better_errors.default)(content)}catch(error){return new CantParseJSONFile(file,(0,import_error_utils.errorToString)(error))}}async function readFileSafe(file){try{return await import_fs_extra.default.readFile(file,"utf8")}catch{return null}}export{readJSONFile};