vercel 62.0.0 → 62.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 (174) hide show
  1. package/dist/chunks/{add-MCZFWZIP.js → add-7HJR3HK7.js} +1 -1
  2. package/dist/chunks/add-Q5OZFIRM.js +8 -0
  3. package/dist/chunks/add-VLVURKGS.js +8 -0
  4. package/dist/chunks/{build-4KB4NLDZ.js → build-MR7MUWBQ.js} +1 -1
  5. package/dist/chunks/{chunk-AKZAWY6R.js → chunk-2RQFMCPJ.js} +1 -1
  6. package/dist/chunks/{chunk-WVQLFM45.js → chunk-3R66O72V.js} +1 -1
  7. package/dist/chunks/{chunk-43XQUIXX.js → chunk-4HXRTNAK.js} +1 -1
  8. package/dist/chunks/{chunk-QKIDYVDL.js → chunk-5VWK73R6.js} +1 -1
  9. package/dist/chunks/{chunk-U2Z3MYSU.js → chunk-6JU3QZ3O.js} +1 -1
  10. package/dist/chunks/{chunk-OGQRWLHV.js → chunk-743NGLUN.js} +1 -1
  11. package/dist/chunks/{chunk-BN3XAVPG.js → chunk-7ANQHBBE.js} +1 -1
  12. package/dist/chunks/{chunk-HXKTQSVU.js → chunk-7I23VXBQ.js} +1 -1
  13. package/dist/chunks/{chunk-ZRNMJQX5.js → chunk-7IRKF3ZG.js} +3 -3
  14. package/dist/chunks/{chunk-36RTKJWB.js → chunk-7JFK53D4.js} +1 -1
  15. package/dist/chunks/{chunk-J3HVEQRC.js → chunk-7POWBJDF.js} +2 -2
  16. package/dist/chunks/{chunk-56FBKYDJ.js → chunk-7T4CJ6MJ.js} +1 -1
  17. package/dist/chunks/{chunk-XWD3HYWE.js → chunk-A752WDCH.js} +1 -1
  18. package/dist/chunks/{chunk-VNOZYSNT.js → chunk-ACCZWEKL.js} +1 -1
  19. package/dist/chunks/chunk-ADDXKC3J.js +9 -0
  20. package/dist/chunks/{chunk-2A2GVGNS.js → chunk-AKPQWZIP.js} +2 -2
  21. package/dist/chunks/chunk-ALXWJ7XN.js +7 -0
  22. package/dist/chunks/{chunk-F46FFOPY.js → chunk-B5PFD6Q3.js} +1 -1
  23. package/dist/chunks/{chunk-HBB6S6FN.js → chunk-C3XFIO5L.js} +1 -1
  24. package/dist/chunks/{chunk-4DGSVSWX.js → chunk-C6ITILVT.js} +2 -2
  25. package/dist/chunks/{chunk-YZH6RUFI.js → chunk-CQ3RAERR.js} +1 -1
  26. package/dist/chunks/{chunk-IDWEEGMC.js → chunk-CVX5X5RI.js} +1 -1
  27. package/dist/chunks/chunk-D5VTBRWF.js +7 -0
  28. package/dist/chunks/{chunk-56CIPRSY.js → chunk-DECIQZZQ.js} +3 -3
  29. package/dist/chunks/{chunk-ZQZL5YQA.js → chunk-E4RLHRDF.js} +1 -1
  30. package/dist/chunks/{chunk-2F5ENFZE.js → chunk-EQHNA4BW.js} +1 -1
  31. package/dist/chunks/{chunk-GP62PIK6.js → chunk-GASSNHZG.js} +1 -1
  32. package/dist/chunks/{chunk-ORF2KLRG.js → chunk-HLVUEYOZ.js} +1 -1
  33. package/dist/chunks/chunk-HVROAV4B.js +9 -0
  34. package/dist/chunks/{chunk-HTPAVQS4.js → chunk-HYW4A5B3.js} +1 -1
  35. package/dist/chunks/{chunk-ZXE4XYIV.js → chunk-ILFUNCJZ.js} +1 -1
  36. package/dist/chunks/{chunk-GA25RADA.js → chunk-ILXXXXVQ.js} +1 -1
  37. package/dist/chunks/{chunk-X7REKM7I.js → chunk-JO3XBFR3.js} +1 -1
  38. package/dist/chunks/{chunk-63524SZ2.js → chunk-JRU6AGXG.js} +1 -1
  39. package/dist/chunks/{chunk-6FGTAOZC.js → chunk-JSKSNCK2.js} +1 -1
  40. package/dist/chunks/{chunk-XSBLZMTW.js → chunk-K5WTLFS6.js} +1 -1
  41. package/dist/chunks/{chunk-KMHCNMWF.js → chunk-KG5BMLOI.js} +1 -1
  42. package/dist/chunks/{chunk-SVOAPAXM.js → chunk-KOSM3DYE.js} +1 -1
  43. package/dist/chunks/{chunk-UNXGP4T4.js → chunk-KREBNPHL.js} +1 -1
  44. package/dist/chunks/{chunk-UOS7HE4I.js → chunk-L46BHPRD.js} +1 -1
  45. package/dist/chunks/{chunk-NNEWLQZ2.js → chunk-LCWCTL6L.js} +1 -1
  46. package/dist/chunks/{chunk-3AZEJ674.js → chunk-LCY4SULE.js} +1 -1
  47. package/dist/chunks/chunk-LHQUNL52.js +7 -0
  48. package/dist/chunks/{chunk-53BZCZTW.js → chunk-M7ZGWERO.js} +1 -1
  49. package/dist/chunks/{chunk-A5VLP25I.js → chunk-MCCL762Q.js} +1 -1
  50. package/dist/chunks/chunk-MK3CTSDV.js +24 -0
  51. package/dist/chunks/{chunk-DT3EUC6S.js → chunk-N4PVXHAJ.js} +2 -1
  52. package/dist/chunks/{chunk-T72CT7NM.js → chunk-N5MNZPPJ.js} +1 -1
  53. package/dist/chunks/{chunk-ODEEQEAD.js → chunk-N7XPPYQQ.js} +1 -1
  54. package/dist/chunks/{chunk-OMXVC7WL.js → chunk-NESZV33T.js} +1 -1
  55. package/dist/chunks/{chunk-J27GIFGM.js → chunk-NRN65VUM.js} +1 -1
  56. package/dist/chunks/{chunk-6HWPJHPE.js → chunk-NT67T6DL.js} +1 -1
  57. package/dist/chunks/chunk-NXTK7VKL.js +7 -0
  58. package/dist/chunks/{chunk-6MNJOHPD.js → chunk-PADCVJ7G.js} +1 -1
  59. package/dist/chunks/{chunk-2RU3W7DI.js → chunk-PAI3WRPA.js} +1 -1
  60. package/dist/chunks/{chunk-3RR5CAUY.js → chunk-PTFKU33G.js} +1 -1
  61. package/dist/chunks/{chunk-UKVHDIP7.js → chunk-PV5YI2ZZ.js} +1 -1
  62. package/dist/chunks/{chunk-UMSD2UEI.js → chunk-RFWCEREA.js} +1 -1
  63. package/dist/chunks/{chunk-HRW6JPGE.js → chunk-RVKOPGOI.js} +1 -1
  64. package/dist/chunks/{chunk-JV2R73IG.js → chunk-S2LBGLRE.js} +1 -1
  65. package/dist/chunks/{chunk-6OI6SRHZ.js → chunk-SDGWKUST.js} +1 -1
  66. package/dist/chunks/{chunk-QS3H2ANN.js → chunk-UOHVKN6N.js} +1 -1
  67. package/dist/chunks/{chunk-4HR5QZI5.js → chunk-UWO3M2L2.js} +1 -1
  68. package/dist/chunks/{chunk-J4WPHU3P.js → chunk-VDOJERIW.js} +1 -1
  69. package/dist/chunks/chunk-VGXFOQ4P.js +8 -0
  70. package/dist/chunks/{chunk-WPC7UHAS.js → chunk-VTMLKJVQ.js} +1 -1
  71. package/dist/chunks/{chunk-YIJERP7V.js → chunk-VZDY57PJ.js} +1 -1
  72. package/dist/chunks/{chunk-LW7WCZ52.js → chunk-W7PVS44H.js} +1 -1
  73. package/dist/chunks/{chunk-LQMW75EU.js → chunk-WN6OXK2F.js} +1 -1
  74. package/dist/chunks/{chunk-2YSKT6HL.js → chunk-WOKSTB3F.js} +1 -1
  75. package/dist/chunks/{chunk-3CJI4EAR.js → chunk-WW3VUXRV.js} +1 -1
  76. package/dist/chunks/{chunk-QMLU6UFC.js → chunk-X47XV2WG.js} +1 -1
  77. package/dist/chunks/{chunk-6WAQETPS.js → chunk-ZQIUMXCI.js} +1 -1
  78. package/dist/chunks/{chunk-ZRVFN7YO.js → chunk-ZUYWATU5.js} +1 -1
  79. package/dist/chunks/{clear-6NP2IT4F.js → clear-PPE55RPM.js} +1 -1
  80. package/dist/chunks/{compile-vercel-config-7JBRIIM7.js → compile-vercel-config-2IC23CNT.js} +1 -1
  81. package/dist/chunks/{config-ZP32YP6C.js → config-G2A6KPPM.js} +1 -1
  82. package/dist/chunks/{config-562NRVVZ.js → config-T3WHONFJ.js} +1 -1
  83. package/dist/chunks/config-validator.mjs +1 -1
  84. package/dist/chunks/{delete-UL76FA4Q.js → delete-75SYJKNE.js} +1 -1
  85. package/dist/chunks/{delete-J4TGLAU6.js → delete-MHXN5KTO.js} +1 -1
  86. package/dist/chunks/{detect-projects-325QE23N.js → detect-projects-GJF4VXQI.js} +1 -1
  87. package/dist/chunks/detect-services-K3363KB7.js +7 -0
  88. package/dist/chunks/{disable-CNJCXFS4.js → disable-OUYOHEWN.js} +1 -1
  89. package/dist/chunks/{discard-2YP7E4YP.js → discard-RXSHOY3J.js} +1 -1
  90. package/dist/chunks/{edit-NTJXKEVD.js → edit-Y7OL72ZK.js} +1 -1
  91. package/dist/chunks/{edit-I5L443ZZ.js → edit-Z5RCWPOX.js} +1 -1
  92. package/dist/chunks/{enable-JQVGB5EU.js → enable-HI2UH2NM.js} +1 -1
  93. package/dist/chunks/{export-KK46QDGW.js → export-CMP3APAJ.js} +1 -1
  94. package/dist/chunks/{future-T4Q7RANL.js → future-GS7ZLJ3N.js} +1 -1
  95. package/dist/chunks/{generate-cert-for-deploy-LUHAFVYC.js → generate-cert-for-deploy-2HHUYGHU.js} +1 -1
  96. package/dist/chunks/{image-4F5NKSSP.js → image-SQIUEBFK.js} +1 -1
  97. package/dist/chunks/{import-builders-B2QQXOHS.js → import-builders-EUOOFPHW.js} +1 -1
  98. package/dist/chunks/{inspect-MSDBVOII.js → inspect-2SXPXNYH.js} +1 -1
  99. package/dist/chunks/{inspect-UINFK4D6.js → inspect-DYNTJMTQ.js} +1 -1
  100. package/dist/chunks/{inspect-OZH4CRGR.js → inspect-J3F3U3YF.js} +1 -1
  101. package/dist/chunks/{inspect-VJ4JXO4W.js → inspect-KYFVYFWX.js} +1 -1
  102. package/dist/chunks/{inspect-TDCFV3JA.js → inspect-V7HA2GZ5.js} +1 -1
  103. package/dist/chunks/{list-W2AYLMXB.js → list-TSDBEAVF.js} +1 -1
  104. package/dist/chunks/{list-GDUN5WEP.js → list-X4MKKDJX.js} +1 -1
  105. package/dist/chunks/{list-VYCM7K3Y.js → list-ZQSOWXRI.js} +1 -1
  106. package/dist/chunks/{login-DFTGXDX2.js → login-5FMKHZVG.js} +1 -1
  107. package/dist/chunks/{login-EBMKYY53.js → login-YEDMPXUF.js} +1 -1
  108. package/dist/chunks/{logs-IXHYNZLV.js → logs-X2OIQXGW.js} +1 -1
  109. package/dist/chunks/{ls-XZO3FMRZ.js → ls-4W4KTJ6T.js} +1 -1
  110. package/dist/chunks/{ls-Z3VHVO6V.js → ls-6EDJUUDW.js} +1 -1
  111. package/dist/chunks/{ls-63MC7N47.js → ls-BMAVUMXU.js} +1 -1
  112. package/dist/chunks/{ls-6K3MIAYQ.js → ls-HK45UWBD.js} +1 -1
  113. package/dist/chunks/{ls-EXRSJHKJ.js → ls-LAYBQVU2.js} +1 -1
  114. package/dist/chunks/{ls-4MYTCHNA.js → ls-SQ42O6O5.js} +1 -1
  115. package/dist/chunks/{ls-AR2DBNXD.js → ls-XIJ4CY2N.js} +1 -1
  116. package/dist/chunks/{mutate-QDPLCRQI.js → mutate-6FCOCHSA.js} +1 -1
  117. package/dist/chunks/{notifications-T32HQJY3.js → notifications-JTK7ZOLC.js} +1 -1
  118. package/dist/chunks/{open-EN657452.js → open-3G4R3VIN.js} +1 -1
  119. package/dist/chunks/{openapi-V26Z3DHE.js → openapi-W365UPH2.js} +1 -1
  120. package/dist/chunks/{permissions-FOQAHGJV.js → permissions-IWUBXZBZ.js} +1 -1
  121. package/dist/chunks/{prompt-missing-credentials-OHEVPOTD.js → prompt-missing-credentials-VDR5HVA2.js} +1 -1
  122. package/dist/chunks/{publish-72BFQW57.js → publish-5QKVU6YV.js} +1 -1
  123. package/dist/chunks/pull-K4JQEP7N.js +7 -0
  124. package/dist/chunks/{purchase-domain-if-available-GNUGZD5G.js → purchase-domain-if-available-Q7H2TGKR.js} +1 -1
  125. package/dist/chunks/{push-KXIA3WMX.js → push-COILRLCW.js} +1 -1
  126. package/dist/chunks/{query-3YKNY4BU.js → query-ABPO2REN.js} +2 -2
  127. package/dist/chunks/{reauthenticate-L4S7TZ4L.js → reauthenticate-3H5Q2ZWD.js} +1 -1
  128. package/dist/chunks/{reorder-OUMHYKGW.js → reorder-FBUQ5ET7.js} +1 -1
  129. package/dist/chunks/{reply-RY25JMY6.js → reply-FR5VO7DA.js} +1 -1
  130. package/dist/chunks/{resolve-5BCDAP6S.js → resolve-JI2ENFS6.js} +1 -1
  131. package/dist/chunks/{restore-UUSDAZCM.js → restore-LYY4BSYJ.js} +1 -1
  132. package/dist/chunks/{rm-HLZI2UGH.js → rm-C2RWWMO3.js} +1 -1
  133. package/dist/chunks/{rm-OY4YZTBH.js → rm-CYYVIF2U.js} +1 -1
  134. package/dist/chunks/rm-ETLZ75RJ.js +8 -0
  135. package/dist/chunks/{rm-677RFR3N.js → rm-GHSQEFRG.js} +1 -1
  136. package/dist/chunks/{rm-LA26QYTP.js → rm-KHO6RV55.js} +1 -1
  137. package/dist/chunks/{routes-IPGKJ2E4.js → routes-FOCZWOGO.js} +1 -1
  138. package/dist/chunks/{rule-inspect-TW56Z4DI.js → rule-inspect-MISYALLU.js} +1 -1
  139. package/dist/chunks/{rules-IMBUQQNG.js → rules-KAGL6MH3.js} +1 -1
  140. package/dist/chunks/schema-EKWTCBNR.js +14 -0
  141. package/dist/chunks/{schema-CJ7N23WS.js → schema-FZVKQRNB.js} +2 -2
  142. package/dist/chunks/{select-org-EIEVJ6Z7.js → select-org-37C26F7T.js} +1 -1
  143. package/dist/chunks/set-5D7C6HMZ.js +7 -0
  144. package/dist/chunks/setup-and-link-H4P3FZB3.js +7 -0
  145. package/dist/chunks/{tags-P3BOHMPP.js → tags-DVGQQZNC.js} +1 -1
  146. package/dist/chunks/{types-CMM7WKD6.js → types-UN5J66MI.js} +1 -1
  147. package/dist/chunks/{update-L5QEVUQO.js → update-QY3ZME4T.js} +1 -1
  148. package/dist/commands/build/index.js +1 -1
  149. package/dist/commands/deploy/index.js +4 -4
  150. package/dist/commands/dev/index.js +7 -7
  151. package/dist/commands/env/index.js +1 -1
  152. package/dist/commands/link/index.js +1 -1
  153. package/dist/commands/list/index.js +1 -1
  154. package/dist/commands-bulk.js +699 -665
  155. package/dist/index.js +2 -2
  156. package/dist/root-help-commands.mjs +1 -1
  157. package/dist/vc.js +4 -2
  158. package/dist/version.mjs +1 -1
  159. package/package.json +56 -55
  160. package/dist/chunks/add-3IGZTUFX.js +0 -8
  161. package/dist/chunks/add-PVWJ6JM2.js +0 -8
  162. package/dist/chunks/chunk-2HB5UL2I.js +0 -9
  163. package/dist/chunks/chunk-6RUAMGHK.js +0 -9
  164. package/dist/chunks/chunk-K7RJ5LI6.js +0 -7
  165. package/dist/chunks/chunk-O242I22A.js +0 -7
  166. package/dist/chunks/chunk-O5GXI6UQ.js +0 -24
  167. package/dist/chunks/chunk-XKSNY65J.js +0 -7
  168. package/dist/chunks/chunk-XYPCSFQH.js +0 -7
  169. package/dist/chunks/detect-services-MGWUCUFW.js +0 -7
  170. package/dist/chunks/pull-LZHMR2OS.js +0 -7
  171. package/dist/chunks/rm-Y7E3Y4EY.js +0 -8
  172. package/dist/chunks/schema-HZIWO2YM.js +0 -14
  173. package/dist/chunks/set-G3SGK3DK.js +0 -7
  174. package/dist/chunks/setup-and-link-ARUWFOSZ.js +0 -7
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import{tracesConfigCommand}from"./chunk-3R66O72V.js";import{deploymentOption,projectOption,protectionBypassOption,yesOption}from"./chunk-PV5YI2ZZ.js";import{packageName}from"./chunk-FI772UVH.js";var spanQueryOptions=[{...projectOption,shorthand:"p",description:"Filter spans to one project (default: all team projects)"},{name:"environment",shorthand:null,type:String,deprecated:!1,description:"Environment: production or preview (case-insensitive)"},{name:"service",shorthand:null,type:String,deprecated:!1,description:"Filter by service name"},{name:"name",shorthand:null,type:String,deprecated:!1,description:"Filter by span name"},{name:"kind",shorthand:null,type:String,deprecated:!1,description:"Filter by span kind: unspecified (0), internal (1), server (2), client (3), producer (4), consumer (5)"},{name:"status",shorthand:null,type:String,deprecated:!1,description:"Status: error, ok, or unset (case-insensitive)"},{name:"deployment-id",shorthand:null,type:String,deprecated:!1,description:"Filter by deployment ID"},{name:"request-id",shorthand:null,type:String,deprecated:!1,description:"Filter by request ID. Some IDs return 404 in traces get. Reuse --scope and --project. See traces get --help."},{name:"trace-id",shorthand:null,type:String,deprecated:!1,description:"Filter by trace ID"},{name:"span-id",shorthand:null,type:String,deprecated:!1,description:"Filter by span ID"},{name:"root",shorthand:null,type:Boolean,deprecated:!1,description:"Show root spans only"},{name:"since",shorthand:null,type:String,deprecated:!1,description:"Start time: 30m, ISO timestamp, or YYYY-MM-DD UTC (default: 1h)"},{name:"until",shorthand:null,type:String,deprecated:!1,description:"End time: same formats as --since (default: now)"}];var requestIdLookupHelp={title:"Request-ID lookup",body:["A request ID in search results does not guarantee traces get can retrieve the trace. Lookup requires a matching root span in the same project within 30 minutes after the request-ID timestamp.","","If no matching root is found, lookup returns 404. Use the same --scope and --project for search and get."]},getSubcommand={name:"get",aliases:[],default:!0,description:"Fetch a captured trace by trace ID or request ID",helpSections:[{title:"Trace-ID lookup",body:["A 32-character hexadecimal ID selects trace-ID lookup. Other IDs select request-ID lookup.","Trace-ID lookup retrieves the trace directly within the trace retention window. Use the same --scope and --project as search."]},requestIdLookupHelp],arguments:[{name:"id",required:!0}],options:[{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Print the raw trace JSON to stdout"},{name:"project",shorthand:null,type:String,argument:"NAME|ID",deprecated:!1,description:"Project name or id to fetch the trace from (overrides the linked project)."},{name:"open",shorthand:null,type:Boolean,deprecated:!1,description:"Open the trace in the Vercel Dashboard instead of printing it."},{name:"view",shorthand:null,type:String,argument:"timeline|tree|waterfall",deprecated:!1,description:"Dashboard view to open. Only valid with --open. Defaults to timeline."}],examples:[{name:"Fetch a trace by trace ID",value:`${packageName} traces get e5c0d1efb3904155472b01692c7f2d00`},{name:"Fetch a trace by request ID",value:`${packageName} traces get qb46r-1790847620933-1145d2891a3e`},{name:"Print the raw trace JSON",value:`${packageName} traces get e5c0d1efb3904155472b01692c7f2d00 --json`},{name:"Fetch a trace without the default get subcommand",value:`${packageName} traces e5c0d1efb3904155472b01692c7f2d00`},{name:"Fetch a trace from a specific team and project",value:`${packageName} traces get e5c0d1efb3904155472b01692c7f2d00 --scope my-team --project my-app`},{name:"Open the trace in the Vercel Dashboard",value:`${packageName} traces get e5c0d1efb3904155472b01692c7f2d00 --open`},{name:"Open the trace in the Vercel Dashboard with the waterfall view",value:`${packageName} traces get e5c0d1efb3904155472b01692c7f2d00 --open --view waterfall`}]},createSubcommand={name:"create",aliases:[],description:"Capture a session trace for a request (alias for `vercel curl --trace`).",arguments:[{name:"path",required:!0}],options:[deploymentOption,protectionBypassOption,{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Emit { response, requestId } as JSON on stdout"},{...yesOption,description:"Skip the production confirmation prompt (e.g. in non-interactive mode)"}],examples:[{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Target a specific deployment",value:`${packageName} traces create /api/status --deployment https://your-project-abc123.vercel.app`},{name:"Pass curl flags after the separator",value:`${packageName} traces create /api/test -- --request POST --data '{"name": "John"}'`}]},searchSubcommand={name:"search",aliases:[],description:"Search team spans. Use --project to filter one project. Results are newest first. Duration filters do not sort results.",helpSections:[{title:"Table columns",body:["Available: span.startTime, span.duration, span.name, span.status.code, service.name, environment, request.id, trace.id, span.id, parent.id, span.kind","Default: all except environment, request.id, and span.kind."]},{title:"KQL filters",body:["Fields: project.id, environment, service.name, deployment.id, request.id, user.id, session.id","Span fields: span.name, span.kind, span.id, parent.id, span.isRoot, span.status.code, span.duration","Trace fields: trace.id, trace.state","","Other fields search span attributes first, then resource attributes.","","span.duration uses milliseconds.","span.kind uses the numeric values shown under --kind.","span.status.code uses Error, Ok, or Unset.","Use field:value filters. Plain text search is not supported.","Use NOT to exclude values. End a value with * to match a prefix.","Wrap values with spaces in double quotes. Keep the full query in single quotes."]}],arguments:[],options:[...spanQueryOptions,{name:"limit",shorthand:"n",type:Number,deprecated:!1,description:"Maximum number of spans (default: 100)"},{name:"query",shorthand:"q",type:String,deprecated:!1,description:"Filter spans using KQL"},{name:"columns",shorthand:null,argument:"LIST",type:String,deprecated:!1,description:"Columns to show, in order. Separate names with commas. Cannot be used with --json or --non-interactive."},{name:"json",shorthand:"j",type:Boolean,deprecated:!1,description:"Output one JSON object per line"}],examples:[{name:"Find production errors for one service",value:`${packageName} traces search --environment production --service checkout-api --status error --since 1h`},{name:"Use KQL and output JSON Lines",value:`${packageName} traces search --query 'http.route:"/api/checkout"' --kind server --json`},{name:"Exclude span names starting with app/lib/fetch-api",value:`${packageName} traces search --query 'NOT span.name:app/lib/fetch-api*'`},{name:"Exclude exact span names",value:`${packageName} traces search --query 'NOT span.name:("GET /screenshot/v2" OR "middleware GET")'`},{name:"Find spans longer than 2 seconds",value:`${packageName} traces search --query 'span.duration > 2000' --columns span.startTime,span.duration,span.name,span.kind,span.status.code`}]},tracesCommand={name:"traces",aliases:[],description:"Fetch project traces and search spans across a Vercel team.",arguments:[{name:"id",required:!1}],subcommands:[getSubcommand,searchSubcommand,createSubcommand,tracesConfigCommand],options:[],examples:[{name:"Fetch a trace by trace ID",value:`${packageName} traces get e5c0d1efb3904155472b01692c7f2d00`},{name:"Fetch a trace by request ID",value:`${packageName} traces get qb46r-1790847620933-1145d2891a3e`},{name:"Print the raw trace JSON",value:`${packageName} traces get e5c0d1efb3904155472b01692c7f2d00 --json`},{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Search recent spans",value:`${packageName} traces search --status error`},{name:"List the trace sampling rules for a project",value:`${packageName} traces config ls`}]};export{getSubcommand,createSubcommand,searchSubcommand,tracesCommand};
@@ -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{AGENT_STATUS}from"./chunk-IDWEEGMC.js";import{RULE_ENVIRONMENTS}from"./chunk-WVQLFM45.js";function writeConfigJson(client,{project,bare,envelope,message,next}){if(!client.nonInteractive){client.stdout.write(`${JSON.stringify(bare,null,2)}
7
+ import{AGENT_STATUS}from"./chunk-CVX5X5RI.js";import{RULE_ENVIRONMENTS}from"./chunk-3R66O72V.js";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})}export{writeConfigJson,RULE_LIMIT,isRuleEnvironment,ENVIRONMENT_ERROR,RATE_ERROR,EMPTY_PATH_ERROR,parseSampleRate,toApiRate,toRule,formatPath,formatRate,formatRuleTarget,formatRuleLine,subcommandArguments,hasSameKey,readProjectTracing,writeSamplingRules};
@@ -7,7 +7,7 @@ const __dirname = __dirname_(__filename);
7
7
  import{require_load_json_file,require_pify}from"./chunk-RCTYVKM5.js";import{isNativeBinaryInstall}from"./chunk-7T6TL3GQ.js";import{require_graceful_fs}from"./chunk-F2ZWW2IO.js";import{output_manager_default,require_build_utils,require_signal_exit}from"./chunk-EWWFNMPZ.js";import{__commonJS,__require,__toESM}from"./chunk-6L236MNA.js";var require_dist=__commonJS({"../../internals/constants/dist/index.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.TITLE=exports.NAME=exports.LOGO=exports.PROJECT_ENV_TARGET=void 0;exports.PROJECT_ENV_TARGET=["production","preview","development"];exports.LOGO="\u25B2";exports.NAME="vercel";exports.TITLE="Vercel"}});var require_imurmurhash=__commonJS({"../../node_modules/.pnpm/imurmurhash@0.1.4/node_modules/imurmurhash/imurmurhash.js"(exports,module){(function(){var cache;function MurmurHash3(key,seed){var m=this instanceof MurmurHash3?this:cache;if(m.reset(seed),typeof key=="string"&&key.length>0&&m.hash(key),m!==this)return m}MurmurHash3.prototype.hash=function(key){var h1,k1,i,top,len;switch(len=key.length,this.len+=len,k1=this.k1,i=0,this.rem){case 0:k1^=len>i?key.charCodeAt(i++)&65535:0;case 1:k1^=len>i?(key.charCodeAt(i++)&65535)<<8:0;case 2:k1^=len>i?(key.charCodeAt(i++)&65535)<<16:0;case 3:k1^=len>i?(key.charCodeAt(i)&255)<<24:0,k1^=len>i?(key.charCodeAt(i++)&65280)>>8:0}if(this.rem=len+this.rem&3,len-=this.rem,len>0){for(h1=this.h1;k1=k1*11601+(k1&65535)*3432906752&4294967295,k1=k1<<15|k1>>>17,k1=k1*13715+(k1&65535)*461832192&4294967295,h1^=k1,h1=h1<<13|h1>>>19,h1=h1*5+3864292196&4294967295,!(i>=len);)k1=key.charCodeAt(i++)&65535^(key.charCodeAt(i++)&65535)<<8^(key.charCodeAt(i++)&65535)<<16,top=key.charCodeAt(i++),k1^=(top&255)<<24^(top&65280)>>8;switch(k1=0,this.rem){case 3:k1^=(key.charCodeAt(i+2)&65535)<<16;case 2:k1^=(key.charCodeAt(i+1)&65535)<<8;case 1:k1^=key.charCodeAt(i)&65535}this.h1=h1}return this.k1=k1,this},MurmurHash3.prototype.result=function(){var k1,h1;return k1=this.k1,h1=this.h1,k1>0&&(k1=k1*11601+(k1&65535)*3432906752&4294967295,k1=k1<<15|k1>>>17,k1=k1*13715+(k1&65535)*461832192&4294967295,h1^=k1),h1^=this.len,h1^=h1>>>16,h1=h1*51819+(h1&65535)*2246770688&4294967295,h1^=h1>>>13,h1=h1*44597+(h1&65535)*3266445312&4294967295,h1^=h1>>>16,h1>>>0},MurmurHash3.prototype.reset=function(seed){return this.h1=typeof seed=="number"?seed:0,this.rem=this.k1=this.len=0,this},cache=new MurmurHash3,typeof module<"u"?module.exports=MurmurHash3:this.MurmurHash3=MurmurHash3})()}});var require_write_file_atomic=__commonJS({"../../node_modules/.pnpm/write-file-atomic@2.4.3/node_modules/write-file-atomic/index.js"(exports,module){"use strict";module.exports=writeFile;module.exports.sync=writeFileSync2;module.exports._getTmpname=getTmpname;module.exports._cleanupOnExit=cleanupOnExit;var fs=require_graceful_fs(),MurmurHash3=require_imurmurhash(),onExit=require_signal_exit(),path=__require("path"),activeFiles={},threadId=function(){try{var workerThreads=__require("worker_threads");return workerThreads.threadId}catch{return 0}}(),invocations=0;function getTmpname(filename){return filename+"."+MurmurHash3(__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result()}function cleanupOnExit(tmpfile){return function(){try{fs.unlinkSync(typeof tmpfile=="function"?tmpfile():tmpfile)}catch{}}}function writeFile(filename,data,options,callback){options?options instanceof Function?(callback=options,options={}):typeof options=="string"&&(options={encoding:options}):options={};var Promise2=options.Promise||global.Promise,truename,fd,tmpfile,removeOnExitHandler=onExit(cleanupOnExit(()=>tmpfile)),absoluteName=path.resolve(filename);new Promise2(function(resolve){activeFiles[absoluteName]||(activeFiles[absoluteName]=[]),activeFiles[absoluteName].push(resolve),activeFiles[absoluteName].length===1&&resolve()}).then(function(){return new Promise2(function(resolve){fs.realpath(filename,function(_,realname){truename=realname||filename,tmpfile=getTmpname(truename),resolve()})})}).then(function(){return new Promise2(function(resolve){options.mode&&options.chown?resolve():fs.stat(truename,function(err,stats){err||!stats||(options=Object.assign({},options),options.mode==null&&(options.mode=stats.mode),options.chown==null&&process.getuid&&(options.chown={uid:stats.uid,gid:stats.gid})),resolve()})})}).then(function(){return new Promise2(function(resolve,reject){fs.open(tmpfile,"w",options.mode,function(err,_fd){fd=_fd,err?reject(err):resolve()})})}).then(function(){return new Promise2(function(resolve,reject){Buffer.isBuffer(data)?fs.write(fd,data,0,data.length,0,function(err){err?reject(err):resolve()}):data!=null?fs.write(fd,String(data),0,String(options.encoding||"utf8"),function(err){err?reject(err):resolve()}):resolve()})}).then(function(){return new Promise2(function(resolve,reject){options.fsync!==!1?fs.fsync(fd,function(err){err?fs.close(fd,()=>reject(err)):fs.close(fd,resolve)}):fs.close(fd,resolve)})}).then(function(){if(fd=null,options.chown)return new Promise2(function(resolve,reject){fs.chown(tmpfile,options.chown.uid,options.chown.gid,function(err){err?reject(err):resolve()})})}).then(function(){if(options.mode)return new Promise2(function(resolve,reject){fs.chmod(tmpfile,options.mode,function(err){err?reject(err):resolve()})})}).then(function(){return new Promise2(function(resolve,reject){fs.rename(tmpfile,truename,function(err){err?reject(err):resolve()})})}).then(function(){removeOnExitHandler(),callback()},function(err){return new Promise2(resolve=>fd?fs.close(fd,resolve):resolve()).then(()=>{removeOnExitHandler(),fs.unlink(tmpfile,function(){callback(err)})})}).then(function(){activeFiles[absoluteName].shift(),activeFiles[absoluteName].length>0?activeFiles[absoluteName][0]():delete activeFiles[absoluteName]})}function writeFileSync2(filename,data,options){typeof options=="string"?options={encoding:options}:options||(options={});try{filename=fs.realpathSync(filename)}catch{}var tmpfile=getTmpname(filename);if(!options.mode||!options.chown)try{var stats=fs.statSync(filename);options=Object.assign({},options),options.mode||(options.mode=stats.mode),!options.chown&&process.getuid&&(options.chown={uid:stats.uid,gid:stats.gid})}catch{}var fd,cleanup=cleanupOnExit(tmpfile),removeOnExitHandler=onExit(cleanup);try{fd=fs.openSync(tmpfile,"w",options.mode),Buffer.isBuffer(data)?fs.writeSync(fd,data,0,data.length,0):data!=null&&fs.writeSync(fd,String(data),0,String(options.encoding||"utf8")),options.fsync!==!1&&fs.fsyncSync(fd),fs.closeSync(fd),options.chown&&fs.chownSync(tmpfile,options.chown.uid,options.chown.gid),options.mode&&fs.chmodSync(tmpfile,options.mode),fs.renameSync(tmpfile,filename),removeOnExitHandler()}catch(err){if(fd)try{fs.closeSync(fd)}catch{}throw removeOnExitHandler(),cleanup(),err}}}});var require_is_plain_obj=__commonJS({"../../node_modules/.pnpm/is-plain-obj@1.1.0/node_modules/is-plain-obj/index.js"(exports,module){"use strict";var toString=Object.prototype.toString;module.exports=function(x){var prototype;return toString.call(x)==="[object Object]"&&(prototype=Object.getPrototypeOf(x),prototype===null||prototype===Object.getPrototypeOf({}))}}});var require_sort_keys=__commonJS({"../../node_modules/.pnpm/sort-keys@1.1.2/node_modules/sort-keys/index.js"(exports,module){"use strict";var isPlainObj=require_is_plain_obj();module.exports=function(obj,opts){if(!isPlainObj(obj))throw new TypeError("Expected a plain object");opts=opts||{},typeof opts=="function"&&(opts={compare:opts});var deep=opts.deep,seenInput=[],seenOutput=[],sortKeys=function(x){var seenIndex=seenInput.indexOf(x);if(seenIndex!==-1)return seenOutput[seenIndex];var ret={},keys=Object.keys(x).sort(opts.compare);seenInput.push(x),seenOutput.push(ret);for(var i=0;i<keys.length;i++){var key=keys[i],val=x[key];ret[key]=deep&&isPlainObj(val)?sortKeys(val):val}return ret};return sortKeys(obj)}}});var require_pify2=__commonJS({"../../node_modules/.pnpm/pify@3.0.0/node_modules/pify/index.js"(exports,module){"use strict";var processFn=(fn,opts)=>function(){let P=opts.promiseModule,args=new Array(arguments.length);for(let i=0;i<arguments.length;i++)args[i]=arguments[i];return new P((resolve,reject)=>{opts.errorFirst?args.push(function(err,result){if(opts.multiArgs){let results=new Array(arguments.length-1);for(let i=1;i<arguments.length;i++)results[i-1]=arguments[i];err?(results.unshift(err),reject(results)):resolve(results)}else err?reject(err):resolve(result)}):args.push(function(result){if(opts.multiArgs){let results=new Array(arguments.length-1);for(let i=0;i<arguments.length;i++)results[i]=arguments[i];resolve(results)}else resolve(result)}),fn.apply(this,args)})};module.exports=(obj,opts)=>{opts=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},opts);let filter=key=>{let match=pattern=>typeof pattern=="string"?key===pattern:pattern.test(key);return opts.include?opts.include.some(match):!opts.exclude.some(match)},ret;typeof obj=="function"?ret=function(){return opts.excludeMain?obj.apply(this,arguments):processFn(obj,opts).apply(this,arguments)}:ret=Object.create(Object.getPrototypeOf(obj));for(let key in obj){let x=obj[key];ret[key]=typeof x=="function"&&filter(key)?processFn(x,opts):x}return ret}}});var require_make_dir=__commonJS({"../../node_modules/.pnpm/make-dir@1.3.0/node_modules/make-dir/index.js"(exports,module){"use strict";var fs=__require("fs"),path=__require("path"),pify=require_pify2(),defaults={mode:511&~process.umask(),fs},checkPath=pth=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(pth.replace(path.parse(pth).root,""))){let err=new Error(`Path contains invalid characters: ${pth}`);throw err.code="EINVAL",err}};module.exports=(input,opts)=>Promise.resolve().then(()=>{checkPath(input),opts=Object.assign({},defaults,opts);let mkdir=pify(opts.fs.mkdir),stat=pify(opts.fs.stat),make=pth=>mkdir(pth,opts.mode).then(()=>pth).catch(err=>{if(err.code==="ENOENT"){if(err.message.includes("null bytes")||path.dirname(pth)===pth)throw err;return make(path.dirname(pth)).then(()=>make(pth))}return stat(pth).then(stats=>stats.isDirectory()?pth:Promise.reject()).catch(()=>{throw err})});return make(path.resolve(input))});module.exports.sync=(input,opts)=>{checkPath(input),opts=Object.assign({},defaults,opts);let make=pth=>{try{opts.fs.mkdirSync(pth,opts.mode)}catch(err){if(err.code==="ENOENT"){if(err.message.includes("null bytes")||path.dirname(pth)===pth)throw err;return make(path.dirname(pth)),make(pth)}try{if(!opts.fs.statSync(pth).isDirectory())throw new Error("The path is not a directory")}catch{throw err}}return pth};return make(path.resolve(input))}}});var require_detect_indent=__commonJS({"../../node_modules/.pnpm/detect-indent@5.0.0/node_modules/detect-indent/index.js"(exports,module){"use strict";var INDENT_RE=/^(?:( )+|\t+)/;function getMostUsed(indents){let result=0,maxUsed=0,maxWeight=0;for(let entry of indents){let key=entry[0],val=entry[1],u=val[0],w=val[1];(u>maxUsed||u===maxUsed&&w>maxWeight)&&(maxUsed=u,maxWeight=w,result=Number(key))}return result}module.exports=str=>{if(typeof str!="string")throw new TypeError("Expected a string");let tabs=0,spaces=0,prev=0,indents=new Map,current,isIndent;for(let line of str.split(/\n/g)){if(!line)continue;let indent2,matches=line.match(INDENT_RE);matches?(indent2=matches[0].length,matches[1]?spaces++:tabs++):indent2=0;let diff=indent2-prev;prev=indent2,diff?(isIndent=diff>0,current=indents.get(isIndent?diff:-diff),current?current[0]++:(current=[1,0],indents.set(diff,current))):current&&(current[1]+=Number(isIndent))}let amount=getMostUsed(indents),type,indent;return amount?spaces>=tabs?(type="space",indent=" ".repeat(amount)):(type="tab",indent=" ".repeat(amount)):(type=null,indent=""),{amount,type,indent}}}});var require_write_json_file=__commonJS({"../../node_modules/.pnpm/write-json-file@2.2.0/node_modules/write-json-file/index.js"(exports,module){"use strict";var path=__require("path"),fs=require_graceful_fs(),writeFileAtomic=require_write_file_atomic(),sortKeys=require_sort_keys(),makeDir=require_make_dir(),pify=require_pify(),detectIndent=require_detect_indent(),init=(fn,fp,data,opts)=>{if(!fp)throw new TypeError("Expected a filepath");if(data===void 0)throw new TypeError("Expected data to stringify");return opts=Object.assign({indent:" ",sortKeys:!1},opts),opts.sortKeys&&(data=sortKeys(data,{deep:!0,compare:typeof opts.sortKeys=="function"&&opts.sortKeys})),fn(fp,data,opts)},readFile=fp=>pify(fs.readFile)(fp,"utf8").catch(()=>{}),main=(fp,data,opts)=>(opts.detectIndent?readFile(fp):Promise.resolve()).then(str=>{let indent=str?detectIndent(str).indent:opts.indent,json=JSON.stringify(data,opts.replacer,indent);return pify(writeFileAtomic)(fp,`${json}
8
8
  `,{mode:opts.mode})}),mainSync=(fp,data,opts)=>{let indent=opts.indent;if(opts.detectIndent)try{let file=fs.readFileSync(fp,"utf8");indent=detectIndent(file).indent}catch(err){if(err.code!=="ENOENT")throw err}let json=JSON.stringify(data,opts.replacer,indent);return writeFileAtomic.sync(fp,`${json}
9
9
  `,{mode:opts.mode})};module.exports=(fp,data,opts)=>makeDir(path.dirname(fp),{fs}).then(()=>init(main,fp,data,opts));module.exports.sync=(fp,data,opts)=>{makeDir.sync(path.dirname(fp),{fs}),init(mainSync,fp,data,opts)}}});import{randomUUID as randomUUID2}from"node:crypto";import os from"node:os";var import_constants=__toESM(require_dist(),1),import_build_utils=__toESM(require_build_utils(),1);import{spawn}from"node:child_process";var import_load_json_file=__toESM(require_load_json_file(),1),import_write_json_file=__toESM(require_write_json_file(),1);import{randomUUID}from"node:crypto";import{mkdirSync,renameSync,rmSync,writeFileSync}from"node:fs";import{dirname}from"node:path";var DEFAULT_CLI_SESSION_INACTIVITY_TIMEOUT_MS=30*60*1e3,DEFAULT_CLI_SESSION_MAX_LIFETIME_MS=24*60*60*1e3;function isPersistedCliSession(value){if(!value||typeof value!="object")return!1;let session=value;return typeof session.id=="string"&&typeof session.createdAt=="number"&&Number.isFinite(session.createdAt)&&typeof session.lastSeenAt=="number"&&Number.isFinite(session.lastSeenAt)}function isPersistedCliDevice(value){return!value||typeof value!="object"?!1:typeof value.id=="string"}function readPersistedCliSession(filePath){try{let session=import_load_json_file.default.sync(filePath);return isPersistedCliSession(session)?session:null}catch{return null}}function writePersistedCliSession(filePath,session){let temporaryPath=`${filePath}.${process.pid}.${randomUUID()}.tmp`;try{mkdirSync(dirname(filePath),{recursive:!0}),writeFileSync(temporaryPath,`${JSON.stringify(session,null,2)}
10
- `,{flag:"wx",mode:384}),renameSync(temporaryPath,filePath)}catch{}finally{try{rmSync(temporaryPath,{force:!0})}catch{}}}function readPersistedCliDevice(filePath){try{let device=import_load_json_file.default.sync(filePath);return isPersistedCliDevice(device)?device:null}catch{return null}}function writePersistedCliDevice(filePath,device){try{mkdirSync(dirname(filePath),{recursive:!0}),import_write_json_file.default.sync(filePath,device,{indent:2})}catch{}}function getOrCreatePersistedCliSession(opts){let now=opts.now?.()??Date.now(),inactivityTimeoutMs=opts.inactivityTimeoutMs??DEFAULT_CLI_SESSION_INACTIVITY_TIMEOUT_MS,maxLifetimeMs=opts.maxLifetimeMs??DEFAULT_CLI_SESSION_MAX_LIFETIME_MS,existing=readPersistedCliSession(opts.filePath),session=existing&&now-existing.lastSeenAt<=inactivityTimeoutMs&&now-existing.createdAt<=maxLifetimeMs?{...existing,lastSeenAt:now}:{id:randomUUID(),createdAt:now,lastSeenAt:now};return writePersistedCliSession(opts.filePath,session),session}function touchPersistedCliSession(opts,session){let nextSession={...session,lastSeenAt:opts.now?.()??Date.now()};return writePersistedCliSession(opts.filePath,nextSession),nextSession}function getOrCreatePersistedCliDevice(opts){let existing=readPersistedCliDevice(opts.filePath);if(existing)return existing;let device={id:randomUUID()};return writePersistedCliDevice(opts.filePath,device),device}var LogLabel="['telemetry']:",MAX_ERROR_SERVER_MESSAGE_LENGTH=500,TelemetryClient=class{constructor({opts}){this.redactedValue="[REDACTED]";this.noValueToTriggerPrompt="[TRIGGER_PROMPT]";this.redactedArgumentsLength=args=>args&&args.length===1?"ONE":args.length>1?"MANY":"NONE";this.redactedTargetName=target=>import_constants.PROJECT_ENV_TARGET.includes(target)?target:this.redactedValue;this.isDebug=opts.isDebug||!1,this.store=opts.store}track(eventData){this.isDebug&&output_manager_default.debug(`${LogLabel} ${eventData.key}:${eventData.value}`);let event={id:randomUUID2(),eventTime:Date.now(),...eventData};this.store.add(event)}trackCliCommand(eventData){this.track({key:`command:${eventData.command}`,value:eventData.value})}trackCliSubcommand(eventData){this.track({key:`subcommand:${eventData.subcommand}`,value:eventData.value})}trackCliArgument(eventData){eventData.value&&this.track({key:`argument:${eventData.arg}`,value:eventData.value})}trackCliOption(eventData){this.track({key:`option:${eventData.option}`,value:eventData.value})}trackTargetEnvironment(targetEnvironment){this.track({key:"target_environment",value:targetEnvironment})}trackCommandOutput(eventData){this.track({key:`output:${eventData.key}`,value:eventData.value})}trackCliFlag(flag){this.track({key:`flag:${flag}`,value:"TRUE"})}trackOidcTokenRefresh(count){this.track({key:"oidc-token-refresh",value:`${count}`})}trackCPUs(){this.track({key:"cpu_count",value:String(os.cpus().length)})}trackAgenticUse(agent){agent&&this.track({key:"agent",value:agent})}trackPlatform(){this.track({key:"platform",value:os.platform()})}trackArch(){this.track({key:"arch",value:os.arch()})}trackCI(ciVendorName){ciVendorName&&this.track({key:"ci",value:ciVendorName})}trackStdinIsTTY(isTTY){this.track({key:"stdin_is_tty",value:isTTY?"true":"false"})}trackVersion(version){version&&this.track({key:"version",value:version})}trackDefaultDeploy(){this.track({key:"default-deploy",value:"TRUE"})}trackProjectId(projectId){projectId&&this.track({key:"project_id",value:projectId})}trackInvocationId(invocationId){invocationId&&this.track({key:"invocation_id",value:invocationId})}trackDeviceId(deviceId){deviceId&&this.track({key:"device_id",value:deviceId})}trackVercelPluginActiveSession(){this.track({key:"vercel_plugin_active_session",value:"TRUE"})}trackVercelPluginVersion(version){version&&this.track({key:"vercel_plugin_version",value:version})}trackErrorStatus(status){typeof status<"u"&&this.track({key:"error_status",value:String(status)})}trackErrorCode(code){code&&this.track({key:"error_code",value:code})}trackErrorSlug(slug){slug&&this.track({key:"error_slug",value:slug})}trackErrorAction(action){action&&this.track({key:"error_action",value:action})}trackErrorServerMessage(serverMessage){if(serverMessage){let normalizedServerMessage=serverMessage.trim().replace(/\s+/g," ");this.track({key:"error_server_message",value:normalizedServerMessage.slice(0,MAX_ERROR_SERVER_MESSAGE_LENGTH)})}}trackExtension(){this.track({key:"extension",value:this.redactedValue})}trackLoginState(state){state==="started"&&(this.loginAttempt=randomUUID2()),this.loginAttempt&&this.track({key:`login:attempt:${this.loginAttempt}`,value:state}),state!=="started"&&(this.loginAttempt=void 0)}trackCliFlagHelp(command,subcommands){let subcommand;subcommands&&(subcommand=Array.isArray(subcommands)?subcommands[0]:subcommands),this.track({key:"flag:help",value:subcommand?`${command}:${subcommand}`:command})}trackCliOptionFormat(format){if(format){let allowedFormat=["json"].includes(format)?format:this.redactedValue;this.trackCliOption({option:"format",value:allowedFormat})}}trackCliOptionProject(value){value&&(Array.isArray(value)&&value.length===0||this.trackCliOption({option:"project",value:this.redactedValue}))}},TelemetryEventStore=class{constructor(opts){this.teamId="NO_TEAM_ID";this.userId="NO_USER_ID";this.projectId="NO_PROJECT_ID";this.isDebug=opts?.isDebug||!1,this.events=[],this.config=opts?.config,this.cliDeviceOptions=opts?.cliDevice,this.cliSessionOptions=opts?.cliSession,this.invocationId=randomUUID2(),this.deviceId=randomUUID2(),this.cliDeviceOptions&&(this.cliDevice=getOrCreatePersistedCliDevice(this.cliDeviceOptions),this.deviceId=this.cliDevice.id),this.cliSessionOptions?(this.cliSession=getOrCreatePersistedCliSession(this.cliSessionOptions),this.sessionId=this.cliSession.id):this.sessionId=randomUUID2()}add(event){event.sessionId=this.sessionId,event.teamId=this.teamId,event.userId=this.userId,event.projectId=this.projectId,this.events.push(event)}updateTeamId(teamId){teamId&&(this.teamId=teamId)}updateUserId(userId){userId&&(this.userId=userId)}updateProjectId(projectId){projectId&&(this.projectId=projectId)}get hasUserId(){return this.userId!=="NO_USER_ID"}get currentProjectId(){return this.projectId}get currentInvocationId(){return this.invocationId}get currentDeviceId(){return this.deviceId}get currentSessionId(){return this.sessionId}get readonlyEvents(){return Array.from(this.events)}reset(){this.events=[]}get enabled(){return process.env.VERCEL_TELEMETRY_DISABLED?!1:this.config?.enabled??!0}async save(){if(this.cliSession&&this.cliSessionOptions&&(this.cliSession=touchPersistedCliSession(this.cliSessionOptions,this.cliSession)),this.isDebug){output_manager_default.log(`${LogLabel} Flushing Events`);for(let event of this.events)event.teamId=this.teamId,event.userId=this.userId,event.projectId=this.projectId,output_manager_default.log(JSON.stringify(event));return}if(this.enabled){let sessionId=this.events[0].sessionId;if(!sessionId){output_manager_default.debug("Unable to send metrics: no session ID");return}let events=this.events.map(event=>{delete event.sessionId,delete event.teamId,delete event.userId,delete event.projectId;let{eventTime,...rest}=event;return{event_time:eventTime,team_id:this.teamId,user_id:this.userId,project_id:this.projectId,...rest}}),payload={headers:{"Client-id":"vercel-cli","x-vercel-cli-topic-id":"generic","x-vercel-cli-session-id":sessionId},body:events};await this.sendToSubprocess(payload,output_manager_default.debugEnabled)}}async sendToSubprocess(payload,outputDebugEnabled){let flushArgs=["telemetry","flush",JSON.stringify(payload)],nodeBinaryPath,script;if(isNativeBinaryInstall())nodeBinaryPath=process.execPath,script=flushArgs;else{let args=[process.execPath,process.argv[0],process.argv[1]];args[0]===args[1]&&args.shift(),nodeBinaryPath=args[0],script=[...args.slice(1),...flushArgs]}let env=(0,import_build_utils.cloneEnv)(process.env,{VERCEL_TELEMETRY_DISABLED:"1"});if(outputDebugEnabled)return new Promise(resolve=>{let childProcess=spawn(nodeBinaryPath,script,{env,stdio:["ignore","pipe","pipe"]});childProcess.stderr.on("data",data=>output_manager_default.debug(data.toString())),childProcess.stdout.on("data",data=>output_manager_default.debug(data.toString())),childProcess.on("error",d=>{output_manager_default.debug(d)});let timeout=setTimeout(()=>{output_manager_default.debug("Telemetry subprocess killed due to timeout"),childProcess.kill()},2e3);childProcess.on("exit",code=>{output_manager_default.debug(`Telemetry subprocess exited with code ${code}`),childProcess.unref(),timeout.unref(),resolve()})});spawn(nodeBinaryPath,script,{stdio:"ignore",env,windowsHide:!0,detached:!0}).unref()}};export{require_dist,TelemetryClient,TelemetryEventStore};
10
+ `,{flag:"wx",mode:384}),renameSync(temporaryPath,filePath)}catch{}finally{try{rmSync(temporaryPath,{force:!0})}catch{}}}function readPersistedCliDevice(filePath){try{let device=import_load_json_file.default.sync(filePath);return isPersistedCliDevice(device)?device:null}catch{return null}}function writePersistedCliDevice(filePath,device){try{mkdirSync(dirname(filePath),{recursive:!0}),import_write_json_file.default.sync(filePath,device,{indent:2})}catch{}}function getOrCreatePersistedCliSession(opts){let now=opts.now?.()??Date.now(),inactivityTimeoutMs=opts.inactivityTimeoutMs??DEFAULT_CLI_SESSION_INACTIVITY_TIMEOUT_MS,maxLifetimeMs=opts.maxLifetimeMs??DEFAULT_CLI_SESSION_MAX_LIFETIME_MS,existing=readPersistedCliSession(opts.filePath),session=existing&&now-existing.lastSeenAt<=inactivityTimeoutMs&&now-existing.createdAt<=maxLifetimeMs?{...existing,lastSeenAt:now}:{id:randomUUID(),createdAt:now,lastSeenAt:now};return writePersistedCliSession(opts.filePath,session),session}function touchPersistedCliSession(opts,session){let nextSession={...session,lastSeenAt:opts.now?.()??Date.now()};return writePersistedCliSession(opts.filePath,nextSession),nextSession}function getOrCreatePersistedCliDevice(opts){let existing=readPersistedCliDevice(opts.filePath);if(existing)return existing;let device={id:randomUUID()};return writePersistedCliDevice(opts.filePath,device),device}var LogLabel="['telemetry']:",MAX_ERROR_SERVER_MESSAGE_LENGTH=500,TelemetryClient=class{constructor({opts}){this.redactedValue="[REDACTED]";this.noValueToTriggerPrompt="[TRIGGER_PROMPT]";this.redactedArgumentsLength=args=>args&&args.length===1?"ONE":args.length>1?"MANY":"NONE";this.redactedTargetName=target=>import_constants.PROJECT_ENV_TARGET.includes(target)?target:this.redactedValue;this.isDebug=opts.isDebug||!1,this.store=opts.store}track(eventData){this.isDebug&&output_manager_default.debug(`${LogLabel} ${eventData.key}:${eventData.value}`);let event={id:randomUUID2(),eventTime:Date.now(),...eventData};this.store.add(event)}trackCliCommand(eventData){this.track({key:`command:${eventData.command}`,value:eventData.value})}trackCliSubcommand(eventData){this.track({key:`subcommand:${eventData.subcommand}`,value:eventData.value})}trackCliArgument(eventData){eventData.value&&this.track({key:`argument:${eventData.arg}`,value:eventData.value})}trackCliOption(eventData){this.track({key:`option:${eventData.option}`,value:eventData.value})}trackTargetEnvironment(targetEnvironment){this.track({key:"target_environment",value:targetEnvironment})}trackCommandOutput(eventData){this.track({key:`output:${eventData.key}`,value:eventData.value})}trackCliFlag(flag){this.track({key:`flag:${flag}`,value:"TRUE"})}trackOidcTokenRefresh(count){this.track({key:"oidc-token-refresh",value:`${count}`})}trackCPUs(){this.track({key:"cpu_count",value:String(os.cpus().length)})}trackAgenticUse(agent){agent&&this.track({key:"agent",value:agent})}trackPlatform(){this.track({key:"platform",value:os.platform()})}trackArch(){this.track({key:"arch",value:os.arch()})}trackCI(ciVendorName){ciVendorName&&this.track({key:"ci",value:ciVendorName})}trackStdinIsTTY(isTTY){this.track({key:"stdin_is_tty",value:isTTY?"true":"false"})}trackVersion(version){version&&this.track({key:"version",value:version})}trackDefaultDeploy(){this.track({key:"default-deploy",value:"TRUE"})}trackProjectId(projectId){projectId&&this.track({key:"project_id",value:projectId})}trackInvocationId(invocationId){invocationId&&this.track({key:"invocation_id",value:invocationId})}trackDeviceId(deviceId){deviceId&&this.track({key:"device_id",value:deviceId})}trackVercelPluginActiveSession(){this.track({key:"vercel_plugin_active_session",value:"TRUE"})}trackVercelPluginVersion(version){version&&this.track({key:"vercel_plugin_version",value:version})}trackErrorStatus(status){typeof status<"u"&&this.track({key:"error_status",value:String(status)})}trackErrorCode(code){code&&this.track({key:"error_code",value:code})}trackErrorSlug(slug){slug&&this.track({key:"error_slug",value:slug})}trackErrorAction(action){action&&this.track({key:"error_action",value:action})}trackErrorServerMessage(serverMessage){if(serverMessage){let normalizedServerMessage=serverMessage.trim().replace(/\s+/g," ");this.track({key:"error_server_message",value:normalizedServerMessage.slice(0,MAX_ERROR_SERVER_MESSAGE_LENGTH)})}}trackExtension(){this.track({key:"extension",value:this.redactedValue})}trackLoginState(state){state==="started"&&(this.loginAttempt=randomUUID2()),this.loginAttempt&&this.track({key:`login:attempt:${this.loginAttempt}`,value:state}),state!=="started"&&(this.loginAttempt=void 0)}trackCliFlagHelp(command,subcommands){let subcommand;subcommands&&(subcommand=Array.isArray(subcommands)?subcommands[0]:subcommands),this.track({key:"flag:help",value:subcommand?`${command}:${subcommand}`:command})}trackCliOptionFormat(format){if(format){let allowedFormat=["json"].includes(format)?format:this.redactedValue;this.trackCliOption({option:"format",value:allowedFormat})}}trackCliOptionProject(value){value&&(Array.isArray(value)&&value.length===0||this.trackCliOption({option:"project",value:this.redactedValue}))}},TelemetryEventStore=class{constructor(opts){this.teamId="NO_TEAM_ID";this.userId="NO_USER_ID";this.projectId="NO_PROJECT_ID";this.isDebug=opts?.isDebug||!1,this.events=[],this.config=opts?.config,this.cliDeviceOptions=opts?.cliDevice,this.cliSessionOptions=opts?.cliSession,this.invocationId=randomUUID2(),this.deviceId=randomUUID2(),this.cliDeviceOptions&&(this.cliDevice=getOrCreatePersistedCliDevice(this.cliDeviceOptions),this.deviceId=this.cliDevice.id),this.cliSessionOptions?(this.cliSession=getOrCreatePersistedCliSession(this.cliSessionOptions),this.sessionId=this.cliSession.id):this.sessionId=randomUUID2()}add(event){event.sessionId=this.sessionId,event.invocationId=this.invocationId,event.teamId=this.teamId,event.userId=this.userId,event.projectId=this.projectId,this.events.push(event)}updateTeamId(teamId){teamId&&(this.teamId=teamId)}updateUserId(userId){userId&&(this.userId=userId)}updateProjectId(projectId){projectId&&(this.projectId=projectId)}get hasUserId(){return this.userId!=="NO_USER_ID"}get currentProjectId(){return this.projectId}get currentInvocationId(){return this.invocationId}get currentDeviceId(){return this.deviceId}get currentSessionId(){return this.sessionId}get readonlyEvents(){return Array.from(this.events)}reset(){this.events=[]}get enabled(){return process.env.VERCEL_TELEMETRY_DISABLED?!1:this.config?.enabled??!0}async save(){if(this.cliSession&&this.cliSessionOptions&&(this.cliSession=touchPersistedCliSession(this.cliSessionOptions,this.cliSession)),this.isDebug){output_manager_default.log(`${LogLabel} Flushing Events`);for(let event of this.events)event.teamId=this.teamId,event.userId=this.userId,event.projectId=this.projectId,output_manager_default.log(JSON.stringify(event));return}if(this.enabled){let sessionId=this.events[0]?.sessionId;if(!sessionId){output_manager_default.debug("Unable to send metrics: no session ID");return}let events=this.events.map(event=>{let{eventTime,invocationId,...rest}=event;return delete rest.sessionId,delete rest.teamId,delete rest.userId,delete rest.projectId,{event_time:eventTime,invocation_id:invocationId,team_id:this.teamId,user_id:this.userId,project_id:this.projectId,...rest}}),payload={invocationId:this.invocationId,headers:{"Client-id":"vercel-cli","x-vercel-cli-topic-id":"generic","x-vercel-cli-session-id":sessionId},body:events};await this.sendToSubprocess(payload,output_manager_default.debugEnabled)}}async sendToSubprocess(payload,outputDebugEnabled){let flushArgs=["telemetry","flush",JSON.stringify(payload)],nodeBinaryPath,script;if(isNativeBinaryInstall())nodeBinaryPath=process.execPath,script=flushArgs;else{let args=[process.execPath,process.argv[0],process.argv[1]];args[0]===args[1]&&args.shift(),nodeBinaryPath=args[0],script=[...args.slice(1),...flushArgs]}let env=(0,import_build_utils.cloneEnv)(process.env,{VERCEL_TELEMETRY_DISABLED:"1"});if(outputDebugEnabled)return new Promise(resolve=>{let childProcess=spawn(nodeBinaryPath,script,{env,stdio:["ignore","pipe","pipe"]});childProcess.stderr.on("data",data=>output_manager_default.debug(data.toString())),childProcess.stdout.on("data",data=>output_manager_default.debug(data.toString())),childProcess.on("error",d=>{output_manager_default.debug(d)});let timeout=setTimeout(()=>{output_manager_default.debug("Telemetry subprocess killed due to timeout"),childProcess.kill()},2e3);childProcess.on("exit",code=>{output_manager_default.debug(`Telemetry subprocess exited with code ${code}`),childProcess.unref(),timeout.unref(),resolve()})});spawn(nodeBinaryPath,script,{stdio:"ignore",env,windowsHide:!0,detached:!0}).unref()}};export{require_dist,TelemetryClient,TelemetryEventStore};
11
11
  /*! Bundled license information:
12
12
 
13
13
  imurmurhash/imurmurhash.js: