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
@@ -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",
@@ -4,18 +4,6 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import {
8
- printProjectNotFoundError
9
- } from "./chunk-IMUF5MGV.js";
10
- import {
11
- detectExplicitScope
12
- } from "./chunk-DWU7JOO6.js";
13
- import {
14
- getLinkedProject
15
- } from "./chunk-DDEPCAGE.js";
16
- import {
17
- omitGlobalFlagsFromArgs
18
- } from "./chunk-CB3I3QIT.js";
19
7
  import {
20
8
  require_dist
21
9
  } from "./chunk-OX7KI3LF.js";
@@ -311,48 +299,11 @@ function ellipsis(str, length) {
311
299
  return str.length > length ? `${str.slice(0, length - 1)}\u2026` : str;
312
300
  }
313
301
 
314
- // src/util/projects/resolve-project-context.ts
315
- function getInvokingCommandFromArgv(argv) {
316
- const args = omitGlobalFlagsFromArgs(argv.slice(2));
317
- const positionals = [];
318
- for (const arg of args) {
319
- if (arg.startsWith("-")) {
320
- break;
321
- }
322
- positionals.push(arg);
323
- }
324
- return positionals.join(" ");
325
- }
326
- async function resolveProjectContext({
327
- client,
328
- cwd = client.cwd,
329
- projectNameOrId,
330
- commandName = ""
331
- }) {
332
- const context = await getLinkedProject(client, {
333
- cwd,
334
- projectName: projectNameOrId,
335
- projectNameIsExplicit: Boolean(projectNameOrId),
336
- scopeIsExplicit: detectExplicitScope(client)
337
- });
338
- if (context.status === "not_linked" && projectNameOrId) {
339
- await printProjectNotFoundError(
340
- client,
341
- projectNameOrId,
342
- commandName || getInvokingCommandFromArgv(client.argv),
343
- context.orgId
344
- );
345
- return { status: "error", exitCode: 1, orgId: context.orgId };
346
- }
347
- return context;
348
- }
349
-
350
302
  export {
351
303
  readStandardInput,
352
304
  CHECKBOX_INSTRUCTIONS,
353
305
  getCustomEnvironments,
354
306
  pickCustomEnvironment,
355
307
  ellipsis,
356
- resolveProjectContext,
357
308
  require_dist2 as require_dist
358
309
  };
@@ -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-DDEPCAGE.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,11 +11,11 @@ import {
11
11
  findSourceVercelConfigFile,
12
12
  getVercelConfigPath,
13
13
  normalizeConfig
14
- } from "./chunk-DDEPCAGE.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
20
  import "./chunk-52QYYTM5.js";
21
21
  import "./chunk-OX7KI3LF.js";
@@ -8,34 +8,30 @@ 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-75PKWYOS.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-DDEPCAGE.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
36
  import "./chunk-52QYYTM5.js";
41
37
  import {
@@ -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
  }
@@ -11,30 +11,27 @@ import {
11
11
  getRouteVersions
12
12
  } from "./chunk-AHU7WNL2.js";
13
13
  import {
14
- ensureProjectLink,
15
14
  getRoutes,
16
15
  offerAutoPromote,
17
16
  parseSubcommandArgs,
17
+ requireProjectContext,
18
18
  resolveRoute,
19
19
  withGlobalFlags
20
- } from "./chunk-75PKWYOS.js";
20
+ } from "./chunk-22G26AIX.js";
21
21
  import {
22
22
  disableSubcommand
23
- } from "./chunk-DREO3DFB.js";
23
+ } from "./chunk-VZSZBD4V.js";
24
24
  import {
25
25
  stamp_default
26
26
  } from "./chunk-64IF634X.js";
27
27
  import "./chunk-VXYGCOKL.js";
28
- import "./chunk-IC4YEIGW.js";
29
- import "./chunk-DDEPCAGE.js";
28
+ import "./chunk-2MXGTALG.js";
30
29
  import {
31
30
  outputAgentError
32
- } from "./chunk-CB3I3QIT.js";
31
+ } from "./chunk-UDWRZXIT.js";
33
32
  import "./chunk-ECCWJHC6.js";
34
- import "./chunk-EHTPDXTS.js";
35
- import {
36
- getCommandName
37
- } from "./chunk-P6AK7SVK.js";
33
+ import "./chunk-SZXT3PDQ.js";
34
+ import "./chunk-KSSNLCL4.js";
38
35
  import "./chunk-P4QNYOFB.js";
39
36
  import "./chunk-52QYYTM5.js";
40
37
  import {
@@ -54,7 +51,11 @@ async function disable(client, argv) {
54
51
  const parsed = await parseSubcommandArgs(argv, disableSubcommand, client);
55
52
  if (typeof parsed === "number")
56
53
  return parsed;
57
- const link = await ensureProjectLink(client);
54
+ const link = await requireProjectContext(
55
+ client,
56
+ "routes",
57
+ parsed.flags["--project"]
58
+ );
58
59
  if (typeof link === "number")
59
60
  return link;
60
61
  const { project, org } = link;
@@ -84,7 +85,7 @@ async function disable(client, argv) {
84
85
  );
85
86
  }
86
87
  output_manager_default.error(
87
- `Route name or ID is required. Usage: ${getCommandName("routes disable <name-or-id>")}`
88
+ `Route name or ID is required. Usage: ${withGlobalFlags(client, "routes disable <name-or-id>")}`
88
89
  );
89
90
  return 1;
90
91
  }
@@ -129,7 +130,7 @@ async function disable(client, argv) {
129
130
  }
130
131
  output_manager_default.error(
131
132
  `No route found matching "${identifier}". Run ${import_chalk.default.cyan(
132
- getCommandName("routes list")
133
+ withGlobalFlags(client, "routes list")
133
134
  )} to see all routes.`
134
135
  );
135
136
  return 1;
@@ -12,29 +12,26 @@ import {
12
12
  } from "./chunk-AHU7WNL2.js";
13
13
  import {
14
14
  confirmAction,
15
- ensureProjectLink,
16
15
  getRoutes,
17
16
  parseSubcommandArgs,
18
17
  printDiffSummary,
18
+ requireProjectContext,
19
19
  withGlobalFlags
20
- } from "./chunk-75PKWYOS.js";
20
+ } from "./chunk-22G26AIX.js";
21
21
  import {
22
22
  discardSubcommand
23
- } from "./chunk-DREO3DFB.js";
23
+ } from "./chunk-VZSZBD4V.js";
24
24
  import {
25
25
  stamp_default
26
26
  } from "./chunk-64IF634X.js";
27
27
  import "./chunk-VXYGCOKL.js";
28
- import "./chunk-IC4YEIGW.js";
29
- import "./chunk-DDEPCAGE.js";
28
+ import "./chunk-2MXGTALG.js";
30
29
  import {
31
30
  outputAgentError
32
- } from "./chunk-CB3I3QIT.js";
31
+ } from "./chunk-UDWRZXIT.js";
33
32
  import "./chunk-ECCWJHC6.js";
34
- import "./chunk-EHTPDXTS.js";
35
- import {
36
- getCommandName
37
- } from "./chunk-P6AK7SVK.js";
33
+ import "./chunk-SZXT3PDQ.js";
34
+ import "./chunk-KSSNLCL4.js";
38
35
  import "./chunk-P4QNYOFB.js";
39
36
  import "./chunk-52QYYTM5.js";
40
37
  import {
@@ -54,7 +51,11 @@ async function discard(client, argv) {
54
51
  const parsed = await parseSubcommandArgs(argv, discardSubcommand, client);
55
52
  if (typeof parsed === "number")
56
53
  return parsed;
57
- const link = await ensureProjectLink(client);
54
+ const link = await requireProjectContext(
55
+ client,
56
+ "routes",
57
+ parsed.flags["--project"]
58
+ );
58
59
  if (typeof link === "number")
59
60
  return link;
60
61
  const { project, org } = link;
@@ -65,7 +66,7 @@ async function discard(client, argv) {
65
66
  if (!stagingVersion) {
66
67
  output_manager_default.warn(
67
68
  `No staged changes to discard. Make changes first with ${import_chalk.default.cyan(
68
- getCommandName("routes add")
69
+ withGlobalFlags(client, "routes add")
69
70
  )}.`
70
71
  );
71
72
  return 0;
@@ -19,36 +19,33 @@ import {
19
19
  printRouteConfig,
20
20
  routingRuleToCurrentRoute,
21
21
  runInteractiveEditLoop
22
- } from "./chunk-5HNYJHOB.js";
22
+ } from "./chunk-SDK7R4WO.js";
23
23
  import {
24
24
  getRouteVersions
25
25
  } from "./chunk-AHU7WNL2.js";
26
26
  import {
27
- ensureProjectLink,
28
27
  getRoutes,
29
28
  offerAutoPromote,
30
29
  parseSubcommandArgs,
30
+ requireProjectContext,
31
31
  resolveRoute,
32
32
  shellQuoteRouteIdentifierForSuggestion,
33
33
  withGlobalFlags
34
- } from "./chunk-75PKWYOS.js";
34
+ } from "./chunk-22G26AIX.js";
35
35
  import {
36
36
  editSubcommand
37
- } from "./chunk-DREO3DFB.js";
37
+ } from "./chunk-VZSZBD4V.js";
38
38
  import {
39
39
  stamp_default
40
40
  } from "./chunk-64IF634X.js";
41
41
  import "./chunk-VXYGCOKL.js";
42
- import "./chunk-IC4YEIGW.js";
43
- import "./chunk-DDEPCAGE.js";
42
+ import "./chunk-2MXGTALG.js";
44
43
  import {
45
44
  outputAgentError
46
- } from "./chunk-CB3I3QIT.js";
45
+ } from "./chunk-UDWRZXIT.js";
47
46
  import "./chunk-ECCWJHC6.js";
48
- import "./chunk-EHTPDXTS.js";
49
- import {
50
- getCommandName
51
- } from "./chunk-P6AK7SVK.js";
47
+ import "./chunk-SZXT3PDQ.js";
48
+ import "./chunk-KSSNLCL4.js";
52
49
  import "./chunk-P4QNYOFB.js";
53
50
  import "./chunk-52QYYTM5.js";
54
51
  import {
@@ -68,7 +65,11 @@ async function edit(client, argv) {
68
65
  const parsed = await parseSubcommandArgs(argv, editSubcommand, client);
69
66
  if (typeof parsed === "number")
70
67
  return parsed;
71
- const link = await ensureProjectLink(client);
68
+ const link = await requireProjectContext(
69
+ client,
70
+ "routes",
71
+ parsed.flags["--project"]
72
+ );
72
73
  if (typeof link === "number")
73
74
  return link;
74
75
  const { project, org } = link;
@@ -157,7 +158,7 @@ async function edit(client, argv) {
157
158
  );
158
159
  }
159
160
  output_manager_default.error(
160
- `Route name or ID is required. Usage: ${getCommandName("routes edit <name-or-id>")}`
161
+ `Route name or ID is required. Usage: ${withGlobalFlags(client, "routes edit <name-or-id>")}`
161
162
  );
162
163
  return 1;
163
164
  }
@@ -214,9 +215,7 @@ async function edit(client, argv) {
214
215
  );
215
216
  }
216
217
  output_manager_default.error(
217
- `No route found matching "${identifier}". Run ${import_chalk.default.cyan(
218
- getCommandName("routes list")
219
- )} to see all routes.`
218
+ `No route found matching "${identifier}". Run ${import_chalk.default.cyan(withGlobalFlags(client, "routes list"))} to see all routes.`
220
219
  );
221
220
  return 1;
222
221
  }
@@ -336,7 +335,7 @@ async function edit(client, argv) {
336
335
  );
337
336
  }
338
337
  output_manager_default.error(
339
- `No edit flags provided. When running non-interactively, use flags like --name, --dest, --src, etc. Run ${getCommandName("routes edit --help")} for all options.`
338
+ `No edit flags provided. When running non-interactively, use flags like --name, --dest, --src, etc. Run ${withGlobalFlags(client, "routes edit --help")} for all options.`
340
339
  );
341
340
  return 1;
342
341
  }
@@ -475,7 +474,7 @@ async function handleAIEdit(client, projectId, teamId, originalRoute, aiPrompt,
475
474
  }
476
475
  if (!client.stdin.isTTY) {
477
476
  output_manager_default.error(
478
- `Cannot interactively confirm route changes in a non-TTY environment. Use ${getCommandName('routes edit <name-or-id> --ai "..." --yes')} to skip confirmation.`
477
+ `Cannot interactively confirm route changes in a non-TTY environment. Use ${withGlobalFlags(client, 'routes edit <name-or-id> --ai "..." --yes')} to skip confirmation.`
479
478
  );
480
479
  return 1;
481
480
  }
@@ -11,30 +11,27 @@ import {
11
11
  getRouteVersions
12
12
  } from "./chunk-AHU7WNL2.js";
13
13
  import {
14
- ensureProjectLink,
15
14
  getRoutes,
16
15
  offerAutoPromote,
17
16
  parseSubcommandArgs,
17
+ requireProjectContext,
18
18
  resolveRoute,
19
19
  withGlobalFlags
20
- } from "./chunk-75PKWYOS.js";
20
+ } from "./chunk-22G26AIX.js";
21
21
  import {
22
22
  enableSubcommand
23
- } from "./chunk-DREO3DFB.js";
23
+ } from "./chunk-VZSZBD4V.js";
24
24
  import {
25
25
  stamp_default
26
26
  } from "./chunk-64IF634X.js";
27
27
  import "./chunk-VXYGCOKL.js";
28
- import "./chunk-IC4YEIGW.js";
29
- import "./chunk-DDEPCAGE.js";
28
+ import "./chunk-2MXGTALG.js";
30
29
  import {
31
30
  outputAgentError
32
- } from "./chunk-CB3I3QIT.js";
31
+ } from "./chunk-UDWRZXIT.js";
33
32
  import "./chunk-ECCWJHC6.js";
34
- import "./chunk-EHTPDXTS.js";
35
- import {
36
- getCommandName
37
- } from "./chunk-P6AK7SVK.js";
33
+ import "./chunk-SZXT3PDQ.js";
34
+ import "./chunk-KSSNLCL4.js";
38
35
  import "./chunk-P4QNYOFB.js";
39
36
  import "./chunk-52QYYTM5.js";
40
37
  import {
@@ -54,7 +51,11 @@ async function enable(client, argv) {
54
51
  const parsed = await parseSubcommandArgs(argv, enableSubcommand, client);
55
52
  if (typeof parsed === "number")
56
53
  return parsed;
57
- const link = await ensureProjectLink(client);
54
+ const link = await requireProjectContext(
55
+ client,
56
+ "routes",
57
+ parsed.flags["--project"]
58
+ );
58
59
  if (typeof link === "number")
59
60
  return link;
60
61
  const { project, org } = link;
@@ -84,7 +85,7 @@ async function enable(client, argv) {
84
85
  );
85
86
  }
86
87
  output_manager_default.error(
87
- `Route name or ID is required. Usage: ${getCommandName("routes enable <name-or-id>")}`
88
+ `Route name or ID is required. Usage: ${withGlobalFlags(client, "routes enable <name-or-id>")}`
88
89
  );
89
90
  return 1;
90
91
  }
@@ -135,7 +136,7 @@ async function enable(client, argv) {
135
136
  }
136
137
  output_manager_default.error(
137
138
  `No route found matching "${identifier}". Run ${import_chalk.default.cyan(
138
- getCommandName("routes list")
139
+ withGlobalFlags(client, "routes list")
139
140
  )} to see all routes.`
140
141
  );
141
142
  return 1;
@@ -5,24 +5,21 @@ const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
- ensureProjectLink,
9
8
  getRoutes,
10
9
  parseSubcommandArgs,
10
+ requireProjectContext,
11
11
  withGlobalFlags
12
- } from "./chunk-75PKWYOS.js";
12
+ } from "./chunk-22G26AIX.js";
13
13
  import {
14
14
  exportSubcommand
15
- } from "./chunk-DREO3DFB.js";
16
- import "./chunk-IC4YEIGW.js";
17
- import "./chunk-DDEPCAGE.js";
15
+ } from "./chunk-VZSZBD4V.js";
16
+ import "./chunk-2MXGTALG.js";
18
17
  import {
19
18
  outputAgentError
20
- } from "./chunk-CB3I3QIT.js";
19
+ } from "./chunk-UDWRZXIT.js";
21
20
  import "./chunk-ECCWJHC6.js";
22
- import "./chunk-EHTPDXTS.js";
23
- import {
24
- getCommandName
25
- } from "./chunk-P6AK7SVK.js";
21
+ import "./chunk-SZXT3PDQ.js";
22
+ import "./chunk-KSSNLCL4.js";
26
23
  import "./chunk-P4QNYOFB.js";
27
24
  import "./chunk-52QYYTM5.js";
28
25
  import {
@@ -78,7 +75,11 @@ async function exportRoutes(client, argv) {
78
75
  const parsed = await parseSubcommandArgs(argv, exportSubcommand, client);
79
76
  if (typeof parsed === "number")
80
77
  return parsed;
81
- const link = await ensureProjectLink(client);
78
+ const link = await requireProjectContext(
79
+ client,
80
+ "routes",
81
+ parsed.flags["--project"]
82
+ );
82
83
  if (typeof link === "number")
83
84
  return link;
84
85
  const { project, org } = link;
@@ -89,7 +90,7 @@ async function exportRoutes(client, argv) {
89
90
  const nameOrId = args[0];
90
91
  const validFormats = ["json", "ts"];
91
92
  if (!validFormats.includes(format)) {
92
- const msg = `Invalid output format: "${rawFormat}". Valid formats: ${validFormats.join(", ")}. Usage: ${getCommandName("routes export --output json")}`;
93
+ const msg = `Invalid output format: "${rawFormat}". Valid formats: ${validFormats.join(", ")}. Usage: ${withGlobalFlags(client, "routes export --output json")}`;
93
94
  if (client.nonInteractive) {
94
95
  outputAgentError(client, {
95
96
  status: "error",
@@ -111,7 +112,7 @@ async function exportRoutes(client, argv) {
111
112
  const { routes } = await getRoutes(client, project.id, { teamId });
112
113
  if (routes.length === 0) {
113
114
  output_manager_default.log(
114
- `No routes found. Create one with ${getCommandName("routes add")}.`
115
+ `No routes found. Create one with ${withGlobalFlags(client, "routes add")}.`
115
116
  );
116
117
  return 0;
117
118
  }
@@ -122,7 +123,7 @@ async function exportRoutes(client, argv) {
122
123
  (r) => r.name.toLowerCase() === query || r.name.toLowerCase().includes(query) || r.id === nameOrId
123
124
  );
124
125
  if (routesToExport.length === 0) {
125
- const msg = `No route found matching "${nameOrId}". Run ${getCommandName("routes list")} to see all routes.`;
126
+ const msg = `No route found matching "${nameOrId}". Run ${withGlobalFlags(client, "routes list")} to see all routes.`;
126
127
  if (client.nonInteractive) {
127
128
  outputAgentError(client, {
128
129
  status: "error",