vercel 65.1.0 → 65.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/dist/chunks/add-6XE2EK66.js +8 -0
  2. package/dist/chunks/add-WITOGFYA.js +8 -0
  3. package/dist/chunks/add-YSIECJTJ.js +8 -0
  4. package/dist/chunks/build-DNYYPGF2.js +7 -0
  5. package/dist/chunks/{chunk-DRT6ITIC.js → chunk-22FDWPWY.js} +1 -1
  6. package/dist/chunks/{chunk-572TYS62.js → chunk-3ADDGPEN.js} +1 -1
  7. package/dist/chunks/{chunk-PRAWMNTU.js → chunk-3AYYFYZG.js} +1 -1
  8. package/dist/chunks/{chunk-M5WBBJRW.js → chunk-3XCXKOBR.js} +1 -1
  9. package/dist/chunks/{chunk-IC27IY7N.js → chunk-4MTD47Y2.js} +1 -1
  10. package/dist/chunks/{chunk-IZWASLQ6.js → chunk-5IASAERQ.js} +1 -1
  11. package/dist/chunks/{chunk-CKZLNL5F.js → chunk-65TGOMRK.js} +1 -1
  12. package/dist/chunks/{chunk-IWVEHRIU.js → chunk-6URZLHEK.js} +1 -1
  13. package/dist/chunks/{chunk-PXGJGWVA.js → chunk-76KGQU2G.js} +1 -1
  14. package/dist/chunks/{chunk-W4FODG6F.js → chunk-7EC6KLFJ.js} +1 -1
  15. package/dist/chunks/{chunk-2N5LDFMR.js → chunk-7N67TEDX.js} +1 -1
  16. package/dist/chunks/{chunk-WFAZDFAR.js → chunk-7SYW5HXA.js} +1 -1
  17. package/dist/chunks/{chunk-CBXS6UFD.js → chunk-7Z3WUAO5.js} +1 -1
  18. package/dist/chunks/{chunk-4YDPE5DC.js → chunk-ABZEMNDR.js} +1 -1
  19. package/dist/chunks/{chunk-CWQJK5IX.js → chunk-AGBNDJBH.js} +1 -1
  20. package/dist/chunks/{chunk-K4AZWWRJ.js → chunk-AJCM43E4.js} +1 -1
  21. package/dist/chunks/chunk-AWMQGOS2.js +7 -0
  22. package/dist/chunks/{chunk-JBUFVCTP.js → chunk-BBKEP7RO.js} +1 -1
  23. package/dist/chunks/{chunk-F5QCUTBE.js → chunk-BL3GEBL6.js} +1 -1
  24. package/dist/chunks/{chunk-YEYZP3IH.js → chunk-BNQXEQWO.js} +1 -1
  25. package/dist/chunks/{chunk-ESCYLPN6.js → chunk-BZXSCHI7.js} +1 -1
  26. package/dist/chunks/{chunk-5Q7PEC6C.js → chunk-CEMPU323.js} +1 -1
  27. package/dist/chunks/{chunk-6KF43YYP.js → chunk-CF2FOU7X.js} +1 -1
  28. package/dist/chunks/{chunk-F2LZJWGH.js → chunk-CLFCR4UZ.js} +1 -1
  29. package/dist/chunks/{chunk-3PMDNDOO.js → chunk-DA37HMCW.js} +1 -1
  30. package/dist/chunks/{chunk-L6TM45P4.js → chunk-DGG3YML4.js} +2 -2
  31. package/dist/chunks/{chunk-GENXRXFN.js → chunk-DGYHWXD2.js} +1 -1
  32. package/dist/chunks/{chunk-MG7CRSO5.js → chunk-DHSOA6LP.js} +1 -1
  33. package/dist/chunks/{chunk-Y3J6UDPB.js → chunk-E2SADN6I.js} +1 -1
  34. package/dist/chunks/{chunk-KINNDNJ3.js → chunk-EEEYN6B4.js} +1 -1
  35. package/dist/chunks/{chunk-VWIHFPW2.js → chunk-F6FTWDLS.js} +1 -1
  36. package/dist/chunks/{chunk-W6RCABNS.js → chunk-FDNYYENK.js} +1 -1
  37. package/dist/chunks/{chunk-PWNCGM6A.js → chunk-FEI6O5QD.js} +1 -1
  38. package/dist/chunks/{chunk-S3QPCSQR.js → chunk-FI4SNRSM.js} +1 -1
  39. package/dist/chunks/{chunk-6RCYHBTM.js → chunk-G4T7VBGN.js} +1 -1
  40. package/dist/chunks/chunk-GG5RME4X.js +7 -0
  41. package/dist/chunks/{chunk-JB7ZP4L4.js → chunk-GGSM5AHN.js} +1 -1
  42. package/dist/chunks/{chunk-SDDKXGMK.js → chunk-GVTXA6HG.js} +1 -1
  43. package/dist/chunks/{chunk-5A46JI25.js → chunk-H2HV2IWG.js} +1 -1
  44. package/dist/chunks/{chunk-MTTYJO4W.js → chunk-IA3MXJRC.js} +1 -1
  45. package/dist/chunks/{chunk-THRWLZ3N.js → chunk-IEPW2YRH.js} +1 -1
  46. package/dist/chunks/{chunk-4B45V3VM.js → chunk-IGDG5CWT.js} +1 -1
  47. package/dist/chunks/{chunk-FDYDTFFM.js → chunk-IKQTP764.js} +1 -1
  48. package/dist/chunks/{chunk-VT3QK5IV.js → chunk-IUXSJWL3.js} +1 -1
  49. package/dist/chunks/{chunk-XRRGT7CM.js → chunk-JNVVIU6L.js} +1 -1
  50. package/dist/chunks/{chunk-E432NQGO.js → chunk-JVKIWEPJ.js} +1 -1
  51. package/dist/chunks/{chunk-RX2VZBEZ.js → chunk-K3FFPKIV.js} +1 -1
  52. package/dist/chunks/{chunk-QWE7OFE7.js → chunk-KECUEAMH.js} +1 -1
  53. package/dist/chunks/{chunk-HBLBUOZ7.js → chunk-KH6565YH.js} +1 -1
  54. package/dist/chunks/chunk-KTNBXM43.js +7 -0
  55. package/dist/chunks/{chunk-FGEWQYON.js → chunk-L7AHFYDS.js} +1 -1
  56. package/dist/chunks/{chunk-YJXE7NJC.js → chunk-LBNOOFB6.js} +1 -1
  57. package/dist/chunks/{chunk-DWJRJK7I.js → chunk-LC6D6S24.js} +1 -1
  58. package/dist/chunks/{chunk-KKRTKV62.js → chunk-LCHECISY.js} +1 -1
  59. package/dist/chunks/{chunk-H2FI64HG.js → chunk-LH7X2ZJQ.js} +1 -1
  60. package/dist/chunks/chunk-LJBUJ23M.js +7 -0
  61. package/dist/chunks/{chunk-CV333GGZ.js → chunk-LKLH6DZP.js} +1 -1
  62. package/dist/chunks/{chunk-NHRZRW54.js → chunk-LUBUI5GF.js} +1 -1
  63. package/dist/chunks/{chunk-Y5RR6CRP.js → chunk-LZWQBY2I.js} +2 -2
  64. package/dist/chunks/{chunk-IPZHE3OU.js → chunk-MBDXRSHX.js} +1 -1
  65. package/dist/chunks/{chunk-4CKX6KUQ.js → chunk-MX3RY7HH.js} +4 -4
  66. package/dist/chunks/{chunk-J52VRTEQ.js → chunk-N4HJGVRB.js} +2 -2
  67. package/dist/chunks/{chunk-EKLONFSU.js → chunk-NQWGRKF4.js} +1 -1
  68. package/dist/chunks/{chunk-CGSHQ7QM.js → chunk-NTZ5WWYV.js} +1 -1
  69. package/dist/chunks/{chunk-JXLPHMKT.js → chunk-OKEBIUKZ.js} +1 -1
  70. package/dist/chunks/{chunk-NFEG7ONP.js → chunk-P6ZHH3HQ.js} +1 -1
  71. package/dist/chunks/{chunk-PDY2YXG7.js → chunk-PFNYWWLI.js} +1 -1
  72. package/dist/chunks/{chunk-UYOFNAH5.js → chunk-PFPJLIFF.js} +1 -1
  73. package/dist/chunks/{chunk-PCLWLNZC.js → chunk-Q5ODLDCU.js} +1 -1
  74. package/dist/chunks/{chunk-FQ5EU3ML.js → chunk-QEAQNRWM.js} +1 -1
  75. package/dist/chunks/{chunk-AMUAIMYY.js → chunk-QMCHGGDX.js} +2 -2
  76. package/dist/chunks/{chunk-HO6ECDO3.js → chunk-QMGXVTLQ.js} +1 -1
  77. package/dist/chunks/{chunk-SSULKPUE.js → chunk-QOCZPYRV.js} +1 -1
  78. package/dist/chunks/{chunk-L3T6AEPG.js → chunk-QQVGXIFM.js} +1 -1
  79. package/dist/chunks/{chunk-VPH6RJ5P.js → chunk-QYCGL36Q.js} +1 -1
  80. package/dist/chunks/{chunk-I26SSWTS.js → chunk-QZX7VG2V.js} +1 -1
  81. package/dist/chunks/chunk-R5B5ISRX.js +15 -0
  82. package/dist/chunks/{chunk-PA2A2V5Y.js → chunk-RTQ6ERZF.js} +1 -1
  83. package/dist/chunks/{chunk-J2RX4B5S.js → chunk-RUA6EEAJ.js} +1 -1
  84. package/dist/chunks/chunk-RW3X523R.js +8 -0
  85. package/dist/chunks/{chunk-3V6MUBCO.js → chunk-S5IWVPYT.js} +1 -1
  86. package/dist/chunks/{chunk-FDAMQA44.js → chunk-SQE63XFX.js} +1 -1
  87. package/dist/chunks/{chunk-PBC276AK.js → chunk-SXOSF4O6.js} +1 -1
  88. package/dist/chunks/chunk-TO5PJDEN.js +7 -0
  89. package/dist/chunks/{chunk-JP2W5MLV.js → chunk-TZFDVQ72.js} +1 -1
  90. package/dist/chunks/{chunk-CS532HK4.js → chunk-UC2SUUL2.js} +1 -1
  91. package/dist/chunks/{chunk-JY4EKLND.js → chunk-UNEGQPD3.js} +1 -1
  92. package/dist/chunks/{chunk-5WTGQDJ7.js → chunk-VBWQRK3O.js} +6 -6
  93. package/dist/chunks/chunk-VOCZ34ON.js +7 -0
  94. package/dist/chunks/chunk-VT6RIZJH.js +7 -0
  95. package/dist/chunks/{chunk-PF6O7LHL.js → chunk-WBF36MYT.js} +1 -1
  96. package/dist/chunks/{chunk-VG2AJII6.js → chunk-WGXKX24Q.js} +1 -1
  97. package/dist/chunks/{chunk-6HEPFWGT.js → chunk-WUORIKOE.js} +1 -1
  98. package/dist/chunks/{chunk-YPKKC232.js → chunk-X4762EE4.js} +1 -1
  99. package/dist/chunks/{chunk-DQYCNHTR.js → chunk-XK6SNITB.js} +1 -1
  100. package/dist/chunks/{chunk-6A4CDEBQ.js → chunk-XSE75NFU.js} +1 -1
  101. package/dist/chunks/{chunk-L3FAM6KS.js → chunk-XXXRTHTP.js} +1 -1
  102. package/dist/chunks/{chunk-7MQHQTCJ.js → chunk-Y54GKXGG.js} +1 -1
  103. package/dist/chunks/{chunk-ZPXMOZ4S.js → chunk-YHQ7PPXP.js} +1 -1
  104. package/dist/chunks/clear-KLE7JYWS.js +8 -0
  105. package/dist/chunks/compile-vercel-config-QHWJCKJV.js +7 -0
  106. package/dist/chunks/config-3ZSKJULZ.js +7 -0
  107. package/dist/chunks/config-F5QZ5IGE.js +8 -0
  108. package/dist/chunks/config-validator.mjs +1 -1
  109. package/dist/chunks/delete-GKUCUSHP.js +9 -0
  110. package/dist/chunks/delete-TLC65SZD.js +10 -0
  111. package/dist/chunks/detect-services-D6HLLAI4.js +7 -0
  112. package/dist/chunks/disable-ORTTESHC.js +7 -0
  113. package/dist/chunks/discard-TGWEOYRT.js +14 -0
  114. package/dist/chunks/edit-3XLIA7OG.js +8 -0
  115. package/dist/chunks/edit-IE2X5ZQD.js +9 -0
  116. package/dist/chunks/enable-DK3YZA4V.js +7 -0
  117. package/dist/chunks/{export-5G7MAWTT.js → export-XOMKFSVY.js} +1 -1
  118. package/dist/chunks/{select-org-IAA5ZTIS.js → future-XGH5EADE.js} +1 -1
  119. package/dist/chunks/generate-cert-for-deploy-RGFAQHRI.js +7 -0
  120. package/dist/chunks/image-J2SIGGGB.js +7 -0
  121. package/dist/chunks/import-builders-MBKD4ERV.js +7 -0
  122. package/dist/chunks/inspect-CPXTLLSJ.js +13 -0
  123. package/dist/chunks/{inspect-NWAB6AGM.js → inspect-MR3XFJSZ.js} +1 -1
  124. package/dist/chunks/{inspect-5PNUHNL2.js → inspect-MY3WMAQO.js} +1 -1
  125. package/dist/chunks/inspect-Q7D2TTXV.js +9 -0
  126. package/dist/chunks/{inspect-BNOMQCB4.js → inspect-SNN4G5IH.js} +1 -1
  127. package/dist/chunks/{list-JF2OEQON.js → list-5HYYTOOF.js} +1 -1
  128. package/dist/chunks/list-6WEW57IO.js +12 -0
  129. package/dist/chunks/{list-3Q5CBGFH.js → list-7LMA6KKH.js} +1 -1
  130. package/dist/chunks/login-PFJ4ZSUI.js +9 -0
  131. package/dist/chunks/login-TVTT7VFC.js +7 -0
  132. package/dist/chunks/logs-WAOHH4MP.js +7 -0
  133. package/dist/chunks/{ls-MERY5XTJ.js → ls-6NO2RHSW.js} +1 -1
  134. package/dist/chunks/{ls-RWBJBEIJ.js → ls-BHP75R3B.js} +1 -1
  135. package/dist/chunks/{ls-DVHKDVJJ.js → ls-NBMLWOON.js} +1 -1
  136. package/dist/chunks/{ls-RO7VUFMS.js → ls-QPOCM5P2.js} +1 -1
  137. package/dist/chunks/ls-VDMCJ53V.js +11 -0
  138. package/dist/chunks/{ls-GCFLDDFZ.js → ls-WHEKRXAT.js} +1 -1
  139. package/dist/chunks/ls-ZL4DBDXR.js +8 -0
  140. package/dist/chunks/mutate-C6FYX2DM.js +9 -0
  141. package/dist/chunks/notifications-F7GGQGPQ.js +7 -0
  142. package/dist/chunks/open-EX4PGTAE.js +7 -0
  143. package/dist/chunks/openapi-JGYEFJJV.js +7 -0
  144. package/dist/chunks/permissions-KSPXNTFT.js +7 -0
  145. package/dist/chunks/{plugin-offer-E4DLD4HU.js → plugin-offer-4U77LNYA.js} +1 -1
  146. package/dist/chunks/prompt-missing-credentials-JJP6AV5V.js +7 -0
  147. package/dist/chunks/publish-UZES2VJC.js +15 -0
  148. package/dist/chunks/pull-WUTJTCOT.js +7 -0
  149. package/dist/chunks/purchase-domain-if-available-XMNJGSPL.js +7 -0
  150. package/dist/chunks/push-ST6KQ2OK.js +7 -0
  151. package/dist/chunks/{query-RW2DLTO5.js → query-XCRX43SR.js} +1 -1
  152. package/dist/chunks/reauthenticate-LRJ5APNU.js +7 -0
  153. package/dist/chunks/reorder-QSZPOIBU.js +10 -0
  154. package/dist/chunks/reply-CAWLLEJ6.js +9 -0
  155. package/dist/chunks/resolve-GO4RFRQY.js +12 -0
  156. package/dist/chunks/resolve-agent-team-OGT4SLRJ.js +7 -0
  157. package/dist/chunks/restore-NHHAVT4H.js +16 -0
  158. package/dist/chunks/rm-5FFPHHK6.js +8 -0
  159. package/dist/chunks/rm-7WHWMHAY.js +8 -0
  160. package/dist/chunks/rm-IFTLVW4R.js +8 -0
  161. package/dist/chunks/rm-TDUKZY7D.js +8 -0
  162. package/dist/chunks/rm-XIN5CPXB.js +8 -0
  163. package/dist/chunks/{routes-KHBSGELO.js → routes-P6LKQCWH.js} +1 -1
  164. package/dist/chunks/rule-inspect-4EIDKQL6.js +8 -0
  165. package/dist/chunks/{schema-JCJF3AUI.js → schema-NSGCBPHF.js} +1 -1
  166. package/dist/chunks/schema-NYKJCOCR.js +14 -0
  167. package/dist/chunks/select-org-AZVHP7AQ.js +7 -0
  168. package/dist/chunks/set-OC6KN3G4.js +7 -0
  169. package/dist/chunks/setup-and-link-WEXKJDAQ.js +7 -0
  170. package/dist/chunks/{skills-U52S6GRY.js → skills-4J2NC2QI.js} +2 -2
  171. package/dist/chunks/tags-CCM7IGNC.js +7 -0
  172. package/dist/chunks/{types-LKCU7WSY.js → types-SK6J2HFE.js} +1 -1
  173. package/dist/chunks/{update-DUSQP2H7.js → update-TFDQQXYZ.js} +1 -1
  174. package/dist/commands/build/index.js +1 -1
  175. package/dist/commands/deploy/index.js +5 -5
  176. package/dist/commands/dev/index.js +3 -3
  177. package/dist/commands/env/index.js +2 -2
  178. package/dist/commands/link/index.js +1 -1
  179. package/dist/commands/list/index.js +1 -1
  180. package/dist/commands/project/index.js +2 -2
  181. package/dist/commands-account.js +82 -58
  182. package/dist/commands-ai.js +3 -3
  183. package/dist/commands-blob.js +2 -2
  184. package/dist/commands-core.js +8 -8
  185. package/dist/commands-deployments.js +2 -2
  186. package/dist/commands-flags.js +14 -14
  187. package/dist/commands-integrations.js +4 -4
  188. package/dist/commands-observability.js +3 -3
  189. package/dist/commands-routing.js +9 -9
  190. package/dist/index.js +4 -4
  191. package/dist/internal-build.js +1 -1
  192. package/dist/root-help-commands.mjs +1 -1
  193. package/dist/version.mjs +1 -1
  194. package/package.json +58 -57
  195. package/dist/chunks/add-G44L5OSZ.js +0 -8
  196. package/dist/chunks/add-JATTZAMX.js +0 -8
  197. package/dist/chunks/add-QMLQDEWM.js +0 -8
  198. package/dist/chunks/build-ODRPV34E.js +0 -7
  199. package/dist/chunks/chunk-64XCYUH7.js +0 -7
  200. package/dist/chunks/chunk-67NIX52O.js +0 -7
  201. package/dist/chunks/chunk-6CXJXQ6W.js +0 -8
  202. package/dist/chunks/chunk-D3M2JG5C.js +0 -7
  203. package/dist/chunks/chunk-DHYND2QH.js +0 -7
  204. package/dist/chunks/chunk-K246KRFS.js +0 -7
  205. package/dist/chunks/chunk-NFUAFRIC.js +0 -7
  206. package/dist/chunks/chunk-NNH2H4LZ.js +0 -15
  207. package/dist/chunks/chunk-QO7CBCML.js +0 -7
  208. package/dist/chunks/chunk-WSD53RLA.js +0 -7
  209. package/dist/chunks/clear-REFHHJJB.js +0 -8
  210. package/dist/chunks/compile-vercel-config-Q7JGV2RD.js +0 -7
  211. package/dist/chunks/config-DQ23X4AJ.js +0 -7
  212. package/dist/chunks/config-GKMT3G67.js +0 -8
  213. package/dist/chunks/delete-5H7AMGTE.js +0 -10
  214. package/dist/chunks/delete-MIDLGXPG.js +0 -9
  215. package/dist/chunks/detect-services-CNIBYXAN.js +0 -7
  216. package/dist/chunks/disable-45GKGBKT.js +0 -7
  217. package/dist/chunks/discard-ZHC6DXON.js +0 -14
  218. package/dist/chunks/edit-N6D2VXVA.js +0 -9
  219. package/dist/chunks/edit-TVSUOODD.js +0 -8
  220. package/dist/chunks/enable-SXFQAYFU.js +0 -7
  221. package/dist/chunks/future-3BZKO5JV.js +0 -7
  222. package/dist/chunks/generate-cert-for-deploy-YAJHY6TW.js +0 -7
  223. package/dist/chunks/image-W5TWCF3B.js +0 -7
  224. package/dist/chunks/import-builders-PK2EHZ43.js +0 -7
  225. package/dist/chunks/inspect-IS5SYBTI.js +0 -9
  226. package/dist/chunks/inspect-O5IKZFOG.js +0 -13
  227. package/dist/chunks/list-OVHNSNGA.js +0 -12
  228. package/dist/chunks/login-3BXNN3JH.js +0 -7
  229. package/dist/chunks/login-5FKYBEVP.js +0 -9
  230. package/dist/chunks/logs-ALPOUQZZ.js +0 -7
  231. package/dist/chunks/ls-4WMW65WV.js +0 -8
  232. package/dist/chunks/ls-YOXQDZ7X.js +0 -11
  233. package/dist/chunks/mutate-TGIOOZVQ.js +0 -9
  234. package/dist/chunks/notifications-J24CW3SD.js +0 -7
  235. package/dist/chunks/open-5U4GN2S4.js +0 -7
  236. package/dist/chunks/openapi-CZCUACZA.js +0 -7
  237. package/dist/chunks/permissions-B2RJ4FS6.js +0 -7
  238. package/dist/chunks/prompt-missing-credentials-WWEM2TVX.js +0 -7
  239. package/dist/chunks/publish-BK3BK3PV.js +0 -15
  240. package/dist/chunks/pull-CSFLO6P5.js +0 -7
  241. package/dist/chunks/purchase-domain-if-available-7VAJB3SY.js +0 -7
  242. package/dist/chunks/push-ENXU4VFN.js +0 -7
  243. package/dist/chunks/reauthenticate-QKPBNAAH.js +0 -7
  244. package/dist/chunks/reorder-XXOCBKOR.js +0 -10
  245. package/dist/chunks/reply-IJ4UMSYT.js +0 -9
  246. package/dist/chunks/resolve-FHUXU6TQ.js +0 -12
  247. package/dist/chunks/resolve-agent-team-3432OTOK.js +0 -7
  248. package/dist/chunks/restore-V2KCZWP3.js +0 -16
  249. package/dist/chunks/rm-5CDEDJXM.js +0 -8
  250. package/dist/chunks/rm-FN3G7ARM.js +0 -8
  251. package/dist/chunks/rm-MPREW2CR.js +0 -8
  252. package/dist/chunks/rm-VDEXQXNO.js +0 -8
  253. package/dist/chunks/rm-XUEOPXWC.js +0 -8
  254. package/dist/chunks/rule-inspect-27A23NWG.js +0 -8
  255. package/dist/chunks/schema-CE2N7SZP.js +0 -14
  256. package/dist/chunks/set-YP4JEPJQ.js +0 -7
  257. package/dist/chunks/setup-and-link-HS4GH2QQ.js +0 -7
  258. package/dist/chunks/tags-7WRBB2U4.js +0 -7
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{confirmOption,projectOption,yesOption}from"./chunk-64XCYUH7.js";import{packageName}from"./chunk-JESNVRVR.js";var addSubcommand={name:"add",aliases:[],description:"Add projects to an existing repository link created by link --repo",arguments:[],options:[{...yesOption,description:"Skip questions when adding projects with default team and settings"}],examples:[{name:"Add projects to an existing repository link",value:`${packageName} link add`}]},linkCommand={name:"link",aliases:[],description:"Link a local directory to a Vercel project",runsWithoutSubcommand:!0,arguments:[],subcommands:[addSubcommand],options:[{name:"repo",description:"Link multiple projects from the Git repository (alpha; per-directory project links take precedence)",shorthand:null,deprecatedShorthand:"r",type:Boolean,deprecated:!1},{...projectOption,shorthand:"p",description:"Set the project name or ID to link; required for non-interactive existing-project links"},{name:"team",description:"Set the team ID or slug; use with --project for non-interactive links",shorthand:null,argument:"TEAM_ID_OR_SLUG",type:String,deprecated:!1},{...yesOption,description:"Skip questions when setting up with default team and settings"},confirmOption],examples:[{name:"Link current directory to a Vercel project",value:`${packageName} link`},{name:"Link current directory with default options and skip questions",value:`${packageName} link --yes`},{name:"Link to an existing project in CI or agent mode",value:`${packageName} link --yes --team <team-id> --project <project-name-or-id>`},{name:"Link a specific directory to a Vercel project",value:`${packageName} link --cwd /path/to/project`},{name:"Link multiple projects from the current Git repository",value:`${packageName} link --repo`},{name:"Add additional projects to an existing repository link",value:`${packageName} link add`}]};export{addSubcommand,linkCommand};
7
+ import{confirmOption,projectOption,yesOption}from"./chunk-AWMQGOS2.js";import{packageName}from"./chunk-JESNVRVR.js";var addSubcommand={name:"add",aliases:[],description:"Add projects to an existing repository link created by link --repo",arguments:[],options:[{...yesOption,description:"Skip questions when adding projects with default team and settings"}],examples:[{name:"Add projects to an existing repository link",value:`${packageName} link add`}]},linkCommand={name:"link",aliases:[],description:"Link a local directory to a Vercel project",runsWithoutSubcommand:!0,arguments:[],subcommands:[addSubcommand],options:[{name:"repo",description:"Link multiple projects from the Git repository (alpha; per-directory project links take precedence)",shorthand:null,deprecatedShorthand:"r",type:Boolean,deprecated:!1},{...projectOption,shorthand:"p",description:"Set the project name or ID to link; required for non-interactive existing-project links"},{name:"team",description:"Set the team ID or slug; use with --project for non-interactive links",shorthand:null,argument:"TEAM_ID_OR_SLUG",type:String,deprecated:!1},{...yesOption,description:"Skip questions when setting up with default team and settings"},confirmOption],examples:[{name:"Link current directory to a Vercel project",value:`${packageName} link`},{name:"Link current directory with default options and skip questions",value:`${packageName} link --yes`},{name:"Link to an existing project in CI or agent mode",value:`${packageName} link --yes --team <team-id> --project <project-name-or-id>`},{name:"Link a specific directory to a Vercel project",value:`${packageName} link --cwd /path/to/project`},{name:"Link multiple projects from the current Git repository",value:`${packageName} link --repo`},{name:"Add additional projects to an existing repository link",value:`${packageName} link add`}]};export{addSubcommand,linkCommand};
@@ -4,6 +4,6 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{writeProjectSettings}from"./chunk-W4FODG6F.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import{envPullCommandLogic}from"./chunk-MG7CRSO5.js";import{parseTarget,warnDeprecatedProdFlag}from"./chunk-YPKKC232.js";import{ensureLink}from"./chunk-J52VRTEQ.js";import{pullCommand}from"./chunk-PDY2YXG7.js";import{help}from"./chunk-HBLBUOZ7.js";import{printError}from"./chunk-6RCYHBTM.js";import{TelemetryClient}from"./chunk-2PKEEQ5W.js";import{VERCEL_DIR,VERCEL_DIR_PROJECT,humanizePath}from"./chunk-5WTGQDJ7.js";import{parseArguments}from"./chunk-QO7CBCML.js";import{getFlagsSpecification}from"./chunk-64XCYUH7.js";import{emoji,output_manager_default,prependEmoji}from"./chunk-XP3FT56R.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);import{join}from"node:path";var PullTelemetryClient=class extends TelemetryClient{trackCliArgumentProjectPath(value){value&&this.trackCliArgument({arg:"projectPath",value:this.redactedValue})}trackCliOptionEnvironment(environment){environment&&this.trackCliOption({option:"environment",value:this.redactedTargetName(environment)})}trackCliOptionGitBranch(gitBranch){gitBranch&&this.trackCliOption({option:"git-branch",value:this.redactedValue})}trackCliFlagProd(isProduction){isProduction&&this.trackCliFlag("prod")}trackCliFlagYes(yes){yes&&this.trackCliFlag("yes")}};async function pullAllEnvFiles(environment,client,link,flags,cwd){let environmentFile=`.env.${environment}.local`;return await envPullCommandLogic(client,join(".vercel",environmentFile),!!flags["--yes"],environment,link,flags["--git-branch"],cwd,"vercel-cli:pull"),0}async function main(client){let parsedArgs=null,flagsSpecification=getFlagsSpecification(pullCommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(error){return printError(error),2}let telemetryClient=new PullTelemetryClient({opts:{store:client.telemetryEventStore}});if(parsedArgs.flags["--help"])return telemetryClient.trackCliFlagHelp("pull"),output_manager_default.print(help(pullCommand,{columns:client.stderr.columns})),0;let cwd=parsedArgs.args[1]||client.cwd,autoConfirm=!!parsedArgs.flags["--yes"],isProduction=!!parsedArgs.flags["--prod"];warnDeprecatedProdFlag(client,parsedArgs.flags);let environment=parseTarget({flagName:"environment",flags:parsedArgs.flags})||"development";return telemetryClient.trackCliArgumentProjectPath(parsedArgs.args[1]),telemetryClient.trackCliFlagYes(autoConfirm),telemetryClient.trackCliFlagProd(isProduction),telemetryClient.trackCliOptionGitBranch(parsedArgs.flags["--git-branch"]),telemetryClient.trackCliOptionEnvironment(parsedArgs.flags["--environment"]),telemetryClient.trackCliOptionProject(parsedArgs.flags["--project"]),await pullCommandLogic(client,cwd,autoConfirm,environment,parsedArgs.flags,parsedArgs.flags["--project"])}async function pullCommandLogic(client,cwd,autoConfirm,environment,flags,projectNameOrId){let link=await ensureLink("pull",client,cwd,{autoConfirm,pullEnv:!1,projectName:projectNameOrId,failIfNotFound:!!projectNameOrId,skipOwnerLookup:!0});if(typeof link=="number")return link;let{project,org,repoRoot}=link,currentDirectory;repoRoot?currentDirectory=join(repoRoot,project.rootDirectory||""):currentDirectory=cwd,client.config.currentTeam=org.type==="team"?org.id:void 0;let pullResultCode=await pullAllEnvFiles(environment,client,link,flags,currentDirectory);if(pullResultCode!==0)return pullResultCode;output_manager_default.print(`
7
+ import{writeProjectSettings}from"./chunk-7EC6KLFJ.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import{envPullCommandLogic}from"./chunk-DHSOA6LP.js";import{parseTarget,warnDeprecatedProdFlag}from"./chunk-X4762EE4.js";import{ensureLink}from"./chunk-N4HJGVRB.js";import{pullCommand}from"./chunk-PFNYWWLI.js";import{help}from"./chunk-KH6565YH.js";import{printError}from"./chunk-G4T7VBGN.js";import{TelemetryClient}from"./chunk-2PKEEQ5W.js";import{VERCEL_DIR,VERCEL_DIR_PROJECT,humanizePath}from"./chunk-VBWQRK3O.js";import{parseArguments}from"./chunk-VOCZ34ON.js";import{getFlagsSpecification}from"./chunk-AWMQGOS2.js";import{emoji,output_manager_default,prependEmoji}from"./chunk-XP3FT56R.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);import{join}from"node:path";var PullTelemetryClient=class extends TelemetryClient{trackCliArgumentProjectPath(value){value&&this.trackCliArgument({arg:"projectPath",value:this.redactedValue})}trackCliOptionEnvironment(environment){environment&&this.trackCliOption({option:"environment",value:this.redactedTargetName(environment)})}trackCliOptionGitBranch(gitBranch){gitBranch&&this.trackCliOption({option:"git-branch",value:this.redactedValue})}trackCliFlagProd(isProduction){isProduction&&this.trackCliFlag("prod")}trackCliFlagYes(yes){yes&&this.trackCliFlag("yes")}};async function pullAllEnvFiles(environment,client,link,flags,cwd){let environmentFile=`.env.${environment}.local`;return await envPullCommandLogic(client,join(".vercel",environmentFile),!!flags["--yes"],environment,link,flags["--git-branch"],cwd,"vercel-cli:pull"),0}async function main(client){let parsedArgs=null,flagsSpecification=getFlagsSpecification(pullCommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(error){return printError(error),2}let telemetryClient=new PullTelemetryClient({opts:{store:client.telemetryEventStore}});if(parsedArgs.flags["--help"])return telemetryClient.trackCliFlagHelp("pull"),output_manager_default.print(help(pullCommand,{columns:client.stderr.columns})),0;let cwd=parsedArgs.args[1]||client.cwd,autoConfirm=!!parsedArgs.flags["--yes"],isProduction=!!parsedArgs.flags["--prod"];warnDeprecatedProdFlag(client,parsedArgs.flags);let environment=parseTarget({flagName:"environment",flags:parsedArgs.flags})||"development";return telemetryClient.trackCliArgumentProjectPath(parsedArgs.args[1]),telemetryClient.trackCliFlagYes(autoConfirm),telemetryClient.trackCliFlagProd(isProduction),telemetryClient.trackCliOptionGitBranch(parsedArgs.flags["--git-branch"]),telemetryClient.trackCliOptionEnvironment(parsedArgs.flags["--environment"]),telemetryClient.trackCliOptionProject(parsedArgs.flags["--project"]),await pullCommandLogic(client,cwd,autoConfirm,environment,parsedArgs.flags,parsedArgs.flags["--project"])}async function pullCommandLogic(client,cwd,autoConfirm,environment,flags,projectNameOrId){let link=await ensureLink("pull",client,cwd,{autoConfirm,pullEnv:!1,projectName:projectNameOrId,failIfNotFound:!!projectNameOrId,skipOwnerLookup:!0});if(typeof link=="number")return link;let{project,org,repoRoot}=link,currentDirectory;repoRoot?currentDirectory=join(repoRoot,project.rootDirectory||""):currentDirectory=cwd,client.config.currentTeam=org.type==="team"?org.id:void 0;let pullResultCode=await pullAllEnvFiles(environment,client,link,flags,currentDirectory);if(pullResultCode!==0)return pullResultCode;output_manager_default.print(`
8
8
  `),output_manager_default.log("Downloading project settings"),await writeProjectSettings(currentDirectory,project,org,typeof repoRoot=="string");let settingsStamp=stamp_default();return output_manager_default.print(`${prependEmoji(`Downloaded project settings to ${import_chalk.default.bold(humanizePath(join(currentDirectory,VERCEL_DIR,VERCEL_DIR_PROJECT)))} ${import_chalk.default.gray(settingsStamp())}`,emoji("success"))}
9
9
  `),0}export{main,pullCommandLogic};
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{emitAlertsScopeError,resolveAlertsScope}from"./chunk-H2FI64HG.js";import{handleValidationError,validateAllProjectMutualExclusivity}from"./chunk-6CXJXQ6W.js";import{getScope}from"./chunk-VWIHFPW2.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-GENXRXFN.js";import{getProjectByNameOrId}from"./chunk-5WTGQDJ7.js";import{ProjectNotFound,isAPIError}from"./chunk-6VH56CX2.js";async function resolveRulesTeam(client,jsonOutput){let scope;try{scope=await getScope(client,{resolveLocalScope:!0})}catch(err){if(isAPIError(err)&&(err.status===403||err.status===404))return emitAlertsScopeError(client,jsonOutput,err.code||"API_ERROR",err.serverMessage||`API error (${err.status}).`,{reason:AGENT_REASON.MISSING_SCOPE,hint:"The selected team could not be loaded. Select a team you can access, or pass --scope <team-slug>.",next:[{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Select a team"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Inspect the current scope"}]});throw err}let{team}=scope;return team?{teamId:team.id}:emitAlertsScopeError(client,jsonOutput,"NO_TEAM","No team context found. Run `vercel switch` to select a team, use `--scope <team>`, or link a team project.",{reason:AGENT_REASON.MISSING_SCOPE,hint:"Monitors belong to a team. Select the team before retrying.",next:[{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Select a team"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Inspect the current scope"}]})}async function resolveRulesProject(client,projectNameOrId,jsonOutput,command){let teamScope=await resolveRulesTeam(client,jsonOutput);if(typeof teamScope=="number")return teamScope;try{let project=await getProjectByNameOrId(client,projectNameOrId,teamScope.teamId);return project instanceof ProjectNotFound?emitAlertsScopeError(client,jsonOutput,"PROJECT_NOT_FOUND",`Project "${projectNameOrId}" was not found in the selected team.`,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,`${command} --project <name_or_id>`),when:"Retry with a valid project"}]}):{...teamScope,projectId:project.id,projectName:project.name}}catch(error){if(!isAPIError(error))throw error;return emitAlertsScopeError(client,jsonOutput,error.code||"API_ERROR",error.serverMessage||`API error (${error.status}).`,{reason:error.status===401?"not_authorized":error.status===403?"forbidden":AGENT_REASON.API_ERROR})}}async function parseRulesFlagsAndScope(client,flags,jsonOutput,command="monitors ls"){let mutual=validateAllProjectMutualExclusivity(flags["--all"],flags["--project"]);if(!mutual.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:mutual.message,next:[{command:buildCommandWithGlobalFlags(client.argv,"monitors --help"),when:"Use either `--project` or `--all`, not both"}]},2),handleValidationError(mutual,jsonOutput,client);if(flags["--all"])return resolveRulesTeam(client,jsonOutput);if(flags["--project"])return resolveRulesProject(client,flags["--project"],jsonOutput,command);let linkedScope=await resolveAlertsScope(client,{jsonOutput,command});if(typeof linkedScope=="number")return linkedScope;let teamScope=await resolveRulesTeam(client,jsonOutput);return typeof teamScope=="number"?teamScope:linkedScope.teamId===teamScope.teamId?linkedScope:teamScope}export{resolveRulesTeam,resolveRulesProject,parseRulesFlagsAndScope};
7
+ import{emitAlertsScopeError,resolveAlertsScope}from"./chunk-LH7X2ZJQ.js";import{handleValidationError,validateAllProjectMutualExclusivity}from"./chunk-RW3X523R.js";import{getScope}from"./chunk-F6FTWDLS.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-DGYHWXD2.js";import{getProjectByNameOrId}from"./chunk-VBWQRK3O.js";import{ProjectNotFound,isAPIError}from"./chunk-6VH56CX2.js";async function resolveRulesTeam(client,jsonOutput){let scope;try{scope=await getScope(client,{resolveLocalScope:!0})}catch(err){if(isAPIError(err)&&(err.status===403||err.status===404))return emitAlertsScopeError(client,jsonOutput,err.code||"API_ERROR",err.serverMessage||`API error (${err.status}).`,{reason:AGENT_REASON.MISSING_SCOPE,hint:"The selected team could not be loaded. Select a team you can access, or pass --scope <team-slug>.",next:[{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Select a team"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Inspect the current scope"}]});throw err}let{team}=scope;return team?{teamId:team.id}:emitAlertsScopeError(client,jsonOutput,"NO_TEAM","No team context found. Run `vercel switch` to select a team, use `--scope <team>`, or link a team project.",{reason:AGENT_REASON.MISSING_SCOPE,hint:"Monitors belong to a team. Select the team before retrying.",next:[{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Select a team"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Inspect the current scope"}]})}async function resolveRulesProject(client,projectNameOrId,jsonOutput,command){let teamScope=await resolveRulesTeam(client,jsonOutput);if(typeof teamScope=="number")return teamScope;try{let project=await getProjectByNameOrId(client,projectNameOrId,teamScope.teamId);return project instanceof ProjectNotFound?emitAlertsScopeError(client,jsonOutput,"PROJECT_NOT_FOUND",`Project "${projectNameOrId}" was not found in the selected team.`,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,`${command} --project <name_or_id>`),when:"Retry with a valid project"}]}):{...teamScope,projectId:project.id,projectName:project.name}}catch(error){if(!isAPIError(error))throw error;return emitAlertsScopeError(client,jsonOutput,error.code||"API_ERROR",error.serverMessage||`API error (${error.status}).`,{reason:error.status===401?"not_authorized":error.status===403?"forbidden":AGENT_REASON.API_ERROR})}}async function parseRulesFlagsAndScope(client,flags,jsonOutput,command="monitors ls"){let mutual=validateAllProjectMutualExclusivity(flags["--all"],flags["--project"]);if(!mutual.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:mutual.message,next:[{command:buildCommandWithGlobalFlags(client.argv,"monitors --help"),when:"Use either `--project` or `--all`, not both"}]},2),handleValidationError(mutual,jsonOutput,client);if(flags["--all"])return resolveRulesTeam(client,jsonOutput);if(flags["--project"])return resolveRulesProject(client,flags["--project"],jsonOutput,command);let linkedScope=await resolveAlertsScope(client,{jsonOutput,command});if(typeof linkedScope=="number")return linkedScope;let teamScope=await resolveRulesTeam(client,jsonOutput);return typeof teamScope=="number"?teamScope:linkedScope.teamId===teamScope.teamId?linkedScope:teamScope}export{resolveRulesTeam,resolveRulesProject,parseRulesFlagsAndScope};
@@ -4,5 +4,5 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{param}from"./chunk-3G3FQYMW.js";import{getTeams}from"./chunk-FGFLTLEA.js";import{outputActionRequired}from"./chunk-GENXRXFN.js";import{getUser}from"./chunk-5WTGQDJ7.js";import{printAlignedLabel}from"./chunk-ADLBLGT3.js";import{getCommandName,packageName}from"./chunk-JESNVRVR.js";import{emoji,output_manager_default,require_build_utils}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_build_utils=__toESM(require_build_utils(),1);function getScopeOrTeamFromArgv(argv){let args=argv.slice(2);for(let i=0;i<args.length;i++){let arg=args[i];if(arg==="--scope"||arg==="--team"||arg==="-S"||arg==="-T"){let next=args[i+1];if(typeof next=="string"&&!next.startsWith("-"))return next;continue}if(arg.startsWith("--scope="))return arg.slice(8);if(arg.startsWith("--team="))return arg.slice(7)}return null}async function selectOrg(client,question,autoConfirm,searchable=!1,meta,description){let{config:{currentTeam}}=client;output_manager_default.spinner("Loading teams\u2026",1e3);let user,teams;try{[user,teams]=await Promise.all([getUser(client),getTeams(client)])}finally{output_manager_default.stopSpinner()}let formatChoiceName=(name,slug,isCurrent,limited)=>{let title=`${name} (${slug})`;return isCurrent&&(title+=` ${import_chalk.default.bold("(current)")}`),limited&&(title+=` ${emoji("locked")}`),title},personalAccountChoice=user.version==="northstar"?[]:[{name:formatChoiceName(user.name||user.username,user.username,!currentTeam,user.limited),value:{type:"user",id:user.id,slug:user.username}}],orderedTeams=client.ignoresSavedTeam?teams:teams.sort(a=>a.id===user.defaultTeamId?-1:1),choices=[...personalAccountChoice,...orderedTeams.map(team=>({name:formatChoiceName(team.name||team.slug,team.slug,team.id===currentTeam,team.limited),value:{type:"team",id:team.id,slug:team.slug}}))],defaultChoiceIndex=Math.max(choices.findIndex(choice=>choice.value.id===currentTeam),0);meta&&(meta.choiceCount=choices.length);let localConfigScope=client.localConfig?.scope,explicitScope=getScopeOrTeamFromArgv(client.argv)??(typeof localConfigScope=="string"?localConfigScope:null)??(0,import_build_utils.getPlatformEnv)("ORG_ID")??null,matchExplicitScope=()=>{if(!explicitScope)return;let match=choices.find(c=>c.value.id===explicitScope||c.value.slug===explicitScope);if(match)return match.value;if(user.id===explicitScope||user.email===explicitScope||user.username===explicitScope)return choices.find(c=>c.value.type==="user")?.value};if(client.nonInteractive||!client.stdin.isTTY){let match=matchExplicitScope();if(match)return match;if(choices.length===1)return choices[0].value;let actionRequired={status:"action_required",reason:"missing_scope",message:choices.length>0?"Provide --team or --scope explicitly. No default is applied in non-interactive mode.":"No teams available.",...choices.length>0&&{userActionRequired:!0,hint:"Ask the user which team to use, then run the matching command in next[]. Do not choose a team yourself."},choices:choices.map(c=>({id:c.value.id,name:c.value.slug})),next:choices.map(c=>({command:`${packageName} link --team ${c.value.slug}`}))};outputActionRequired(client,actionRequired),output_manager_default.error(choices.length>0?`Multiple teams found. Teams are never auto-selected when the CLI runs without an interactive terminal. Re-run this command with ${param("--team <slug>")}, or run ${getCommandName("teams ls")} to list your teams.`:"No teams available."),process.exit(1)}let explicitOrg=matchExplicitScope();if(explicitOrg)return explicitOrg;if(choices.length===1)return printAlignedLabel("Team",choices[0].value.slug),choices[0].value;let descriptionLine=description?`
7
+ import{param}from"./chunk-3G3FQYMW.js";import{getTeams}from"./chunk-FGFLTLEA.js";import{outputActionRequired}from"./chunk-DGYHWXD2.js";import{getUser}from"./chunk-VBWQRK3O.js";import{printAlignedLabel}from"./chunk-ADLBLGT3.js";import{getCommandName,packageName}from"./chunk-JESNVRVR.js";import{emoji,output_manager_default,require_build_utils}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_build_utils=__toESM(require_build_utils(),1);function getScopeOrTeamFromArgv(argv){let args=argv.slice(2);for(let i=0;i<args.length;i++){let arg=args[i];if(arg==="--scope"||arg==="--team"||arg==="-S"||arg==="-T"){let next=args[i+1];if(typeof next=="string"&&!next.startsWith("-"))return next;continue}if(arg.startsWith("--scope="))return arg.slice(8);if(arg.startsWith("--team="))return arg.slice(7)}return null}async function selectOrg(client,question,autoConfirm,searchable=!1,meta,description){let{config:{currentTeam}}=client;output_manager_default.spinner("Loading teams\u2026",1e3);let user,teams;try{[user,teams]=await Promise.all([getUser(client),getTeams(client)])}finally{output_manager_default.stopSpinner()}let formatChoiceName=(name,slug,isCurrent,limited)=>{let title=`${name} (${slug})`;return isCurrent&&(title+=` ${import_chalk.default.bold("(current)")}`),limited&&(title+=` ${emoji("locked")}`),title},personalAccountChoice=user.version==="northstar"?[]:[{name:formatChoiceName(user.name||user.username,user.username,!currentTeam,user.limited),value:{type:"user",id:user.id,slug:user.username}}],orderedTeams=client.ignoresSavedTeam?teams:teams.sort(a=>a.id===user.defaultTeamId?-1:1),choices=[...personalAccountChoice,...orderedTeams.map(team=>({name:formatChoiceName(team.name||team.slug,team.slug,team.id===currentTeam,team.limited),value:{type:"team",id:team.id,slug:team.slug}}))],defaultChoiceIndex=Math.max(choices.findIndex(choice=>choice.value.id===currentTeam),0);meta&&(meta.choiceCount=choices.length);let localConfigScope=client.localConfig?.scope,explicitScope=getScopeOrTeamFromArgv(client.argv)??(typeof localConfigScope=="string"?localConfigScope:null)??(0,import_build_utils.getPlatformEnv)("ORG_ID")??null,matchExplicitScope=()=>{if(!explicitScope)return;let match=choices.find(c=>c.value.id===explicitScope||c.value.slug===explicitScope);if(match)return match.value;if(user.id===explicitScope||user.email===explicitScope||user.username===explicitScope)return choices.find(c=>c.value.type==="user")?.value};if(client.nonInteractive||!client.stdin.isTTY){let match=matchExplicitScope();if(match)return match;if(choices.length===1)return choices[0].value;let actionRequired={status:"action_required",reason:"missing_scope",message:choices.length>0?"Provide --team or --scope explicitly. No default is applied in non-interactive mode.":"No teams available.",...choices.length>0&&{userActionRequired:!0,hint:"Ask the user which team to use, then run the matching command in next[]. Do not choose a team yourself."},choices:choices.map(c=>({id:c.value.id,name:c.value.slug})),next:choices.map(c=>({command:`${packageName} link --team ${c.value.slug}`}))};outputActionRequired(client,actionRequired),output_manager_default.error(choices.length>0?`Multiple teams found. Teams are never auto-selected when the CLI runs without an interactive terminal. Re-run this command with ${param("--team <slug>")}, or run ${getCommandName("teams ls")} to list your teams.`:"No teams available."),process.exit(1)}let explicitOrg=matchExplicitScope();if(explicitOrg)return explicitOrg;if(choices.length===1)return printAlignedLabel("Team",choices[0].value.slug),choices[0].value;let descriptionLine=description?`
8
8
  ${import_chalk.default.dim(` ${description}`)}`:"";if(!searchable)return await client.input.select({message:`${question}${descriptionLine}`,choices,default:choices[defaultChoiceIndex].value});let defaultChoice=choices[defaultChoiceIndex],initialChoices=defaultChoice?[defaultChoice,...choices.filter(choice=>choice!==defaultChoice)]:choices,pageSize=15,countHint=choices.length>pageSize?` ${import_chalk.default.dim(`(${choices.length} teams)`)}`:"";return await client.input.search({message:`${question}${countHint}${descriptionLine}`,pageSize,source:term=>{let searchTerm=term?.trim().toLowerCase();return searchTerm?choices.filter(choice=>choice.name.toLowerCase().includes(searchTerm)||choice.value.slug.toLowerCase().includes(searchTerm)):initialChoices}})}export{selectOrg};