vercel 59.24.0 → 59.25.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 (187) hide show
  1. package/README.md +2 -0
  2. package/dist/chunks/add-M4CAL43A.js +8 -0
  3. package/dist/chunks/add-UQUROKDW.js +8 -0
  4. package/dist/chunks/add-VI6GCTOM.js +8 -0
  5. package/dist/chunks/build-KQJVVWRT.js +7 -0
  6. package/dist/chunks/{chunk-YOQFHAWX.js → chunk-2R6NQXTQ.js} +1 -1
  7. package/dist/chunks/{chunk-JPIB7NB6.js → chunk-2VEEUAB2.js} +1 -1
  8. package/dist/chunks/{chunk-5H3QCVK5.js → chunk-3B4P7YHO.js} +1 -1
  9. package/dist/chunks/{chunk-X3KGMGDA.js → chunk-3JHCLQOM.js} +1 -1
  10. package/dist/chunks/{chunk-KF62ZVXT.js → chunk-3QHHQAHD.js} +1 -1
  11. package/dist/chunks/{chunk-VXPEFLJ6.js → chunk-3RV2B7D3.js} +1 -1
  12. package/dist/chunks/{chunk-WVXO435I.js → chunk-3V7QO2DE.js} +1 -1
  13. package/dist/chunks/{chunk-NWL3VI5O.js → chunk-4N526L5G.js} +1 -1
  14. package/dist/chunks/{chunk-BG25VOLN.js → chunk-4VC32DHS.js} +1 -1
  15. package/dist/chunks/{chunk-QYFRPNL2.js → chunk-6ISN6ZNQ.js} +1 -1
  16. package/dist/chunks/{chunk-RYVVD7GM.js → chunk-77Z66QDE.js} +1 -1
  17. package/dist/chunks/{chunk-7S6R3LL4.js → chunk-7CQGVZ6Z.js} +1 -1
  18. package/dist/chunks/{chunk-KE3S2RRY.js → chunk-7QPE2TB5.js} +1 -1
  19. package/dist/chunks/{chunk-66KGIWDY.js → chunk-AKZOYEBP.js} +1 -1
  20. package/dist/chunks/{chunk-HW4QHETG.js → chunk-AP36GAOG.js} +1 -1
  21. package/dist/chunks/{chunk-U2EJBAGE.js → chunk-AX3CQSVT.js} +1 -1
  22. package/dist/chunks/{chunk-QR7QPUFN.js → chunk-BKV35LVB.js} +1 -1
  23. package/dist/chunks/chunk-DAWC332R.js +8 -0
  24. package/dist/chunks/{chunk-P5EKTDOS.js → chunk-DXYF2ULP.js} +1 -1
  25. package/dist/chunks/{chunk-NOYJJRDK.js → chunk-EO4G5E7C.js} +4 -4
  26. package/dist/chunks/{chunk-DBABUG2N.js → chunk-EWGDLEGG.js} +1 -1
  27. package/dist/chunks/{chunk-SURYRPWO.js → chunk-GKWT55SU.js} +1 -1
  28. package/dist/chunks/chunk-GQGVOJ4V.js +7 -0
  29. package/dist/chunks/{chunk-SKAUCH5L.js → chunk-GWSFFKFF.js} +1 -1
  30. package/dist/chunks/{chunk-P7GPJFZ7.js → chunk-H4FTGLWV.js} +1 -1
  31. package/dist/chunks/{chunk-LL2XUFCY.js → chunk-HZ5ZZCUZ.js} +1 -1
  32. package/dist/chunks/{chunk-F4PQSGJG.js → chunk-IPTMDVQX.js} +1 -1
  33. package/dist/chunks/{chunk-WTMSMKT5.js → chunk-JSKGZLE4.js} +1 -1
  34. package/dist/chunks/{chunk-MHDVUE2Q.js → chunk-K72XWICT.js} +1 -1
  35. package/dist/chunks/chunk-KCARCOP5.js +10 -0
  36. package/dist/chunks/{chunk-KJ6MUEGB.js → chunk-KYYVQW52.js} +1 -1
  37. package/dist/chunks/{chunk-PGF7MQK6.js → chunk-N5AIKGEO.js} +1 -1
  38. package/dist/chunks/{chunk-RSHNACJX.js → chunk-OXDGBPM6.js} +2 -2
  39. package/dist/chunks/{chunk-V3YAU6ES.js → chunk-Q2KQTYPU.js} +4 -4
  40. package/dist/chunks/{chunk-U7RBKXKN.js → chunk-REDC5VPI.js} +1 -1
  41. package/dist/chunks/{chunk-MQO32DYF.js → chunk-RKH42432.js} +1 -1
  42. package/dist/chunks/{chunk-DPTTW6AM.js → chunk-RQTVTHE7.js} +1 -1
  43. package/dist/chunks/{chunk-7DNHVDK2.js → chunk-RRTWGLJT.js} +1 -1
  44. package/dist/chunks/{chunk-V62NLRIZ.js → chunk-VGECSVOP.js} +1 -1
  45. package/dist/chunks/{chunk-EUJWN3RB.js → chunk-WWB66KP5.js} +1 -1
  46. package/dist/chunks/{chunk-LAKQ6JG3.js → chunk-XDFTDPGS.js} +1 -1
  47. package/dist/chunks/{chunk-MV6LWP5R.js → chunk-XEWSGP2D.js} +1 -1
  48. package/dist/chunks/{chunk-J7DOWLLD.js → chunk-YG6LPJFT.js} +1 -1
  49. package/dist/chunks/{chunk-FXYCV7SI.js → chunk-YUL3DN2H.js} +1 -1
  50. package/dist/chunks/{chunk-6QNPNUTJ.js → chunk-YUQ2GQBY.js} +1 -1
  51. package/dist/chunks/{chunk-OI5JAHZK.js → chunk-ZDB3FWQF.js} +1 -1
  52. package/dist/chunks/clear-OCDDL3S6.js +8 -0
  53. package/dist/chunks/compile-vercel-config-UXTDRI6O.js +7 -0
  54. package/dist/chunks/config-46HFJIVB.js +8 -0
  55. package/dist/chunks/{config-JTA2VZHH.js → config-BTACRRGK.js} +1 -1
  56. package/dist/chunks/delete-CWCGCHDO.js +10 -0
  57. package/dist/chunks/delete-Q3YKRT7J.js +9 -0
  58. package/dist/chunks/detect-services-EEFYZN3O.js +7 -0
  59. package/dist/chunks/disable-FD757X27.js +7 -0
  60. package/dist/chunks/discard-MCCFXCZX.js +14 -0
  61. package/dist/chunks/edit-4G7SOJA4.js +9 -0
  62. package/dist/chunks/edit-6OV2FEJN.js +8 -0
  63. package/dist/chunks/enable-Q633KLQ3.js +7 -0
  64. package/dist/chunks/{export-ZKRSU23G.js → export-CRBBRS6Y.js} +1 -1
  65. package/dist/chunks/future-IGDV62BF.js +7 -0
  66. package/dist/chunks/generate-cert-for-deploy-V3LNOFRV.js +7 -0
  67. package/dist/chunks/image-ABRB2PUJ.js +7 -0
  68. package/dist/chunks/import-builders-EJEQ4WXC.js +7 -0
  69. package/dist/chunks/{inspect-GUUFDCF6.js → inspect-A77NDMCO.js} +1 -1
  70. package/dist/chunks/inspect-DS7LIUWG.js +9 -0
  71. package/dist/chunks/{inspect-OFHABZ6D.js → inspect-IED7TPJ3.js} +1 -1
  72. package/dist/chunks/{inspect-SZ4HH7QY.js → inspect-J3CBCMIX.js} +1 -1
  73. package/dist/chunks/inspect-JFCMOHNJ.js +13 -0
  74. package/dist/chunks/list-FEHTM5WL.js +11 -0
  75. package/dist/chunks/{list-W2TEW25J.js → list-KLXDBNFC.js} +1 -1
  76. package/dist/chunks/{list-O5E5ZYAN.js → list-KSC5IJSH.js} +1 -1
  77. package/dist/chunks/login-C4PUINCQ.js +7 -0
  78. package/dist/chunks/login-S63HHO6R.js +9 -0
  79. package/dist/chunks/logs-6BYIWJPY.js +7 -0
  80. package/dist/chunks/ls-C47FWYJ6.js +8 -0
  81. package/dist/chunks/{ls-WTAMOBVG.js → ls-DHEY2FBJ.js} +1 -1
  82. package/dist/chunks/{ls-OC2YVP7U.js → ls-H4BCSNTG.js} +1 -1
  83. package/dist/chunks/{ls-GNZ5XC5V.js → ls-IKHNJQFH.js} +1 -1
  84. package/dist/chunks/{ls-Q6TGKOW6.js → ls-IZWWHIEK.js} +1 -1
  85. package/dist/chunks/ls-UAWOECKQ.js +11 -0
  86. package/dist/chunks/{ls-X53N2CIG.js → ls-YCPRYUT7.js} +1 -1
  87. package/dist/chunks/mutate-X22CUEKM.js +9 -0
  88. package/dist/chunks/notifications-HDMUEMWS.js +7 -0
  89. package/dist/chunks/open-DU3MYPC3.js +7 -0
  90. package/dist/chunks/openapi-ULBM7RWG.js +7 -0
  91. package/dist/chunks/permissions-PBNI3ZE3.js +7 -0
  92. package/dist/chunks/prompt-missing-credentials-K6IWGP2N.js +7 -0
  93. package/dist/chunks/publish-BDBMRK5M.js +15 -0
  94. package/dist/chunks/pull-KMLPNSY3.js +7 -0
  95. package/dist/chunks/purchase-domain-if-available-ZNTAIIJN.js +7 -0
  96. package/dist/chunks/push-XPKPIGFN.js +7 -0
  97. package/dist/chunks/{query-3GCRJN4Q.js → query-ITYSKSNF.js} +1 -1
  98. package/dist/chunks/reauthenticate-DIFJZWC5.js +7 -0
  99. package/dist/chunks/reorder-CZ6OAJ5D.js +10 -0
  100. package/dist/chunks/reply-QENWO3AS.js +9 -0
  101. package/dist/chunks/resolve-IJUP7C3T.js +12 -0
  102. package/dist/chunks/restore-GUJCGF3E.js +16 -0
  103. package/dist/chunks/rm-2YGKGNKJ.js +8 -0
  104. package/dist/chunks/rm-3POYUGWI.js +8 -0
  105. package/dist/chunks/rm-5MVVB7NO.js +8 -0
  106. package/dist/chunks/rm-OTDHLXGL.js +8 -0
  107. package/dist/chunks/rm-T5F5THS2.js +8 -0
  108. package/dist/chunks/rule-inspect-G3G5ISY4.js +8 -0
  109. package/dist/chunks/rules-7YI6LVNU.js +7 -0
  110. package/dist/chunks/schema-GOG6OEUZ.js +14 -0
  111. package/dist/chunks/{schema-HCHBRZFG.js → schema-N3USOS7S.js} +1 -1
  112. package/dist/chunks/select-org-6AA7XX6E.js +7 -0
  113. package/dist/chunks/set-DGS6G7GQ.js +7 -0
  114. package/dist/chunks/setup-and-link-ZKMVK42H.js +7 -0
  115. package/dist/chunks/tags-XZDKLBYD.js +7 -0
  116. package/dist/chunks/{types-L37GS4JI.js → types-UYIFBCCL.js} +1 -1
  117. package/dist/chunks/{update-GITCTREW.js → update-TTQC7U3R.js} +1 -1
  118. package/dist/commands/build/index.js +1 -1
  119. package/dist/commands/deploy/index.js +4 -4
  120. package/dist/commands/dev/index.js +5 -5
  121. package/dist/commands/env/index.js +1 -1
  122. package/dist/commands/link/index.js +1 -1
  123. package/dist/commands/list/index.js +1 -1
  124. package/dist/commands-bulk.js +8 -8
  125. package/dist/index.js +2 -2
  126. package/dist/vc.js +14 -4
  127. package/dist/version.mjs +1 -1
  128. package/package.json +21 -21
  129. package/dist/chunks/add-7Y2KUKBS.js +0 -8
  130. package/dist/chunks/add-AH7CCGI4.js +0 -8
  131. package/dist/chunks/add-PZQFNEK6.js +0 -8
  132. package/dist/chunks/build-J2L7FBF6.js +0 -7
  133. package/dist/chunks/chunk-BK7VICZ5.js +0 -8
  134. package/dist/chunks/chunk-J3U3L45Y.js +0 -7
  135. package/dist/chunks/chunk-K2MXVUWY.js +0 -7
  136. package/dist/chunks/chunk-QHKY2XXG.js +0 -7
  137. package/dist/chunks/chunk-SQXB2UM4.js +0 -10
  138. package/dist/chunks/clear-K7ORVDOX.js +0 -8
  139. package/dist/chunks/compile-vercel-config-JNODRT2C.js +0 -7
  140. package/dist/chunks/config-RWVPD75M.js +0 -8
  141. package/dist/chunks/delete-2TO7EK2C.js +0 -10
  142. package/dist/chunks/delete-KB2GQRD2.js +0 -9
  143. package/dist/chunks/detect-services-S4EMRGXM.js +0 -7
  144. package/dist/chunks/disable-OECXCINH.js +0 -7
  145. package/dist/chunks/discard-TQ2BYSPA.js +0 -14
  146. package/dist/chunks/edit-GJY2Q7DK.js +0 -8
  147. package/dist/chunks/edit-OARSMUGS.js +0 -9
  148. package/dist/chunks/enable-CHWCHWYK.js +0 -7
  149. package/dist/chunks/future-7RNP7ZP6.js +0 -7
  150. package/dist/chunks/generate-cert-for-deploy-SNWO4UCL.js +0 -7
  151. package/dist/chunks/image-XJJMFNS3.js +0 -7
  152. package/dist/chunks/import-builders-BJTHQZFZ.js +0 -7
  153. package/dist/chunks/inspect-KL6E4NYB.js +0 -13
  154. package/dist/chunks/inspect-PAQAACPV.js +0 -9
  155. package/dist/chunks/list-R3UBCTNJ.js +0 -11
  156. package/dist/chunks/login-FA3ZCLNA.js +0 -7
  157. package/dist/chunks/login-NN7X6ATG.js +0 -9
  158. package/dist/chunks/logs-XXEVORNG.js +0 -7
  159. package/dist/chunks/ls-6DBJ4O2U.js +0 -8
  160. package/dist/chunks/ls-I7TEWFFI.js +0 -11
  161. package/dist/chunks/mutate-TYDZXN6D.js +0 -9
  162. package/dist/chunks/notifications-ISH6L4LN.js +0 -7
  163. package/dist/chunks/open-NP6JK7D3.js +0 -7
  164. package/dist/chunks/openapi-QJEB6PRW.js +0 -7
  165. package/dist/chunks/permissions-CDHSBRVG.js +0 -7
  166. package/dist/chunks/prompt-missing-credentials-FX2H3SHO.js +0 -7
  167. package/dist/chunks/publish-JZHSWOHM.js +0 -15
  168. package/dist/chunks/pull-MCOEV5HI.js +0 -7
  169. package/dist/chunks/purchase-domain-if-available-G7SE7C2F.js +0 -7
  170. package/dist/chunks/push-XSQNASL2.js +0 -7
  171. package/dist/chunks/reauthenticate-QYJGKCGV.js +0 -7
  172. package/dist/chunks/reorder-DHP3CTN2.js +0 -10
  173. package/dist/chunks/reply-WKPVJAWP.js +0 -9
  174. package/dist/chunks/resolve-QF5SMBPD.js +0 -12
  175. package/dist/chunks/restore-A5UQIGNA.js +0 -16
  176. package/dist/chunks/rm-FIZ56DQC.js +0 -8
  177. package/dist/chunks/rm-L5KYP6JP.js +0 -8
  178. package/dist/chunks/rm-MRIJKX4E.js +0 -8
  179. package/dist/chunks/rm-VQ2ESDWM.js +0 -8
  180. package/dist/chunks/rm-WEOLZ2OC.js +0 -8
  181. package/dist/chunks/rule-inspect-WY667VBH.js +0 -8
  182. package/dist/chunks/rules-7PJ5PHRB.js +0 -7
  183. package/dist/chunks/schema-KWNBTTXA.js +0 -14
  184. package/dist/chunks/select-org-JEXIDHLI.js +0 -7
  185. package/dist/chunks/set-BRG2L4NA.js +0 -7
  186. package/dist/chunks/setup-and-link-R6IRKMYF.js +0 -7
  187. package/dist/chunks/tags-Y5KMBUYT.js +0 -7
@@ -4,7 +4,7 @@ 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{getUpdateCommandInfo,getUpgradePackageManager,isGlobal,trustedUpgradeDirectory,trustedUpgradeEnvironment}from"./chunk-MHDVUE2Q.js";import{progress}from"./chunk-U56NHYAH.js";import{writeToConfigFile}from"./chunk-V3YAU6ES.js";import{require_ci_info}from"./chunk-T52FMXWC.js";import{require_semver}from"./chunk-KKS7XWEX.js";import{require_chownr,require_mkdirp,require_pump,require_tar_stream}from"./chunk-V6MR45PD.js";import{param}from"./chunk-SXUEGVWB.js";import{buildCorrectedCommand,suggestCorrection}from"./chunk-EUJWN3RB.js";import{fetch,toNodeReadable}from"./chunk-MY4MONOH.js";import{getInstallRoot,isNativeBinaryInstall}from"./chunk-7T6TL3GQ.js";import{require_lib}from"./chunk-NOYJJRDK.js";import{require_strip_ansi}from"./chunk-OSCCYU74.js";import{shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-SQXB2UM4.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import{pkg_default}from"./chunk-AVSPFBLM.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__commonJS,__require,__toESM}from"./chunk-6L236MNA.js";var require_jaro_winkler=__commonJS({"../../node_modules/.pnpm/jaro-winkler@0.2.8/node_modules/jaro-winkler/index.js"(exports,module){(function(root){"use strict";function extend(a,b){for(var property in b)b.hasOwnProperty(property)&&(a[property]=b[property]);return a}function distance2(s1,s2,options){var m=0,defaults={caseSensitive:!0},settings=extend(defaults,options),i,j;if(s1.length===0||s2.length===0)return 0;if(settings.caseSensitive||(s1=s1.toUpperCase(),s2=s2.toUpperCase()),s1===s2)return 1;var range=Math.floor(Math.max(s1.length,s2.length)/2)-1,s1Matches=new Array(s1.length),s2Matches=new Array(s2.length);for(i=0;i<s1.length;i++){var low=i>=range?i-range:0,high=i+range<=s2.length-1?i+range:s2.length-1;for(j=low;j<=high;j++)if(s1Matches[i]!==!0&&s2Matches[j]!==!0&&s1[i]===s2[j]){++m,s1Matches[i]=s2Matches[j]=!0;break}}if(m===0)return 0;var k=0,numTrans=0;for(i=0;i<s1.length;i++)if(s1Matches[i]===!0){for(j=k;j<s2.length;j++)if(s2Matches[j]===!0){k=j+1;break}s1[i]!==s2[j]&&++numTrans}var weight=(m/s1.length+m/s2.length+(m-numTrans/2)/m)/3,l=0,p=.1;if(weight>.7){for(;s1[l]===s2[l]&&l<4;)++l;weight=weight+l*p*(1-weight)}return weight}typeof define=="function"&&define.amd?define([],function(){return distance2}):typeof exports=="object"?module.exports=distance2:root.distance=distance2})(exports)}});var require_lib2=__commonJS({"../../node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js"(exports,module){"use strict";var os=__require("os"),paths=__require("path"),isWinOS=/^win/i.test(process.platform);function normalize_path(path){return paths.normalize(paths.join(path,"."))}var base=()=>{let{env}=process,object={};return object.home=()=>normalize_path(os.homedir?os.homedir():env.HOME),object.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TMPDIR||env.TEMP||env.TMP),object},windows=()=>{let{env}=process,object={};return object.home=()=>normalize_path(os.homedir?os.homedir():env.USERPROFILE||paths.join(env.HOMEDRIVE,env.HOMEPATH)||env.HOME),object.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TEMP||env.TMP||paths.join(env.LOCALAPPDATA||env.SystemRoot||env.windir,"Temp")),object},_OSPaths=class __OSPaths{constructor(){let OSPaths=function(){return new __OSPaths};this._fn=OSPaths;let extension=isWinOS?windows():base();return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module.exports=new _OSPaths}});var require_lib3=__commonJS({"../../node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js"(exports,module){"use strict";var path=__require("path"),osPaths=require_lib2(),linux=()=>{let object={};return object.cache=()=>process.env.XDG_CACHE_HOME||path.join(osPaths.home()||osPaths.temp(),".cache"),object.config=()=>process.env.XDG_CONFIG_HOME||path.join(osPaths.home()||osPaths.temp(),".config"),object.data=()=>process.env.XDG_DATA_HOME||path.join(osPaths.home()||osPaths.temp(),".local","share"),object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>process.env.XDG_STATE_HOME||path.join(osPaths.home()||osPaths.temp(),".local","state"),object},macos=()=>{let object={};return object.cache=()=>process.env.XDG_CACHE_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Caches"),object.config=()=>process.env.XDG_CONFIG_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Preferences"),object.data=()=>process.env.XDG_DATA_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Application Support"),object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>process.env.XDG_STATE_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"State"),object},windows=()=>{let object={};return object.cache=()=>{let localAppData=process.env.LOCALAPPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_CACHE_HOME||path.join(localAppData,"xdg.cache")},object.config=()=>{let appData=process.env.APPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_CONFIG_HOME||path.join(appData,"xdg.config")},object.data=()=>{let appData=process.env.APPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_DATA_HOME||path.join(appData,"xdg.data")},object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>{let localAppData=process.env.LOCALAPPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_STATE_HOME||path.join(localAppData,"xdg.state")},object},_XDGPortable=()=>{let XDGPortable=function(){return _XDGPortable()},extension={};return/^darwin$/i.test(process.platform)?extension=macos():/^win/i.test(process.platform)?extension=windows():extension=linux(),extension.configDirs=()=>{let dirs=[];return dirs.push(extension.config()),process.env.XDG_CONFIG_DIRS&&dirs.push(...process.env.XDG_CONFIG_DIRS.split(path.delimiter)),dirs},extension.dataDirs=()=>{let dirs=[];return dirs.push(extension.data()),process.env.XDG_DATA_DIRS&&dirs.push(...process.env.XDG_DATA_DIRS.split(path.delimiter)),dirs},Object.keys(extension).forEach(key=>{XDGPortable[key]=extension[key]}),XDGPortable};module.exports=_XDGPortable()}});var require_xdg_app_paths=__commonJS({"../../node_modules/.pnpm/xdg-app-paths@5.1.0/node_modules/xdg-app-paths/index.js"(exports,module){"use strict";var path=__require("path"),os=__require("os"),xdg=require_lib3(),isWinOS=/^win/i.test(process.platform);function _normalizeOptions(options,isolated){if(options=options||{},typeof options!="object"&&(options={isolated:options}),options.isolated=options.isolated===void 0||options.isolated===null?isolated:options.isolated,typeof options.isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof options.isolated}`);return options}var base=(name,isolated)=>{let object={};return object.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.cache(),options.isolated?name:"")),object.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.config(),options.isolated?name:"")),object.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.data(),options.isolated?name:"")),object.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path.join(xdg.runtime(),options.isolated?name:""):void 0),object.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.state(),options.isolated?name:"")),object.configDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.configDirs().map(s=>path.join(s,options.isolated?name:""))),object.dataDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.dataDirs().map(s=>path.join(s,options.isolated?name:""))),object},windows=(name,isolated)=>{let{env}=process,homedir=os.homedir(),tmpdir2=os.tmpdir(),appData=env.APPDATA||path.join(homedir||tmpdir2,"AppData","Roaming"),localAppData=env.LOCALAPPDATA||path.join(homedir||tmpdir2,"AppData","Local"),object={};return object.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CACHE_HOME?path.join(xdg.cache(),options.isolated?name:""):path.join(localAppData,options.isolated?name:"","Cache")),object.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CONFIG_HOME?path.join(xdg.config(),options.isolated?name:""):path.join(appData,options.isolated?name:"","Config")),object.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_DATA_HOME?path.join(xdg.data(),options.isolated?name:""):path.join(appData,options.isolated?name:"","Data")),object.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path.join(xdg.runtime(),options.isolated?name:""):void 0),object.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_STATE_HOME?path.join(xdg.state(),options.isolated?name:""):path.join(localAppData,options.isolated?name:"","State")),object.configDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object.config(options)];return env.XDG_CONFIG_DIRS&&dirs.push(...env.XDG_CONFIG_DIRS.split(path.delimiter).map(s=>path.join(s,options.isolated?name:""))),dirs},object.dataDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object.data(options)];return env.XDG_DATA_DIRS&&dirs.push(...env.XDG_DATA_DIRS.split(path.delimiter).map(s=>path.join(s,options.isolated?name:""))),dirs},object},_XDGAppPaths=class __XDGAppPaths{constructor(options={name:null,suffix:null,isolated:!0}){let XDGAppPaths2=function(options2={name:null,suffix:null,isolated:!0}){return new __XDGAppPaths(options2)};this._fn=XDGAppPaths2,options=options||{},typeof options!="object"&&(options={name:options});let name=options.name||"";if(typeof name!="string")throw new TypeError(`Expected string for "name" argument, got ${typeof name}`);let suffix=options.suffix||"";if(typeof suffix!="string")throw new TypeError(`Expected string for "suffix" argument, got ${typeof suffix}`);let isolated=options.isolated===void 0||options.isolated===null?!0:options.isolated;if(typeof isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof isolated}`);name||(name=path.parse(process.pkg?process.execPath:__require.main?__require.main.filename:process.argv[0]).name),suffix&&(name+=suffix),this._fn.$name=()=>name,this._fn.$isolated=()=>isolated;let extension=isWinOS?windows(name,isolated):base(name,isolated);return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module.exports=new _XDGAppPaths}});var require_tar_fs=__commonJS({"../../node_modules/.pnpm/tar-fs@1.16.5/node_modules/tar-fs/index.js"(exports){var chownr=require_chownr(),tar2=require_tar_stream(),pump=require_pump(),mkdirp=require_mkdirp(),fs=__require("fs"),path=__require("path"),os=__require("os"),win32=os.platform()==="win32",noop=function(){},echo=function(name){return name},normalize=win32?function(name){return name.replace(/\\/g,"/").replace(/[:?<>|]/g,"_")}:echo,statAll=function(fs2,stat3,cwd,ignore,entries,sort){var queue=entries||["."];return function(callback){if(!queue.length)return callback();var next=queue.shift(),nextAbs=path.join(cwd,next);stat3(nextAbs,function(err,stat4){if(err)return callback(err);if(!stat4.isDirectory())return callback(null,next,stat4);fs2.readdir(nextAbs,function(err2,files){if(err2)return callback(err2);sort&&files.sort();for(var i=0;i<files.length;i++)ignore(path.join(cwd,next,files[i]))||queue.push(path.join(next,files[i]));callback(null,next,stat4)})})}},strip=function(map,level){return function(header){header.name=header.name.split("/").slice(level).join("/");var linkname=header.linkname;return linkname&&(header.type==="link"||path.isAbsolute(linkname))&&(header.linkname=linkname.split("/").slice(level).join("/")),map(header)}};exports.pack=function(cwd,opts){cwd||(cwd="."),opts||(opts={});var xfs=opts.fs||fs,ignore=opts.ignore||opts.filter||noop,map=opts.map||noop,mapStream=opts.mapStream||echo,statNext=statAll(xfs,opts.dereference?xfs.stat:xfs.lstat,cwd,ignore,opts.entries,opts.sort),strict=opts.strict!==!1,umask=typeof opts.umask=="number"?~opts.umask:~processUmask(),dmode=typeof opts.dmode=="number"?opts.dmode:0,fmode=typeof opts.fmode=="number"?opts.fmode:0,pack=opts.pack||tar2.pack(),finish=opts.finish||noop;opts.strip&&(map=strip(map,opts.strip)),opts.readable&&(dmode|=parseInt(555,8),fmode|=parseInt(444,8)),opts.writable&&(dmode|=parseInt(333,8),fmode|=parseInt(222,8));var onsymlink=function(filename,header){xfs.readlink(path.join(cwd,filename),function(err,linkname){if(err)return pack.destroy(err);header.linkname=normalize(linkname),pack.entry(header,onnextentry)})},onstat=function(err,filename,stat3){if(err)return pack.destroy(err);if(!filename)return opts.finalize!==!1&&pack.finalize(),finish(pack);if(stat3.isSocket())return onnextentry();var header={name:normalize(filename),mode:(stat3.mode|(stat3.isDirectory()?dmode:fmode))&umask,mtime:stat3.mtime,size:stat3.size,type:"file",uid:stat3.uid,gid:stat3.gid};if(stat3.isDirectory())return header.size=0,header.type="directory",header=map(header)||header,pack.entry(header,onnextentry);if(stat3.isSymbolicLink())return header.size=0,header.type="symlink",header=map(header)||header,onsymlink(filename,header);if(header=map(header)||header,!stat3.isFile())return strict?pack.destroy(new Error("unsupported type for "+filename)):onnextentry();var entry=pack.entry(header,onnextentry);if(entry){var rs=mapStream(xfs.createReadStream(path.join(cwd,filename)),header);rs.on("error",function(err2){entry.destroy(err2)}),pump(rs,entry)}},onnextentry=function(err){if(err)return pack.destroy(err);statNext(onstat)};return onnextentry(),pack};var head=function(list){return list.length?list[list.length-1]:null},processGetuid=function(){return process.getuid?process.getuid():-1},processUmask=function(){return process.umask?process.umask():0};exports.extract=function(cwd,opts){cwd||(cwd="."),opts||(opts={});var xfs=opts.fs||fs,ignore=opts.ignore||opts.filter||noop,map=opts.map||noop,mapStream=opts.mapStream||echo,own=opts.chown!==!1&&!win32&&processGetuid()===0,extract=opts.extract||tar2.extract(),stack=[],now=new Date,umask=typeof opts.umask=="number"?~opts.umask:~processUmask(),dmode=typeof opts.dmode=="number"?opts.dmode:0,fmode=typeof opts.fmode=="number"?opts.fmode:0,strict=opts.strict!==!1;opts.strip&&(map=strip(map,opts.strip)),opts.readable&&(dmode|=parseInt(555,8),fmode|=parseInt(444,8)),opts.writable&&(dmode|=parseInt(333,8),fmode|=parseInt(222,8));var utimesParent=function(name,cb){for(var top;(top=head(stack))&&name.slice(0,top[0].length)!==top[0];)stack.pop();if(!top)return cb();xfs.utimes(top[0],now,top[1],cb)},utimes=function(name,header,cb){if(opts.utimes===!1)return cb();if(header.type==="directory")return xfs.utimes(name,now,header.mtime,cb);if(header.type==="symlink")return utimesParent(name,cb);xfs.utimes(name,now,header.mtime,function(err){if(err)return cb(err);utimesParent(name,cb)})},chperm=function(name,header,cb){var link2=header.type==="symlink",chmod2=link2?xfs.lchmod:xfs.chmod,chown=link2?xfs.lchown:xfs.chown;if(!chmod2)return cb();var mode=(header.mode|(header.type==="directory"?dmode:fmode))&umask;chmod2(name,mode,function(err){if(err)return cb(err);if(!own||!chown)return cb();chown(name,header.uid,header.gid,cb)})};return extract.on("entry",function(header,stream,next){header=map(header)||header,header.name=normalize(header.name);var name=path.join(cwd,path.join("/",header.name));if(ignore(name,header))return stream.resume(),next();var stat3=function(err){if(err)return next(err);utimes(name,header,function(err2){if(err2)return next(err2);if(win32)return next();chperm(name,header,next)})},onsymlink=function(){if(win32)return next();xfs.unlink(name,function(){var dst=path.resolve(path.dirname(name),header.linkname);if(!dst.startsWith(path.resolve(cwd)))return next(new Error(name+" is not a valid symlink"));xfs.symlink(header.linkname,name,stat3)})},onlink=function(){if(win32)return next();xfs.unlink(name,function(){var srcpath=path.join(cwd,path.join("/",header.linkname));xfs.realpath(srcpath,function(err,dst){if(err||!dst.startsWith(path.resolve(cwd)))return next(new Error(name+" is not a valid hardlink"));xfs.link(dst,name,function(err2){if(err2&&err2.code==="EPERM"&&opts.hardlinkAsFilesFallback)return stream=xfs.createReadStream(srcpath),onfile();stat3(err2)})})})},onfile=function(){var ws=xfs.createWriteStream(name),rs=mapStream(stream,header);ws.on("error",function(err){rs.destroy(err)}),pump(rs,ws,function(err){if(err)return next(err);ws.on("close",stat3)})};if(header.type==="directory")return stack.push([name,header.mtime]),mkdirfix(name,{fs:xfs,own,uid:header.uid,gid:header.gid},stat3);var dir=path.dirname(name);validate(xfs,dir,path.join(cwd,"."),function(err,valid){if(err)return next(err);if(!valid)return next(new Error(dir+" is not a valid path"));mkdirfix(dir,{fs:xfs,own,uid:header.uid,gid:header.gid},function(err2){if(err2)return next(err2);switch(header.type){case"file":return onfile();case"link":return onlink();case"symlink":return onsymlink()}if(strict)return next(new Error("unsupported type for "+name+" ("+header.type+")"));stream.resume(),next()})})}),opts.finish&&extract.on("finish",opts.finish),extract};function validate(fs2,name,root,cb){if(name===root)return cb(null,!0);fs2.lstat(name,function(err,st){if(err&&err.code!=="ENOENT")return cb(err);if(err||st.isDirectory())return validate(fs2,path.join(name,".."),root,cb);cb(null,!1)})}function mkdirfix(name,opts,cb){mkdirp(name,{fs:opts.fs},function(err,made){!err&&made&&opts.own?chownr(made,opts.uid,opts.gid,cb):cb(err)})}}});var import_jaro_winkler=__toESM(require_jaro_winkler(),1),did_you_mean_default=didYouMean;function didYouMean(input,list,threshold=.5){let found=list.map(item=>[dashAwareDistance(input,item),item]).filter(item=>item[0]>threshold);if(found.length)return found.reduce((accu,curr)=>accu[0]>curr[0]?accu:curr)[1]}function dashAwareDistance(word,dashWord){let fullDistance=(0,import_jaro_winkler.default)(word,dashWord),distances=dashWord.split("-").map(w=>(0,import_jaro_winkler.default)(w,word)),meanDistance=distances.reduce((accu,curr)=>accu+curr)/distances.length;return fullDistance>meanDistance?fullDistance:meanDistance}function handleCommandTypo({command,availableCommands,threshold=.7,client}){if(!command||command.startsWith("-"))return!1;let visibleCommands=availableCommands.filter(command2=>!command2.hidden),commandNames=visibleCommands.flatMap(({name,aliases})=>[name,...aliases]),correction=suggestCorrection(command,commandNames),suggestion=correction??did_you_mean_default(command,commandNames,threshold);if(suggestion){if(client){let definition=visibleCommands.find(candidate=>candidate.name===correction||candidate.aliases.some(alias=>alias===correction)),corrected=correction?buildCorrectedCommand(client.argv,command,correction,getFlagsSpecification(definition?.options??[])):void 0,payload={status:"error",reason:"unknown_command",message:`Unknown command "${command}". Did you mean "${suggestion}"?`,hint:corrected?"Use the suggested command after replacing any placeholders with the intended values.":`Accepted commands: ${commandNames.join(", ")}.`,...corrected&&{next:[{command:corrected,when:"Run the corrected command; replace any placeholders first"}]}};return shouldEmitNonInteractiveCommandError(client)?writeAgentError(client,payload):(output_manager_default.fatal(payload.message),output_manager_default.print(` ${corrected??payload.hint}
7
+ import{getUpdateCommandInfo,getUpgradePackageManager,isGlobal,trustedUpgradeDirectory,trustedUpgradeEnvironment}from"./chunk-K72XWICT.js";import{progress}from"./chunk-U56NHYAH.js";import{require_ci_info}from"./chunk-T52FMXWC.js";import{require_semver}from"./chunk-KKS7XWEX.js";import{require_chownr,require_mkdirp,require_pump,require_tar_stream}from"./chunk-V6MR45PD.js";import{param}from"./chunk-SXUEGVWB.js";import{writeToConfigFile}from"./chunk-GQGVOJ4V.js";import{buildCorrectedCommand,suggestCorrection}from"./chunk-WWB66KP5.js";import{fetch,toNodeReadable}from"./chunk-MY4MONOH.js";import{getInstallRoot,isNativeBinaryInstall}from"./chunk-7T6TL3GQ.js";import{require_lib}from"./chunk-EO4G5E7C.js";import{require_strip_ansi}from"./chunk-OSCCYU74.js";import{shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-KCARCOP5.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import{pkg_default}from"./chunk-AVSPFBLM.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__commonJS,__require,__toESM}from"./chunk-6L236MNA.js";var require_jaro_winkler=__commonJS({"../../node_modules/.pnpm/jaro-winkler@0.2.8/node_modules/jaro-winkler/index.js"(exports,module){(function(root){"use strict";function extend(a,b){for(var property in b)b.hasOwnProperty(property)&&(a[property]=b[property]);return a}function distance2(s1,s2,options){var m=0,defaults={caseSensitive:!0},settings=extend(defaults,options),i,j;if(s1.length===0||s2.length===0)return 0;if(settings.caseSensitive||(s1=s1.toUpperCase(),s2=s2.toUpperCase()),s1===s2)return 1;var range=Math.floor(Math.max(s1.length,s2.length)/2)-1,s1Matches=new Array(s1.length),s2Matches=new Array(s2.length);for(i=0;i<s1.length;i++){var low=i>=range?i-range:0,high=i+range<=s2.length-1?i+range:s2.length-1;for(j=low;j<=high;j++)if(s1Matches[i]!==!0&&s2Matches[j]!==!0&&s1[i]===s2[j]){++m,s1Matches[i]=s2Matches[j]=!0;break}}if(m===0)return 0;var k=0,numTrans=0;for(i=0;i<s1.length;i++)if(s1Matches[i]===!0){for(j=k;j<s2.length;j++)if(s2Matches[j]===!0){k=j+1;break}s1[i]!==s2[j]&&++numTrans}var weight=(m/s1.length+m/s2.length+(m-numTrans/2)/m)/3,l=0,p=.1;if(weight>.7){for(;s1[l]===s2[l]&&l<4;)++l;weight=weight+l*p*(1-weight)}return weight}typeof define=="function"&&define.amd?define([],function(){return distance2}):typeof exports=="object"?module.exports=distance2:root.distance=distance2})(exports)}});var require_lib2=__commonJS({"../../node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js"(exports,module){"use strict";var os=__require("os"),paths=__require("path"),isWinOS=/^win/i.test(process.platform);function normalize_path(path){return paths.normalize(paths.join(path,"."))}var base=()=>{let{env}=process,object={};return object.home=()=>normalize_path(os.homedir?os.homedir():env.HOME),object.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TMPDIR||env.TEMP||env.TMP),object},windows=()=>{let{env}=process,object={};return object.home=()=>normalize_path(os.homedir?os.homedir():env.USERPROFILE||paths.join(env.HOMEDRIVE,env.HOMEPATH)||env.HOME),object.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TEMP||env.TMP||paths.join(env.LOCALAPPDATA||env.SystemRoot||env.windir,"Temp")),object},_OSPaths=class __OSPaths{constructor(){let OSPaths=function(){return new __OSPaths};this._fn=OSPaths;let extension=isWinOS?windows():base();return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module.exports=new _OSPaths}});var require_lib3=__commonJS({"../../node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js"(exports,module){"use strict";var path=__require("path"),osPaths=require_lib2(),linux=()=>{let object={};return object.cache=()=>process.env.XDG_CACHE_HOME||path.join(osPaths.home()||osPaths.temp(),".cache"),object.config=()=>process.env.XDG_CONFIG_HOME||path.join(osPaths.home()||osPaths.temp(),".config"),object.data=()=>process.env.XDG_DATA_HOME||path.join(osPaths.home()||osPaths.temp(),".local","share"),object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>process.env.XDG_STATE_HOME||path.join(osPaths.home()||osPaths.temp(),".local","state"),object},macos=()=>{let object={};return object.cache=()=>process.env.XDG_CACHE_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Caches"),object.config=()=>process.env.XDG_CONFIG_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Preferences"),object.data=()=>process.env.XDG_DATA_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Application Support"),object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>process.env.XDG_STATE_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"State"),object},windows=()=>{let object={};return object.cache=()=>{let localAppData=process.env.LOCALAPPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_CACHE_HOME||path.join(localAppData,"xdg.cache")},object.config=()=>{let appData=process.env.APPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_CONFIG_HOME||path.join(appData,"xdg.config")},object.data=()=>{let appData=process.env.APPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_DATA_HOME||path.join(appData,"xdg.data")},object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>{let localAppData=process.env.LOCALAPPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_STATE_HOME||path.join(localAppData,"xdg.state")},object},_XDGPortable=()=>{let XDGPortable=function(){return _XDGPortable()},extension={};return/^darwin$/i.test(process.platform)?extension=macos():/^win/i.test(process.platform)?extension=windows():extension=linux(),extension.configDirs=()=>{let dirs=[];return dirs.push(extension.config()),process.env.XDG_CONFIG_DIRS&&dirs.push(...process.env.XDG_CONFIG_DIRS.split(path.delimiter)),dirs},extension.dataDirs=()=>{let dirs=[];return dirs.push(extension.data()),process.env.XDG_DATA_DIRS&&dirs.push(...process.env.XDG_DATA_DIRS.split(path.delimiter)),dirs},Object.keys(extension).forEach(key=>{XDGPortable[key]=extension[key]}),XDGPortable};module.exports=_XDGPortable()}});var require_xdg_app_paths=__commonJS({"../../node_modules/.pnpm/xdg-app-paths@5.1.0/node_modules/xdg-app-paths/index.js"(exports,module){"use strict";var path=__require("path"),os=__require("os"),xdg=require_lib3(),isWinOS=/^win/i.test(process.platform);function _normalizeOptions(options,isolated){if(options=options||{},typeof options!="object"&&(options={isolated:options}),options.isolated=options.isolated===void 0||options.isolated===null?isolated:options.isolated,typeof options.isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof options.isolated}`);return options}var base=(name,isolated)=>{let object={};return object.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.cache(),options.isolated?name:"")),object.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.config(),options.isolated?name:"")),object.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.data(),options.isolated?name:"")),object.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path.join(xdg.runtime(),options.isolated?name:""):void 0),object.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.state(),options.isolated?name:"")),object.configDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.configDirs().map(s=>path.join(s,options.isolated?name:""))),object.dataDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.dataDirs().map(s=>path.join(s,options.isolated?name:""))),object},windows=(name,isolated)=>{let{env}=process,homedir=os.homedir(),tmpdir2=os.tmpdir(),appData=env.APPDATA||path.join(homedir||tmpdir2,"AppData","Roaming"),localAppData=env.LOCALAPPDATA||path.join(homedir||tmpdir2,"AppData","Local"),object={};return object.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CACHE_HOME?path.join(xdg.cache(),options.isolated?name:""):path.join(localAppData,options.isolated?name:"","Cache")),object.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CONFIG_HOME?path.join(xdg.config(),options.isolated?name:""):path.join(appData,options.isolated?name:"","Config")),object.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_DATA_HOME?path.join(xdg.data(),options.isolated?name:""):path.join(appData,options.isolated?name:"","Data")),object.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path.join(xdg.runtime(),options.isolated?name:""):void 0),object.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_STATE_HOME?path.join(xdg.state(),options.isolated?name:""):path.join(localAppData,options.isolated?name:"","State")),object.configDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object.config(options)];return env.XDG_CONFIG_DIRS&&dirs.push(...env.XDG_CONFIG_DIRS.split(path.delimiter).map(s=>path.join(s,options.isolated?name:""))),dirs},object.dataDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object.data(options)];return env.XDG_DATA_DIRS&&dirs.push(...env.XDG_DATA_DIRS.split(path.delimiter).map(s=>path.join(s,options.isolated?name:""))),dirs},object},_XDGAppPaths=class __XDGAppPaths{constructor(options={name:null,suffix:null,isolated:!0}){let XDGAppPaths2=function(options2={name:null,suffix:null,isolated:!0}){return new __XDGAppPaths(options2)};this._fn=XDGAppPaths2,options=options||{},typeof options!="object"&&(options={name:options});let name=options.name||"";if(typeof name!="string")throw new TypeError(`Expected string for "name" argument, got ${typeof name}`);let suffix=options.suffix||"";if(typeof suffix!="string")throw new TypeError(`Expected string for "suffix" argument, got ${typeof suffix}`);let isolated=options.isolated===void 0||options.isolated===null?!0:options.isolated;if(typeof isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof isolated}`);name||(name=path.parse(process.pkg?process.execPath:__require.main?__require.main.filename:process.argv[0]).name),suffix&&(name+=suffix),this._fn.$name=()=>name,this._fn.$isolated=()=>isolated;let extension=isWinOS?windows(name,isolated):base(name,isolated);return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module.exports=new _XDGAppPaths}});var require_tar_fs=__commonJS({"../../node_modules/.pnpm/tar-fs@1.16.5/node_modules/tar-fs/index.js"(exports){var chownr=require_chownr(),tar2=require_tar_stream(),pump=require_pump(),mkdirp=require_mkdirp(),fs=__require("fs"),path=__require("path"),os=__require("os"),win32=os.platform()==="win32",noop=function(){},echo=function(name){return name},normalize=win32?function(name){return name.replace(/\\/g,"/").replace(/[:?<>|]/g,"_")}:echo,statAll=function(fs2,stat3,cwd,ignore,entries,sort){var queue=entries||["."];return function(callback){if(!queue.length)return callback();var next=queue.shift(),nextAbs=path.join(cwd,next);stat3(nextAbs,function(err,stat4){if(err)return callback(err);if(!stat4.isDirectory())return callback(null,next,stat4);fs2.readdir(nextAbs,function(err2,files){if(err2)return callback(err2);sort&&files.sort();for(var i=0;i<files.length;i++)ignore(path.join(cwd,next,files[i]))||queue.push(path.join(next,files[i]));callback(null,next,stat4)})})}},strip=function(map,level){return function(header){header.name=header.name.split("/").slice(level).join("/");var linkname=header.linkname;return linkname&&(header.type==="link"||path.isAbsolute(linkname))&&(header.linkname=linkname.split("/").slice(level).join("/")),map(header)}};exports.pack=function(cwd,opts){cwd||(cwd="."),opts||(opts={});var xfs=opts.fs||fs,ignore=opts.ignore||opts.filter||noop,map=opts.map||noop,mapStream=opts.mapStream||echo,statNext=statAll(xfs,opts.dereference?xfs.stat:xfs.lstat,cwd,ignore,opts.entries,opts.sort),strict=opts.strict!==!1,umask=typeof opts.umask=="number"?~opts.umask:~processUmask(),dmode=typeof opts.dmode=="number"?opts.dmode:0,fmode=typeof opts.fmode=="number"?opts.fmode:0,pack=opts.pack||tar2.pack(),finish=opts.finish||noop;opts.strip&&(map=strip(map,opts.strip)),opts.readable&&(dmode|=parseInt(555,8),fmode|=parseInt(444,8)),opts.writable&&(dmode|=parseInt(333,8),fmode|=parseInt(222,8));var onsymlink=function(filename,header){xfs.readlink(path.join(cwd,filename),function(err,linkname){if(err)return pack.destroy(err);header.linkname=normalize(linkname),pack.entry(header,onnextentry)})},onstat=function(err,filename,stat3){if(err)return pack.destroy(err);if(!filename)return opts.finalize!==!1&&pack.finalize(),finish(pack);if(stat3.isSocket())return onnextentry();var header={name:normalize(filename),mode:(stat3.mode|(stat3.isDirectory()?dmode:fmode))&umask,mtime:stat3.mtime,size:stat3.size,type:"file",uid:stat3.uid,gid:stat3.gid};if(stat3.isDirectory())return header.size=0,header.type="directory",header=map(header)||header,pack.entry(header,onnextentry);if(stat3.isSymbolicLink())return header.size=0,header.type="symlink",header=map(header)||header,onsymlink(filename,header);if(header=map(header)||header,!stat3.isFile())return strict?pack.destroy(new Error("unsupported type for "+filename)):onnextentry();var entry=pack.entry(header,onnextentry);if(entry){var rs=mapStream(xfs.createReadStream(path.join(cwd,filename)),header);rs.on("error",function(err2){entry.destroy(err2)}),pump(rs,entry)}},onnextentry=function(err){if(err)return pack.destroy(err);statNext(onstat)};return onnextentry(),pack};var head=function(list){return list.length?list[list.length-1]:null},processGetuid=function(){return process.getuid?process.getuid():-1},processUmask=function(){return process.umask?process.umask():0};exports.extract=function(cwd,opts){cwd||(cwd="."),opts||(opts={});var xfs=opts.fs||fs,ignore=opts.ignore||opts.filter||noop,map=opts.map||noop,mapStream=opts.mapStream||echo,own=opts.chown!==!1&&!win32&&processGetuid()===0,extract=opts.extract||tar2.extract(),stack=[],now=new Date,umask=typeof opts.umask=="number"?~opts.umask:~processUmask(),dmode=typeof opts.dmode=="number"?opts.dmode:0,fmode=typeof opts.fmode=="number"?opts.fmode:0,strict=opts.strict!==!1;opts.strip&&(map=strip(map,opts.strip)),opts.readable&&(dmode|=parseInt(555,8),fmode|=parseInt(444,8)),opts.writable&&(dmode|=parseInt(333,8),fmode|=parseInt(222,8));var utimesParent=function(name,cb){for(var top;(top=head(stack))&&name.slice(0,top[0].length)!==top[0];)stack.pop();if(!top)return cb();xfs.utimes(top[0],now,top[1],cb)},utimes=function(name,header,cb){if(opts.utimes===!1)return cb();if(header.type==="directory")return xfs.utimes(name,now,header.mtime,cb);if(header.type==="symlink")return utimesParent(name,cb);xfs.utimes(name,now,header.mtime,function(err){if(err)return cb(err);utimesParent(name,cb)})},chperm=function(name,header,cb){var link2=header.type==="symlink",chmod2=link2?xfs.lchmod:xfs.chmod,chown=link2?xfs.lchown:xfs.chown;if(!chmod2)return cb();var mode=(header.mode|(header.type==="directory"?dmode:fmode))&umask;chmod2(name,mode,function(err){if(err)return cb(err);if(!own||!chown)return cb();chown(name,header.uid,header.gid,cb)})};return extract.on("entry",function(header,stream,next){header=map(header)||header,header.name=normalize(header.name);var name=path.join(cwd,path.join("/",header.name));if(ignore(name,header))return stream.resume(),next();var stat3=function(err){if(err)return next(err);utimes(name,header,function(err2){if(err2)return next(err2);if(win32)return next();chperm(name,header,next)})},onsymlink=function(){if(win32)return next();xfs.unlink(name,function(){var dst=path.resolve(path.dirname(name),header.linkname);if(!dst.startsWith(path.resolve(cwd)))return next(new Error(name+" is not a valid symlink"));xfs.symlink(header.linkname,name,stat3)})},onlink=function(){if(win32)return next();xfs.unlink(name,function(){var srcpath=path.join(cwd,path.join("/",header.linkname));xfs.realpath(srcpath,function(err,dst){if(err||!dst.startsWith(path.resolve(cwd)))return next(new Error(name+" is not a valid hardlink"));xfs.link(dst,name,function(err2){if(err2&&err2.code==="EPERM"&&opts.hardlinkAsFilesFallback)return stream=xfs.createReadStream(srcpath),onfile();stat3(err2)})})})},onfile=function(){var ws=xfs.createWriteStream(name),rs=mapStream(stream,header);ws.on("error",function(err){rs.destroy(err)}),pump(rs,ws,function(err){if(err)return next(err);ws.on("close",stat3)})};if(header.type==="directory")return stack.push([name,header.mtime]),mkdirfix(name,{fs:xfs,own,uid:header.uid,gid:header.gid},stat3);var dir=path.dirname(name);validate(xfs,dir,path.join(cwd,"."),function(err,valid){if(err)return next(err);if(!valid)return next(new Error(dir+" is not a valid path"));mkdirfix(dir,{fs:xfs,own,uid:header.uid,gid:header.gid},function(err2){if(err2)return next(err2);switch(header.type){case"file":return onfile();case"link":return onlink();case"symlink":return onsymlink()}if(strict)return next(new Error("unsupported type for "+name+" ("+header.type+")"));stream.resume(),next()})})}),opts.finish&&extract.on("finish",opts.finish),extract};function validate(fs2,name,root,cb){if(name===root)return cb(null,!0);fs2.lstat(name,function(err,st){if(err&&err.code!=="ENOENT")return cb(err);if(err||st.isDirectory())return validate(fs2,path.join(name,".."),root,cb);cb(null,!1)})}function mkdirfix(name,opts,cb){mkdirp(name,{fs:opts.fs},function(err,made){!err&&made&&opts.own?chownr(made,opts.uid,opts.gid,cb):cb(err)})}}});var import_jaro_winkler=__toESM(require_jaro_winkler(),1),did_you_mean_default=didYouMean;function didYouMean(input,list,threshold=.5){let found=list.map(item=>[dashAwareDistance(input,item),item]).filter(item=>item[0]>threshold);if(found.length)return found.reduce((accu,curr)=>accu[0]>curr[0]?accu:curr)[1]}function dashAwareDistance(word,dashWord){let fullDistance=(0,import_jaro_winkler.default)(word,dashWord),distances=dashWord.split("-").map(w=>(0,import_jaro_winkler.default)(w,word)),meanDistance=distances.reduce((accu,curr)=>accu+curr)/distances.length;return fullDistance>meanDistance?fullDistance:meanDistance}function handleCommandTypo({command,availableCommands,threshold=.7,client}){if(!command||command.startsWith("-"))return!1;let visibleCommands=availableCommands.filter(command2=>!command2.hidden),commandNames=visibleCommands.flatMap(({name,aliases})=>[name,...aliases]),correction=suggestCorrection(command,commandNames),suggestion=correction??did_you_mean_default(command,commandNames,threshold);if(suggestion){if(client){let definition=visibleCommands.find(candidate=>candidate.name===correction||candidate.aliases.some(alias=>alias===correction)),corrected=correction?buildCorrectedCommand(client.argv,command,correction,getFlagsSpecification(definition?.options??[])):void 0,payload={status:"error",reason:"unknown_command",message:`Unknown command "${command}". Did you mean "${suggestion}"?`,hint:corrected?"Use the suggested command after replacing any placeholders with the intended values.":`Accepted commands: ${commandNames.join(", ")}.`,...corrected&&{next:[{command:corrected,when:"Run the corrected command; replace any placeholders first"}]}};return shouldEmitNonInteractiveCommandError(client)?writeAgentError(client,payload):(output_manager_default.fatal(payload.message),output_manager_default.print(` ${corrected??payload.hint}
8
8
  `)),!0}return output_manager_default.error(`${param(command)} is not a valid target directory or subcommand. Did you mean ${param(suggestion)}?`),!0}return!1}var import_semver=__toESM(require_semver(),1);import{spawn,execFile}from"child_process";function renderUpgradeProgress(current,total,phase){let bar=progress(current,total);output_manager_default.spinner(bar?`Upgrading Vercel CLI [${bar}] (${current}/${total})${phase?` ${phase}`:""}`:phase||"Upgrading Vercel CLI\u2026",0)}function execFileStdout(command,args,cwd,env=trustedUpgradeEnvironment){return new Promise((resolve3,reject)=>{execFile(command,args,{encoding:"utf8",windowsHide:!0,cwd,timeout:15e3,env},(error,stdout)=>{if(error){reject(error);return}resolve3(stdout.toString())})})}function parseVersionOutput(stdout){for(let line of[stdout.trim(),...stdout.trim().split(`
9
9
  `).reverse()])try{let value=JSON.parse(line),parsed=Array.isArray(value)&&value.length===1?value[0]:value,version=typeof parsed=="string"?parsed:typeof parsed?.data=="string"?parsed.data:void 0;if(version&&import_semver.default.valid(version))return version}catch{let version=line.trim();if(import_semver.default.valid(version))return version}}async function getLatestPackageVersion(packageManager,installArgs,cwd,global,env,bypassMinReleaseAge=!0){let packageSpecifier=installArgs.find(arg=>arg.endsWith("@latest"));if(!packageSpecifier)return;let manager=getUpgradePackageManager(packageManager),queryArgs=[...manager.metadataArgs(packageSpecifier),...bypassMinReleaseAge?manager.releaseAgeBypassArgs:[]];try{let stdout=await execFileStdout(packageManager,queryArgs,cwd,env);return parseVersionOutput(stdout)}catch(error){output_manager_default.debug(`Failed to resolve the latest Vercel CLI version: ${error instanceof Error?error.message:String(error)}`);return}}async function getInstalledPackageVersion(packageManager,installArgs,cwd,global){let packageSpecifier=installArgs.find(arg=>arg.endsWith("@latest"));if(!packageSpecifier)return;let packageName=packageSpecifier.slice(0,-7);try{let stdout=await execFileStdout(packageManager,["list",packageName,"--depth=0","--json",...global?["--global"]:[]],cwd),parsed=JSON.parse(stdout),projects=Array.isArray(parsed)?parsed:[parsed];for(let project of projects){let version=project?.dependencies?.[packageName]?.version??project?.devDependencies?.[packageName]?.version??project?.optionalDependencies?.[packageName]?.version;if(typeof version=="string"&&import_semver.default.valid(version))return version}}catch(error){output_manager_default.debug(`Failed to read the installed Vercel CLI version: ${error instanceof Error?error.message:String(error)}`)}}function isVersionCurrent(current,latest){return import_semver.default.valid(current)&&import_semver.default.valid(latest)?import_semver.default.gte(current,latest):current===latest}function pinPackageVersion(args,version){return args.map(arg=>arg.endsWith("@latest")?`${arg.slice(0,-6)}${version}`:arg)}async function getMinReleaseAgeContext(packageManager,cwd,global){let setting=packageManager==="pnpm"?"minimumReleaseAge":"min-release-age";try{let raw=(await execFileStdout(packageManager,["config","get",setting,"--json",...global?["--global"]:[]],cwd)).trim(),value=raw===""||raw==="undefined"?void 0:JSON.parse(raw);if(!(value==null||value===""||value==="undefined")){let age=typeof value=="number"||typeof value=="string"&&value.trim()!==""?Number(value):NaN;if(!Number.isFinite(age)||age<0)return`Could not determine ${packageManager}'s configured minimum release age.`;let minutes=packageManager==="pnpm"?age:age*1440,duration=minutes>0&&minutes%60===0?`${minutes/60} ${minutes===60?"hour":"hours"}`:`${minutes} ${minutes===1?"minute":"minutes"}`;return`${packageManager} ${setting} is configured to ${duration}.`}if(packageManager==="pnpm"){let version=parseVersionOutput(await execFileStdout(packageManager,["--version"],cwd));if(version&&!import_semver.default.prerelease(version)&&import_semver.default.gte(version,"11.0.0"))return`pnpm ${version} defaults to a minimum release age of 24 hours (1440 minutes); no explicit minimumReleaseAge setting was reported.`}return`${packageManager} did not report a configured minimum release age.`}catch{return`Could not determine ${packageManager}'s configured minimum release age.`}}function isMinReleaseAgeError(packageManager,stdout,stderr){let installerOutput=`${stdout}
10
10
  ${stderr}`;return packageManager==="pnpm"?installerOutput.includes("ERR_PNPM_NO_MATURE_MATCHING_VERSION")||installerOutput.includes("ERR_PNPM_NO_MATCHING_VERSION")&&installerOutput.includes("satisfies the specs but was released at"):packageManager==="npm"?/\bETARGET\b/.test(installerOutput)&&installerOutput.includes("with a date before")||/min-release-age cannot be provided/i.test(installerOutput):!1}function setMinReleaseAgeBypass(client,enabled){client.config={...client.config,updates:{...client.config.updates,bypassMinReleaseAge:enabled}},writeToConfigFile(client.config)}function executeAutomaticUpgrade(client,env=trustedUpgradeEnvironment){return executeUpgrade("latest",client,!1,!0,env,"package-manager")}async function executeUpgrade(targetVersion,client,bypassMinReleaseAge=!1,explicitTarget=!1,env=trustedUpgradeEnvironment,releaseAgePolicy="newest"){let totalSteps=targetVersion?2:3;renderUpgradeProgress(0,totalSteps,"Resolving installer\u2026");let{command:updateCommand,global,packageManager}=await getUpdateCommandInfo(env).catch(error=>{throw output_manager_default.stopSpinner(),error}),[command,...args]=updateCommand.split(" "),cwd=global?trustedUpgradeDirectory:process.cwd(),bypassArgs=getUpgradePackageManager(packageManager).releaseAgeBypassArgs;if(bypassMinReleaseAge&&bypassArgs.length===0)return output_manager_default.stopSpinner(),output_manager_default.error(`Minimum release-age bypass is not supported for ${packageManager}. Run the upgrade without --bypass-min-release-age, or configure release-age settings in ${packageManager} directly.`),1;bypassMinReleaseAge&&client&&client.config.updates?.bypassMinReleaseAge!==!0&&setMinReleaseAgeBypass(client,!0);let versionBefore=pkg_default.version,installLatestTag=explicitTarget&&targetVersion==="latest",resolvedTargetVersion=installLatestTag?void 0:targetVersion;if(targetVersion||(renderUpgradeProgress(1,totalSteps,"Checking for updates\u2026"),resolvedTargetVersion=await getLatestPackageVersion(packageManager,args,cwd,global,env,releaseAgePolicy==="newest")),!resolvedTargetVersion&&!installLatestTag)return output_manager_default.stopSpinner(),output_manager_default.error("Failed to resolve the latest Vercel CLI version."),1;if(!explicitTarget&&resolvedTargetVersion&&isVersionCurrent(versionBefore,resolvedTargetVersion))return renderUpgradeProgress(totalSteps,totalSteps),output_manager_default.stopSpinner(),output_manager_default.log(`No upgrade available. Vercel CLI is already up to date (v${versionBefore}).`),0;let installArgs=resolvedTargetVersion?pinPackageVersion(args,resolvedTargetVersion):args,shouldBypass=releaseAgePolicy==="newest"&&bypassArgs.length>0&&(bypassMinReleaseAge||client?.config.updates?.bypassMinReleaseAge===!0);shouldBypass&&(installArgs=[...installArgs,...bypassArgs]);let runInstall=currentArgs=>{let installCommand=[command,...currentArgs].join(" ");return output_manager_default.debug(`Executing: ${installCommand} (cwd: ${cwd})`),new Promise(resolve3=>{let stdout=[],stderr=[],upgradeProcess=spawn(command,currentArgs,{cwd,env,stdio:["inherit","pipe","pipe"],shell:!1});upgradeProcess.stdout?.on("data",data=>{stdout.push(Uint8Array.from(data)),output_manager_default.debug(`[upgrade stdout] ${data.toString().trimEnd()}`)}),upgradeProcess.stderr?.on("data",data=>{stderr.push(Uint8Array.from(data)),output_manager_default.debug(`[upgrade stderr] ${data.toString().trimEnd()}`)});let settled=!1;upgradeProcess.on("error",spawnError=>{settled||(settled=!0,resolve3({code:1,stdout:"",stderr:"",spawnError}))}),upgradeProcess.on("close",code=>{settled||(settled=!0,resolve3({code:code??1,stdout:Buffer.concat(stdout).toString(),stderr:Buffer.concat(stderr).toString()}))})})};renderUpgradeProgress(targetVersion?1:2,totalSteps,"Installing\u2026");let result=await runInstall(installArgs),usedAllowedRelease=!1;if(result.code!==0&&!result.spawnError&&releaseAgePolicy==="newest"&&!shouldBypass&&bypassArgs.length>0&&isMinReleaseAgeError(packageManager,result.stdout,result.stderr)){let context=await getMinReleaseAgeContext(packageManager,cwd,global);output_manager_default.stopSpinner();let blockedMessage=`The package manager blocked this Vercel CLI release because of its minimum release-age setting. ${context}`;if(!client||client.nonInteractive||!client.stdin.isTTY)return output_manager_default.error(`${blockedMessage}
@@ -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{MISSING_BOTH_MESSAGE}from"./chunk-LL2XUFCY.js";import{RULE_ENVIRONMENTS}from"./chunk-IVWPQYIH.js";import{resolveProjectContext}from"./chunk-SURYRPWO.js";import{AGENT_REASON,AGENT_STATUS}from"./chunk-T4LZS75P.js";import{detectExplicitScope}from"./chunk-K2MXVUWY.js";import{printError}from"./chunk-PGF7MQK6.js";import{outputAgentError}from"./chunk-SQXB2UM4.js";import{isAPIError}from"./chunk-RINZXCDJ.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";function messageFor(err){return isAPIError(err)?err.serverMessage||err.message:err instanceof Error?err.message:String(err)}function handleTracingApiError(client,err){if(client.nonInteractive){let status=isAPIError(err)?err.status:void 0;outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:status===403?AGENT_REASON.PERMISSION_DENIED:status===404?AGENT_REASON.NOT_FOUND:AGENT_REASON.API_ERROR,message:messageFor(err)})}return isAPIError(err)&&err.status===403?(output_manager_default.error(messageFor(err)),1):(printError(err),1)}function configError(client,reason,message){return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason,message}),output_manager_default.error(message),1}function invalidArguments(client,message){return configError(client,AGENT_REASON.INVALID_ARGUMENTS,message)}function ruleNotFound(client,message){return configError(client,AGENT_REASON.NOT_FOUND,message)}function confirmationRequired(client,message,next){return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.CONFIRMATION_REQUIRED,message,userActionRequired:!0,next}),output_manager_default.error(message),1}function writeConfigJson(client,{project,bare,envelope,message,next}){if(!client.nonInteractive){client.stdout.write(`${JSON.stringify(bare,null,2)}
7
+ import{MISSING_BOTH_MESSAGE}from"./chunk-HZ5ZZCUZ.js";import{RULE_ENVIRONMENTS}from"./chunk-IVWPQYIH.js";import{resolveProjectContext}from"./chunk-GKWT55SU.js";import{AGENT_REASON,AGENT_STATUS}from"./chunk-T4LZS75P.js";import{detectExplicitScope}from"./chunk-GQGVOJ4V.js";import{printError}from"./chunk-N5AIKGEO.js";import{outputAgentError}from"./chunk-KCARCOP5.js";import{isAPIError}from"./chunk-RINZXCDJ.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";function messageFor(err){return isAPIError(err)?err.serverMessage||err.message:err instanceof Error?err.message:String(err)}function handleTracingApiError(client,err){if(client.nonInteractive){let status=isAPIError(err)?err.status:void 0;outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:status===403?AGENT_REASON.PERMISSION_DENIED:status===404?AGENT_REASON.NOT_FOUND:AGENT_REASON.API_ERROR,message:messageFor(err)})}return isAPIError(err)&&err.status===403?(output_manager_default.error(messageFor(err)),1):(printError(err),1)}function configError(client,reason,message){return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason,message}),output_manager_default.error(message),1}function invalidArguments(client,message){return configError(client,AGENT_REASON.INVALID_ARGUMENTS,message)}function ruleNotFound(client,message){return configError(client,AGENT_REASON.NOT_FOUND,message)}function confirmationRequired(client,message,next){return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.CONFIRMATION_REQUIRED,message,userActionRequired:!0,next}),output_manager_default.error(message),1}function writeConfigJson(client,{project,bare,envelope,message,next}){if(!client.nonInteractive){client.stdout.write(`${JSON.stringify(bare,null,2)}
8
8
  `);return}client.stdout.write(`${JSON.stringify({status:AGENT_STATUS.OK,projectId:project.id,projectName:project.name,...envelope,message,next},null,2)}
9
9
  `)}var RULE_LIMIT=10,MIN_SAMPLE_RATE=1,MAX_SAMPLE_RATE=100;function isRuleEnvironment(value){return RULE_ENVIRONMENTS.includes(value)}var ENVIRONMENT_ERROR=`\`environment\` must be one of: ${RULE_ENVIRONMENTS.join(", ")}.`,RATE_ERROR=`\`rate\` must be a whole number from ${MIN_SAMPLE_RATE} to ${MAX_SAMPLE_RATE}.`,EMPTY_PATH_ERROR="`requestPath` cannot be empty.";function parseSampleRate(value){if(!/^\d+$/.test(value.trim()))return;let rate=Number(value);return rate>=MIN_SAMPLE_RATE&&rate<=MAX_SAMPLE_RATE?rate:void 0}function toRow(rule){return{environment:rule.env??"any",requestPath:rule.requestPath??null,sampleRate:Math.round(rule.rate*100)}}function toApiRate(sampleRate){return sampleRate/100}function toRule(row){return{rate:toApiRate(row.sampleRate),...row.environment==="any"?{}:{env:row.environment},...row.requestPath===null?{}:{requestPath:row.requestPath}}}var ALL_PATHS_LABEL="(all paths)";function formatPath(requestPath){return requestPath??ALL_PATHS_LABEL}function formatRate(sampleRate){return`${sampleRate}%`}function formatRuleTarget(environment,requestPath){return`${environment} ${formatPath(requestPath)}`}function formatRuleLine(row){return`${formatRuleTarget(row.environment,row.requestPath)} ${formatRate(row.sampleRate)}`}var COMMAND_WORD_COUNT=3;function subcommandArguments(positional){return positional.slice(COMMAND_WORD_COUNT)}function hasSameKey(a,b){return a.environment===b.environment&&a.requestPath===b.requestPath}async function readProjectTracing({client,teamId,projectId}){let project=await client.fetch(`/v9/projects/${encodeURIComponent(projectId)}`,{accountId:teamId}),tracing=project.tracing??null;return{project,tracing,entries:(tracing?.samplingRules??[]).map(rule=>({rule,row:toRow(rule)}))}}async function writeSamplingRules({client,teamId,projectId,tracing,rules}){let body={tracing:{...tracing??{},samplingRules:rules}};await client.fetch(`/v9/projects/${encodeURIComponent(projectId)}`,{accountId:teamId,method:"PATCH",body})}async function resolveConfigScope(client,flags){let link=await resolveProjectContext({client,projectNameOrId:flags.project});return link.status==="error"?{exitCode:link.exitCode}:link.status==="not_linked"?(output_manager_default.error(MISSING_BOTH_MESSAGE),{exitCode:1}):flags.project===void 0&&detectExplicitScope(client)&&link.org.id!==client.config.currentTeam?(output_manager_default.error(`The linked project ${link.project.name} belongs to ${link.org.slug||link.org.id}, which is not the scope that was passed. Pass --project <name> to act on a project in that scope.`),{exitCode:1}):{teamId:link.org.id,projectId:link.project.id}}export{handleTracingApiError,invalidArguments,ruleNotFound,confirmationRequired,writeConfigJson,RULE_LIMIT,isRuleEnvironment,ENVIRONMENT_ERROR,RATE_ERROR,EMPTY_PATH_ERROR,parseSampleRate,toApiRate,toRule,formatPath,formatRate,formatRuleTarget,formatRuleLine,subcommandArguments,hasSameKey,readProjectTracing,writeSamplingRules,resolveConfigScope};
@@ -4,7 +4,7 @@ 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{VERCEL_CONFIG_EXTENSIONS}from"./chunk-QR7QPUFN.js";import{VERCEL_DIR}from"./chunk-NOYJJRDK.js";import{ConflictingConfigFiles,DeprecatedNowJson}from"./chunk-RINZXCDJ.js";import{output_manager_default,require_build_utils}from"./chunk-EWWFNMPZ.js";import{__commonJS,__require,__toESM}from"./chunk-6L236MNA.js";var require_main=__commonJS({"../../node_modules/.pnpm/dotenv@4.0.0/node_modules/dotenv/lib/main.js"(exports,module){"use strict";var fs=__require("fs");function parse(src){var obj={};return src.toString().split(`
7
+ import{VERCEL_CONFIG_EXTENSIONS,VERCEL_DIR}from"./chunk-EO4G5E7C.js";import{ConflictingConfigFiles,DeprecatedNowJson}from"./chunk-RINZXCDJ.js";import{output_manager_default,require_build_utils}from"./chunk-EWWFNMPZ.js";import{__commonJS,__require,__toESM}from"./chunk-6L236MNA.js";var require_main=__commonJS({"../../node_modules/.pnpm/dotenv@4.0.0/node_modules/dotenv/lib/main.js"(exports,module){"use strict";var fs=__require("fs");function parse(src){var obj={};return src.toString().split(`
8
8
  `).forEach(function(line){var keyValueArr=line.match(/^\s*([\w\.\-]+)\s*=\s*(.*)?\s*$/);if(keyValueArr!=null){var key=keyValueArr[1],value=keyValueArr[2]?keyValueArr[2]:"",len=value?value.length:0;len>0&&value.charAt(0)==='"'&&value.charAt(len-1)==='"'&&(value=value.replace(/\\n/gm,`
9
9
  `)),value=value.replace(/(^['"]|['"]$)/g,"").trim(),obj[key]=value}}),obj}function config(options){var path=".env",encoding="utf8";options&&(options.path&&(path=options.path),options.encoding&&(encoding=options.encoding));try{var parsedObj=parse(fs.readFileSync(path,{encoding}));return Object.keys(parsedObj).forEach(function(key){process.env[key]=process.env[key]||parsedObj[key]}),{parsed:parsedObj}}catch(e){return{error:e}}}module.exports.config=config;module.exports.load=config;module.exports.parse=parse}});var import_dotenv=__toESM(require_main(),1);import{mkdir,readFile,writeFile,unlink,access}from"fs/promises";import{join,basename}from"path";import{fork}from"child_process";async function loadEsbuild(){let nativeLoader=Reflect.get(globalThis,Symbol.for("vercel.cli.loadEsbuild"));return typeof nativeLoader=="function"?nativeLoader():import("esbuild")}var import_build_utils=__toESM(require_build_utils(),1);function toRouteFormat(item){if("src"in item)return item;let{source,destination,headers,statusCode,permanent,...rest}=item,route={src:source,...rest};return destination&&(route.dest=destination),headers&&(route.headers=Object.fromEntries(headers.map(h=>[h.key,h.value]))),statusCode!==void 0?route.status=statusCode:permanent!==void 0&&(route.status=permanent?308:307),route}function normalizeConfig(config){let normalized={...config},{rewrites,redirects,headers}=normalized,allRoutes=normalized.routes||[],hasRoutes=allRoutes.length>0,hasRewrites=(rewrites?.length??0)>0,hasRedirects=(redirects?.length??0)>0,hasHeaders=(headers?.length??0)>0;function hasRouteFormat(items){return items?.some(item=>"src"in item)??!1}if(hasRoutes&&(hasRewrites||hasRedirects||hasHeaders))return normalized;let shouldConvertRewrites=hasRewrites&&hasRouteFormat(rewrites),shouldConvertRedirects=hasRedirects&&hasRouteFormat(redirects),shouldConvertHeaders=hasHeaders&&hasRouteFormat(headers);if((shouldConvertRewrites||shouldConvertRedirects||shouldConvertHeaders)&&(hasRewrites&&!shouldConvertRewrites||hasRedirects&&!shouldConvertRedirects||hasHeaders&&!shouldConvertHeaders))throw new import_build_utils.NowBuildError({code:"INVALID_VERCEL_CONFIG",message:"Transforms (e.g., requestHeaders) require the `routes` format, which cannot be used alongside `rewrites`, `redirects`, or `headers`. Move everything into the `routes` array instead.",link:"https://vercel.com/docs/projects/project-configuration#routes"});return rewrites&&shouldConvertRewrites&&(allRoutes=[...allRoutes,...rewrites.map(toRouteFormat)],delete normalized.rewrites),redirects&&shouldConvertRedirects&&(allRoutes=[...allRoutes,...redirects.map(toRouteFormat)],delete normalized.redirects),headers&&shouldConvertHeaders&&(allRoutes=[...allRoutes,...headers.map(toRouteFormat)],delete normalized.headers),allRoutes.length>0&&(normalized.routes=allRoutes.map(toRouteFormat)),normalized}async function fileExists(filePath){try{return await access(filePath),!0}catch{return!1}}async function findAllVercelConfigFiles(workPath){let foundFiles=[];for(let ext of VERCEL_CONFIG_EXTENSIONS){let configPath=join(workPath,`vercel.${ext}`);await fileExists(configPath)&&foundFiles.push(configPath)}return foundFiles}async function findSourceVercelConfigFile(workPath){for(let ext of VERCEL_CONFIG_EXTENSIONS){let configPath=join(workPath,`vercel.${ext}`);if(await fileExists(configPath))return basename(configPath)}let tomlPath=join(workPath,"vercel.toml");return await fileExists(tomlPath)?"vercel.toml":null}async function findVercelConfigFile(workPath){let foundFiles=await findAllVercelConfigFiles(workPath);if(foundFiles.length>1)throw new ConflictingConfigFiles(foundFiles,"Multiple vercel config files found. Please use only one configuration file.","https://vercel.com/docs/projects/project-configuration");return foundFiles[0]||null}function parseConfigLoaderError(stderr){if(!stderr.trim())return"";let moduleNotFoundMatch=stderr.match(/Error \[ERR_MODULE_NOT_FOUND\]: Cannot find package '([^']+)'/);if(moduleNotFoundMatch)return`Cannot find package '${moduleNotFoundMatch[1]}'. Make sure it's installed in your project dependencies.`;let syntaxErrorMatch=stderr.match(/SyntaxError: (.+?)(?:\n|$)/);if(syntaxErrorMatch)return`Syntax error: ${syntaxErrorMatch[1]}`;let errorMatch=stderr.match(/^(?:Error|TypeError|ReferenceError): (.+?)(?:\n|$)/m);return errorMatch?errorMatch[1]:stderr.trim()}async function compileVercelConfig(workPath){let vercelJsonPath=join(workPath,"vercel.json"),nowJsonPath=join(workPath,"now.json"),vercelTomlPath=join(workPath,"vercel.toml"),hasVercelJson=await fileExists(vercelJsonPath),hasNowJson=await fileExists(nowJsonPath),hasVercelToml=await fileExists(vercelTomlPath),vercelConfigPath=await findVercelConfigFile(workPath),vercelDir=join(workPath,VERCEL_DIR),compiledConfigPath=join(vercelDir,"vercel.json");if(hasNowJson)throw new DeprecatedNowJson(nowJsonPath);let foundConfigs=[];if(hasVercelJson&&foundConfigs.push(vercelJsonPath),hasVercelToml&&foundConfigs.push(vercelTomlPath),vercelConfigPath&&foundConfigs.push(vercelConfigPath),foundConfigs.length>1)throw new ConflictingConfigFiles(foundConfigs,`Multiple config files found: ${foundConfigs.map(f=>basename(f)).join(", ")}. Please use only one configuration method.`,"https://vercel.com/docs/projects/project-configuration");if(!vercelConfigPath&&!hasVercelToml)return hasVercelJson?{configPath:vercelJsonPath,wasCompiled:!1}:await fileExists(compiledConfigPath)?{configPath:compiledConfigPath,wasCompiled:!0,sourceFile:await findSourceVercelConfigFile(workPath)??void 0}:{configPath:null,wasCompiled:!1};if(hasVercelToml)try{let{parse:tomlParse}=await import("smol-toml"),tomlContent=await readFile(vercelTomlPath,"utf8"),config=tomlParse(tomlContent),normalizedConfig=normalizeConfig(config);return await mkdir(vercelDir,{recursive:!0}),await writeFile(compiledConfigPath,JSON.stringify(normalizedConfig,null,2),"utf-8"),output_manager_default.debug(`Compiled ${vercelTomlPath} -> ${compiledConfigPath}`),{configPath:compiledConfigPath,wasCompiled:!0,sourceFile:"vercel.toml"}}catch(error){throw new import_build_utils.NowBuildError({code:error.code??"vercel_toml_parse_failed",message:`Failed to parse vercel.toml: ${error.message}`,link:error.link??"https://vercel.com/docs/projects/project-configuration"})}let sourceConfigPath=vercelConfigPath;(0,import_dotenv.config)({path:join(workPath,".env")}),(0,import_dotenv.config)({path:join(workPath,".env.local")});let tempOutPath=join(vercelDir,"vercel-temp.mjs"),loaderPath=join(vercelDir,"vercel-loader.mjs");try{let{build}=await loadEsbuild();await mkdir(vercelDir,{recursive:!0}),await build({entryPoints:[sourceConfigPath],bundle:!0,platform:"node",format:"esm",outfile:tempOutPath,packages:"external",target:"node20",sourcemap:"inline"}),await writeFile(loaderPath,`
10
10
  import { pathToFileURL } from 'url';