vercel 56.2.1 → 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 (86) hide show
  1. package/dist/chunks/{add-YIAPBLSF.js → add-CF5SQESQ.js} +10 -13
  2. package/dist/chunks/{add-ZAQLTF5W.js → add-DMRGZN3Z.js} +9 -12
  3. package/dist/chunks/{chunk-75PKWYOS.js → chunk-22G26AIX.js} +99 -74
  4. package/dist/chunks/{chunk-7OJJKCSW.js → chunk-2C2JJTAM.js} +6 -10
  5. package/dist/chunks/{chunk-DDEPCAGE.js → chunk-2MXGTALG.js} +529 -164
  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-NULWLKT7.js → chunk-4YOCOUDN.js} +4 -4
  10. package/dist/chunks/{chunk-GXBDQRHJ.js → chunk-4Z5LC2CI.js} +1 -1
  11. package/dist/chunks/{chunk-CMJMYVQM.js → chunk-6OMC3HOW.js} +1 -1
  12. package/dist/chunks/{chunk-JF7LPEBD.js → chunk-A6LE5VAN.js} +1 -1
  13. package/dist/chunks/{chunk-QY63UKTP.js → chunk-DMSLNAVH.js} +2 -2
  14. package/dist/chunks/{chunk-52V5NDUN.js → chunk-DZHRFBKE.js} +2 -2
  15. package/dist/chunks/{chunk-MYD7N6MH.js → chunk-ERPZJ4SX.js} +13 -3
  16. package/dist/chunks/{chunk-YKJA5TVC.js → chunk-EYNXG3FO.js} +3 -5
  17. package/dist/chunks/{chunk-RLJA2KI7.js → chunk-FYQPTH5C.js} +2 -4
  18. package/dist/chunks/{chunk-7TJLLZPN.js → chunk-G4PG5HVE.js} +6 -10
  19. package/dist/chunks/{chunk-7C7MMT4J.js → chunk-GIL3VAUR.js} +2 -4
  20. package/dist/chunks/{chunk-GPVU6JRS.js → chunk-HUKYQKVQ.js} +9 -7
  21. package/dist/chunks/{chunk-EPBUWIAO.js → chunk-I2IICWBW.js} +48 -24
  22. package/dist/chunks/{chunk-KXVQEPTA.js → chunk-ICSIFPXG.js} +3 -5
  23. package/dist/chunks/{chunk-P6AK7SVK.js → chunk-KSSNLCL4.js} +360 -25
  24. package/dist/chunks/{chunk-HIO4M75R.js → chunk-KXKQQIUS.js} +6 -10
  25. package/dist/chunks/{chunk-HA7C7SDO.js → chunk-LHFNIZ2P.js} +2 -4
  26. package/dist/chunks/{chunk-2I34TRQZ.js → chunk-NP32PAKT.js} +2 -2
  27. package/dist/chunks/{chunk-QEEGXNFK.js → chunk-NZRWTCRM.js} +1 -1
  28. package/dist/chunks/{chunk-IDMKFYEA.js → chunk-OGG6UBXK.js} +2 -4
  29. package/dist/chunks/{chunk-PASZMRTZ.js → chunk-PRO4S2KV.js} +5 -5
  30. package/dist/chunks/{chunk-DD6D5J7E.js → chunk-Q5ADSH7D.js} +8 -12
  31. package/dist/chunks/{chunk-6ZVIC6FL.js → chunk-QP3C5YS5.js} +8 -8
  32. package/dist/chunks/{chunk-5HNYJHOB.js → chunk-SDK7R4WO.js} +1 -1
  33. package/dist/chunks/{chunk-22GUZ5KG.js → chunk-STJJ3DFO.js} +2 -4
  34. package/dist/chunks/{chunk-EHTPDXTS.js → chunk-SZXT3PDQ.js} +3 -294
  35. package/dist/chunks/{chunk-CB3I3QIT.js → chunk-UDWRZXIT.js} +193 -85
  36. package/dist/chunks/{chunk-DREO3DFB.js → chunk-VZSZBD4V.js} +16 -6
  37. package/dist/chunks/{chunk-VOBBH2SB.js → chunk-W346YNDN.js} +0 -49
  38. package/dist/chunks/{chunk-7S3QUMIG.js → chunk-YS6EDZHB.js} +3 -5
  39. package/dist/chunks/{chunk-UESEGACQ.js → chunk-ZDCS54ZZ.js} +3 -3
  40. package/dist/chunks/{chunk-4RGSUV5C.js → chunk-ZVLPUREX.js} +2 -2
  41. package/dist/chunks/{compile-vercel-config-4NKPN3EG.js → compile-vercel-config-RPPL7W56.js} +4 -4
  42. package/dist/chunks/{delete-NCMDC3IU.js → delete-QBVZ5X6B.js} +14 -14
  43. package/dist/chunks/{disable-Z7DXY4AY.js → disable-YYGXPXBI.js} +14 -13
  44. package/dist/chunks/{discard-4ILK3ULP.js → discard-X2MSUFGI.js} +13 -12
  45. package/dist/chunks/{edit-ROJQCTWR.js → edit-3ABZQYUU.js} +17 -18
  46. package/dist/chunks/{enable-TAVCLAEC.js → enable-HUMYCGKA.js} +14 -13
  47. package/dist/chunks/{export-YTSIGJFX.js → export-KGHH4WAT.js} +15 -14
  48. package/dist/chunks/{image-LORSHERP.js → image-OO3WWKZV.js} +6 -8
  49. package/dist/chunks/{inspect-5C4UHSCT.js → inspect-5TNHHD2M.js} +10 -12
  50. package/dist/chunks/{inspect-OHDU2SVS.js → inspect-FNUCB7Y3.js} +8 -10
  51. package/dist/chunks/{inspect-L4UIWOXO.js → inspect-KSSQEAW7.js} +11 -15
  52. package/dist/chunks/{inspect-A2X7RTP4.js → inspect-Z6SSD2SR.js} +8 -10
  53. package/dist/chunks/{list-FGVDMSFN.js → list-TXNYRVJG.js} +8 -10
  54. package/dist/chunks/{list-P2B5MHON.js → list-X2AD3HCX.js} +10 -13
  55. package/dist/chunks/{login-4BK3VGII.js → login-SLPCZ2OF.js} +11 -14
  56. package/dist/chunks/{ls-YXKRRYTL.js → ls-2YSINRJ3.js} +10 -13
  57. package/dist/chunks/{ls-NU4D6TLG.js → ls-4QMJLQQL.js} +10 -13
  58. package/dist/chunks/{ls-WDRFGE2J.js → ls-C7MNQ4IK.js} +12 -15
  59. package/dist/chunks/{ls-RAC5LMTR.js → ls-QLTOY23G.js} +9 -12
  60. package/dist/chunks/{publish-DGF2TQCQ.js → publish-GV4LLLXP.js} +13 -12
  61. package/dist/chunks/{query-NWW6RDHK.js → query-3AHRMAPA.js} +10 -12
  62. package/dist/chunks/{reorder-TTZBKCEB.js → reorder-VSVOPNM4.js} +17 -16
  63. package/dist/chunks/{restore-DG3LZMHQ.js → restore-FKYCF73P.js} +19 -18
  64. package/dist/chunks/{rm-7WXXLTXF.js → rm-4QCXZRC2.js} +10 -13
  65. package/dist/chunks/{rm-U2DFRDKE.js → rm-UTFG42FN.js} +8 -11
  66. package/dist/chunks/{rm-2VBE4C2V.js → rm-YV5WQKQM.js} +9 -12
  67. package/dist/chunks/{rule-inspect-4NL3GGDB.js → rule-inspect-IONN4MTP.js} +9 -12
  68. package/dist/chunks/{rules-DABNOUNG.js → rules-S2KPV7HY.js} +9 -11
  69. package/dist/chunks/{schema-4RRRUUOO.js → schema-3LX3V2HE.js} +11 -12
  70. package/dist/chunks/{tags-MLX3AHHK.js → tags-CQ4FRIJ4.js} +5 -7
  71. package/dist/chunks/{types-2TPA6J4G.js → types-QKLIFDDP.js} +5 -5
  72. package/dist/chunks/{update-YXH7WWTN.js → update-U7OGHCP5.js} +9 -12
  73. package/dist/commands/build/index.js +26 -31
  74. package/dist/commands/deploy/index.js +57 -75
  75. package/dist/commands/dev/index.js +193 -159
  76. package/dist/commands/env/index.js +70 -47
  77. package/dist/commands/link/index.js +25 -29
  78. package/dist/commands/list/index.js +13 -17
  79. package/dist/commands-bulk.js +637 -620
  80. package/dist/index.js +23 -25
  81. package/dist/version.mjs +1 -1
  82. package/package.json +20 -20
  83. package/dist/chunks/chunk-DWU7JOO6.js +0 -158
  84. package/dist/chunks/chunk-IC4YEIGW.js +0 -101
  85. package/dist/chunks/chunk-IMUF5MGV.js +0 -81
  86. package/dist/chunks/chunk-SGL3NMOP.js +0 -86
@@ -9,35 +9,32 @@ import {
9
9
  handleVcrApiError,
10
10
  resolveVcrScope,
11
11
  validateVcrJsonOutput
12
- } from "./chunk-7TJLLZPN.js";
12
+ } from "./chunk-G4PG5HVE.js";
13
13
  import {
14
14
  outputError
15
15
  } from "./chunk-BUZRVER7.js";
16
16
  import "./chunk-XPKWKPWA.js";
17
17
  import {
18
18
  addSubcommand
19
- } from "./chunk-5OT26JZN.js";
20
- import "./chunk-7C7MMT4J.js";
21
- import "./chunk-RLJA2KI7.js";
22
- import {
23
- AGENT_REASON
24
- } from "./chunk-IC4YEIGW.js";
25
- import "./chunk-DWU7JOO6.js";
26
- import "./chunk-DDEPCAGE.js";
19
+ } from "./chunk-3VS4DTAU.js";
20
+ import "./chunk-GIL3VAUR.js";
21
+ import "./chunk-FYQPTH5C.js";
22
+ import "./chunk-2MXGTALG.js";
27
23
  import {
24
+ AGENT_REASON,
28
25
  buildCommandWithGlobalFlags,
29
26
  outputAgentError
30
- } from "./chunk-CB3I3QIT.js";
27
+ } from "./chunk-UDWRZXIT.js";
31
28
  import "./chunk-ECCWJHC6.js";
32
29
  import {
33
- getFlagsSpecification,
34
30
  parseArguments,
35
31
  printError
36
- } from "./chunk-EHTPDXTS.js";
32
+ } from "./chunk-SZXT3PDQ.js";
37
33
  import {
34
+ getFlagsSpecification,
38
35
  isAPIError,
39
36
  packageName
40
- } from "./chunk-P6AK7SVK.js";
37
+ } from "./chunk-KSSNLCL4.js";
41
38
  import "./chunk-P4QNYOFB.js";
42
39
  import "./chunk-52QYYTM5.js";
43
40
  import {
@@ -9,34 +9,31 @@ import {
9
9
  handleRulesApiError,
10
10
  parseRulesFlagsAndScope,
11
11
  rulesCollectionPath
12
- } from "./chunk-KXVQEPTA.js";
13
- import "./chunk-7OJJKCSW.js";
12
+ } from "./chunk-ICSIFPXG.js";
13
+ import "./chunk-2C2JJTAM.js";
14
14
  import "./chunk-BUZRVER7.js";
15
15
  import {
16
16
  validateJsonOutput
17
17
  } from "./chunk-XPKWKPWA.js";
18
18
  import {
19
19
  rulesAddSubcommand
20
- } from "./chunk-22GUZ5KG.js";
21
- import {
22
- AGENT_REASON
23
- } from "./chunk-IC4YEIGW.js";
24
- import "./chunk-DWU7JOO6.js";
25
- import "./chunk-DDEPCAGE.js";
20
+ } from "./chunk-STJJ3DFO.js";
21
+ import "./chunk-2MXGTALG.js";
26
22
  import {
23
+ AGENT_REASON,
27
24
  buildCommandWithGlobalFlags,
28
25
  outputAgentError
29
- } from "./chunk-CB3I3QIT.js";
26
+ } from "./chunk-UDWRZXIT.js";
30
27
  import "./chunk-ECCWJHC6.js";
31
28
  import {
32
- getFlagsSpecification,
33
29
  parseArguments,
34
30
  printError
35
- } from "./chunk-EHTPDXTS.js";
31
+ } from "./chunk-SZXT3PDQ.js";
36
32
  import {
33
+ getFlagsSpecification,
37
34
  isAPIError,
38
35
  packageName
39
- } from "./chunk-P6AK7SVK.js";
36
+ } from "./chunk-KSSNLCL4.js";
40
37
  import "./chunk-P4QNYOFB.js";
41
38
  import "./chunk-52QYYTM5.js";
42
39
  import {
@@ -5,26 +5,25 @@ const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
- AGENT_REASON,
9
- AGENT_STATUS
10
- } from "./chunk-IC4YEIGW.js";
11
- import {
12
- getLinkedProject
13
- } from "./chunk-DDEPCAGE.js";
8
+ resolveProjectContext
9
+ } from "./chunk-2MXGTALG.js";
14
10
  import {
11
+ AGENT_REASON,
12
+ AGENT_STATUS,
15
13
  buildCommandWithYes,
16
- outputAgentError
17
- } from "./chunk-CB3I3QIT.js";
14
+ outputAgentError,
15
+ withGlobalFlags
16
+ } from "./chunk-UDWRZXIT.js";
18
17
  import {
19
- getFlagsSpecification,
20
- getGlobalFlagsOnlyFromArgs,
21
18
  parseArguments,
22
19
  printError
23
- } from "./chunk-EHTPDXTS.js";
20
+ } from "./chunk-SZXT3PDQ.js";
24
21
  import {
25
22
  getCommandName,
26
- getCommandNamePlain
27
- } from "./chunk-P6AK7SVK.js";
23
+ getCommandNamePlain,
24
+ getFlagsSpecification,
25
+ getGlobalFlagsFromArgs
26
+ } from "./chunk-KSSNLCL4.js";
28
27
  import {
29
28
  output_manager_default
30
29
  } from "./chunk-OX7KI3LF.js";
@@ -35,6 +34,73 @@ import {
35
34
  __toESM
36
35
  } from "./chunk-TZ2YI2VH.js";
37
36
 
37
+ // src/util/projects/require-project-context.ts
38
+ async function requireProjectContext(client, command, projectName) {
39
+ const link = await resolveProjectContext({
40
+ client,
41
+ projectNameOrId: projectName
42
+ });
43
+ if (link.status === "error") {
44
+ return link.exitCode;
45
+ } else if (link.status === "not_linked") {
46
+ if (client.nonInteractive) {
47
+ if (command === "redirects") {
48
+ const linkCmd = getCommandNamePlain("link");
49
+ outputAgentError(
50
+ client,
51
+ {
52
+ status: AGENT_STATUS.ERROR,
53
+ reason: AGENT_REASON.NOT_LINKED,
54
+ message: `Your codebase isn't linked to a project on Vercel. Run ${linkCmd} to begin.`,
55
+ next: [{ command: linkCmd }]
56
+ },
57
+ 1
58
+ );
59
+ } else {
60
+ const flags = getGlobalFlagsFromArgs(client.argv.slice(2));
61
+ const cmd = getCommandNamePlain(`link ${flags.join(" ")}`.trim());
62
+ outputAgentError(
63
+ client,
64
+ {
65
+ status: AGENT_STATUS.ERROR,
66
+ reason: AGENT_REASON.NOT_LINKED,
67
+ userActionRequired: true,
68
+ message: `Your codebase is not linked to a Vercel project. Run link first, then retry ${command} commands.`,
69
+ next: [
70
+ {
71
+ command: cmd,
72
+ when: "to link this directory to a project"
73
+ }
74
+ ]
75
+ },
76
+ 1
77
+ );
78
+ return 1;
79
+ }
80
+ }
81
+ output_manager_default.error(
82
+ `Your codebase isn't linked to a project on Vercel. Run ${getCommandName("link")} to begin.`
83
+ );
84
+ return 1;
85
+ }
86
+ client.config.currentTeam = link.org.type === "team" ? link.org.id : void 0;
87
+ return link;
88
+ }
89
+
90
+ // src/util/command-arguments.ts
91
+ function parseSubcommandArguments(argv, command) {
92
+ const flagsSpecification = getFlagsSpecification(command.options);
93
+ return parseArguments(argv, flagsSpecification);
94
+ }
95
+ function validateRequiredArguments(args, required) {
96
+ for (let i = 0; i < required.length; i++) {
97
+ if (!args[i]) {
98
+ return `Missing required argument: ${required[i]}`;
99
+ }
100
+ }
101
+ return null;
102
+ }
103
+
38
104
  // src/util/routes/types.ts
39
105
  var ROUTE_TYPE_LABELS = {
40
106
  rewrite: "Rewrite",
@@ -62,9 +128,10 @@ function isTargetTransform(transform) {
62
128
 
63
129
  // src/commands/routes/shared.ts
64
130
  var import_chalk = __toESM(require_source(), 1);
65
- function withGlobalFlags(client, commandTemplate) {
66
- const flags = getGlobalFlagsOnlyFromArgs(client.argv.slice(2));
67
- return getCommandNamePlain(`${commandTemplate} ${flags.join(" ")}`.trim());
131
+ function withGlobalFlags2(client, commandTemplate) {
132
+ return withGlobalFlags(client, commandTemplate, {
133
+ preserveProject: true
134
+ });
68
135
  }
69
136
  function shellQuoteRouteIdentifierForSuggestion(identifier) {
70
137
  if (!identifier.includes(" ")) {
@@ -80,13 +147,14 @@ function shellQuoteRouteIdentifierForSuggestion(identifier) {
80
147
  }
81
148
  async function parseSubcommandArgs(argv, command, client) {
82
149
  let parsedArgs;
83
- const flagsSpecification = getFlagsSpecification(command.options);
84
150
  try {
85
- parsedArgs = parseArguments(argv, flagsSpecification);
151
+ parsedArgs = parseSubcommandArguments(argv, command);
86
152
  } catch (err) {
87
153
  if (client?.nonInteractive) {
88
154
  const rawMessage = err instanceof Error ? err.message : String(err);
89
- const flags = getGlobalFlagsOnlyFromArgs(client.argv.slice(2));
155
+ const flags = getGlobalFlagsFromArgs(client.argv.slice(2), {
156
+ preserveProject: true
157
+ });
90
158
  let message = rawMessage;
91
159
  let next = [
92
160
  {
@@ -105,7 +173,7 @@ async function parseSubcommandArgs(argv, command, client) {
105
173
  message = command.name === "add" ? '--ai requires a description. Example: routes add --ai <description> --yes --non-interactive. Replace <description> with your text; use shell quotes if it contains spaces (e.g. --ai "Redirect /old to /new").' : "--ai requires a description. Example: routes edit <name-or-id> --ai <description> --yes --non-interactive. Replace placeholders; use shell quotes for <description> if it contains spaces.";
106
174
  next = [
107
175
  {
108
- command: withGlobalFlags(
176
+ command: withGlobalFlags2(
109
177
  client,
110
178
  command.name === "add" ? `routes add --ai <description> --yes` : `routes edit <name-or-id> --ai <description> --yes`
111
179
  ),
@@ -136,40 +204,6 @@ async function parseSubcommandArgs(argv, command, client) {
136
204
  }
137
205
  return parsedArgs;
138
206
  }
139
- async function ensureProjectLink(client) {
140
- const link = await getLinkedProject(client);
141
- if (link.status === "error") {
142
- return link.exitCode;
143
- } else if (link.status === "not_linked") {
144
- if (client.nonInteractive) {
145
- const flags = getGlobalFlagsOnlyFromArgs(client.argv.slice(2));
146
- const cmd = getCommandNamePlain(`link ${flags.join(" ")}`.trim());
147
- outputAgentError(
148
- client,
149
- {
150
- status: AGENT_STATUS.ERROR,
151
- reason: AGENT_REASON.NOT_LINKED,
152
- userActionRequired: true,
153
- message: "Your codebase is not linked to a Vercel project. Run link first, then retry routes commands.",
154
- next: [
155
- {
156
- command: cmd,
157
- when: "to link this directory to a project"
158
- }
159
- ]
160
- },
161
- 1
162
- );
163
- return 1;
164
- }
165
- output_manager_default.error(
166
- `Your codebase isn't linked to a project on Vercel. Run ${getCommandName("link")} to begin.`
167
- );
168
- return 1;
169
- }
170
- client.config.currentTeam = link.org.type === "team" ? link.org.id : void 0;
171
- return link;
172
- }
173
207
  async function confirmAction(client, skipConfirmation, message, details) {
174
208
  if (skipConfirmation)
175
209
  return true;
@@ -194,14 +228,6 @@ async function confirmAction(client, skipConfirmation, message, details) {
194
228
  }
195
229
  return await client.input.confirm(message, false);
196
230
  }
197
- function validateRequiredArgs(args, required) {
198
- for (let i = 0; i < required.length; i++) {
199
- if (!args[i]) {
200
- return `Missing required argument: ${required[i]}`;
201
- }
202
- }
203
- return null;
204
- }
205
231
  function formatCondition(condition) {
206
232
  const parts = [import_chalk.default.gray(`[${condition.type}]`)];
207
233
  if (condition.key) {
@@ -269,7 +295,7 @@ async function offerAutoPromote(client, projectId, version, hadExistingStagingVe
269
295
  const { default: stamp } = await import("./stamp-AA7R3MZS.js");
270
296
  output_manager_default.print(
271
297
  `
272
- ${import_chalk.default.gray(`This change is staged. Run ${import_chalk.default.cyan(getCommandName("routes publish"))} to make it live, or ${import_chalk.default.cyan(getCommandName("routes discard-staging"))} to undo.`)}
298
+ ${import_chalk.default.gray(`This change is staged. Run ${import_chalk.default.cyan(withGlobalFlags2(client, "routes publish"))} to make it live, or ${import_chalk.default.cyan(withGlobalFlags2(client, "routes discard-staging"))} to undo.`)}
273
299
  `
274
300
  );
275
301
  if (!hadExistingStagingVersion && !opts.skipPrompts) {
@@ -297,7 +323,7 @@ async function offerAutoPromote(client, projectId, version, hadExistingStagingVe
297
323
  }
298
324
  } else if (hadExistingStagingVersion) {
299
325
  output_manager_default.warn(
300
- `There are other staged changes. Review with ${import_chalk.default.cyan(getCommandName("routes list --diff"))} before promoting.`
326
+ `There are other staged changes. Review with ${import_chalk.default.cyan(withGlobalFlags2(client, "routes list --diff"))} before promoting.`
301
327
  );
302
328
  }
303
329
  }
@@ -364,7 +390,7 @@ async function resolveRoute(client, routes, identifier) {
364
390
  message: `Multiple routes match "${identifier}" (${matches.length} matches). Pass an exact route name or ID.`,
365
391
  next: [
366
392
  {
367
- command: withGlobalFlags(client, "routes list"),
393
+ command: withGlobalFlags2(client, "routes list"),
368
394
  when: "list routes to get exact id"
369
395
  }
370
396
  ]
@@ -396,7 +422,7 @@ async function resolveRoutes(client, routes, identifiers) {
396
422
  message: `No route found matching "${identifier}".`,
397
423
  next: [
398
424
  {
399
- command: withGlobalFlags(client, "routes list"),
425
+ command: withGlobalFlags2(client, "routes list"),
400
426
  when: "list routes"
401
427
  }
402
428
  ]
@@ -406,9 +432,7 @@ async function resolveRoutes(client, routes, identifiers) {
406
432
  return null;
407
433
  }
408
434
  output_manager_default.error(
409
- `No route found matching "${identifier}". Run ${import_chalk.default.cyan(
410
- getCommandName("routes list")
411
- )} to see all routes.`
435
+ `No route found matching "${identifier}". Run ${import_chalk.default.cyan(withGlobalFlags2(client, "routes list"))} to see all routes.`
412
436
  );
413
437
  return null;
414
438
  }
@@ -416,12 +440,12 @@ async function resolveRoutes(client, routes, identifiers) {
416
440
  }
417
441
  return Array.from(resolved.values());
418
442
  }
419
- function findVersionById(versions, identifier) {
443
+ function findVersionById(client, versions, identifier) {
420
444
  const matchingVersions = versions.filter((v) => v.id.startsWith(identifier));
421
445
  if (matchingVersions.length === 0) {
422
446
  return {
423
447
  error: `Version "${identifier}" not found. Run ${import_chalk.default.cyan(
424
- getCommandName("routes list-versions")
448
+ withGlobalFlags2(client, "routes list-versions")
425
449
  )} to see available versions.`
426
450
  };
427
451
  }
@@ -455,15 +479,16 @@ async function getRoutes(client, projectId, options = {}) {
455
479
  }
456
480
 
457
481
  export {
482
+ requireProjectContext,
483
+ parseSubcommandArguments,
484
+ validateRequiredArguments,
458
485
  getRouteTypeLabel,
459
486
  getSrcSyntaxLabel,
460
487
  isTargetTransform,
461
- withGlobalFlags,
488
+ withGlobalFlags2 as withGlobalFlags,
462
489
  shellQuoteRouteIdentifierForSuggestion,
463
490
  parseSubcommandArgs,
464
- ensureProjectLink,
465
491
  confirmAction,
466
- validateRequiredArgs,
467
492
  formatCondition,
468
493
  TRANSFORM_TYPE_LABELS,
469
494
  formatTransform,
@@ -7,24 +7,20 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  outputError
9
9
  } from "./chunk-BUZRVER7.js";
10
- import {
11
- AGENT_REASON
12
- } from "./chunk-IC4YEIGW.js";
13
- import {
14
- getScope
15
- } from "./chunk-DWU7JOO6.js";
16
10
  import {
17
11
  getLinkedProject,
18
- getProjectByNameOrId
19
- } from "./chunk-DDEPCAGE.js";
12
+ getProjectByNameOrId,
13
+ getScope
14
+ } from "./chunk-2MXGTALG.js";
20
15
  import {
16
+ AGENT_REASON,
21
17
  buildCommandWithGlobalFlags,
22
18
  outputAgentError
23
- } from "./chunk-CB3I3QIT.js";
19
+ } from "./chunk-UDWRZXIT.js";
24
20
  import {
25
21
  ProjectNotFound,
26
22
  isAPIError
27
- } from "./chunk-P6AK7SVK.js";
23
+ } from "./chunk-KSSNLCL4.js";
28
24
 
29
25
  // src/commands/alerts/resolve-alerts-scope.ts
30
26
  function emitAlertsScopeError(client, jsonOutput, code, message, agent) {