vercel 56.2.0 → 56.3.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 (88) hide show
  1. package/dist/chunks/{add-YQRDKWJH.js → add-CF5SQESQ.js} +11 -14
  2. package/dist/chunks/{add-T6ZTAEU2.js → add-DMRGZN3Z.js} +10 -13
  3. package/dist/chunks/{chunk-LSPZHWWP.js → chunk-22G26AIX.js} +99 -74
  4. package/dist/chunks/{chunk-HMMPJ3VD.js → chunk-2C2JJTAM.js} +6 -10
  5. package/dist/chunks/{chunk-YGSTSVXS.js → chunk-2MXGTALG.js} +1076 -3627
  6. package/dist/chunks/{chunk-5AJNUXWP.js → chunk-3PKFXNJZ.js} +2 -4
  7. package/dist/chunks/{chunk-5OT26JZN.js → chunk-3VS4DTAU.js} +4 -6
  8. package/dist/chunks/{chunk-JJWESW5Y.js → chunk-4G6QZSBL.js} +2 -4
  9. package/dist/chunks/{chunk-HR6VI6UV.js → chunk-4YOCOUDN.js} +5 -6
  10. package/dist/chunks/{chunk-GXBDQRHJ.js → chunk-4Z5LC2CI.js} +1 -1
  11. package/dist/chunks/{chunk-2RVK3DDN.js → chunk-52QYYTM5.js} +4 -0
  12. package/dist/chunks/{chunk-CMJMYVQM.js → chunk-6OMC3HOW.js} +1 -1
  13. package/dist/chunks/{chunk-SRJTYE5U.js → chunk-A6LE5VAN.js} +1 -1
  14. package/dist/chunks/{chunk-QY63UKTP.js → chunk-DMSLNAVH.js} +2 -2
  15. package/dist/chunks/{chunk-PN2GJKM5.js → chunk-DZHRFBKE.js} +2 -2
  16. package/dist/chunks/{chunk-SHT5IY3Q.js → chunk-ERPZJ4SX.js} +14 -4
  17. package/dist/chunks/{chunk-K2THP63Z.js → chunk-EYNXG3FO.js} +3 -5
  18. package/dist/chunks/{chunk-RLJA2KI7.js → chunk-FYQPTH5C.js} +2 -4
  19. package/dist/chunks/{chunk-RLXBXRU2.js → chunk-G4PG5HVE.js} +6 -10
  20. package/dist/chunks/{chunk-7PZWVZN6.js → chunk-G75NFPIT.js} +1 -1
  21. package/dist/chunks/{chunk-7C7MMT4J.js → chunk-GIL3VAUR.js} +2 -4
  22. package/dist/chunks/{chunk-EKIKD7RS.js → chunk-HUKYQKVQ.js} +9 -7
  23. package/dist/chunks/{chunk-AVLGVZJ5.js → chunk-I2IICWBW.js} +190 -29
  24. package/dist/chunks/{chunk-E3Y4SDXF.js → chunk-ICSIFPXG.js} +3 -5
  25. package/dist/chunks/{chunk-P6AK7SVK.js → chunk-KSSNLCL4.js} +360 -25
  26. package/dist/chunks/{chunk-WOA4Z45Z.js → chunk-KXKQQIUS.js} +18 -12
  27. package/dist/chunks/{chunk-HA7C7SDO.js → chunk-LHFNIZ2P.js} +2 -4
  28. package/dist/chunks/{chunk-B6SCQUDV.js → chunk-NP32PAKT.js} +2 -2
  29. package/dist/chunks/{chunk-QEEGXNFK.js → chunk-NZRWTCRM.js} +1 -1
  30. package/dist/chunks/{chunk-IDMKFYEA.js → chunk-OGG6UBXK.js} +2 -4
  31. package/dist/chunks/{chunk-XFMTSTYT.js → chunk-PRO4S2KV.js} +8 -68
  32. package/dist/chunks/{chunk-NQEAHRBI.js → chunk-Q5ADSH7D.js} +11 -16
  33. package/dist/chunks/{chunk-AEENIITE.js → chunk-QP3C5YS5.js} +8 -8
  34. package/dist/chunks/{chunk-24FCBXI4.js → chunk-R6IGDGX3.js} +1 -1
  35. package/dist/chunks/{chunk-PQK4YU22.js → chunk-SDK7R4WO.js} +1 -1
  36. package/dist/chunks/{chunk-22GUZ5KG.js → chunk-STJJ3DFO.js} +2 -4
  37. package/dist/chunks/{chunk-EHTPDXTS.js → chunk-SZXT3PDQ.js} +3 -294
  38. package/dist/chunks/{chunk-CB3I3QIT.js → chunk-UDWRZXIT.js} +193 -85
  39. package/dist/chunks/{chunk-DREO3DFB.js → chunk-VZSZBD4V.js} +16 -6
  40. package/dist/chunks/{chunk-7S3QUMIG.js → chunk-YS6EDZHB.js} +3 -5
  41. package/dist/chunks/{chunk-EI555LUJ.js → chunk-ZDCS54ZZ.js} +3 -3
  42. package/dist/chunks/{chunk-4RGSUV5C.js → chunk-ZVLPUREX.js} +2 -2
  43. package/dist/chunks/{compile-vercel-config-3AG4VKHZ.js → compile-vercel-config-RPPL7W56.js} +5 -5
  44. package/dist/chunks/{delete-JLJ753B4.js → delete-QBVZ5X6B.js} +15 -15
  45. package/dist/chunks/{disable-AXFGDOYN.js → disable-YYGXPXBI.js} +15 -14
  46. package/dist/chunks/{discard-557SDKVO.js → discard-X2MSUFGI.js} +14 -13
  47. package/dist/chunks/{edit-ITGNF7S5.js → edit-3ABZQYUU.js} +18 -19
  48. package/dist/chunks/{enable-6RMJPNW5.js → enable-HUMYCGKA.js} +15 -14
  49. package/dist/chunks/{exec-G4AUF3KG.js → exec-CNBOV577.js} +3 -3
  50. package/dist/chunks/{export-3NC3DPRR.js → export-KGHH4WAT.js} +16 -15
  51. package/dist/chunks/{image-FGP5UVA5.js → image-OO3WWKZV.js} +6 -8
  52. package/dist/chunks/{inspect-FDF5WZMM.js → inspect-5TNHHD2M.js} +11 -13
  53. package/dist/chunks/{inspect-N5DHCKLZ.js → inspect-FNUCB7Y3.js} +9 -11
  54. package/dist/chunks/{inspect-AF5J3QDV.js → inspect-KSSQEAW7.js} +12 -16
  55. package/dist/chunks/{inspect-56OMR6RC.js → inspect-Z6SSD2SR.js} +9 -11
  56. package/dist/chunks/{list-PLG2ZHBA.js → list-TXNYRVJG.js} +9 -11
  57. package/dist/chunks/{list-F2AW7L3D.js → list-X2AD3HCX.js} +11 -14
  58. package/dist/chunks/{login-LQRR64K7.js → login-SLPCZ2OF.js} +14 -17
  59. package/dist/chunks/{ls-FWPYY7GH.js → ls-2YSINRJ3.js} +11 -14
  60. package/dist/chunks/{ls-EKNQN3V4.js → ls-4QMJLQQL.js} +11 -14
  61. package/dist/chunks/{ls-HZDBJLMG.js → ls-C7MNQ4IK.js} +13 -16
  62. package/dist/chunks/{ls-E7FYH3DW.js → ls-QLTOY23G.js} +10 -13
  63. package/dist/chunks/{publish-PDGTM3M7.js → publish-GV4LLLXP.js} +14 -13
  64. package/dist/chunks/{query-MUQKKYXI.js → query-3AHRMAPA.js} +11 -13
  65. package/dist/chunks/{reorder-B76HXU6D.js → reorder-VSVOPNM4.js} +18 -17
  66. package/dist/chunks/{restore-2PYXS4NP.js → restore-FKYCF73P.js} +20 -19
  67. package/dist/chunks/{rm-GZW2IDWX.js → rm-4QCXZRC2.js} +11 -14
  68. package/dist/chunks/{rm-SD3EJRXY.js → rm-UTFG42FN.js} +9 -12
  69. package/dist/chunks/{rm-SFC67P5U.js → rm-YV5WQKQM.js} +10 -13
  70. package/dist/chunks/{rule-inspect-MSPP3V4O.js → rule-inspect-IONN4MTP.js} +10 -13
  71. package/dist/chunks/{rules-AN32QRP7.js → rules-S2KPV7HY.js} +9 -11
  72. package/dist/chunks/{schema-2GYFHMCN.js → schema-3LX3V2HE.js} +12 -13
  73. package/dist/chunks/{tags-ULDC3YLP.js → tags-CQ4FRIJ4.js} +5 -7
  74. package/dist/chunks/{types-2TPA6J4G.js → types-QKLIFDDP.js} +5 -5
  75. package/dist/chunks/{update-NE62WKTZ.js → update-U7OGHCP5.js} +10 -13
  76. package/dist/commands/build/index.js +43 -38
  77. package/dist/commands/deploy/index.js +58 -75
  78. package/dist/commands/dev/index.js +206 -163
  79. package/dist/commands/env/index.js +77 -44
  80. package/dist/commands/link/index.js +26 -29
  81. package/dist/commands/list/index.js +15 -19
  82. package/dist/commands-bulk.js +3103 -1872
  83. package/dist/index.js +30 -33
  84. package/dist/version.mjs +1 -1
  85. package/package.json +22 -23
  86. package/dist/chunks/chunk-IC4YEIGW.js +0 -101
  87. package/dist/chunks/chunk-LXF3AXHM.js +0 -158
  88. package/dist/chunks/chunk-SGL3NMOP.js +0 -86
package/dist/index.js CHANGED
@@ -18,10 +18,10 @@ import {
18
18
  require_ci_info,
19
19
  setAutoUpdate,
20
20
  tryOpenApiFallback
21
- } from "./chunks/chunk-AEENIITE.js";
21
+ } from "./chunks/chunk-QP3C5YS5.js";
22
22
  import {
23
23
  getUpdateCommand
24
- } from "./chunks/chunk-PN2GJKM5.js";
24
+ } from "./chunks/chunk-DZHRFBKE.js";
25
25
  import {
26
26
  Client,
27
27
  getAuthConfigFilePath,
@@ -30,36 +30,34 @@ import {
30
30
  readAuthConfigFile,
31
31
  readConfigFile,
32
32
  writeToConfigFile
33
- } from "./chunks/chunk-HR6VI6UV.js";
33
+ } from "./chunks/chunk-4YOCOUDN.js";
34
34
  import {
35
35
  highlight
36
36
  } from "./chunks/chunk-V5P25P7F.js";
37
37
  import {
38
38
  commandNames,
39
39
  commands
40
- } from "./chunks/chunk-AVLGVZJ5.js";
41
- import "./chunks/chunk-5OT26JZN.js";
42
- import "./chunks/chunk-7C7MMT4J.js";
43
- import "./chunks/chunk-RLJA2KI7.js";
44
- import "./chunks/chunk-JJWESW5Y.js";
45
- import "./chunks/chunk-DREO3DFB.js";
46
- import "./chunks/chunk-5AJNUXWP.js";
47
- import "./chunks/chunk-7S3QUMIG.js";
48
- import "./chunks/chunk-22GUZ5KG.js";
49
- import "./chunks/chunk-IDMKFYEA.js";
50
- import "./chunks/chunk-HA7C7SDO.js";
40
+ } from "./chunks/chunk-I2IICWBW.js";
41
+ import "./chunks/chunk-3VS4DTAU.js";
42
+ import "./chunks/chunk-GIL3VAUR.js";
43
+ import "./chunks/chunk-FYQPTH5C.js";
44
+ import "./chunks/chunk-4G6QZSBL.js";
45
+ import "./chunks/chunk-VZSZBD4V.js";
46
+ import "./chunks/chunk-3PKFXNJZ.js";
47
+ import "./chunks/chunk-YS6EDZHB.js";
48
+ import "./chunks/chunk-STJJ3DFO.js";
49
+ import "./chunks/chunk-OGG6UBXK.js";
50
+ import "./chunks/chunk-LHFNIZ2P.js";
51
51
  import {
52
52
  require_semver
53
53
  } from "./chunks/chunk-IB5L4LKZ.js";
54
- import "./chunks/chunk-EI555LUJ.js";
55
- import "./chunks/chunk-K2THP63Z.js";
56
- import {
57
- getScope
58
- } from "./chunks/chunk-LXF3AXHM.js";
59
- import "./chunks/chunk-QY63UKTP.js";
60
- import "./chunks/chunk-QEEGXNFK.js";
54
+ import "./chunks/chunk-ZDCS54ZZ.js";
55
+ import "./chunks/chunk-EYNXG3FO.js";
56
+ import "./chunks/chunk-DMSLNAVH.js";
57
+ import "./chunks/chunk-NZRWTCRM.js";
61
58
  import {
62
59
  getLinkFromDir,
60
+ getScope,
63
61
  getTeams,
64
62
  getUser,
65
63
  getVercelDirectory,
@@ -68,8 +66,8 @@ import {
68
66
  readJSONFile,
69
67
  require_dist as require_dist2,
70
68
  require_lib
71
- } from "./chunks/chunk-YGSTSVXS.js";
72
- import "./chunks/chunk-CB3I3QIT.js";
69
+ } from "./chunks/chunk-2MXGTALG.js";
70
+ import "./chunks/chunk-UDWRZXIT.js";
73
71
  import {
74
72
  TelemetryClient,
75
73
  TelemetryEventStore,
@@ -79,7 +77,7 @@ import {
79
77
  getArgs,
80
78
  parseArguments,
81
79
  printError
82
- } from "./chunks/chunk-EHTPDXTS.js";
80
+ } from "./chunks/chunk-SZXT3PDQ.js";
83
81
  import {
84
82
  APIError,
85
83
  CantFindConfig,
@@ -89,13 +87,13 @@ import {
89
87
  cmd,
90
88
  getCommandName,
91
89
  getTitleName
92
- } from "./chunks/chunk-P6AK7SVK.js";
90
+ } from "./chunks/chunk-KSSNLCL4.js";
93
91
  import {
94
92
  pkg_default
95
93
  } from "./chunks/chunk-P4QNYOFB.js";
96
94
  import {
97
95
  setFetchDispatcher
98
- } from "./chunks/chunk-2RVK3DDN.js";
96
+ } from "./chunks/chunk-52QYYTM5.js";
99
97
  import {
100
98
  output_manager_default,
101
99
  require_dist
@@ -764,7 +762,6 @@ async function earlyGetConfig(configFile) {
764
762
 
765
763
  // src/index.ts
766
764
  import { getDefaultAuthConfig, defaultGlobalConfig } from "@vercel/cli-config";
767
- import { Agent as HttpsAgent } from "https";
768
765
 
769
766
  // src/util/telemetry/root.ts
770
767
  var import_ci_info = __toESM(require_ci_info(), 1);
@@ -1732,14 +1729,11 @@ var main = async () => {
1732
1729
  output_manager_default.debug(
1733
1730
  `Agent/TTY/nonInteractive: isAgent=${isAgent} agentName=${detectedAgent?.name ?? "none"} stdin.isTTY=${String(process.stdin?.isTTY)} --non-interactive=${nonInteractiveFlag} explicitFalse=${explicitNonInteractiveFalse} => nonInteractive=${nonInteractive}`
1734
1731
  );
1735
- const proxyConfigured = hasProxyConfig();
1736
- const agent = proxyConfigured ? new (await import("proxy-agent")).ProxyAgent({ keepAlive: true }) : new HttpsAgent({ keepAlive: true });
1737
- if (proxyConfigured) {
1732
+ if (hasProxyConfig()) {
1738
1733
  const { EnvProxyDispatcher } = await import("./chunks/fetch-proxy-R3JZNXBZ.js");
1739
1734
  setFetchDispatcher(new EnvProxyDispatcher());
1740
1735
  }
1741
1736
  client = new Client({
1742
- agent,
1743
1737
  apiUrl,
1744
1738
  stdin: process.stdin,
1745
1739
  stdout: process.stdout,
@@ -1908,7 +1902,10 @@ var main = async () => {
1908
1902
  }
1909
1903
  let targetCommand = typeof subcommand === "string" ? commands.get(subcommand) : void 0;
1910
1904
  const scope = parsedArgs.flags["--scope"] || parsedArgs.flags["--team"] || localConfig?.scope;
1911
- if (typeof scope === "string" && targetCommand !== "login" && targetCommand !== "build" && targetCommand !== "sandbox") {
1905
+ const separatorIndex = client.argv.indexOf("--");
1906
+ const cliArgs = separatorIndex === -1 ? client.argv : client.argv.slice(0, separatorIndex);
1907
+ const buildNeedsRemoteProjectScope = targetCommand === "build" && cliArgs.some((arg) => arg === "--project" || arg.startsWith("--project="));
1908
+ if (typeof scope === "string" && targetCommand !== "login" && (targetCommand !== "build" || buildNeedsRemoteProjectScope) && targetCommand !== "sandbox") {
1912
1909
  let user = null;
1913
1910
  try {
1914
1911
  user = await getUser(client);
@@ -1981,7 +1978,7 @@ var main = async () => {
1981
1978
  if (!targetCommand) {
1982
1979
  targetCommand = parsedArgs.args[2];
1983
1980
  try {
1984
- const { execExtension } = await import("./chunks/exec-G4AUF3KG.js");
1981
+ const { execExtension } = await import("./chunks/exec-CNBOV577.js");
1985
1982
  exitCode = await execExtension(
1986
1983
  client,
1987
1984
  targetCommand,
package/dist/version.mjs CHANGED
@@ -1 +1 @@
1
- export const version = "56.2.0";
1
+ export const version = "56.3.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel",
3
- "version": "56.2.0",
3
+ "version": "56.3.0",
4
4
  "type": "module",
5
5
  "preferGlobal": true,
6
6
  "license": "Apache-2.0",
@@ -30,34 +30,33 @@
30
30
  "jose": "5.9.6",
31
31
  "jsonc-parser": "3.3.1",
32
32
  "luxon": "^3.4.0",
33
- "proxy-agent": "6.4.0",
34
33
  "sandbox": "3.4.0",
35
34
  "smol-toml": "1.5.2",
36
35
  "undici": "5.29.0",
37
36
  "zod": "4.1.11",
38
- "@vercel/backends": "0.8.23",
39
- "@vercel/build-utils": "13.33.0",
40
- "@vercel/cli-auth": "0.3.0",
41
- "@vercel/cli-config": "0.2.0",
37
+ "@vercel/backends": "0.8.25",
38
+ "@vercel/build-utils": "13.34.0",
42
39
  "@vercel/container": "0.0.5",
40
+ "@vercel/cli-config": "0.2.0",
43
41
  "@vercel/detect-agent": "1.2.3",
44
- "@vercel/fastify": "0.1.103",
45
- "@vercel/express": "0.1.114",
42
+ "@vercel/cli-auth": "0.3.0",
43
+ "@vercel/elysia": "0.1.102",
44
+ "@vercel/fastify": "0.1.105",
45
+ "@vercel/express": "0.1.116",
46
+ "@vercel/h3": "0.1.111",
47
+ "@vercel/hono": "0.2.105",
46
48
  "@vercel/go": "3.10.2",
47
- "@vercel/h3": "0.1.109",
48
- "@vercel/hono": "0.2.103",
49
49
  "@vercel/hydrogen": "1.4.0",
50
- "@vercel/elysia": "0.1.100",
51
- "@vercel/nestjs": "0.2.104",
52
- "@vercel/koa": "0.1.83",
50
+ "@vercel/nestjs": "0.2.106",
53
51
  "@vercel/next": "4.20.4",
54
- "@vercel/python": "6.50.0",
55
- "@vercel/node": "5.8.24",
52
+ "@vercel/koa": "0.1.85",
53
+ "@vercel/node": "5.8.26",
54
+ "@vercel/python": "6.51.0",
55
+ "@vercel/redwood": "2.5.0",
56
56
  "@vercel/remix-builder": "5.9.1",
57
+ "@vercel/ruby": "2.5.1",
57
58
  "@vercel/rust": "1.4.0",
58
- "@vercel/redwood": "2.5.0",
59
- "@vercel/static-build": "2.11.6",
60
- "@vercel/ruby": "2.5.1"
59
+ "@vercel/static-build": "2.11.8"
61
60
  },
62
61
  "devDependencies": {
63
62
  "@edge-runtime/node-utils": "2.3.0",
@@ -181,13 +180,13 @@
181
180
  "xdg-app-paths": "5.1.0",
182
181
  "yauzl-promise": "2.1.3",
183
182
  "@vercel-internals/constants": "1.0.4",
183
+ "@vercel-internals/get-package-json": "1.0.0",
184
184
  "@vercel-internals/types": "3.0.6",
185
- "@vercel/client": "17.6.5",
186
185
  "@vercel/error-utils": "2.2.0",
187
- "@vercel-internals/get-package-json": "1.0.0",
188
- "@vercel/frameworks": "3.30.6",
189
- "@vercel/routing-utils": "6.4.0",
190
- "@vercel/fs-detectors": "6.13.0"
186
+ "@vercel/client": "18.1.0",
187
+ "@vercel/frameworks": "3.30.7",
188
+ "@vercel/fs-detectors": "6.13.2",
189
+ "@vercel/routing-utils": "6.4.0"
191
190
  },
192
191
  "scripts": {
193
192
  "test": "vitest run --config ./vitest.config.mts",
@@ -1,101 +0,0 @@
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
-
8
- // src/util/agent-output-constants.ts
9
- var AGENT_STATUS = {
10
- ERROR: "error",
11
- ACTION_REQUIRED: "action_required",
12
- OK: "ok"
13
- };
14
- var AGENT_REASON = {
15
- // Common (use across dns, flags, routes, env, domains, link)
16
- MISSING_ARGUMENTS: "missing_arguments",
17
- INVALID_ARGUMENTS: "invalid_arguments",
18
- CONFIRMATION_REQUIRED: "confirmation_required",
19
- LOGIN_REQUIRED: "login_required",
20
- PROJECT_SETTINGS_REQUIRED: "project_settings_required",
21
- NOT_LINKED: "not_linked",
22
- NOT_FOUND: "not_found",
23
- PROJECT_NOT_FOUND: "project_not_found",
24
- MISSING_SCOPE: "missing_scope",
25
- SCOPE_NOT_ACCESSIBLE: "scope_not_accessible",
26
- API_ERROR: "api_error",
27
- // Flags
28
- SEGMENT_IN_USE: "segment_in_use",
29
- // Env
30
- MISSING_REQUIREMENTS: "missing_requirements",
31
- MISSING_NAME: "missing_name",
32
- MISSING_VALUE: "missing_value",
33
- MISSING_ENVIRONMENT: "missing_environment",
34
- ENV_NOT_FOUND: "env_not_found",
35
- MULTIPLE_ENVS: "multiple_envs",
36
- ENV_FILE_EXISTS: "env_file_exists",
37
- GIT_BRANCH_REQUIRED: "git_branch_required",
38
- ENV_KEY_SENSITIVE: "env_key_sensitive",
39
- // Routes
40
- AMBIGUOUS_ROUTE: "ambiguous_route",
41
- ROUTE_CREATE_FAILED: "route_create_failed",
42
- ROUTE_GENERATION_FAILED: "route_generation_failed",
43
- // DNS
44
- DOMAIN_NOT_FOUND: "domain_not_found",
45
- DNS_RECORD_NOT_FOUND: "dns_record_not_found",
46
- INCOMPLETE_RECORD: "incomplete_record",
47
- PERMISSION_DENIED: "permission_denied",
48
- INVALID_PORT: "invalid_port",
49
- INVALID_DNS_TYPE: "invalid_dns_type",
50
- DNS_ADD_FAILED: "dns_add_failed",
51
- INVALID_DOMAIN: "invalid_domain",
52
- CONFIGURED_CORRECTLY: "configured_correctly",
53
- VERIFICATION_NEEDED: "verification_needed",
54
- INVALID_CONFIGURATION: "invalid_configuration",
55
- DNS_CHANGE_REQUIRED: "dns_change_required",
56
- DNS_CHANGE_RECOMMENDED: "dns_change_recommended",
57
- DNSSEC_NEEDS_TO_BE_DISABLED: "dnssec_needs_to_be_disabled",
58
- PROJECT_ATTACHMENT_RECOMMENDED: "project_attachment_recommended",
59
- PROJECT_DOMAIN_MISSING: "project_domain_missing",
60
- /** User must accept marketplace integration terms in the browser before install can continue. */
61
- INTEGRATION_TERMS_ACCEPTANCE_REQUIRED: "integration_terms_acceptance_required",
62
- /** Integration uninstall blocked because team-scoped resources still exist. */
63
- HAS_RESOURCES: "has_resources",
64
- /** User must claim a sandbox marketplace resource (e.g. Stripe, Shopify) in the browser. */
65
- INTEGRATION_SANDBOX_CLAIM_REQUIRED: "integration_sandbox_claim_required",
66
- // Tokens
67
- CLASSIC_TOKEN_REQUIRED: "classic_token_required",
68
- /** Classic token lacks full user/account scope (e.g. team- or product-scoped token). */
69
- TOKEN_USER_SCOPE_REQUIRED: "token_user_scope_required",
70
- // Webhooks
71
- MISSING_URL: "missing_url",
72
- MISSING_EVENTS: "missing_events",
73
- INVALID_URL: "invalid_url",
74
- INVALID_EVENT: "invalid_event",
75
- // AI Gateway
76
- INVALID_BUDGET: "invalid_budget",
77
- INVALID_REFRESH_PERIOD: "invalid_refresh_period",
78
- INVALID_EXPIRATION: "invalid_expiration",
79
- /**
80
- * Every selected agent needs explicit `--agent`/`--all` consent (see the
81
- * payload's skipped[]). `--yes` does not grant it, so this is deliberately
82
- * not `confirmation_required` — re-running with --yes would loop forever.
83
- */
84
- REQUIRES_CONSENT: "requires_consent",
85
- // Redirects
86
- REDIRECT_NOT_FOUND: "redirect_not_found",
87
- VERSION_NOT_FOUND: "version_not_found",
88
- VERSION_ALREADY_LIVE: "version_already_live",
89
- VERSION_IS_STAGING: "version_is_staging"
90
- };
91
- var AGENT_ACTION = {
92
- MISSING_ARGUMENTS: "missing_arguments",
93
- CONFIRMATION_REQUIRED: "confirmation_required",
94
- LOGIN_REQUIRED: "login_required"
95
- };
96
-
97
- export {
98
- AGENT_STATUS,
99
- AGENT_REASON,
100
- AGENT_ACTION
101
- };
@@ -1,158 +0,0 @@
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 {
8
- findProjectsFromPath,
9
- getLinkFromDir,
10
- getRepoLink,
11
- getTeamById,
12
- getUser,
13
- getVercelDirectory
14
- } from "./chunk-YGSTSVXS.js";
15
- import {
16
- TeamDeleted
17
- } from "./chunk-P6AK7SVK.js";
18
- import {
19
- output_manager_default
20
- } from "./chunk-OX7KI3LF.js";
21
-
22
- // src/util/get-scope.ts
23
- import { relative } from "path";
24
- async function getScope(client, opts = {}) {
25
- const user = await getUser(client);
26
- let contextName = user.username || user.email;
27
- let team = null;
28
- const defaultTeamId = user.version === "northstar" ? user.defaultTeamId : void 0;
29
- const currentTeamOrDefaultTeamId = client.config.currentTeam || defaultTeamId;
30
- if (!client.config.currentTeam && defaultTeamId) {
31
- client.config.currentTeam = defaultTeamId;
32
- }
33
- if (currentTeamOrDefaultTeamId && opts.getTeam !== false) {
34
- team = await getTeamById(client, currentTeamOrDefaultTeamId);
35
- if (!team) {
36
- throw new TeamDeleted();
37
- }
38
- contextName = team.slug;
39
- }
40
- if (!opts.resolveLocalScope) {
41
- return { contextName, team, user };
42
- }
43
- const explicitScopeProvided = detectExplicitScope(client);
44
- const globalTeamId = client.config.currentTeam;
45
- const globalTeam = team;
46
- const cwd = client.cwd;
47
- let projectLink = null;
48
- try {
49
- projectLink = await getLinkFromDir(getVercelDirectory(cwd));
50
- } catch (_error) {
51
- projectLink = null;
52
- }
53
- let repoLink = null;
54
- try {
55
- repoLink = await getRepoLink(client, cwd);
56
- } catch (_error) {
57
- repoLink = null;
58
- }
59
- let localOrgId;
60
- if (projectLink) {
61
- localOrgId = projectLink.orgId;
62
- } else if (repoLink?.repoConfig) {
63
- const repoConfig = repoLink.repoConfig;
64
- const projects = findProjectsFromPath(
65
- repoConfig.projects,
66
- relative(repoLink.rootPath, cwd)
67
- );
68
- if (projects.length === 1) {
69
- localOrgId = projects[0].orgId ?? repoLink.repoConfig.orgId ?? void 0;
70
- } else if (projects.length > 1) {
71
- const orgIds = new Set(
72
- projects.map((p) => p.orgId ?? repoConfig.orgId ?? "")
73
- );
74
- if (orgIds.size === 1) {
75
- const [singleOrgId] = orgIds;
76
- if (singleOrgId) {
77
- localOrgId = singleOrgId;
78
- }
79
- }
80
- }
81
- }
82
- const isCrossTeamRepo = detectCrossTeamRepo(repoLink?.repoConfig);
83
- const scopeMismatch = Boolean(
84
- localOrgId && globalTeamId && globalTeamId !== localOrgId
85
- );
86
- let resolvedOrg;
87
- let resolvedContextName = contextName;
88
- let resolvedTeam = team;
89
- let linkedRepoResult = null;
90
- if (repoLink?.repoConfig) {
91
- linkedRepoResult = {
92
- repoConfig: repoLink.repoConfig,
93
- rootPath: repoLink.rootPath
94
- };
95
- }
96
- if (explicitScopeProvided) {
97
- resolvedOrg = team ? { type: "team", id: team.id, slug: team.slug } : { type: "user", id: user.id, slug: user.username };
98
- } else if (localOrgId) {
99
- client.config.currentTeam = localOrgId.startsWith("team_") ? localOrgId : void 0;
100
- const correctedTeam = client.config.currentTeam ? await getTeamById(client, client.config.currentTeam) : null;
101
- const correctedUser = await getUser(client);
102
- resolvedOrg = correctedTeam ? { type: "team", id: correctedTeam.id, slug: correctedTeam.slug } : {
103
- type: "user",
104
- id: correctedUser.id,
105
- slug: correctedUser.username
106
- };
107
- resolvedContextName = correctedTeam ? correctedTeam.slug : correctedUser.username || correctedUser.email;
108
- resolvedTeam = correctedTeam;
109
- } else {
110
- if (isCrossTeamRepo) {
111
- output_manager_default.warn(
112
- `This repository has projects across multiple teams. Use \`--scope\` to specify which team, or \`cd\` into a project directory.`
113
- );
114
- }
115
- resolvedOrg = team ? { type: "team", id: team.id, slug: team.slug } : { type: "user", id: user.id, slug: user.username };
116
- }
117
- return {
118
- org: resolvedOrg,
119
- contextName: resolvedContextName,
120
- user,
121
- team: resolvedTeam,
122
- globalTeam,
123
- linkedRepo: linkedRepoResult,
124
- isCrossTeamRepo,
125
- scopeMismatch,
126
- explicitScopeProvided
127
- };
128
- }
129
- function detectExplicitScope(client) {
130
- const argv = client.argv;
131
- for (const arg of argv) {
132
- if (arg === "--scope" || arg === "--team" || arg.startsWith("--scope=") || arg.startsWith("--team=") || arg === "-S" || arg === "-T") {
133
- return true;
134
- }
135
- }
136
- if (client.localConfig?.scope) {
137
- return true;
138
- }
139
- return false;
140
- }
141
- function detectCrossTeamRepo(repoConfig) {
142
- if (!repoConfig?.projects || repoConfig.projects.length < 2) {
143
- return false;
144
- }
145
- const orgIds = /* @__PURE__ */ new Set();
146
- for (const project of repoConfig.projects) {
147
- const orgId = project.orgId ?? repoConfig.orgId;
148
- if (orgId) {
149
- orgIds.add(orgId);
150
- }
151
- }
152
- return orgIds.size > 1;
153
- }
154
-
155
- export {
156
- getScope,
157
- detectExplicitScope
158
- };
@@ -1,86 +0,0 @@
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 {
8
- CertConfigurationError,
9
- CertError,
10
- DeploymentNotFound,
11
- DeploymentPermissionDenied,
12
- DomainNotFound,
13
- InvalidDeploymentId,
14
- TooManyRequests,
15
- isAPIError
16
- } from "./chunk-P6AK7SVK.js";
17
-
18
- // src/util/to-host.ts
19
- function toHost(url) {
20
- return url.replace(/^(?:.*?\/\/)?([^/]+).*/, "$1");
21
- }
22
-
23
- // src/util/certs/map-cert-error.ts
24
- function mapCertError(error, cns) {
25
- const errorCode = error.code;
26
- if (errorCode === "too_many_requests") {
27
- const retryAfter = typeof error.retryAfterMs === "number" ? error.retryAfterMs : 0;
28
- return new TooManyRequests("certificates", retryAfter);
29
- }
30
- if (errorCode === "not_found") {
31
- return new DomainNotFound(error.domain);
32
- }
33
- if (errorCode === "configuration_error") {
34
- return new CertConfigurationError({
35
- cns: cns || error.cns || [],
36
- message: error.message,
37
- external: error.external,
38
- helpUrl: error.helpUrl,
39
- type: error.statusCode === 449 ? "http-01" : "dns-01"
40
- });
41
- }
42
- if (errorCode === "bad_domains" || errorCode === "challenge_still_pending" || errorCode === "common_name_domain_name_mismatch" || errorCode === "conflicting_caa_record" || errorCode === "domain_not_verified" || errorCode === "invalid_cn" || errorCode === "invalid_domain" || errorCode === "rate_limited" || errorCode === "should_share_root_domain" || errorCode === "unauthorized_request_error" || errorCode === "unsupported_challenge_priority" || errorCode === "wildcard_not_allowed" || errorCode === "validation_running" || errorCode === "dns_error" || errorCode === "challenge_error" || errorCode === "txt_record_not_found") {
43
- return new CertError({
44
- cns: cns || error.cns || [],
45
- code: errorCode,
46
- message: error.message,
47
- helpUrl: error.helpUrl
48
- });
49
- }
50
- return null;
51
- }
52
-
53
- // src/util/get-deployment.ts
54
- async function getDeployment(client, contextName, hostOrId) {
55
- if (hostOrId.includes(".")) {
56
- hostOrId = toHost(hostOrId);
57
- }
58
- try {
59
- return await client.fetch(
60
- `/v13/deployments/${encodeURIComponent(hostOrId)}`
61
- );
62
- } catch (err) {
63
- if (isAPIError(err)) {
64
- if (err.status === 404) {
65
- throw new DeploymentNotFound({ id: hostOrId, context: contextName });
66
- }
67
- if (err.status === 403) {
68
- throw new DeploymentPermissionDenied(hostOrId, contextName);
69
- }
70
- if (err.status === 400 && err.message.includes("`id`")) {
71
- throw new InvalidDeploymentId(hostOrId);
72
- }
73
- const certError = mapCertError(err);
74
- if (certError) {
75
- throw certError;
76
- }
77
- }
78
- throw err;
79
- }
80
- }
81
-
82
- export {
83
- mapCertError,
84
- toHost,
85
- getDeployment
86
- };