vercel 54.17.3 → 54.18.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 (61) hide show
  1. package/dist/chunks/{add-PQWZCK7O.js → add-6IFGG2TY.js} +8 -8
  2. package/dist/chunks/chunk-2RVK3DDN.js +224 -0
  3. package/dist/chunks/{chunk-OYQKUG4C.js → chunk-5ACKBNHW.js} +8 -8
  4. package/dist/chunks/{chunk-HCJRHKSM.js → chunk-AQIWBG3Y.js} +8 -8
  5. package/dist/chunks/{chunk-IAOBSXJ5.js → chunk-AWAUGLOM.js} +3 -3
  6. package/dist/chunks/{chunk-2CYJVSAM.js → chunk-B3VMTJM2.js} +1 -1
  7. package/dist/chunks/{chunk-UXP2N2WD.js → chunk-C6H4BP2L.js} +57 -5
  8. package/dist/chunks/{chunk-YI3JV6GM.js → chunk-CT3OCODK.js} +1 -1
  9. package/dist/chunks/{chunk-5FAPBIX6.js → chunk-DZ65TDY4.js} +1 -1
  10. package/dist/chunks/{chunk-NRP6ZKXJ.js → chunk-F57GYOKZ.js} +1 -1
  11. package/dist/chunks/{chunk-G4YL2LRL.js → chunk-FOPFOSQM.js} +2 -2
  12. package/dist/chunks/{chunk-JKIM3UW3.js → chunk-GZ5KF7HK.js} +5 -5
  13. package/dist/chunks/{chunk-ATBH7KGL.js → chunk-HMWVVA4B.js} +1 -1
  14. package/dist/chunks/{chunk-4FG6Q2EM.js → chunk-IBJBNVZV.js} +1 -1
  15. package/dist/chunks/{chunk-QM7D5H2G.js → chunk-JJKW6J63.js} +1 -1
  16. package/dist/chunks/{chunk-MB63D7UN.js → chunk-JWQ37WLT.js} +4 -3
  17. package/dist/chunks/{chunk-QMMMXYOY.js → chunk-KQDEJE65.js} +2 -2
  18. package/dist/chunks/{chunk-6V37RSQB.js → chunk-MUDZFSZC.js} +1 -1
  19. package/dist/chunks/{chunk-OSXRHH6W.js → chunk-UNIIXDM2.js} +20 -20
  20. package/dist/chunks/{chunk-BHMMV3HE.js → chunk-VUVQO3LF.js} +3605 -512
  21. package/dist/chunks/{chunk-FMBDRMTZ.js → chunk-X7KGEDKQ.js} +9 -8
  22. package/dist/chunks/{chunk-P4KQ3FJ4.js → chunk-XQQXV6ZZ.js} +1 -0
  23. package/dist/chunks/{chunk-SBYEIQ32.js → chunk-YHFZKOKK.js} +1 -1
  24. package/dist/chunks/{compile-vercel-config-45XN4U4D.js → compile-vercel-config-CZH5GU3R.js} +4 -4
  25. package/dist/chunks/{delete-RQYOSBNO.js → delete-KZJPJUTT.js} +5 -5
  26. package/dist/chunks/{disable-RRGOZIA7.js → disable-XXKGGPR5.js} +5 -5
  27. package/dist/chunks/{discard-X2NIGII5.js → discard-VFWCCRDF.js} +5 -5
  28. package/dist/chunks/{edit-QV3Y6IUT.js → edit-RY2KAHX2.js} +6 -6
  29. package/dist/chunks/{enable-UQAJJKCG.js → enable-M2PSCPZH.js} +5 -5
  30. package/dist/chunks/{exec-HI4HF4GY.js → exec-CGBHRYWG.js} +14 -9
  31. package/dist/chunks/{export-D4YNS2G5.js → export-U3ZPYBWC.js} +5 -5
  32. package/dist/chunks/fetch-proxy-R3JZNXBZ.js +99 -0
  33. package/dist/chunks/{inspect-FHB3H3NA.js → inspect-HI7DLEJ2.js} +7 -7
  34. package/dist/chunks/{list-QYUCZR26.js → list-KLZIIRGS.js} +12 -12
  35. package/dist/chunks/{list-6RAHTDT2.js → list-TUYF4LRT.js} +6 -6
  36. package/dist/chunks/{ls-GKWWEHQS.js → ls-6PFY2I7Q.js} +8 -8
  37. package/dist/chunks/{publish-UTKKRA4P.js → publish-GXWEL4UA.js} +5 -5
  38. package/dist/chunks/{query-NM7MXRFW.js → query-SLLJ6OJT.js} +11 -11
  39. package/dist/chunks/{reorder-ZLVQQBMG.js → reorder-VRC6BLJM.js} +5 -5
  40. package/dist/chunks/{restore-SDTDA4A6.js → restore-SMXHUGVC.js} +5 -5
  41. package/dist/chunks/{rm-65PQY7XN.js → rm-V7DGLIHX.js} +8 -8
  42. package/dist/chunks/{rule-inspect-JFKSPCDU.js → rule-inspect-7AZGYZDI.js} +8 -8
  43. package/dist/chunks/{rules-6672IXZE.js → rules-MQBE2RMP.js} +6 -6
  44. package/dist/chunks/{schema-DC2LLUHD.js → schema-EMHEFUMV.js} +6 -6
  45. package/dist/chunks/{update-7VFELUTD.js → update-GSQ26HZG.js} +8 -8
  46. package/dist/commands/build/index.js +28 -18
  47. package/dist/commands/deploy/index.js +21 -21
  48. package/dist/commands/dev/index.js +46 -38
  49. package/dist/commands/env/index.js +15 -15
  50. package/dist/commands/link/index.js +13 -13
  51. package/dist/commands/list/index.js +12 -12
  52. package/dist/commands-bulk.js +227 -84
  53. package/dist/fetch-dist-tags.cjs +60 -0
  54. package/dist/get-latest-worker.cjs +6 -56
  55. package/dist/help.js +1 -1
  56. package/dist/index.js +200 -61
  57. package/dist/version.mjs +1 -1
  58. package/package.json +17 -19
  59. package/dist/chunks/chunk-N2T234LO.js +0 -3144
  60. package/dist/chunks/{chunk-3NR6OYDV.js → chunk-LWJWW6ZY.js} +3 -3
  61. package/dist/chunks/{chunk-D7MGZH35.js → chunk-U5FVI3MF.js} +3 -3
@@ -10,10 +10,13 @@ import {
10
10
  } from "./chunk-QH7WYDEP.js";
11
11
  import {
12
12
  getLocalPathConfig
13
- } from "./chunk-2CYJVSAM.js";
13
+ } from "./chunk-B3VMTJM2.js";
14
14
  import {
15
15
  getScope
16
- } from "./chunk-6V37RSQB.js";
16
+ } from "./chunk-MUDZFSZC.js";
17
+ import {
18
+ table
19
+ } from "./chunk-LYCSVJIX.js";
17
20
  import {
18
21
  VERCEL_DIR_PROJECT,
19
22
  VERCEL_DIR_README,
@@ -48,15 +51,12 @@ import {
48
51
  selectAndParseRemoteUrl,
49
52
  selectOrg,
50
53
  writeServicesConfig
51
- } from "./chunk-BHMMV3HE.js";
54
+ } from "./chunk-VUVQO3LF.js";
52
55
  import {
53
56
  buildCommandWithGlobalFlags,
54
57
  outputAgentError,
55
58
  shouldEmitNonInteractiveCommandError
56
59
  } from "./chunk-X5UROEGN.js";
57
- import {
58
- table
59
- } from "./chunk-LYCSVJIX.js";
60
60
  import {
61
61
  printError
62
62
  } from "./chunk-MYWLF3BZ.js";
@@ -745,7 +745,7 @@ async function promptForInferredServicesSetup({
745
745
  choice = { type: "services" };
746
746
  } else if (!nonInteractive) {
747
747
  const webServices = inferred.services.filter(
748
- (service) => service.type === "web"
748
+ (service) => (0, import_fs_detectors.isExperimentalService)(service) ? service.type === "web" : true
749
749
  );
750
750
  const choices = [
751
751
  {
@@ -777,9 +777,10 @@ async function promptForInferredServicesSetup({
777
777
  const index = Number.parseInt(selected.slice("single-app:".length), 10);
778
778
  const service = webServices[index];
779
779
  if (service) {
780
+ const serviceRoot = (0, import_fs_detectors.isExperimentalServiceV2)(service) ? service.root : service.workspace;
780
781
  choice = {
781
782
  type: "single-app",
782
- selectedPath: service.workspace === "." ? workPath : join(workPath, service.workspace)
783
+ selectedPath: serviceRoot === "." ? workPath : join(workPath, serviceRoot)
783
784
  };
784
785
  }
785
786
  }
@@ -68,6 +68,7 @@ var help = () => `
68
68
  dns [name] Manages your DNS records
69
69
  domains [name] Manages your domain names
70
70
  firewall [cmd] Manages Vercel Firewall configuration and custom rules
71
+ flags [cmd] Manage feature flags for a Vercel project
71
72
  httpstat path Visualize HTTP timing statistics for deployments
72
73
  logs [url] Displays the logs for a deployment
73
74
  metrics <metric> Queries observability metrics for your project or team
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  require_lib
9
- } from "./chunk-BHMMV3HE.js";
9
+ } from "./chunk-VUVQO3LF.js";
10
10
  import {
11
11
  isNativeBinaryInstall
12
12
  } from "./chunk-Q77ALSXR.js";
@@ -11,15 +11,15 @@ import {
11
11
  findSourceVercelConfigFile,
12
12
  getVercelConfigPath,
13
13
  normalizeConfig
14
- } from "./chunk-BHMMV3HE.js";
15
- import "./chunk-Q77ALSXR.js";
14
+ } from "./chunk-VUVQO3LF.js";
16
15
  import "./chunk-X5UROEGN.js";
17
- import "./chunk-N2T234LO.js";
18
- import "./chunk-GGP5R3FU.js";
16
+ import "./chunk-Q77ALSXR.js";
19
17
  import "./chunk-MYWLF3BZ.js";
20
18
  import "./chunk-LN6B7ZI3.js";
21
19
  import "./chunk-P4QNYOFB.js";
20
+ import "./chunk-2RVK3DDN.js";
22
21
  import "./chunk-Z5SBJH6L.js";
22
+ import "./chunk-GGP5R3FU.js";
23
23
  import "./chunk-S7KYDPEM.js";
24
24
  import "./chunk-TZ2YI2VH.js";
25
25
  export {
@@ -15,7 +15,7 @@ import {
15
15
  parseSubcommandArgs,
16
16
  resolveRoutes,
17
17
  withGlobalFlags
18
- } from "./chunk-QM7D5H2G.js";
18
+ } from "./chunk-JJKW6J63.js";
19
19
  import {
20
20
  deleteSubcommand
21
21
  } from "./chunk-IB56QKCM.js";
@@ -27,21 +27,21 @@ import {
27
27
  AGENT_REASON,
28
28
  AGENT_STATUS
29
29
  } from "./chunk-QH7WYDEP.js";
30
- import "./chunk-BHMMV3HE.js";
31
- import "./chunk-Q77ALSXR.js";
30
+ import "./chunk-VUVQO3LF.js";
32
31
  import {
33
32
  outputAgentError
34
33
  } from "./chunk-X5UROEGN.js";
35
- import "./chunk-N2T234LO.js";
36
- import "./chunk-GGP5R3FU.js";
34
+ import "./chunk-Q77ALSXR.js";
37
35
  import "./chunk-MYWLF3BZ.js";
38
36
  import {
39
37
  getCommandName
40
38
  } from "./chunk-LN6B7ZI3.js";
41
39
  import "./chunk-P4QNYOFB.js";
40
+ import "./chunk-2RVK3DDN.js";
42
41
  import {
43
42
  output_manager_default
44
43
  } from "./chunk-Z5SBJH6L.js";
44
+ import "./chunk-GGP5R3FU.js";
45
45
  import {
46
46
  require_source
47
47
  } from "./chunk-S7KYDPEM.js";
@@ -17,7 +17,7 @@ import {
17
17
  parseSubcommandArgs,
18
18
  resolveRoute,
19
19
  withGlobalFlags
20
- } from "./chunk-QM7D5H2G.js";
20
+ } from "./chunk-JJKW6J63.js";
21
21
  import {
22
22
  disableSubcommand
23
23
  } from "./chunk-IB56QKCM.js";
@@ -26,21 +26,21 @@ import {
26
26
  } from "./chunk-64IF634X.js";
27
27
  import "./chunk-VXYGCOKL.js";
28
28
  import "./chunk-QH7WYDEP.js";
29
- import "./chunk-BHMMV3HE.js";
30
- import "./chunk-Q77ALSXR.js";
29
+ import "./chunk-VUVQO3LF.js";
31
30
  import {
32
31
  outputAgentError
33
32
  } from "./chunk-X5UROEGN.js";
34
- import "./chunk-N2T234LO.js";
35
- import "./chunk-GGP5R3FU.js";
33
+ import "./chunk-Q77ALSXR.js";
36
34
  import "./chunk-MYWLF3BZ.js";
37
35
  import {
38
36
  getCommandName
39
37
  } from "./chunk-LN6B7ZI3.js";
40
38
  import "./chunk-P4QNYOFB.js";
39
+ import "./chunk-2RVK3DDN.js";
41
40
  import {
42
41
  output_manager_default
43
42
  } from "./chunk-Z5SBJH6L.js";
43
+ import "./chunk-GGP5R3FU.js";
44
44
  import {
45
45
  require_source
46
46
  } from "./chunk-S7KYDPEM.js";
@@ -17,7 +17,7 @@ import {
17
17
  parseSubcommandArgs,
18
18
  printDiffSummary,
19
19
  withGlobalFlags
20
- } from "./chunk-QM7D5H2G.js";
20
+ } from "./chunk-JJKW6J63.js";
21
21
  import {
22
22
  discardSubcommand
23
23
  } from "./chunk-IB56QKCM.js";
@@ -26,21 +26,21 @@ import {
26
26
  } from "./chunk-64IF634X.js";
27
27
  import "./chunk-VXYGCOKL.js";
28
28
  import "./chunk-QH7WYDEP.js";
29
- import "./chunk-BHMMV3HE.js";
30
- import "./chunk-Q77ALSXR.js";
29
+ import "./chunk-VUVQO3LF.js";
31
30
  import {
32
31
  outputAgentError
33
32
  } from "./chunk-X5UROEGN.js";
34
- import "./chunk-N2T234LO.js";
35
- import "./chunk-GGP5R3FU.js";
33
+ import "./chunk-Q77ALSXR.js";
36
34
  import "./chunk-MYWLF3BZ.js";
37
35
  import {
38
36
  getCommandName
39
37
  } from "./chunk-LN6B7ZI3.js";
40
38
  import "./chunk-P4QNYOFB.js";
39
+ import "./chunk-2RVK3DDN.js";
41
40
  import {
42
41
  output_manager_default
43
42
  } from "./chunk-Z5SBJH6L.js";
43
+ import "./chunk-GGP5R3FU.js";
44
44
  import {
45
45
  require_source
46
46
  } from "./chunk-S7KYDPEM.js";
@@ -19,7 +19,7 @@ import {
19
19
  printRouteConfig,
20
20
  routingRuleToCurrentRoute,
21
21
  runInteractiveEditLoop
22
- } from "./chunk-NRP6ZKXJ.js";
22
+ } from "./chunk-F57GYOKZ.js";
23
23
  import {
24
24
  getRouteVersions
25
25
  } from "./chunk-AHU7WNL2.js";
@@ -31,7 +31,7 @@ import {
31
31
  resolveRoute,
32
32
  shellQuoteRouteIdentifierForSuggestion,
33
33
  withGlobalFlags
34
- } from "./chunk-QM7D5H2G.js";
34
+ } from "./chunk-JJKW6J63.js";
35
35
  import {
36
36
  editSubcommand
37
37
  } from "./chunk-IB56QKCM.js";
@@ -40,21 +40,21 @@ import {
40
40
  } from "./chunk-64IF634X.js";
41
41
  import "./chunk-VXYGCOKL.js";
42
42
  import "./chunk-QH7WYDEP.js";
43
- import "./chunk-BHMMV3HE.js";
44
- import "./chunk-Q77ALSXR.js";
43
+ import "./chunk-VUVQO3LF.js";
45
44
  import {
46
45
  outputAgentError
47
46
  } from "./chunk-X5UROEGN.js";
48
- import "./chunk-N2T234LO.js";
49
- import "./chunk-GGP5R3FU.js";
47
+ import "./chunk-Q77ALSXR.js";
50
48
  import "./chunk-MYWLF3BZ.js";
51
49
  import {
52
50
  getCommandName
53
51
  } from "./chunk-LN6B7ZI3.js";
54
52
  import "./chunk-P4QNYOFB.js";
53
+ import "./chunk-2RVK3DDN.js";
55
54
  import {
56
55
  output_manager_default
57
56
  } from "./chunk-Z5SBJH6L.js";
57
+ import "./chunk-GGP5R3FU.js";
58
58
  import {
59
59
  require_source
60
60
  } from "./chunk-S7KYDPEM.js";
@@ -17,7 +17,7 @@ import {
17
17
  parseSubcommandArgs,
18
18
  resolveRoute,
19
19
  withGlobalFlags
20
- } from "./chunk-QM7D5H2G.js";
20
+ } from "./chunk-JJKW6J63.js";
21
21
  import {
22
22
  enableSubcommand
23
23
  } from "./chunk-IB56QKCM.js";
@@ -26,21 +26,21 @@ import {
26
26
  } from "./chunk-64IF634X.js";
27
27
  import "./chunk-VXYGCOKL.js";
28
28
  import "./chunk-QH7WYDEP.js";
29
- import "./chunk-BHMMV3HE.js";
30
- import "./chunk-Q77ALSXR.js";
29
+ import "./chunk-VUVQO3LF.js";
31
30
  import {
32
31
  outputAgentError
33
32
  } from "./chunk-X5UROEGN.js";
34
- import "./chunk-N2T234LO.js";
35
- import "./chunk-GGP5R3FU.js";
33
+ import "./chunk-Q77ALSXR.js";
36
34
  import "./chunk-MYWLF3BZ.js";
37
35
  import {
38
36
  getCommandName
39
37
  } from "./chunk-LN6B7ZI3.js";
40
38
  import "./chunk-P4QNYOFB.js";
39
+ import "./chunk-2RVK3DDN.js";
41
40
  import {
42
41
  output_manager_default
43
42
  } from "./chunk-Z5SBJH6L.js";
43
+ import "./chunk-GGP5R3FU.js";
44
44
  import {
45
45
  require_source
46
46
  } from "./chunk-S7KYDPEM.js";
@@ -10,10 +10,11 @@ import {
10
10
  import {
11
11
  require_execa,
12
12
  require_isexe
13
- } from "./chunk-YI3JV6GM.js";
13
+ } from "./chunk-CT3OCODK.js";
14
14
  import {
15
- require_lib
16
- } from "./chunk-N2T234LO.js";
15
+ Headers,
16
+ toNodeReadable
17
+ } from "./chunk-2RVK3DDN.js";
17
18
  import {
18
19
  output_manager_default,
19
20
  require_dist as require_dist2
@@ -26,7 +27,7 @@ import {
26
27
  } from "./chunk-TZ2YI2VH.js";
27
28
 
28
29
  // ../../node_modules/.pnpm/which@3.0.0/node_modules/which/lib/index.js
29
- var require_lib2 = __commonJS2({
30
+ var require_lib = __commonJS2({
30
31
  "../../node_modules/.pnpm/which@3.0.0/node_modules/which/lib/index.js"(exports2, module2) {
31
32
  var isexe = require_isexe();
32
33
  var { join, delimiter, sep, posix } = __require("path");
@@ -1256,18 +1257,17 @@ var import_blob_polyfill = __toESM(require_Blob());
1256
1257
  });
1257
1258
 
1258
1259
  // src/util/extension/exec.ts
1259
- var import_which = __toESM3(require_lib2(), 1);
1260
+ var import_which = __toESM3(require_lib(), 1);
1260
1261
  var import_execa = __toESM3(require_execa(), 1);
1261
1262
  var import_async_listen = __toESM3(require_dist3(), 1);
1262
1263
  import { dirname } from "path";
1263
1264
  import { scanParentDirs, walkParentDirs } from "@vercel/build-utils";
1264
1265
 
1265
1266
  // src/util/extension/proxy.ts
1266
- var import_node_fetch = __toESM3(require_lib(), 1);
1267
- var import_node_utils = __toESM3(require_dist4(), 1);
1268
1267
  import { createServer } from "http";
1268
+ var import_node_utils = __toESM3(require_dist4(), 1);
1269
1269
  var toHeaders = (0, import_node_utils.buildToHeaders)({
1270
- Headers: import_node_fetch.Headers
1270
+ Headers
1271
1271
  });
1272
1272
  function createProxy(client) {
1273
1273
  return createServer(async (req, res) => {
@@ -1278,6 +1278,7 @@ function createProxy(client) {
1278
1278
  headers,
1279
1279
  method: req.method,
1280
1280
  body: req.method === "GET" || req.method === "HEAD" ? void 0 : req,
1281
+ redirect: "manual",
1281
1282
  useCurrentTeam: false,
1282
1283
  json: false
1283
1284
  });
@@ -1288,7 +1289,11 @@ function createProxy(client) {
1288
1289
  delete outgoingHeaders["content-encoding"];
1289
1290
  delete outgoingHeaders["content-length"];
1290
1291
  (0, import_node_utils.mergeIntoServerResponse)(outgoingHeaders, res);
1291
- fetchRes.body.pipe(res);
1292
+ if (fetchRes.body) {
1293
+ toNodeReadable(fetchRes.body).pipe(res);
1294
+ } else {
1295
+ res.end();
1296
+ }
1292
1297
  } catch (err) {
1293
1298
  output_manager_default.prettyError(err);
1294
1299
  if (!res.headersSent) {
@@ -9,26 +9,26 @@ import {
9
9
  getRoutes,
10
10
  parseSubcommandArgs,
11
11
  withGlobalFlags
12
- } from "./chunk-QM7D5H2G.js";
12
+ } from "./chunk-JJKW6J63.js";
13
13
  import {
14
14
  exportSubcommand
15
15
  } from "./chunk-IB56QKCM.js";
16
16
  import "./chunk-QH7WYDEP.js";
17
- import "./chunk-BHMMV3HE.js";
18
- import "./chunk-Q77ALSXR.js";
17
+ import "./chunk-VUVQO3LF.js";
19
18
  import {
20
19
  outputAgentError
21
20
  } from "./chunk-X5UROEGN.js";
22
- import "./chunk-N2T234LO.js";
23
- import "./chunk-GGP5R3FU.js";
21
+ import "./chunk-Q77ALSXR.js";
24
22
  import "./chunk-MYWLF3BZ.js";
25
23
  import {
26
24
  getCommandName
27
25
  } from "./chunk-LN6B7ZI3.js";
28
26
  import "./chunk-P4QNYOFB.js";
27
+ import "./chunk-2RVK3DDN.js";
29
28
  import {
30
29
  output_manager_default
31
30
  } from "./chunk-Z5SBJH6L.js";
31
+ import "./chunk-GGP5R3FU.js";
32
32
  import "./chunk-S7KYDPEM.js";
33
33
  import "./chunk-TZ2YI2VH.js";
34
34
 
@@ -0,0 +1,99 @@
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 "./chunk-TZ2YI2VH.js";
8
+
9
+ // src/util/fetch-proxy.ts
10
+ import { Agent, ProxyAgent } from "undici";
11
+ var DEFAULT_PORTS = {
12
+ "http:": 80,
13
+ "https:": 443
14
+ };
15
+ function getEnv(name) {
16
+ return process.env[name.toLowerCase()] || process.env[name.toUpperCase()];
17
+ }
18
+ function normalizeProxyUrl(value) {
19
+ const proxyUrl = value.includes("://") ? value : `http://${value}`;
20
+ const protocol = new URL(proxyUrl).protocol;
21
+ if (protocol !== "http:" && protocol !== "https:") {
22
+ throw new TypeError(`Unsupported proxy protocol: ${protocol}`);
23
+ }
24
+ return proxyUrl;
25
+ }
26
+ var EnvProxyDispatcher = class {
27
+ constructor(options = {}) {
28
+ this.noProxyValue = "";
29
+ this.noProxyEntries = [];
30
+ const createProxyAgent = options.createProxyAgent || ((url) => new ProxyAgent(url));
31
+ const allProxy = getEnv("all_proxy");
32
+ const httpProxy = getEnv("http_proxy") || allProxy;
33
+ const httpsProxy = getEnv("https_proxy") || httpProxy || allProxy;
34
+ this.directAgent = options.directAgent || new Agent();
35
+ this.httpAgent = httpProxy ? createProxyAgent(normalizeProxyUrl(httpProxy)) : this.directAgent;
36
+ this.httpsAgent = httpsProxy ? createProxyAgent(normalizeProxyUrl(httpsProxy)) : this.httpAgent;
37
+ this.parseNoProxy();
38
+ }
39
+ dispatch(options, handler) {
40
+ const url = new URL(String(options.origin));
41
+ return this.getAgent(url).dispatch(options, handler);
42
+ }
43
+ async close() {
44
+ await Promise.all([...this.agents()].map((agent) => agent.close()));
45
+ }
46
+ async destroy(error) {
47
+ await Promise.all(
48
+ [...this.agents()].map((agent) => agent.destroy(error || null))
49
+ );
50
+ }
51
+ agents() {
52
+ return /* @__PURE__ */ new Set([this.directAgent, this.httpAgent, this.httpsAgent]);
53
+ }
54
+ getAgent(url) {
55
+ if (this.noProxyValue !== (getEnv("no_proxy") || "")) {
56
+ this.parseNoProxy();
57
+ }
58
+ const hostname = url.hostname.toLowerCase();
59
+ const port = Number.parseInt(url.port, 10) || DEFAULT_PORTS[url.protocol];
60
+ if (!this.shouldProxy(hostname, port)) {
61
+ return this.directAgent;
62
+ }
63
+ return url.protocol === "https:" ? this.httpsAgent : this.httpAgent;
64
+ }
65
+ shouldProxy(hostname, port) {
66
+ if (this.noProxyEntries.length === 0) {
67
+ return true;
68
+ }
69
+ if (this.noProxyValue === "*") {
70
+ return false;
71
+ }
72
+ for (const entry of this.noProxyEntries) {
73
+ if (entry.port && entry.port !== port) {
74
+ continue;
75
+ }
76
+ if (!entry.hostname.startsWith(".") && !entry.hostname.startsWith("*")) {
77
+ if (hostname === entry.hostname) {
78
+ return false;
79
+ }
80
+ } else if (hostname.endsWith(entry.hostname.replace(/^\*/, ""))) {
81
+ return false;
82
+ }
83
+ }
84
+ return true;
85
+ }
86
+ parseNoProxy() {
87
+ this.noProxyValue = getEnv("no_proxy") || "";
88
+ this.noProxyEntries = this.noProxyValue.toLowerCase().split(/[,\s]/).filter(Boolean).map((value) => {
89
+ const parsed = value.match(/^(.+):(\d+)$/);
90
+ return {
91
+ hostname: parsed ? parsed[1] : value,
92
+ port: parsed ? Number.parseInt(parsed[2], 10) : 0
93
+ };
94
+ });
95
+ }
96
+ };
97
+ export {
98
+ EnvProxyDispatcher
99
+ };
@@ -6,12 +6,12 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  emitAlertsScopeError
9
- } from "./chunk-IAOBSXJ5.js";
9
+ } from "./chunk-AWAUGLOM.js";
10
10
  import {
11
11
  handleValidationError,
12
12
  outputError,
13
13
  validateAllProjectMutualExclusivity
14
- } from "./chunk-D7MGZH35.js";
14
+ } from "./chunk-U5FVI3MF.js";
15
15
  import {
16
16
  validateJsonOutput
17
17
  } from "./chunk-XPKWKPWA.js";
@@ -24,18 +24,16 @@ import {
24
24
  } from "./chunk-QH7WYDEP.js";
25
25
  import {
26
26
  getScope
27
- } from "./chunk-6V37RSQB.js";
27
+ } from "./chunk-MUDZFSZC.js";
28
28
  import {
29
29
  getLinkedProject,
30
30
  getProjectByNameOrId
31
- } from "./chunk-BHMMV3HE.js";
32
- import "./chunk-Q77ALSXR.js";
31
+ } from "./chunk-VUVQO3LF.js";
33
32
  import {
34
33
  buildCommandWithGlobalFlags,
35
34
  outputAgentError
36
35
  } from "./chunk-X5UROEGN.js";
37
- import "./chunk-N2T234LO.js";
38
- import "./chunk-GGP5R3FU.js";
36
+ import "./chunk-Q77ALSXR.js";
39
37
  import {
40
38
  getFlagsSpecification,
41
39
  parseArguments,
@@ -47,9 +45,11 @@ import {
47
45
  packageName
48
46
  } from "./chunk-LN6B7ZI3.js";
49
47
  import "./chunk-P4QNYOFB.js";
48
+ import "./chunk-2RVK3DDN.js";
50
49
  import {
51
50
  output_manager_default
52
51
  } from "./chunk-Z5SBJH6L.js";
52
+ import "./chunk-GGP5R3FU.js";
53
53
  import {
54
54
  require_source
55
55
  } from "./chunk-S7KYDPEM.js";
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  resolveAlertsScope
9
- } from "./chunk-IAOBSXJ5.js";
9
+ } from "./chunk-AWAUGLOM.js";
10
10
  import {
11
11
  handleValidationError,
12
12
  normalizeRepeatableStringFilters,
@@ -15,7 +15,7 @@ import {
15
15
  validateOptionalIntegerRange,
16
16
  validateTimeBound,
17
17
  validateTimeOrder
18
- } from "./chunk-D7MGZH35.js";
18
+ } from "./chunk-U5FVI3MF.js";
19
19
  import {
20
20
  validateJsonOutput
21
21
  } from "./chunk-XPKWKPWA.js";
@@ -26,21 +26,17 @@ import "./chunk-SGPBULVT.js";
26
26
  import {
27
27
  AGENT_REASON
28
28
  } from "./chunk-QH7WYDEP.js";
29
- import "./chunk-6V37RSQB.js";
30
- import "./chunk-BHMMV3HE.js";
31
- import "./chunk-Q77ALSXR.js";
29
+ import "./chunk-MUDZFSZC.js";
30
+ import {
31
+ table
32
+ } from "./chunk-LYCSVJIX.js";
33
+ import "./chunk-VUVQO3LF.js";
32
34
  import {
33
35
  buildCommandWithGlobalFlags,
34
36
  outputAgentError,
35
37
  shouldEmitNonInteractiveCommandError
36
38
  } from "./chunk-X5UROEGN.js";
37
- import "./chunk-N2T234LO.js";
38
- import {
39
- require_ms
40
- } from "./chunk-GGP5R3FU.js";
41
- import {
42
- table
43
- } from "./chunk-LYCSVJIX.js";
39
+ import "./chunk-Q77ALSXR.js";
44
40
  import {
45
41
  getFlagsSpecification,
46
42
  parseArguments,
@@ -50,9 +46,13 @@ import {
50
46
  isAPIError
51
47
  } from "./chunk-LN6B7ZI3.js";
52
48
  import "./chunk-P4QNYOFB.js";
49
+ import "./chunk-2RVK3DDN.js";
53
50
  import {
54
51
  output_manager_default
55
52
  } from "./chunk-Z5SBJH6L.js";
53
+ import {
54
+ require_ms
55
+ } from "./chunk-GGP5R3FU.js";
56
56
  import {
57
57
  require_source
58
58
  } from "./chunk-S7KYDPEM.js";
@@ -12,7 +12,7 @@ import {
12
12
  validateIntegerRangeWithDefault,
13
13
  validateTimeBound,
14
14
  validateTimeOrder
15
- } from "./chunk-D7MGZH35.js";
15
+ } from "./chunk-U5FVI3MF.js";
16
16
  import {
17
17
  getCommandFlags
18
18
  } from "./chunk-EOZFDJSY.js";
@@ -24,15 +24,13 @@ import {
24
24
  } from "./chunk-56AJHIQC.js";
25
25
  import {
26
26
  getScope
27
- } from "./chunk-6V37RSQB.js";
27
+ } from "./chunk-MUDZFSZC.js";
28
28
  import {
29
29
  getLinkedProject,
30
30
  getProjectByNameOrId
31
- } from "./chunk-BHMMV3HE.js";
32
- import "./chunk-Q77ALSXR.js";
31
+ } from "./chunk-VUVQO3LF.js";
33
32
  import "./chunk-X5UROEGN.js";
34
- import "./chunk-N2T234LO.js";
35
- import "./chunk-GGP5R3FU.js";
33
+ import "./chunk-Q77ALSXR.js";
36
34
  import {
37
35
  getFlagsSpecification,
38
36
  parseArguments,
@@ -44,9 +42,11 @@ import {
44
42
  isAPIError
45
43
  } from "./chunk-LN6B7ZI3.js";
46
44
  import "./chunk-P4QNYOFB.js";
45
+ import "./chunk-2RVK3DDN.js";
47
46
  import {
48
47
  output_manager_default
49
48
  } from "./chunk-Z5SBJH6L.js";
49
+ import "./chunk-GGP5R3FU.js";
50
50
  import {
51
51
  require_source
52
52
  } from "./chunk-S7KYDPEM.js";
@@ -9,9 +9,9 @@ import {
9
9
  handleRulesApiError,
10
10
  parseRulesFlagsAndScope,
11
11
  rulesCollectionPath
12
- } from "./chunk-G4YL2LRL.js";
13
- import "./chunk-IAOBSXJ5.js";
14
- import "./chunk-D7MGZH35.js";
12
+ } from "./chunk-FOPFOSQM.js";
13
+ import "./chunk-AWAUGLOM.js";
14
+ import "./chunk-U5FVI3MF.js";
15
15
  import {
16
16
  validateJsonOutput
17
17
  } from "./chunk-XPKWKPWA.js";
@@ -21,14 +21,12 @@ import {
21
21
  import {
22
22
  AGENT_REASON
23
23
  } from "./chunk-QH7WYDEP.js";
24
- import "./chunk-6V37RSQB.js";
25
- import "./chunk-BHMMV3HE.js";
26
- import "./chunk-Q77ALSXR.js";
24
+ import "./chunk-MUDZFSZC.js";
25
+ import "./chunk-VUVQO3LF.js";
27
26
  import {
28
27
  outputAgentError
29
28
  } from "./chunk-X5UROEGN.js";
30
- import "./chunk-N2T234LO.js";
31
- import "./chunk-GGP5R3FU.js";
29
+ import "./chunk-Q77ALSXR.js";
32
30
  import {
33
31
  getFlagsSpecification,
34
32
  parseArguments,
@@ -38,9 +36,11 @@ import {
38
36
  isAPIError
39
37
  } from "./chunk-LN6B7ZI3.js";
40
38
  import "./chunk-P4QNYOFB.js";
39
+ import "./chunk-2RVK3DDN.js";
41
40
  import {
42
41
  output_manager_default
43
42
  } from "./chunk-Z5SBJH6L.js";
43
+ import "./chunk-GGP5R3FU.js";
44
44
  import "./chunk-S7KYDPEM.js";
45
45
  import "./chunk-TZ2YI2VH.js";
46
46