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
@@ -7,10 +7,12 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  LinkRequiredError,
9
9
  ProjectNotFound,
10
+ getGlobalFlagsFromArgs,
10
11
  isAPIError,
11
12
  packageName,
12
- stripSensitiveAuthArgs
13
- } from "./chunk-P6AK7SVK.js";
13
+ stripSensitiveAuthArgs,
14
+ suggestionFlagTakesSeparateValue
15
+ } from "./chunk-KSSNLCL4.js";
14
16
  import {
15
17
  require_dist
16
18
  } from "./chunk-OX7KI3LF.js";
@@ -38,7 +40,6 @@ var GLOBAL_FLAG_NAMES = /* @__PURE__ */ new Set([
38
40
  "-T"
39
41
  // --token/-t are intentionally excluded and stripped via stripSensitiveAuthArgs.
40
42
  ]);
41
- var GLOBAL_FLAGS_BOOLEAN = /* @__PURE__ */ new Set(["--yes", "-y", "--non-interactive"]);
42
43
  var GLOBAL_FLAG_SHORTHANDS = {
43
44
  "-y": "--yes",
44
45
  "-S": "--scope",
@@ -48,14 +49,17 @@ function canonicalGlobalFlagName(name) {
48
49
  return GLOBAL_FLAG_SHORTHANDS[name] ?? name;
49
50
  }
50
51
  function getGlobalFlagsFromArgv(argv) {
51
- const args = stripSensitiveAuthArgs(argv.slice(2));
52
+ const args = getGlobalFlagsFromArgs(argv.slice(2), {
53
+ preserveConfig: true,
54
+ preserveYes: true
55
+ });
52
56
  const out = [];
53
57
  for (let i = 0; i < args.length; i++) {
54
58
  const arg = args[i];
55
59
  const name = arg.startsWith("--") ? arg.split("=")[0] : arg;
56
60
  if (GLOBAL_FLAG_NAMES.has(name)) {
57
61
  out.push(arg);
58
- const takesSeparateValue = !GLOBAL_FLAGS_BOOLEAN.has(name) && !arg.includes("=") && i + 1 < args.length && !args[i + 1].startsWith("-");
62
+ const takesSeparateValue = suggestionFlagTakesSeparateValue(name) && !arg.includes("=") && i + 1 < args.length && !args[i + 1].startsWith("-");
59
63
  if (takesSeparateValue) {
60
64
  out.push(args[i + 1]);
61
65
  i++;
@@ -71,7 +75,7 @@ function omitGlobalFlagsFromArgs(args) {
71
75
  const arg = safeArgs[i];
72
76
  const name = arg.startsWith("--") ? arg.split("=")[0] : arg;
73
77
  if (GLOBAL_FLAG_NAMES.has(name)) {
74
- const skipSeparateValue = !GLOBAL_FLAGS_BOOLEAN.has(name) && !arg.includes("=") && i + 1 < safeArgs.length && !safeArgs[i + 1].startsWith("-");
78
+ const skipSeparateValue = suggestionFlagTakesSeparateValue(name) && !arg.includes("=") && i + 1 < safeArgs.length && !safeArgs[i + 1].startsWith("-");
75
79
  if (skipSeparateValue) {
76
80
  i++;
77
81
  }
@@ -90,7 +94,16 @@ function buildIntegrationCommandTailFromArgv(argv) {
90
94
  return omitGlobalFlagsFromArgs(args.slice(idx)).join(" ");
91
95
  }
92
96
  function buildCommandWithGlobalFlags(argv, commandTemplate, pkgName = packageName, options) {
93
- let preserved = getGlobalFlagsFromArgv(argv);
97
+ let preserved = options?.globalFlags === "all" ? getGlobalFlagsFromArgs(argv.slice(2), {
98
+ preserveProject: options.preserveProject
99
+ }) : getGlobalFlagsFromArgv(argv);
100
+ if (options?.globalFlags !== "all" && options?.preserveProject) {
101
+ const globalArgs = getGlobalFlagsFromArgs(argv.slice(2));
102
+ const contextArgs = getGlobalFlagsFromArgs(argv.slice(2), {
103
+ preserveProject: true
104
+ });
105
+ preserved.push(...contextArgs.slice(globalArgs.length));
106
+ }
94
107
  const exclude = new Set(
95
108
  commandTemplate.split(/\s+/).filter((token) => token.startsWith("-")).map((token) => canonicalGlobalFlagName(token.split("=")[0]))
96
109
  );
@@ -121,106 +134,108 @@ function buildCommandWithGlobalFlags(argv, commandTemplate, pkgName = packageNam
121
134
  }
122
135
  return `${base} ${preserved.join(" ")}`;
123
136
  }
124
- function getPreservedArgsForEnvAdd(argv) {
125
- const args = argv.slice(2);
126
- const addIdx = args.indexOf("add");
127
- if (addIdx === -1 || args[addIdx - 1] !== "env")
128
- return stripSensitiveAuthArgs(args);
129
- let i = addIdx + 1;
130
- let positionals = 0;
131
- while (i < args.length && positionals < 3 && !args[i].startsWith("-")) {
132
- positionals++;
133
- i++;
134
- }
135
- return stripSensitiveAuthArgs(args.slice(i));
137
+ function withGlobalFlags(client, commandTemplate, options = {}) {
138
+ return buildCommandWithGlobalFlags(
139
+ client.argv,
140
+ commandTemplate,
141
+ packageName,
142
+ {
143
+ globalFlags: "all",
144
+ preserveProject: options.preserveProject
145
+ }
146
+ );
136
147
  }
137
- function buildEnvAddCommandWithPreservedArgs(argv, commandTemplate, pkgName = packageName) {
138
- let preserved = getPreservedArgsForEnvAdd(argv);
139
- if (commandTemplate.includes("--yes")) {
140
- preserved = preserved.filter((a) => a !== "--yes" && a !== "-y");
148
+ function getPreservedArgsAfterEnvSubcommand(argv, subcommands, positionalCount) {
149
+ const args = stripSensitiveAuthArgs(argv.slice(2));
150
+ const envIdx = args.findIndex(
151
+ (arg, index) => arg === "env" && subcommands.includes(args[index + 1])
152
+ );
153
+ const subcommandIdx = envIdx + 1;
154
+ if (envIdx === -1) {
155
+ return args;
141
156
  }
142
- if (commandTemplate.includes("--value")) {
143
- const out = [];
144
- for (let j = 0; j < preserved.length; j++) {
145
- if (preserved[j] === "--value" && j + 1 < preserved.length) {
146
- j++;
147
- continue;
157
+ const preserved = [];
158
+ let positionals = 0;
159
+ let optionsEnded = false;
160
+ for (let i = subcommandIdx + 1; i < args.length; i++) {
161
+ const arg = args[i];
162
+ if (arg === "--" && !optionsEnded) {
163
+ optionsEnded = true;
164
+ continue;
165
+ }
166
+ if (!optionsEnded && arg.startsWith("-")) {
167
+ preserved.push(arg);
168
+ if (!arg.includes("=") && suggestionFlagTakesSeparateValue(arg) && i + 1 < args.length && !args[i + 1].startsWith("-")) {
169
+ preserved.push(args[++i]);
148
170
  }
149
- if (preserved[j].startsWith("--value="))
150
- continue;
151
- out.push(preserved[j]);
171
+ continue;
152
172
  }
153
- preserved = out;
173
+ if (positionals < positionalCount) {
174
+ positionals++;
175
+ continue;
176
+ }
177
+ if (optionsEnded && !preserved.includes("--")) {
178
+ preserved.push("--");
179
+ }
180
+ preserved.push(arg);
154
181
  }
182
+ return preserved;
183
+ }
184
+ function omitPreservedFlagsAlreadyInTemplate(args, commandTemplate) {
185
+ const templateFlags = new Set(
186
+ commandTemplate.split(/\s+/).filter((token) => token.startsWith("-")).map((token) => canonicalGlobalFlagName(token.split("=")[0]))
187
+ );
188
+ const out = [];
189
+ for (let i = 0; i < args.length; i++) {
190
+ const arg = args[i];
191
+ const name = arg.startsWith("-") ? arg.split("=")[0] : arg;
192
+ if (!templateFlags.has(canonicalGlobalFlagName(name))) {
193
+ out.push(arg);
194
+ continue;
195
+ }
196
+ if (!arg.includes("=") && suggestionFlagTakesSeparateValue(name) && i + 1 < args.length && !args[i + 1].startsWith("-")) {
197
+ i++;
198
+ }
199
+ }
200
+ return out;
201
+ }
202
+ function getPreservedArgsForEnvAdd(argv) {
203
+ return getPreservedArgsAfterEnvSubcommand(argv, ["add"], 3);
204
+ }
205
+ function buildEnvAddCommandWithPreservedArgs(argv, commandTemplate, pkgName = packageName) {
206
+ const preserved = omitPreservedFlagsAlreadyInTemplate(
207
+ getPreservedArgsForEnvAdd(argv),
208
+ commandTemplate
209
+ );
155
210
  const base = `${pkgName} ${commandTemplate}`;
156
211
  if (preserved.length === 0)
157
212
  return base;
158
213
  return `${base} ${preserved.join(" ")}`;
159
214
  }
160
215
  function getPreservedArgsForEnvPull(argv) {
161
- const args = argv.slice(2);
162
- const pullIdx = args.indexOf("pull");
163
- if (pullIdx === -1 || args[pullIdx - 1] !== "env")
164
- return stripSensitiveAuthArgs(args);
165
- let i = pullIdx + 1;
166
- if (i < args.length && !args[i].startsWith("-"))
167
- i++;
168
- return stripSensitiveAuthArgs(args.slice(i));
216
+ return getPreservedArgsAfterEnvSubcommand(argv, ["pull"], 1);
169
217
  }
170
218
  function getPreservedArgsForEnvRm(argv) {
171
- const args = argv.slice(2);
172
- const rmIdx = args.indexOf("rm");
173
- if (rmIdx === -1 || args[rmIdx - 1] !== "env")
174
- return stripSensitiveAuthArgs(args);
175
- let i = rmIdx + 1;
176
- let positionals = 0;
177
- while (i < args.length && positionals < 3 && !args[i].startsWith("-")) {
178
- positionals++;
179
- i++;
180
- }
181
- return stripSensitiveAuthArgs(args.slice(i));
219
+ return getPreservedArgsAfterEnvSubcommand(argv, ["rm", "remove"], 3);
182
220
  }
183
221
  function buildEnvRmCommandWithPreservedArgs(argv, commandTemplate, pkgName = packageName) {
184
- let preserved = getPreservedArgsForEnvRm(argv);
185
- if (commandTemplate.includes("--yes")) {
186
- preserved = preserved.filter((a) => a !== "--yes" && a !== "-y");
187
- }
222
+ const preserved = omitPreservedFlagsAlreadyInTemplate(
223
+ getPreservedArgsForEnvRm(argv),
224
+ commandTemplate
225
+ );
188
226
  const base = `${pkgName} ${commandTemplate}`;
189
227
  if (preserved.length === 0)
190
228
  return base;
191
229
  return `${base} ${preserved.join(" ")}`;
192
230
  }
193
231
  function getPreservedArgsForEnvUpdate(argv) {
194
- const args = argv.slice(2);
195
- const updateIdx = args.indexOf("update");
196
- if (updateIdx === -1 || args[updateIdx - 1] !== "env")
197
- return stripSensitiveAuthArgs(args);
198
- let i = updateIdx + 1;
199
- let positionals = 0;
200
- while (i < args.length && positionals < 3 && !args[i].startsWith("-")) {
201
- positionals++;
202
- i++;
203
- }
204
- return stripSensitiveAuthArgs(args.slice(i));
232
+ return getPreservedArgsAfterEnvSubcommand(argv, ["update"], 3);
205
233
  }
206
234
  function buildEnvUpdateCommandWithPreservedArgs(argv, commandTemplate, pkgName = packageName) {
207
- let preserved = getPreservedArgsForEnvUpdate(argv);
208
- if (commandTemplate.includes("--yes")) {
209
- preserved = preserved.filter((a) => a !== "--yes" && a !== "-y");
210
- }
211
- if (commandTemplate.includes("--value")) {
212
- const out = [];
213
- for (let i = 0; i < preserved.length; i++) {
214
- if (preserved[i] === "--value" && i + 1 < preserved.length) {
215
- i++;
216
- continue;
217
- }
218
- if (preserved[i].startsWith("--value="))
219
- continue;
220
- out.push(preserved[i]);
221
- }
222
- preserved = out;
223
- }
235
+ const preserved = omitPreservedFlagsAlreadyInTemplate(
236
+ getPreservedArgsForEnvUpdate(argv),
237
+ commandTemplate
238
+ );
224
239
  const base = `${pkgName} ${commandTemplate}`;
225
240
  if (preserved.length === 0)
226
241
  return base;
@@ -527,11 +542,101 @@ function openUrlInBrowserCommand(url) {
527
542
  return `xdg-open '${url}'`;
528
543
  }
529
544
 
545
+ // src/util/agent-output-constants.ts
546
+ var AGENT_STATUS = {
547
+ ERROR: "error",
548
+ ACTION_REQUIRED: "action_required",
549
+ OK: "ok"
550
+ };
551
+ var AGENT_REASON = {
552
+ // Common (use across dns, flags, routes, env, domains, link)
553
+ MISSING_ARGUMENTS: "missing_arguments",
554
+ INVALID_ARGUMENTS: "invalid_arguments",
555
+ CONFIRMATION_REQUIRED: "confirmation_required",
556
+ LOGIN_REQUIRED: "login_required",
557
+ PROJECT_SETTINGS_REQUIRED: "project_settings_required",
558
+ NOT_LINKED: "not_linked",
559
+ NOT_FOUND: "not_found",
560
+ PROJECT_NOT_FOUND: "project_not_found",
561
+ MISSING_SCOPE: "missing_scope",
562
+ SCOPE_NOT_ACCESSIBLE: "scope_not_accessible",
563
+ API_ERROR: "api_error",
564
+ // Flags
565
+ SEGMENT_IN_USE: "segment_in_use",
566
+ // Env
567
+ MISSING_REQUIREMENTS: "missing_requirements",
568
+ MISSING_NAME: "missing_name",
569
+ MISSING_VALUE: "missing_value",
570
+ MISSING_ENVIRONMENT: "missing_environment",
571
+ ENV_NOT_FOUND: "env_not_found",
572
+ MULTIPLE_ENVS: "multiple_envs",
573
+ ENV_FILE_EXISTS: "env_file_exists",
574
+ GIT_BRANCH_REQUIRED: "git_branch_required",
575
+ ENV_KEY_SENSITIVE: "env_key_sensitive",
576
+ // Routes
577
+ AMBIGUOUS_ROUTE: "ambiguous_route",
578
+ ROUTE_CREATE_FAILED: "route_create_failed",
579
+ ROUTE_GENERATION_FAILED: "route_generation_failed",
580
+ // DNS
581
+ DOMAIN_NOT_FOUND: "domain_not_found",
582
+ DNS_RECORD_NOT_FOUND: "dns_record_not_found",
583
+ INCOMPLETE_RECORD: "incomplete_record",
584
+ PERMISSION_DENIED: "permission_denied",
585
+ INVALID_PORT: "invalid_port",
586
+ INVALID_DNS_TYPE: "invalid_dns_type",
587
+ DNS_ADD_FAILED: "dns_add_failed",
588
+ INVALID_DOMAIN: "invalid_domain",
589
+ CONFIGURED_CORRECTLY: "configured_correctly",
590
+ VERIFICATION_NEEDED: "verification_needed",
591
+ INVALID_CONFIGURATION: "invalid_configuration",
592
+ DNS_CHANGE_REQUIRED: "dns_change_required",
593
+ DNS_CHANGE_RECOMMENDED: "dns_change_recommended",
594
+ DNSSEC_NEEDS_TO_BE_DISABLED: "dnssec_needs_to_be_disabled",
595
+ PROJECT_ATTACHMENT_RECOMMENDED: "project_attachment_recommended",
596
+ PROJECT_DOMAIN_MISSING: "project_domain_missing",
597
+ /** User must accept marketplace integration terms in the browser before install can continue. */
598
+ INTEGRATION_TERMS_ACCEPTANCE_REQUIRED: "integration_terms_acceptance_required",
599
+ /** Integration uninstall blocked because team-scoped resources still exist. */
600
+ HAS_RESOURCES: "has_resources",
601
+ /** User must claim a sandbox marketplace resource (e.g. Stripe, Shopify) in the browser. */
602
+ INTEGRATION_SANDBOX_CLAIM_REQUIRED: "integration_sandbox_claim_required",
603
+ // Tokens
604
+ CLASSIC_TOKEN_REQUIRED: "classic_token_required",
605
+ /** Classic token lacks full user/account scope (e.g. team- or product-scoped token). */
606
+ TOKEN_USER_SCOPE_REQUIRED: "token_user_scope_required",
607
+ // Webhooks
608
+ MISSING_URL: "missing_url",
609
+ MISSING_EVENTS: "missing_events",
610
+ INVALID_URL: "invalid_url",
611
+ INVALID_EVENT: "invalid_event",
612
+ // AI Gateway
613
+ INVALID_BUDGET: "invalid_budget",
614
+ INVALID_REFRESH_PERIOD: "invalid_refresh_period",
615
+ INVALID_EXPIRATION: "invalid_expiration",
616
+ /**
617
+ * Every selected agent needs explicit `--agent`/`--all` consent (see the
618
+ * payload's skipped[]). `--yes` does not grant it, so this is deliberately
619
+ * not `confirmation_required` — re-running with --yes would loop forever.
620
+ */
621
+ REQUIRES_CONSENT: "requires_consent",
622
+ // Redirects
623
+ REDIRECT_NOT_FOUND: "redirect_not_found",
624
+ VERSION_NOT_FOUND: "version_not_found",
625
+ VERSION_ALREADY_LIVE: "version_already_live",
626
+ VERSION_IS_STAGING: "version_is_staging"
627
+ };
628
+ var AGENT_ACTION = {
629
+ MISSING_ARGUMENTS: "missing_arguments",
630
+ CONFIRMATION_REQUIRED: "confirmation_required",
631
+ LOGIN_REQUIRED: "login_required"
632
+ };
633
+
530
634
  export {
531
635
  buildCommandWithYes,
532
636
  omitGlobalFlagsFromArgs,
533
637
  buildIntegrationCommandTailFromArgv,
534
638
  buildCommandWithGlobalFlags,
639
+ withGlobalFlags,
535
640
  getPreservedArgsForEnvAdd,
536
641
  buildEnvAddCommandWithPreservedArgs,
537
642
  getPreservedArgsForEnvPull,
@@ -545,5 +650,8 @@ export {
545
650
  outputAgentError,
546
651
  outputAgentSuccess,
547
652
  exitWithNonInteractiveError,
548
- openUrlInBrowserCommand
653
+ openUrlInBrowserCommand,
654
+ AGENT_STATUS,
655
+ AGENT_REASON,
656
+ AGENT_ACTION
549
657
  };
@@ -5,11 +5,10 @@ const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
+ packageName,
9
+ projectOption,
8
10
  yesOption
9
- } from "./chunk-EHTPDXTS.js";
10
- import {
11
- packageName
12
- } from "./chunk-P6AK7SVK.js";
11
+ } from "./chunk-KSSNLCL4.js";
13
12
 
14
13
  // src/commands/routes/command.ts
15
14
  var listSubcommand = {
@@ -18,6 +17,7 @@ var listSubcommand = {
18
17
  description: "List all routing rules for the current project. These routes apply to all deployments and environments.",
19
18
  arguments: [],
20
19
  options: [
20
+ projectOption,
21
21
  {
22
22
  name: "search",
23
23
  description: "Search by name, description, source, or destination",
@@ -97,6 +97,7 @@ var listVersionsSubcommand = {
97
97
  description: "List all versions of routing rules",
98
98
  arguments: [],
99
99
  options: [
100
+ projectOption,
100
101
  {
101
102
  name: "count",
102
103
  description: "Number of versions to fetch (default: 20, max: 100)",
@@ -128,6 +129,7 @@ var inspectSubcommand = {
128
129
  }
129
130
  ],
130
131
  options: [
132
+ projectOption,
131
133
  {
132
134
  name: "diff",
133
135
  description: "Compare staged changes against production for this route",
@@ -162,6 +164,7 @@ var addSubcommand = {
162
164
  }
163
165
  ],
164
166
  options: [
167
+ projectOption,
165
168
  // Path & Matching
166
169
  {
167
170
  name: "src",
@@ -381,6 +384,7 @@ var publishSubcommand = {
381
384
  description: "Publish staged routing changes to production",
382
385
  arguments: [],
383
386
  options: [
387
+ projectOption,
384
388
  {
385
389
  ...yesOption,
386
390
  description: "Skip the confirmation prompt when publishing"
@@ -408,6 +412,7 @@ var restoreSubcommand = {
408
412
  }
409
413
  ],
410
414
  options: [
415
+ projectOption,
411
416
  {
412
417
  ...yesOption,
413
418
  description: "Skip the confirmation prompt when restoring"
@@ -430,6 +435,7 @@ var discardSubcommand = {
430
435
  description: "Discard staged routing changes",
431
436
  arguments: [],
432
437
  options: [
438
+ projectOption,
433
439
  {
434
440
  ...yesOption,
435
441
  description: "Skip the confirmation prompt when discarding"
@@ -458,6 +464,7 @@ var deleteSubcommand = {
458
464
  }
459
465
  ],
460
466
  options: [
467
+ projectOption,
461
468
  {
462
469
  ...yesOption,
463
470
  description: "Skip the confirmation prompt when deleting"
@@ -492,7 +499,7 @@ var enableSubcommand = {
492
499
  required: true
493
500
  }
494
501
  ],
495
- options: [],
502
+ options: [projectOption],
496
503
  examples: [
497
504
  {
498
505
  name: "Enable a route by name",
@@ -514,7 +521,7 @@ var disableSubcommand = {
514
521
  required: true
515
522
  }
516
523
  ],
517
- options: [],
524
+ options: [projectOption],
518
525
  examples: [
519
526
  {
520
527
  name: "Disable a route by name",
@@ -537,6 +544,7 @@ var reorderSubcommand = {
537
544
  }
538
545
  ],
539
546
  options: [
547
+ projectOption,
540
548
  {
541
549
  name: "position",
542
550
  description: "Target position: start, end, a number (1-based), before:<id>, after:<id>",
@@ -598,6 +606,7 @@ var editSubcommand = {
598
606
  }
599
607
  ],
600
608
  options: [
609
+ projectOption,
601
610
  // Metadata
602
611
  {
603
612
  name: "name",
@@ -836,6 +845,7 @@ var exportSubcommand = {
836
845
  }
837
846
  ],
838
847
  options: [
848
+ projectOption,
839
849
  {
840
850
  name: "output",
841
851
  description: "Output file format: .json (default) or .ts",
@@ -6,15 +6,13 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  rulesAggregateCommand
9
- } from "./chunk-22GUZ5KG.js";
9
+ } from "./chunk-STJJ3DFO.js";
10
10
  import {
11
11
  formatOption,
12
12
  limitOption,
13
+ packageName,
13
14
  projectOption
14
- } from "./chunk-EHTPDXTS.js";
15
- import {
16
- packageName
17
- } from "./chunk-P6AK7SVK.js";
15
+ } from "./chunk-KSSNLCL4.js";
18
16
 
19
17
  // src/commands/alerts/command.ts
20
18
  var listSubcommand = {
@@ -7,15 +7,15 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  VERCEL_DIR,
9
9
  isVercelTomlEnabled
10
- } from "./chunk-YGSTSVXS.js";
10
+ } from "./chunk-2MXGTALG.js";
11
11
  import {
12
12
  parseArguments
13
- } from "./chunk-EHTPDXTS.js";
13
+ } from "./chunk-SZXT3PDQ.js";
14
14
  import {
15
15
  ConflictingConfigFiles,
16
16
  DeprecatedNowJson,
17
17
  InvalidLocalConfig
18
- } from "./chunk-P6AK7SVK.js";
18
+ } from "./chunk-KSSNLCL4.js";
19
19
 
20
20
  // src/util/input/prompt-cancellation.ts
21
21
  var PromptCanceledError = class extends Error {
@@ -6,10 +6,10 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  table
9
- } from "./chunk-QEEGXNFK.js";
9
+ } from "./chunk-NZRWTCRM.js";
10
10
  import {
11
11
  require_strip_ansi
12
- } from "./chunk-EHTPDXTS.js";
12
+ } from "./chunk-SZXT3PDQ.js";
13
13
  import {
14
14
  require_source
15
15
  } from "./chunk-S7KYDPEM.js";
@@ -11,13 +11,13 @@ import {
11
11
  findSourceVercelConfigFile,
12
12
  getVercelConfigPath,
13
13
  normalizeConfig
14
- } from "./chunk-YGSTSVXS.js";
15
- import "./chunk-CB3I3QIT.js";
14
+ } from "./chunk-2MXGTALG.js";
15
+ import "./chunk-UDWRZXIT.js";
16
16
  import "./chunk-ECCWJHC6.js";
17
- import "./chunk-EHTPDXTS.js";
18
- import "./chunk-P6AK7SVK.js";
17
+ import "./chunk-SZXT3PDQ.js";
18
+ import "./chunk-KSSNLCL4.js";
19
19
  import "./chunk-P4QNYOFB.js";
20
- import "./chunk-2RVK3DDN.js";
20
+ import "./chunk-52QYYTM5.js";
21
21
  import "./chunk-OX7KI3LF.js";
22
22
  import "./chunk-GGP5R3FU.js";
23
23
  import "./chunk-S7KYDPEM.js";
@@ -8,36 +8,32 @@ import {
8
8
  getRouteVersions
9
9
  } from "./chunk-AHU7WNL2.js";
10
10
  import {
11
- ensureProjectLink,
12
11
  getRouteTypeLabel,
13
12
  getRoutes,
14
13
  offerAutoPromote,
15
14
  parseSubcommandArgs,
15
+ requireProjectContext,
16
16
  resolveRoutes,
17
17
  withGlobalFlags
18
- } from "./chunk-LSPZHWWP.js";
18
+ } from "./chunk-22G26AIX.js";
19
19
  import {
20
20
  deleteSubcommand
21
- } from "./chunk-DREO3DFB.js";
21
+ } from "./chunk-VZSZBD4V.js";
22
22
  import {
23
23
  stamp_default
24
24
  } from "./chunk-64IF634X.js";
25
25
  import "./chunk-VXYGCOKL.js";
26
+ import "./chunk-2MXGTALG.js";
26
27
  import {
27
28
  AGENT_REASON,
28
- AGENT_STATUS
29
- } from "./chunk-IC4YEIGW.js";
30
- import "./chunk-YGSTSVXS.js";
31
- import {
29
+ AGENT_STATUS,
32
30
  outputAgentError
33
- } from "./chunk-CB3I3QIT.js";
31
+ } from "./chunk-UDWRZXIT.js";
34
32
  import "./chunk-ECCWJHC6.js";
35
- import "./chunk-EHTPDXTS.js";
36
- import {
37
- getCommandName
38
- } from "./chunk-P6AK7SVK.js";
33
+ import "./chunk-SZXT3PDQ.js";
34
+ import "./chunk-KSSNLCL4.js";
39
35
  import "./chunk-P4QNYOFB.js";
40
- import "./chunk-2RVK3DDN.js";
36
+ import "./chunk-52QYYTM5.js";
41
37
  import {
42
38
  output_manager_default
43
39
  } from "./chunk-OX7KI3LF.js";
@@ -74,7 +70,11 @@ async function deleteRoute(client, argv) {
74
70
  const parsed = await parseSubcommandArgs(argv, deleteSubcommand, client);
75
71
  if (typeof parsed === "number")
76
72
  return parsed;
77
- const link = await ensureProjectLink(client);
73
+ const link = await requireProjectContext(
74
+ client,
75
+ "routes",
76
+ parsed.flags["--project"]
77
+ );
78
78
  if (typeof link === "number")
79
79
  return link;
80
80
  const { project, org } = link;
@@ -103,7 +103,7 @@ async function deleteRoute(client, argv) {
103
103
  );
104
104
  }
105
105
  output_manager_default.error(
106
- `At least one route name or ID is required. Usage: ${getCommandName("routes delete <name-or-id> [...]")}`
106
+ `At least one route name or ID is required. Usage: ${withGlobalFlags(client, "routes delete <name-or-id> [...]")}`
107
107
  );
108
108
  return 1;
109
109
  }