vercel 54.21.1 → 56.0.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 (74) hide show
  1. package/dist/chunks/{add-UMB55BRR.js → add-MD247HM7.js} +6 -6
  2. package/dist/chunks/{add-NKDLTZ3B.js → add-YN76XNHI.js} +6 -6
  3. package/dist/chunks/{chunk-MLY3KGVY.js → chunk-2BZVY6SF.js} +4 -4
  4. package/dist/chunks/{chunk-TLKTTWDA.js → chunk-36OUS2KE.js} +1 -1
  5. package/dist/chunks/{chunk-43I5EAPY.js → chunk-3JOLICSO.js} +1 -1
  6. package/dist/chunks/{chunk-3EMRC44D.js → chunk-5OT26JZN.js} +32 -0
  7. package/dist/chunks/{chunk-TRQJQXKD.js → chunk-75HDPY6N.js} +82 -19
  8. package/dist/chunks/chunk-7PZWVZN6.js +105 -0
  9. package/dist/chunks/{chunk-DKE73NGN.js → chunk-C6E2RJS7.js} +29 -2
  10. package/dist/chunks/{chunk-2QBF3ZL3.js → chunk-CB3I3QIT.js} +3 -4
  11. package/dist/chunks/{chunk-I3HGCZ4E.js → chunk-CMJMYVQM.js} +1 -0
  12. package/dist/chunks/{chunk-IMTOXXTF.js → chunk-DO3V6PZD.js} +6 -4
  13. package/dist/chunks/{chunk-QKR7GNAK.js → chunk-DREO3DFB.js} +6 -6
  14. package/dist/chunks/{chunk-GAJ2ESDD.js → chunk-FN36GZDS.js} +100 -36
  15. package/dist/chunks/{chunk-4UZF3U4N.js → chunk-HA7C7SDO.js} +2 -0
  16. package/dist/chunks/{chunk-QH7WYDEP.js → chunk-IC4YEIGW.js} +7 -0
  17. package/dist/chunks/{chunk-H3KWN2KA.js → chunk-JHZG2MPW.js} +4 -4
  18. package/dist/chunks/{chunk-QMZO4CEP.js → chunk-KODCUW77.js} +353 -403
  19. package/dist/chunks/{chunk-RO5JIUOI.js → chunk-KSJ4FNUG.js} +3 -3
  20. package/dist/chunks/{chunk-KNSDQCVQ.js → chunk-MBH4DFF7.js} +51 -9
  21. package/dist/chunks/{chunk-MV65GD4L.js → chunk-N4VWB5RV.js} +1 -1
  22. package/dist/chunks/{chunk-AUYY7RD3.js → chunk-NZ73KKYG.js} +550 -191
  23. package/dist/chunks/{chunk-ADTCIFMD.js → chunk-ORKY33ZK.js} +69 -16
  24. package/dist/chunks/{chunk-XMJAKLQQ.js → chunk-T7EIXPC5.js} +1 -1
  25. package/dist/chunks/{chunk-I4NRKN2Z.js → chunk-THMFJODG.js} +480 -277
  26. package/dist/chunks/{chunk-2ZXLLEEZ.js → chunk-TNDFVAZV.js} +4 -4
  27. package/dist/chunks/{chunk-OVE2GAHC.js → chunk-VPDJOK2C.js} +3 -3
  28. package/dist/chunks/{chunk-HMFUXSD7.js → chunk-VSD5BID5.js} +1 -1
  29. package/dist/chunks/{chunk-ZZIAWRCX.js → chunk-W346YNDN.js} +18 -0
  30. package/dist/chunks/chunk-WGGABYO5.js +31 -0
  31. package/dist/chunks/{chunk-XCL7I6W5.js → chunk-ZHDXN5V3.js} +3 -3
  32. package/dist/chunks/{compile-vercel-config-OKONVGZI.js → compile-vercel-config-65QWHKPO.js} +2 -2
  33. package/dist/chunks/{delete-L7TN5GNZ.js → delete-NPEJGNTV.js} +5 -5
  34. package/dist/chunks/{disable-7NVU4H2N.js → disable-RH3MH7PH.js} +5 -5
  35. package/dist/chunks/{discard-SJ2TDPS2.js → discard-IJBFO24S.js} +5 -5
  36. package/dist/chunks/{edit-SW4MF4Q3.js → edit-GMLOKGHO.js} +6 -6
  37. package/dist/chunks/{enable-FOKEO6J2.js → enable-QCTL7ISO.js} +5 -5
  38. package/dist/chunks/{exec-UKMIYIF6.js → exec-G4AUF3KG.js} +4 -90
  39. package/dist/chunks/{export-3DSHT2FD.js → export-6ERWU54A.js} +9 -8
  40. package/dist/chunks/{image-T6I7BZSC.js → image-XUMTOUQS.js} +5 -5
  41. package/dist/chunks/{inspect-RV444SBC.js → inspect-7UPFOAJO.js} +5 -5
  42. package/dist/chunks/{inspect-EP24WN4I.js → inspect-F6LEST4Y.js} +10 -10
  43. package/dist/chunks/{inspect-2MY25CMN.js → inspect-OKOUOOWW.js} +10 -10
  44. package/dist/chunks/{inspect-DJ7OGHBK.js → inspect-ZS4U24NA.js} +9 -9
  45. package/dist/chunks/{list-CCG2NVLL.js → list-BTMO3CXU.js} +5 -5
  46. package/dist/chunks/{list-OMJ7EDKA.js → list-ZK7Q3UHB.js} +3 -3
  47. package/dist/chunks/login-POFRYQZ6.js +247 -0
  48. package/dist/chunks/{ls-VXZGEJJD.js → ls-D5Z4IWMU.js} +6 -6
  49. package/dist/chunks/{ls-VCTHIVI7.js → ls-EXRMNZUT.js} +9 -9
  50. package/dist/chunks/{ls-33Z3R2KY.js → ls-JGNNPYUA.js} +9 -9
  51. package/dist/chunks/{ls-5KN5FKAQ.js → ls-Z2TCQW5W.js} +9 -9
  52. package/dist/chunks/{publish-RZ2DIYRU.js → publish-ED2XVYSE.js} +5 -5
  53. package/dist/chunks/{query-2MIBB7C5.js → query-6XMBJTPX.js} +3 -3
  54. package/dist/chunks/{reorder-FEZIPHNW.js → reorder-7B6HZCOZ.js} +5 -5
  55. package/dist/chunks/{restore-JHH6CW2S.js → restore-47ZDRYQT.js} +5 -5
  56. package/dist/chunks/{rm-EKPVQYGH.js → rm-4IY6QGHF.js} +6 -6
  57. package/dist/chunks/{rm-3KAXICHP.js → rm-AA7WYBZ5.js} +5 -5
  58. package/dist/chunks/{rm-ULQHII4K.js → rm-NGTPTPZK.js} +6 -6
  59. package/dist/chunks/{rule-inspect-FOZOCOUO.js → rule-inspect-FNX6P4LZ.js} +6 -6
  60. package/dist/chunks/{rules-RJD4S7JA.js → rules-MMCCBGQJ.js} +10 -10
  61. package/dist/chunks/{schema-CDXFJU72.js → schema-JSK7S7HL.js} +3 -3
  62. package/dist/chunks/{tags-BLBAPEWV.js → tags-KNCSBTIH.js} +4 -4
  63. package/dist/chunks/{update-2NW6NKG6.js → update-JEFLJ3TH.js} +6 -6
  64. package/dist/commands/build/index.js +47 -16
  65. package/dist/commands/deploy/index.js +24 -46
  66. package/dist/commands/dev/index.js +202 -59
  67. package/dist/commands/env/index.js +10 -20
  68. package/dist/commands/link/index.js +33 -16
  69. package/dist/commands/list/index.js +26 -11
  70. package/dist/commands-bulk.js +13722 -10599
  71. package/dist/index.js +14 -24
  72. package/dist/version.mjs +1 -1
  73. package/package.json +24 -23
  74. package/dist/chunks/chunk-Y4JJYHUG.js +0 -16
@@ -9,7 +9,7 @@ import {
9
9
  getPreservedArgsForEnvPull,
10
10
  outputActionRequired,
11
11
  outputAgentError
12
- } from "./chunk-2QBF3ZL3.js";
12
+ } from "./chunk-CB3I3QIT.js";
13
13
  import {
14
14
  TelemetryClient,
15
15
  require_dist as require_dist2,
@@ -8431,14 +8431,14 @@ var require_templates = __commonJS({
8431
8431
  }
8432
8432
  return results;
8433
8433
  }
8434
- function buildStyle(chalk14, styles) {
8434
+ function buildStyle(chalk15, styles) {
8435
8435
  const enabled = {};
8436
8436
  for (const layer of styles) {
8437
8437
  for (const style of layer.styles) {
8438
8438
  enabled[style[0]] = layer.inverse ? null : style.slice(1);
8439
8439
  }
8440
8440
  }
8441
- let current = chalk14;
8441
+ let current = chalk15;
8442
8442
  for (const [styleName, styles2] of Object.entries(enabled)) {
8443
8443
  if (!Array.isArray(styles2)) {
8444
8444
  continue;
@@ -8450,7 +8450,7 @@ var require_templates = __commonJS({
8450
8450
  }
8451
8451
  return current;
8452
8452
  }
8453
- module.exports = (chalk14, temporary) => {
8453
+ module.exports = (chalk15, temporary) => {
8454
8454
  const styles = [];
8455
8455
  const chunks = [];
8456
8456
  let chunk = [];
@@ -8460,13 +8460,13 @@ var require_templates = __commonJS({
8460
8460
  } else if (style) {
8461
8461
  const string = chunk.join("");
8462
8462
  chunk = [];
8463
- chunks.push(styles.length === 0 ? string : buildStyle(chalk14, styles)(string));
8463
+ chunks.push(styles.length === 0 ? string : buildStyle(chalk15, styles)(string));
8464
8464
  styles.push({ inverse, styles: parseStyle(style) });
8465
8465
  } else if (close) {
8466
8466
  if (styles.length === 0) {
8467
8467
  throw new Error("Found extraneous } in Chalk template literal");
8468
8468
  }
8469
- chunks.push(buildStyle(chalk14, styles)(chunk.join("")));
8469
+ chunks.push(buildStyle(chalk15, styles)(chunk.join("")));
8470
8470
  chunk = [];
8471
8471
  styles.pop();
8472
8472
  } else {
@@ -8514,16 +8514,16 @@ var require_source2 = __commonJS({
8514
8514
  }
8515
8515
  };
8516
8516
  var chalkFactory = (options) => {
8517
- const chalk15 = {};
8518
- applyOptions(chalk15, options);
8519
- chalk15.template = (...arguments_) => chalkTag(chalk15.template, ...arguments_);
8520
- Object.setPrototypeOf(chalk15, Chalk.prototype);
8521
- Object.setPrototypeOf(chalk15.template, chalk15);
8522
- chalk15.template.constructor = () => {
8517
+ const chalk16 = {};
8518
+ applyOptions(chalk16, options);
8519
+ chalk16.template = (...arguments_) => chalkTag(chalk16.template, ...arguments_);
8520
+ Object.setPrototypeOf(chalk16, Chalk.prototype);
8521
+ Object.setPrototypeOf(chalk16.template, chalk16);
8522
+ chalk16.template.constructor = () => {
8523
8523
  throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
8524
8524
  };
8525
- chalk15.template.Instance = ChalkClass;
8526
- return chalk15.template;
8525
+ chalk16.template.Instance = ChalkClass;
8526
+ return chalk16.template;
8527
8527
  };
8528
8528
  function Chalk(options) {
8529
8529
  return chalkFactory(options);
@@ -8634,7 +8634,7 @@ var require_source2 = __commonJS({
8634
8634
  return openAll + string + closeAll;
8635
8635
  };
8636
8636
  var template;
8637
- var chalkTag = (chalk15, ...strings) => {
8637
+ var chalkTag = (chalk16, ...strings) => {
8638
8638
  const [firstString] = strings;
8639
8639
  if (!isArray(firstString) || !isArray(firstString.raw)) {
8640
8640
  return strings.join(" ");
@@ -8650,14 +8650,14 @@ var require_source2 = __commonJS({
8650
8650
  if (template === void 0) {
8651
8651
  template = require_templates();
8652
8652
  }
8653
- return template(chalk15, parts.join(""));
8653
+ return template(chalk16, parts.join(""));
8654
8654
  };
8655
8655
  Object.defineProperties(Chalk.prototype, styles);
8656
- var chalk14 = Chalk();
8657
- chalk14.supportsColor = stdoutColor;
8658
- chalk14.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
8659
- chalk14.stderr.supportsColor = stderrColor;
8660
- module.exports = chalk14;
8656
+ var chalk15 = Chalk();
8657
+ chalk15.supportsColor = stdoutColor;
8658
+ chalk15.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
8659
+ chalk15.stderr.supportsColor = stderrColor;
8660
+ module.exports = chalk15;
8661
8661
  }
8662
8662
  });
8663
8663
 
@@ -15702,6 +15702,52 @@ var require_frameworks = __commonJS({
15702
15702
  },
15703
15703
  getOutputDirName: async () => "dist"
15704
15704
  },
15705
+ {
15706
+ name: "TanStack Start",
15707
+ slug: "tanstack-start-lovable",
15708
+ logo: "https://api-frameworks.vercel.sh/framework-logos/tanstack-start.svg",
15709
+ darkModeLogo: "https://api-frameworks.vercel.sh/framework-logos/tanstack-start-dark.svg",
15710
+ platform: {
15711
+ name: "lovable",
15712
+ logo: "https://api-frameworks.vercel.sh/framework-logos/lovable.svg"
15713
+ },
15714
+ tagline: "Full-stack Framework powered by TanStack Router imported from Lovable",
15715
+ description: "Full-document SSR, Streaming, Server Functions, bundling and more, imported from Lovable",
15716
+ website: "https://lovable.dev/",
15717
+ supersedes: ["tanstack-start", "ionic-react", "vite"],
15718
+ detectors: {
15719
+ every: [
15720
+ {
15721
+ matchPackage: "@lovable.dev/vite-tanstack-config"
15722
+ }
15723
+ ],
15724
+ some: [
15725
+ {
15726
+ matchPackage: "@tanstack/react-start"
15727
+ },
15728
+ {
15729
+ matchPackage: "@tanstack/solid-start"
15730
+ }
15731
+ ]
15732
+ },
15733
+ settings: {
15734
+ installCommand: {
15735
+ placeholder: "`yarn install`, `pnpm install`, `npm install`, or `bun install`"
15736
+ },
15737
+ buildCommand: {
15738
+ placeholder: "`npm run build` or `vite build`",
15739
+ value: "vite build"
15740
+ },
15741
+ devCommand: {
15742
+ placeholder: "vite",
15743
+ value: "vite --port $PORT"
15744
+ },
15745
+ outputDirectory: {
15746
+ value: "dist"
15747
+ }
15748
+ },
15749
+ getOutputDirName: async () => "dist"
15750
+ },
15705
15751
  {
15706
15752
  name: "VitePress",
15707
15753
  slug: "vitepress",
@@ -23071,14 +23117,14 @@ var require_utils3 = __commonJS({
23071
23117
  __export2(utils_exports, {
23072
23118
  DETECTION_FRAMEWORKS: () => DETECTION_FRAMEWORKS,
23073
23119
  INTERNAL_QUEUES_PREFIX: () => INTERNAL_QUEUES_PREFIX,
23074
- INTERNAL_SERVICE_PREFIX: () => import_build_utils6.INTERNAL_SERVICE_PREFIX,
23120
+ INTERNAL_SERVICE_PREFIX: () => import_build_utils7.INTERNAL_SERVICE_PREFIX,
23075
23121
  assignMountPaths: () => assignMountPaths,
23076
23122
  combineBuildCommand: () => combineBuildCommand,
23077
23123
  filterFrameworksByRuntime: () => filterFrameworksByRuntime,
23078
23124
  getBuilderForRuntime: () => getBuilderForRuntime,
23079
- getInternalServiceCronPath: () => import_build_utils6.getInternalServiceCronPath,
23080
- getInternalServiceCronPathPrefix: () => import_build_utils6.getInternalServiceCronPathPrefix,
23081
- getInternalServiceFunctionPath: () => import_build_utils6.getInternalServiceFunctionPath,
23125
+ getInternalServiceCronPath: () => import_build_utils7.getInternalServiceCronPath,
23126
+ getInternalServiceCronPathPrefix: () => import_build_utils7.getInternalServiceCronPathPrefix,
23127
+ getInternalServiceFunctionPath: () => import_build_utils7.getInternalServiceFunctionPath,
23082
23128
  getInternalServiceWorkerPath: () => getInternalServiceWorkerPath2,
23083
23129
  getInternalServiceWorkerPathPrefix: () => getInternalServiceWorkerPathPrefix2,
23084
23130
  hasFile: () => hasFile,
@@ -23093,7 +23139,7 @@ var require_utils3 = __commonJS({
23093
23139
  });
23094
23140
  module.exports = __toCommonJS2(utils_exports);
23095
23141
  var import_framework_helpers = __require("@vercel/build-utils/dist/framework-helpers");
23096
- var import_build_utils6 = __require("@vercel/build-utils");
23142
+ var import_build_utils7 = __require("@vercel/build-utils");
23097
23143
  var import_frameworks2 = require_frameworks();
23098
23144
  var import_types = require_types3();
23099
23145
  var DETECTION_FRAMEWORKS = import_frameworks2.frameworkList.filter(
@@ -23116,7 +23162,7 @@ var require_utils3 = __commonJS({
23116
23162
  return normalized || "index";
23117
23163
  }
23118
23164
  function getInternalServiceWorkerPathPrefix2(serviceName) {
23119
- return `${import_build_utils6.INTERNAL_SERVICE_PREFIX}/${serviceName}/workers`;
23165
+ return `${import_build_utils7.INTERNAL_SERVICE_PREFIX}/${serviceName}/workers`;
23120
23166
  }
23121
23167
  function getInternalServiceWorkerPath2(serviceName, entrypoint, handler = "worker") {
23122
23168
  const normalizedEntrypoint = normalizeInternalServiceEntrypoint(entrypoint);
@@ -23190,6 +23236,9 @@ var require_utils3 = __commonJS({
23190
23236
  }
23191
23237
  }
23192
23238
  if (config.entrypoint) {
23239
+ if (config.entrypoint === "pyproject.toml" || config.entrypoint.endsWith("/pyproject.toml")) {
23240
+ return "python";
23241
+ }
23193
23242
  for (const [ext, runtime] of Object.entries(import_types.ENTRYPOINT_EXTENSIONS)) {
23194
23243
  if (config.entrypoint.endsWith(ext)) {
23195
23244
  return runtime;
@@ -23567,7 +23616,7 @@ var require_resolve2 = __commonJS({
23567
23616
  });
23568
23617
  module.exports = __toCommonJS2(resolve_exports);
23569
23618
  var import_path12 = __require("path");
23570
- var import_build_utils6 = __require("@vercel/build-utils");
23619
+ var import_build_utils7 = __require("@vercel/build-utils");
23571
23620
  var import_types = require_types3();
23572
23621
  var import_utils4 = require_utils3();
23573
23622
  var import_frameworks2 = require_frameworks();
@@ -23876,8 +23925,8 @@ var require_resolve2 = __commonJS({
23876
23925
  trigger: effectiveTrigger
23877
23926
  };
23878
23927
  const isJobService = serviceType === "job" || serviceType === "cron";
23879
- const isScheduleJobService = (0, import_build_utils6.isScheduleTriggeredService)(effectiveService);
23880
- const isQueueJobService = serviceType === "job" && (0, import_build_utils6.isQueueTriggeredService)(effectiveService);
23928
+ const isScheduleJobService = (0, import_build_utils7.isScheduleTriggeredService)(effectiveService);
23929
+ const isQueueJobService = serviceType === "job" && (0, import_build_utils7.isQueueTriggeredService)(effectiveService);
23881
23930
  const isWorkflowService = serviceType === "job" && effectiveTrigger === "workflow";
23882
23931
  const isNonWebService = serviceType === "worker" || isJobService;
23883
23932
  const serviceTypeLabel = isJobService ? "Job" : serviceType === "worker" ? "Worker" : "Web";
@@ -23931,10 +23980,10 @@ var require_resolve2 = __commonJS({
23931
23980
  serviceName: name
23932
23981
  };
23933
23982
  }
23934
- if (serviceType === "job" && effectiveTrigger && !import_build_utils6.JOB_TRIGGERS.includes(effectiveTrigger)) {
23983
+ if (serviceType === "job" && effectiveTrigger && !import_build_utils7.JOB_TRIGGERS.includes(effectiveTrigger)) {
23935
23984
  return {
23936
23985
  code: "INVALID_JOB_TRIGGER",
23937
- message: `Job service "${name}" has invalid trigger "${effectiveTrigger}". Expected ${import_build_utils6.JOB_TRIGGERS.map((t) => `"${t}"`).join(", ")}.`,
23986
+ message: `Job service "${name}" has invalid trigger "${effectiveTrigger}". Expected ${import_build_utils7.JOB_TRIGGERS.map((t) => `"${t}"`).join(", ")}.`,
23938
23987
  serviceName: name
23939
23988
  };
23940
23989
  }
@@ -24163,7 +24212,7 @@ var require_resolve2 = __commonJS({
24163
24212
  workspace = workspace === "." ? normalizedRoot : import_path12.posix.join(normalizedRoot, workspace);
24164
24213
  }
24165
24214
  }
24166
- const topics = type === "worker" ? (0, import_build_utils6.getServiceQueueTopics)({ type, topics: config.topics }) : trigger === "queue" ? config.topics : trigger === "workflow" ? ["__wkf_*"] : void 0;
24215
+ const topics = type === "worker" ? (0, import_build_utils7.getServiceQueueTopics)({ type, topics: config.topics }) : trigger === "queue" ? config.topics : trigger === "workflow" ? ["__wkf_*"] : void 0;
24167
24216
  let builderUse;
24168
24217
  let builderSrc;
24169
24218
  const frameworkDefinition = config.framework ? frameworksBySlug.get(config.framework) : void 0;
@@ -24171,7 +24220,7 @@ var require_resolve2 = __commonJS({
24171
24220
  builderUse = config.builder;
24172
24221
  builderSrc = resolvedEntrypointFile || frameworkDefinition?.useRuntime?.src || "package.json";
24173
24222
  } else if (config.framework) {
24174
- const isCronService = (0, import_build_utils6.isScheduleTriggeredService)({ type, trigger });
24223
+ const isCronService = (0, import_build_utils7.isScheduleTriggeredService)({ type, trigger });
24175
24224
  if ((0, import_build_utils22.isNodeBackendFramework)(config.framework) && (type === "web" || isCronService)) {
24176
24225
  builderUse = "@vercel/backends";
24177
24226
  } else {
@@ -24185,7 +24234,7 @@ var require_resolve2 = __commonJS({
24185
24234
  );
24186
24235
  }
24187
24236
  if (inferredRuntime === "node") {
24188
- const isCronService = (0, import_build_utils6.isScheduleTriggeredService)({ type, trigger });
24237
+ const isCronService = (0, import_build_utils7.isScheduleTriggeredService)({ type, trigger });
24189
24238
  builderUse = type === "web" || isCronService ? "@vercel/backends" : "@vercel/node";
24190
24239
  } else {
24191
24240
  builderUse = (0, import_utils4.getBuilderForRuntime)(inferredRuntime);
@@ -24469,7 +24518,7 @@ var require_resolve_v2 = __commonJS({
24469
24518
  });
24470
24519
  module.exports = __toCommonJS2(resolve_v2_exports);
24471
24520
  var import_path12 = __require("path");
24472
- var import_build_utils6 = __require("@vercel/build-utils");
24521
+ var import_build_utils7 = __require("@vercel/build-utils");
24473
24522
  var import_frameworks2 = require_frameworks();
24474
24523
  var import_types = require_types3();
24475
24524
  var import_resolve = require_resolve2();
@@ -24714,7 +24763,7 @@ var require_resolve_v2 = __commonJS({
24714
24763
  let builderUse;
24715
24764
  let builderSrc;
24716
24765
  if (framework) {
24717
- builderUse = (0, import_build_utils6.isNodeBackendFramework)(framework) ? "@vercel/backends" : frameworkDefinition?.useRuntime?.use || "@vercel/static-build";
24766
+ builderUse = (0, import_build_utils7.isNodeBackendFramework)(framework) ? "@vercel/backends" : frameworkDefinition?.useRuntime?.use || "@vercel/static-build";
24718
24767
  builderSrc = entrypointFile || frameworkDefinition?.useRuntime?.src || "package.json";
24719
24768
  } else {
24720
24769
  if (!inferredRuntime) {
@@ -28725,7 +28774,7 @@ var require_detect_services = __commonJS({
28725
28774
  generateServicesRoutes: () => generateServicesRoutes2
28726
28775
  });
28727
28776
  module.exports = __toCommonJS2(detect_services_exports);
28728
- var import_build_utils6 = __require("@vercel/build-utils");
28777
+ var import_build_utils7 = __require("@vercel/build-utils");
28729
28778
  var import_routing_utils2 = require_dist5();
28730
28779
  var import_utils4 = require_utils3();
28731
28780
  var import_resolve = require_resolve2();
@@ -28998,7 +29047,7 @@ var require_detect_services = __commonJS({
28998
29047
  });
28999
29048
  }
29000
29049
  function generateServicesRoutes2(allServices) {
29001
- const services = allServices.filter(import_build_utils6.isExperimentalService);
29050
+ const services = allServices.filter(import_build_utils7.isExperimentalService);
29002
29051
  const hostRewrites = [];
29003
29052
  const rewrites = [];
29004
29053
  const defaults = [];
@@ -29073,7 +29122,7 @@ var require_detect_services = __commonJS({
29073
29122
  }
29074
29123
  }
29075
29124
  }
29076
- const cronServices = services.filter(import_build_utils6.isScheduleTriggeredService);
29125
+ const cronServices = services.filter(import_build_utils7.isScheduleTriggeredService);
29077
29126
  for (const service of cronServices) {
29078
29127
  const cronPrefix = (0, import_utils4.getInternalServiceCronPathPrefix)(service.name);
29079
29128
  const functionPath = (0, import_utils4.getInternalServiceFunctionPath)(service.name);
@@ -29527,7 +29576,7 @@ var require_detect_builders = __commonJS({
29527
29576
  var import_path12 = __require("path");
29528
29577
  var import_frameworks2 = require_frameworks();
29529
29578
  var import_is_official_runtime = require_is_official_runtime();
29530
- var import_build_utils6 = __require("@vercel/build-utils");
29579
+ var import_build_utils7 = __require("@vercel/build-utils");
29531
29580
  var import_get_services_builders = require_get_services_builders();
29532
29581
  var REGEX_MIDDLEWARE_FILES = "middleware.[jt]s";
29533
29582
  var REGEX_VERCEL_PLATFORM_FILES = [
@@ -29834,7 +29883,7 @@ var require_detect_builders = __commonJS({
29834
29883
  }
29835
29884
  if (fileName.endsWith(".py") && options.workPath) {
29836
29885
  const fsPath = (0, import_path12.join)(options.workPath, fileName);
29837
- const isEntrypoint = await (0, import_build_utils6.isPythonEntrypoint)({ fsPath });
29886
+ const isEntrypoint = await (0, import_build_utils7.isPythonEntrypoint)({ fsPath });
29838
29887
  if (!isEntrypoint) {
29839
29888
  return null;
29840
29889
  }
@@ -29842,7 +29891,7 @@ var require_detect_builders = __commonJS({
29842
29891
  const nodeExtensions = [".js", ".mjs", ".ts", ".tsx"];
29843
29892
  if (fileName.startsWith("api/") && process.env.VERCEL_NODE_FILTER_ENTRYPOINTS === "1" && nodeExtensions.some((ext) => fileName.endsWith(ext)) && options.workPath) {
29844
29893
  const fsPath = (0, import_path12.join)(options.workPath, fileName);
29845
- const isEntrypoint = await (0, import_build_utils6.isNodeEntrypoint)({ fsPath });
29894
+ const isEntrypoint = await (0, import_build_utils7.isNodeEntrypoint)({ fsPath });
29846
29895
  if (!isEntrypoint) {
29847
29896
  return null;
29848
29897
  }
@@ -29952,8 +30001,8 @@ var require_detect_builders = __commonJS({
29952
30001
  const f = slugToFramework.get(framework || "");
29953
30002
  if (f && f.useRuntime) {
29954
30003
  const { src, use } = f.useRuntime;
29955
- const shouldUseUnifiedBackend = (0, import_build_utils6.isExperimentalBackendsEnabled)() && import_build_utils6.BACKEND_BUILDERS.includes(use);
29956
- const finalUse = shouldUseUnifiedBackend ? import_build_utils6.UNIFIED_BACKEND_BUILDER : use;
30004
+ const shouldUseUnifiedBackend = (0, import_build_utils7.isExperimentalBackendsEnabled)() && import_build_utils7.BACKEND_BUILDERS.includes(use);
30005
+ const finalUse = shouldUseUnifiedBackend ? import_build_utils7.UNIFIED_BACKEND_BUILDER : use;
29957
30006
  return { src, use: `${finalUse}${withTag}`, config };
29958
30007
  }
29959
30008
  const entrypoints = /* @__PURE__ */ new Set([
@@ -29998,7 +30047,7 @@ var require_detect_builders = __commonJS({
29998
30047
  message: "Function must contain at least one property."
29999
30048
  };
30000
30049
  }
30001
- const maxDurationLimit = (0, import_build_utils6.getMaxDurationLimit)();
30050
+ const maxDurationLimit = (0, import_build_utils7.getMaxDurationLimit)();
30002
30051
  if (func.maxDuration !== void 0 && func.maxDuration !== "max" && (func.maxDuration < 1 || maxDurationLimit !== void 0 && func.maxDuration > maxDurationLimit || !Number.isInteger(func.maxDuration))) {
30003
30052
  return {
30004
30053
  code: "invalid_function_duration",
@@ -34862,8 +34911,8 @@ var require_dist6 = __commonJS({
34862
34911
  getServicesBuilders: () => import_get_services_builders.getServicesBuilders,
34863
34912
  getWorkspacePackagePaths: () => import_get_workspace_package_paths.getWorkspacePackagePaths,
34864
34913
  getWorkspaces: () => import_get_workspaces.getWorkspaces,
34865
- isExperimentalService: () => import_build_utils6.isExperimentalService,
34866
- isExperimentalServiceV2: () => import_build_utils6.isExperimentalServiceV2,
34914
+ isExperimentalService: () => import_build_utils7.isExperimentalService,
34915
+ isExperimentalServiceV2: () => import_build_utils7.isExperimentalServiceV2,
34867
34916
  isOfficialRuntime: () => import_is_official_runtime.isOfficialRuntime,
34868
34917
  isRouteOwningBuilder: () => import_utils4.isRouteOwningBuilder,
34869
34918
  isStaticBuild: () => import_utils4.isStaticBuild,
@@ -34879,7 +34928,7 @@ var require_dist6 = __commonJS({
34879
34928
  var import_detect_builders = require_detect_builders();
34880
34929
  var import_detect_services2 = require_detect_services();
34881
34930
  var import_resolve_v2 = require_resolve_v2();
34882
- var import_build_utils6 = __require("@vercel/build-utils");
34931
+ var import_build_utils7 = __require("@vercel/build-utils");
34883
34932
  var import_auto_detect = require_auto_detect();
34884
34933
  var import_utils4 = require_utils3();
34885
34934
  var import_get_services_builders = require_get_services_builders();
@@ -40902,7 +40951,7 @@ var require_package = __commonJS({
40902
40951
  "../client/package.json"(exports, module) {
40903
40952
  module.exports = {
40904
40953
  name: "@vercel/client",
40905
- version: "17.6.3",
40954
+ version: "17.6.5",
40906
40955
  main: "dist/index.js",
40907
40956
  typings: "dist/index.d.ts",
40908
40957
  homepage: "https://vercel.com",
@@ -48823,7 +48872,7 @@ var require_utils10 = __commonJS({
48823
48872
  var import_url4 = __require("url");
48824
48873
  var import_ignore = __toESM2(require_ignore());
48825
48874
  var import_pkg2 = require_pkg();
48826
- var import_build_utils6 = __require("@vercel/build-utils");
48875
+ var import_build_utils7 = __require("@vercel/build-utils");
48827
48876
  var import_async_sema = require_lib6();
48828
48877
  var import_fs_extra9 = require_lib5();
48829
48878
  var import_readdir_recursive = __toESM2(require_readdir_recursive());
@@ -49057,7 +49106,7 @@ var require_utils10 = __commonJS({
49057
49106
  maybeRead((0, import_path12.join)(cwd2, ".nowignore"), "")
49058
49107
  ]);
49059
49108
  if (vercelignore && nowignore) {
49060
- throw new import_build_utils6.NowBuildError({
49109
+ throw new import_build_utils7.NowBuildError({
49061
49110
  code: "CONFLICTING_IGNORE_FILES",
49062
49111
  message: "Cannot use both a `.vercelignore` and `.nowignore` file. Please delete the `.nowignore` file.",
49063
49112
  link: "https://vercel.link/combining-old-and-new-config"
@@ -49101,10 +49150,13 @@ ${clearRelative(ignoreFile)}`);
49101
49150
  };
49102
49151
  debug(`${opts.method || "GET"} ${url}`);
49103
49152
  time = Date.now();
49104
- const res = await (0, import_node_fetch.default)(url, opts);
49105
- debug(`DONE in ${Date.now() - time}ms: ${opts.method || "GET"} ${url}`);
49106
- semaphore.release();
49107
- return res;
49153
+ try {
49154
+ const res = await (0, import_node_fetch.default)(url, opts);
49155
+ debug(`DONE in ${Date.now() - time}ms: ${opts.method || "GET"} ${url}`);
49156
+ return res;
49157
+ } finally {
49158
+ semaphore.release();
49159
+ }
49108
49160
  };
49109
49161
  var isWin = process.platform.includes("win");
49110
49162
  var prepareFiles = (files, clientOptions) => {
@@ -49241,6 +49293,36 @@ var require_check_deployment_status = __commonJS({
49241
49293
  var RETRY_DELAY_MIN_MS = 5e3;
49242
49294
  var RETRY_DELAY_SKEW_MS = 3e4;
49243
49295
  var RETRY_DELAY_DEFAULT_MS = 5e3;
49296
+ function getAliasAssignedEvent(signal, deploymentId) {
49297
+ if (!signal?.aborted)
49298
+ return;
49299
+ const event = signal.reason;
49300
+ if (event?.type === "alias-assigned" && event.deploymentId === deploymentId && typeof event.date === "number" && Array.isArray(event.alias) && "aliasError" in event && "aliasWarning" in event) {
49301
+ return event;
49302
+ }
49303
+ return void 0;
49304
+ }
49305
+ async function sleepUntilAliasAssigned(duration, signal, deploymentId) {
49306
+ if (getAliasAssignedEvent(signal, deploymentId))
49307
+ return;
49308
+ if (!signal || signal.aborted) {
49309
+ await (0, import_sleep_promise.default)(duration);
49310
+ return;
49311
+ }
49312
+ await new Promise((resolve4) => {
49313
+ const timeout = setTimeout(finish, duration);
49314
+ function finish() {
49315
+ clearTimeout(timeout);
49316
+ signal?.removeEventListener("abort", onAbort);
49317
+ resolve4();
49318
+ }
49319
+ function onAbort() {
49320
+ if (getAliasAssignedEvent(signal, deploymentId))
49321
+ finish();
49322
+ }
49323
+ signal.addEventListener("abort", onAbort, { once: true });
49324
+ });
49325
+ }
49244
49326
  function parseRetryAfterMs(response) {
49245
49327
  if (response.status === 429 || response.status === 503) {
49246
49328
  let header = response.headers.get("Retry-After");
@@ -49270,6 +49352,8 @@ var require_check_deployment_status = __commonJS({
49270
49352
  const { token, teamId, apiUrl, userAgent: userAgent2 } = clientOptions;
49271
49353
  const debug = (0, import_utils22.createDebug)(clientOptions.debug);
49272
49354
  let deploymentState = deployment;
49355
+ const deploymentId = deployment.id || deployment.deploymentId;
49356
+ let aliasAssignedSignal = clientOptions.aliasAssignedSignal;
49273
49357
  const apiDeployments = (0, import_utils4.getApiDeploymentsUrl)();
49274
49358
  if ((0, import_ready_state.isDone)(deploymentState) && (0, import_ready_state.isAliasAssigned)(deploymentState)) {
49275
49359
  debug(
@@ -49280,109 +49364,172 @@ var require_check_deployment_status = __commonJS({
49280
49364
  debug("Waiting for builds and the deployment to complete...");
49281
49365
  const finishedEvents = /* @__PURE__ */ new Set();
49282
49366
  const startTime = Date.now();
49283
- while (true) {
49284
- let deploymentResponse;
49285
- let retriesLeft = RETRY_COUNT;
49367
+ polling:
49286
49368
  while (true) {
49287
- deploymentResponse = await (0, import_utils4.fetchApi)(
49288
- `${apiDeployments}/${deployment.id || deployment.deploymentId}${teamId ? `?teamId=${teamId}` : ""}`,
49289
- token,
49290
- { apiUrl, userAgent: userAgent2, agent: clientOptions.agent }
49369
+ const aliasAssignedEvent = getAliasAssignedEvent(
49370
+ aliasAssignedSignal,
49371
+ deploymentId
49291
49372
  );
49292
- retriesLeft--;
49293
- if (retriesLeft == 0) {
49373
+ if (aliasAssignedEvent) {
49374
+ deploymentState = {
49375
+ ...deploymentState,
49376
+ readyState: "READY",
49377
+ aliasAssigned: aliasAssignedEvent.date,
49378
+ alias: aliasAssignedEvent.alias,
49379
+ aliasError: aliasAssignedEvent.aliasError,
49380
+ aliasWarning: aliasAssignedEvent.aliasWarning
49381
+ };
49382
+ if (!finishedEvents.has("ready")) {
49383
+ debug("Deployment state changed to READY");
49384
+ finishedEvents.add("ready");
49385
+ yield { type: "ready", payload: deploymentState };
49386
+ }
49387
+ debug("Deployment alias assigned from event stream");
49388
+ return yield { type: "alias-assigned", payload: deploymentState };
49389
+ }
49390
+ let deploymentResponse;
49391
+ let retriesLeft = RETRY_COUNT;
49392
+ while (true) {
49393
+ try {
49394
+ deploymentResponse = await (0, import_utils4.fetchApi)(
49395
+ `${apiDeployments}/${deploymentId}${teamId ? `?teamId=${teamId}` : ""}`,
49396
+ token,
49397
+ {
49398
+ apiUrl,
49399
+ userAgent: userAgent2,
49400
+ agent: clientOptions.agent,
49401
+ // node-fetch's bundled AbortSignal type predates the native one.
49402
+ signal: aliasAssignedSignal
49403
+ }
49404
+ );
49405
+ } catch (error) {
49406
+ if (getAliasAssignedEvent(aliasAssignedSignal, deploymentId)) {
49407
+ continue polling;
49408
+ }
49409
+ if (aliasAssignedSignal?.aborted) {
49410
+ aliasAssignedSignal = void 0;
49411
+ continue polling;
49412
+ }
49413
+ throw error;
49414
+ }
49415
+ if (getAliasAssignedEvent(aliasAssignedSignal, deploymentId)) {
49416
+ continue polling;
49417
+ }
49418
+ retriesLeft--;
49419
+ if (retriesLeft == 0) {
49420
+ break;
49421
+ }
49422
+ const retryAfterMs = parseRetryAfterMs(deploymentResponse);
49423
+ if (retryAfterMs != null) {
49424
+ const randomSkewMs = Math.floor(RETRY_DELAY_SKEW_MS * Math.random());
49425
+ debug(
49426
+ `Received a transient error or rate limit (HTTP ${deploymentResponse.status}) while querying deployment status, retrying after ${retryAfterMs + randomSkewMs}ms (${retryAfterMs} + ${randomSkewMs}ms of random skew)`
49427
+ );
49428
+ await sleepUntilAliasAssigned(
49429
+ retryAfterMs + randomSkewMs,
49430
+ aliasAssignedSignal,
49431
+ deploymentId
49432
+ );
49433
+ if (getAliasAssignedEvent(aliasAssignedSignal, deploymentId)) {
49434
+ continue polling;
49435
+ }
49436
+ continue;
49437
+ }
49294
49438
  break;
49295
49439
  }
49296
- const retryAfterMs = parseRetryAfterMs(deploymentResponse);
49297
- if (retryAfterMs != null) {
49298
- const randomSkewMs = Math.floor(RETRY_DELAY_SKEW_MS * Math.random());
49299
- debug(
49300
- `Received a transient error or rate limit (HTTP ${deploymentResponse.status}) while querying deployment status, retrying after ${retryAfterMs + randomSkewMs}ms (${retryAfterMs} + ${randomSkewMs}ms of random skew)`
49301
- );
49302
- await (0, import_sleep_promise.default)(retryAfterMs + randomSkewMs);
49303
- continue;
49440
+ let deploymentUpdate;
49441
+ try {
49442
+ deploymentUpdate = await deploymentResponse.json();
49443
+ } catch (error) {
49444
+ if (getAliasAssignedEvent(aliasAssignedSignal, deploymentId))
49445
+ continue;
49446
+ if (aliasAssignedSignal?.aborted) {
49447
+ aliasAssignedSignal = void 0;
49448
+ continue;
49449
+ }
49450
+ throw error;
49304
49451
  }
49305
- break;
49306
- }
49307
- const deploymentUpdate = await deploymentResponse.json();
49308
- if (deploymentUpdate.error) {
49309
- debug("Deployment status check has errorred");
49310
- return yield { type: "error", payload: deploymentUpdate.error };
49311
- }
49312
- if (deploymentUpdate.readyState === "BUILDING" && !finishedEvents.has("building")) {
49313
- debug("Deployment state changed to BUILDING");
49314
- finishedEvents.add("building");
49315
- yield { type: "building", payload: deploymentUpdate };
49316
- }
49317
- if (deploymentUpdate.readyState === "CANCELED" && !finishedEvents.has("canceled")) {
49318
- debug("Deployment state changed to CANCELED");
49319
- finishedEvents.add("canceled");
49320
- yield { type: "canceled", payload: deploymentUpdate };
49321
- }
49322
- if ((0, import_ready_state.isReady)(deploymentUpdate) && !finishedEvents.has("ready")) {
49323
- debug("Deployment state changed to READY");
49324
- finishedEvents.add("ready");
49325
- yield { type: "ready", payload: deploymentUpdate };
49326
- }
49327
- if (deploymentUpdate.checksState !== void 0) {
49328
- if (deploymentUpdate.checksState === "completed" && !finishedEvents.has("checks-completed")) {
49329
- finishedEvents.add("checks-completed");
49330
- if (deploymentUpdate.checksConclusion === "succeeded") {
49331
- yield {
49332
- type: "checks-conclusion-succeeded",
49333
- payload: deploymentUpdate
49334
- };
49335
- } else if (deploymentUpdate.checksConclusion === "failed") {
49336
- yield { type: "checks-conclusion-failed", payload: deploymentUpdate };
49337
- } else if (deploymentUpdate.checksConclusion === "skipped") {
49338
- yield {
49339
- type: "checks-conclusion-skipped",
49340
- payload: deploymentUpdate
49341
- };
49342
- } else if (deploymentUpdate.checksConclusion === "canceled") {
49343
- yield {
49344
- type: "checks-conclusion-canceled",
49345
- payload: deploymentUpdate
49346
- };
49452
+ if (getAliasAssignedEvent(aliasAssignedSignal, deploymentId))
49453
+ continue;
49454
+ if (deploymentUpdate.error) {
49455
+ debug("Deployment status check has errorred");
49456
+ return yield { type: "error", payload: deploymentUpdate.error };
49457
+ }
49458
+ deploymentState = deploymentUpdate;
49459
+ if (deploymentUpdate.readyState === "BUILDING" && !finishedEvents.has("building")) {
49460
+ debug("Deployment state changed to BUILDING");
49461
+ finishedEvents.add("building");
49462
+ yield { type: "building", payload: deploymentUpdate };
49463
+ }
49464
+ if (deploymentUpdate.readyState === "CANCELED" && !finishedEvents.has("canceled")) {
49465
+ debug("Deployment state changed to CANCELED");
49466
+ finishedEvents.add("canceled");
49467
+ yield { type: "canceled", payload: deploymentUpdate };
49468
+ }
49469
+ if ((0, import_ready_state.isReady)(deploymentUpdate) && !finishedEvents.has("ready")) {
49470
+ debug("Deployment state changed to READY");
49471
+ finishedEvents.add("ready");
49472
+ yield { type: "ready", payload: deploymentUpdate };
49473
+ }
49474
+ if (deploymentUpdate.checksState !== void 0) {
49475
+ if (deploymentUpdate.checksState === "completed" && !finishedEvents.has("checks-completed")) {
49476
+ finishedEvents.add("checks-completed");
49477
+ if (deploymentUpdate.checksConclusion === "succeeded") {
49478
+ yield {
49479
+ type: "checks-conclusion-succeeded",
49480
+ payload: deploymentUpdate
49481
+ };
49482
+ } else if (deploymentUpdate.checksConclusion === "failed") {
49483
+ yield { type: "checks-conclusion-failed", payload: deploymentUpdate };
49484
+ } else if (deploymentUpdate.checksConclusion === "skipped") {
49485
+ yield {
49486
+ type: "checks-conclusion-skipped",
49487
+ payload: deploymentUpdate
49488
+ };
49489
+ } else if (deploymentUpdate.checksConclusion === "canceled") {
49490
+ yield {
49491
+ type: "checks-conclusion-canceled",
49492
+ payload: deploymentUpdate
49493
+ };
49494
+ }
49495
+ }
49496
+ if (deploymentUpdate.checksState === "registered" && !finishedEvents.has("checks-registered")) {
49497
+ finishedEvents.add("checks-registered");
49498
+ yield { type: "checks-registered", payload: deploymentUpdate };
49499
+ }
49500
+ if (deploymentUpdate.checksState === "running" && !finishedEvents.has("checks-running")) {
49501
+ finishedEvents.add("checks-running");
49502
+ yield { type: "checks-running", payload: deploymentUpdate };
49347
49503
  }
49348
49504
  }
49349
- if (deploymentUpdate.checksState === "registered" && !finishedEvents.has("checks-registered")) {
49350
- finishedEvents.add("checks-registered");
49351
- yield { type: "checks-registered", payload: deploymentUpdate };
49505
+ if (deploymentUpdate.checks?.["deployment-alias"]?.state === "failed" && !finishedEvents.has("checks-v2-failed")) {
49506
+ debug("v2 deployment-alias check failed");
49507
+ finishedEvents.add("checks-v2-failed");
49508
+ return yield {
49509
+ type: "checks-v2-failed",
49510
+ payload: deploymentUpdate
49511
+ };
49352
49512
  }
49353
- if (deploymentUpdate.checksState === "running" && !finishedEvents.has("checks-running")) {
49354
- finishedEvents.add("checks-running");
49355
- yield { type: "checks-running", payload: deploymentUpdate };
49513
+ if ((0, import_ready_state.isAliasAssigned)(deploymentUpdate)) {
49514
+ debug("Deployment alias assigned");
49515
+ return yield { type: "alias-assigned", payload: deploymentUpdate };
49356
49516
  }
49517
+ if ((0, import_ready_state.isAliasError)(deploymentUpdate)) {
49518
+ return yield { type: "error", payload: deploymentUpdate.aliasError };
49519
+ }
49520
+ if (deploymentUpdate.readyState === "ERROR" && deploymentUpdate.errorCode === "BUILD_FAILED") {
49521
+ return yield { type: "error", payload: deploymentUpdate };
49522
+ }
49523
+ if ((0, import_ready_state.isFailed)(deploymentUpdate)) {
49524
+ return yield {
49525
+ type: "error",
49526
+ payload: deploymentUpdate.error || deploymentUpdate
49527
+ };
49528
+ }
49529
+ const elapsed = Date.now() - startTime;
49530
+ const duration = (0, import_get_polling_delay.getPollingDelay)(elapsed);
49531
+ await sleepUntilAliasAssigned(duration, aliasAssignedSignal, deploymentId);
49357
49532
  }
49358
- if (deploymentUpdate.checks?.["deployment-alias"]?.state === "failed" && !finishedEvents.has("checks-v2-failed")) {
49359
- debug("v2 deployment-alias check failed");
49360
- finishedEvents.add("checks-v2-failed");
49361
- return yield {
49362
- type: "checks-v2-failed",
49363
- payload: deploymentUpdate
49364
- };
49365
- }
49366
- if ((0, import_ready_state.isAliasAssigned)(deploymentUpdate)) {
49367
- debug("Deployment alias assigned");
49368
- return yield { type: "alias-assigned", payload: deploymentUpdate };
49369
- }
49370
- if ((0, import_ready_state.isAliasError)(deploymentUpdate)) {
49371
- return yield { type: "error", payload: deploymentUpdate.aliasError };
49372
- }
49373
- if (deploymentUpdate.readyState === "ERROR" && deploymentUpdate.errorCode === "BUILD_FAILED") {
49374
- return yield { type: "error", payload: deploymentUpdate };
49375
- }
49376
- if ((0, import_ready_state.isFailed)(deploymentUpdate)) {
49377
- return yield {
49378
- type: "error",
49379
- payload: deploymentUpdate.error || deploymentUpdate
49380
- };
49381
- }
49382
- const elapsed = Date.now() - startTime;
49383
- const duration = (0, import_get_polling_delay.getPollingDelay)(elapsed);
49384
- await (0, import_sleep_promise.default)(duration);
49385
- }
49386
49533
  }
49387
49534
  }
49388
49535
  });
@@ -55530,7 +55677,7 @@ var require_archive = __commonJS({
55530
55677
  module.exports = __toCommonJS2(archive_exports);
55531
55678
  var import_node_path2 = __require("path");
55532
55679
  var import_node_zlib = __require("zlib");
55533
- var import_build_utils6 = __require("@vercel/build-utils");
55680
+ var import_build_utils7 = __require("@vercel/build-utils");
55534
55681
  var import_tar_fs = __toESM2(require_tar_fs());
55535
55682
  var import_hashes = require_hashes();
55536
55683
  async function createTgzFiles(workPath, fileList, debug, exclude) {
@@ -55539,7 +55686,7 @@ var require_archive = __commonJS({
55539
55686
  const tarStream = import_tar_fs.default.pack(workPath, {
55540
55687
  entries: filesToArchive.map((file) => (0, import_node_path2.relative)(workPath, file))
55541
55688
  }).pipe((0, import_node_zlib.createGzip)());
55542
- const chunkedTarBuffers = await (0, import_build_utils6.streamToBufferChunks)(tarStream);
55689
+ const chunkedTarBuffers = await (0, import_build_utils7.streamToBufferChunks)(tarStream);
55543
55690
  debug?.(`Packed tarball into ${chunkedTarBuffers.length} chunks`);
55544
55691
  return new Map(
55545
55692
  chunkedTarBuffers.map((chunk, index) => [
@@ -56248,11 +56395,11 @@ function isDirectory(targetPath) {
56248
56395
  }
56249
56396
 
56250
56397
  // src/util/projects/link.ts
56251
- import { NowBuildError as NowBuildError2, getPlatformEnv } from "@vercel/build-utils";
56398
+ import { NowBuildError as NowBuildError2, getPlatformEnv as getPlatformEnv2 } from "@vercel/build-utils";
56252
56399
  var import_error_utils4 = __toESM(require_dist(), 1);
56253
56400
 
56254
56401
  // src/util/link/repo.ts
56255
- var import_chalk7 = __toESM(require_source(), 1);
56402
+ var import_chalk9 = __toESM(require_source(), 1);
56256
56403
 
56257
56404
  // ../../node_modules/.pnpm/@inquirer+core@7.1.3/node_modules/@inquirer/core/dist/esm/lib/key.mjs
56258
56405
  var isUpKey = (key) => (
@@ -57622,6 +57769,9 @@ async function getOriginUrl(configPath) {
57622
57769
  return null;
57623
57770
  }
57624
57771
 
57772
+ // src/util/input/select-org.ts
57773
+ var import_chalk6 = __toESM(require_source(), 1);
57774
+
57625
57775
  // src/util/teams/get-teams.ts
57626
57776
  import { URLSearchParams as URLSearchParams2 } from "url";
57627
57777
  async function getTeams(client, opts = {}) {
@@ -57681,6 +57831,27 @@ async function fetchTeams(client, opts = {}) {
57681
57831
  }
57682
57832
  }
57683
57833
 
57834
+ // src/util/input/select-org.ts
57835
+ import { getPlatformEnv } from "@vercel/build-utils";
57836
+
57837
+ // src/util/output/param.ts
57838
+ var import_chalk4 = __toESM(require_source(), 1);
57839
+ function param(text) {
57840
+ return `${import_chalk4.default.gray('"')}${import_chalk4.default.bold(text)}${import_chalk4.default.gray('"')}`;
57841
+ }
57842
+
57843
+ // src/util/output/print-aligned-label.ts
57844
+ var import_chalk5 = __toESM(require_source(), 1);
57845
+ var ALIGNED_LABEL_WIDTH = 16;
57846
+ function printAlignedLabel(label, value, options = {}) {
57847
+ const gutter = options.gutter === "\u2713" ? import_chalk5.default.green("\u2713") : options.gutter;
57848
+ const prefix = gutter ? `${gutter} ` : " ";
57849
+ output_manager_default.print(
57850
+ `${prefix}${import_chalk5.default.bold(label.padEnd(ALIGNED_LABEL_WIDTH))}${import_chalk5.default.bold(value)}
57851
+ `
57852
+ );
57853
+ }
57854
+
57684
57855
  // src/util/input/select-org.ts
57685
57856
  function getScopeOrTeamFromArgv(argv) {
57686
57857
  const args = argv.slice(2);
@@ -57702,44 +57873,10 @@ function getScopeOrTeamFromArgv(argv) {
57702
57873
  }
57703
57874
  return null;
57704
57875
  }
57705
- async function selectOrg(client, question, autoConfirm) {
57876
+ async function selectOrg(client, question, autoConfirm, searchable = false, meta) {
57706
57877
  const {
57707
57878
  config: { currentTeam }
57708
57879
  } = client;
57709
- if (autoConfirm && !client.nonInteractive) {
57710
- if (currentTeam) {
57711
- output_manager_default.spinner("Loading team\u2026", 1e3);
57712
- try {
57713
- const team = await getTeamById(client, currentTeam);
57714
- return { type: "team", id: team.id, slug: team.slug };
57715
- } catch (err) {
57716
- output_manager_default.debug(`Unable to load current team directly: ${err}`);
57717
- } finally {
57718
- output_manager_default.stopSpinner();
57719
- }
57720
- }
57721
- output_manager_default.spinner("Loading user\u2026", 1e3);
57722
- let user2;
57723
- try {
57724
- user2 = await getUser(client);
57725
- } finally {
57726
- output_manager_default.stopSpinner();
57727
- }
57728
- if (user2.version !== "northstar") {
57729
- return { type: "user", id: user2.id, slug: user2.username };
57730
- }
57731
- if (user2.defaultTeamId) {
57732
- output_manager_default.spinner("Loading team\u2026", 1e3);
57733
- try {
57734
- const team = await getTeamById(client, user2.defaultTeamId);
57735
- return { type: "team", id: team.id, slug: team.slug };
57736
- } catch (err) {
57737
- output_manager_default.debug(`Unable to load default team directly: ${err}`);
57738
- } finally {
57739
- output_manager_default.stopSpinner();
57740
- }
57741
- }
57742
- }
57743
57880
  output_manager_default.spinner("Loading teams\u2026", 1e3);
57744
57881
  let user;
57745
57882
  let teams;
@@ -57748,16 +57885,36 @@ async function selectOrg(client, question, autoConfirm) {
57748
57885
  } finally {
57749
57886
  output_manager_default.stopSpinner();
57750
57887
  }
57888
+ const formatChoiceName = (name, slug, isCurrent, limited) => {
57889
+ let title2 = `${name} (${slug})`;
57890
+ if (isCurrent) {
57891
+ title2 += ` ${import_chalk6.default.bold("(current)")}`;
57892
+ }
57893
+ if (limited) {
57894
+ title2 += ` ${emoji("locked")}`;
57895
+ }
57896
+ return title2;
57897
+ };
57751
57898
  const personalAccountChoice = user.version === "northstar" ? [] : [
57752
57899
  {
57753
- name: user.name || user.username,
57900
+ name: formatChoiceName(
57901
+ user.name || user.username,
57902
+ user.username,
57903
+ !currentTeam,
57904
+ user.limited
57905
+ ),
57754
57906
  value: { type: "user", id: user.id, slug: user.username }
57755
57907
  }
57756
57908
  ];
57757
57909
  const choices = [
57758
57910
  ...personalAccountChoice,
57759
57911
  ...teams.sort((a) => a.id === user.defaultTeamId ? -1 : 1).map((team) => ({
57760
- name: team.name || team.slug,
57912
+ name: formatChoiceName(
57913
+ team.name || team.slug,
57914
+ team.slug,
57915
+ team.id === currentTeam,
57916
+ team.limited
57917
+ ),
57761
57918
  value: { type: "team", id: team.id, slug: team.slug }
57762
57919
  }))
57763
57920
  ];
@@ -57765,19 +57922,30 @@ async function selectOrg(client, question, autoConfirm) {
57765
57922
  choices.findIndex((choice) => choice.value.id === currentTeam),
57766
57923
  0
57767
57924
  );
57768
- if (client.nonInteractive) {
57769
- if (currentTeam) {
57770
- const match = choices.find((c) => c.value.id === currentTeam);
57771
- if (match)
57772
- return match.value;
57773
- }
57774
- const explicitScope = getScopeOrTeamFromArgv(client.argv);
57775
- if (explicitScope) {
57776
- const match = choices.find(
57777
- (c) => c.value.id === explicitScope || c.value.slug === explicitScope
57778
- );
57779
- if (match)
57780
- return match.value;
57925
+ if (meta) {
57926
+ meta.choiceCount = choices.length;
57927
+ }
57928
+ const localConfigScope = client.localConfig?.scope;
57929
+ const explicitScope = getScopeOrTeamFromArgv(client.argv) ?? (typeof localConfigScope === "string" ? localConfigScope : null) ?? getPlatformEnv("ORG_ID") ?? null;
57930
+ const matchExplicitScope = () => {
57931
+ if (!explicitScope)
57932
+ return void 0;
57933
+ const match = choices.find(
57934
+ (c) => c.value.id === explicitScope || c.value.slug === explicitScope
57935
+ );
57936
+ if (match)
57937
+ return match.value;
57938
+ if (user.id === explicitScope || user.email === explicitScope || user.username === explicitScope) {
57939
+ return choices.find((c) => c.value.type === "user")?.value;
57940
+ }
57941
+ return void 0;
57942
+ };
57943
+ if (client.nonInteractive || !client.stdin.isTTY) {
57944
+ const match = matchExplicitScope();
57945
+ if (match)
57946
+ return match;
57947
+ if (choices.length === 1) {
57948
+ return choices[0].value;
57781
57949
  }
57782
57950
  const actionRequired = {
57783
57951
  status: "action_required",
@@ -57792,15 +57960,44 @@ async function selectOrg(client, question, autoConfirm) {
57792
57960
  }))
57793
57961
  };
57794
57962
  outputActionRequired(client, actionRequired);
57963
+ output_manager_default.error(
57964
+ choices.length > 0 ? `Multiple teams found. Teams are never auto-selected when the CLI runs without an interactive terminal. Re-run this command with ${param(
57965
+ "--team <slug>"
57966
+ )}, or run ${getCommandName("teams ls")} to list your teams.` : "No teams available."
57967
+ );
57795
57968
  process.exit(1);
57796
57969
  }
57797
- if (autoConfirm) {
57798
- return choices[defaultChoiceIndex].value;
57970
+ const explicitOrg = matchExplicitScope();
57971
+ if (explicitOrg) {
57972
+ return explicitOrg;
57799
57973
  }
57800
- return await client.input.select({
57801
- message: question,
57802
- choices,
57803
- default: choices[defaultChoiceIndex].value
57974
+ if (choices.length === 1) {
57975
+ printAlignedLabel("Team", choices[0].value.slug);
57976
+ return choices[0].value;
57977
+ }
57978
+ if (!searchable) {
57979
+ return await client.input.select({
57980
+ message: question,
57981
+ choices,
57982
+ default: choices[defaultChoiceIndex].value
57983
+ });
57984
+ }
57985
+ const defaultChoice = choices[defaultChoiceIndex];
57986
+ const initialChoices = defaultChoice ? [defaultChoice, ...choices.filter((choice) => choice !== defaultChoice)] : choices;
57987
+ const pageSize = 15;
57988
+ const countHint = choices.length > pageSize ? ` ${import_chalk6.default.dim(`(${choices.length} teams)`)}` : "";
57989
+ return await client.input.search({
57990
+ message: `${question}${countHint}`,
57991
+ pageSize,
57992
+ source: (term) => {
57993
+ const searchTerm = term?.trim().toLowerCase();
57994
+ if (!searchTerm) {
57995
+ return initialChoices;
57996
+ }
57997
+ return choices.filter(
57998
+ (choice) => choice.name.toLowerCase().includes(searchTerm) || choice.value.slug.toLowerCase().includes(searchTerm)
57999
+ );
58000
+ }
57804
58001
  });
57805
58002
  }
57806
58003
 
@@ -57885,16 +58082,16 @@ function repoInfoToUrl(info) {
57885
58082
  }
57886
58083
 
57887
58084
  // src/util/git/connect-git-provider.ts
57888
- var import_chalk5 = __toESM(require_source(), 1);
58085
+ var import_chalk8 = __toESM(require_source(), 1);
57889
58086
  import { URL as URL2 } from "url";
57890
58087
 
57891
58088
  // ../../node_modules/.pnpm/@inquirer+select@2.2.2/node_modules/@inquirer/select/dist/esm/index.mjs
57892
- var import_chalk4 = __toESM(require_source2(), 1);
58089
+ var import_chalk7 = __toESM(require_source2(), 1);
57893
58090
  var import_figures3 = __toESM(require_figures(), 1);
57894
58091
  var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1);
57895
58092
  var selectTheme = {
57896
58093
  icon: { cursor: import_figures3.default.pointer },
57897
- style: { disabled: (text) => import_chalk4.default.dim(`- ${text}`) }
58094
+ style: { disabled: (text) => import_chalk7.default.dim(`- ${text}`) }
57898
58095
  };
57899
58096
  function isSelectable2(item) {
57900
58097
  return !Separator.isSeparator(item) && !item.disabled;
@@ -58110,7 +58307,7 @@ async function connectGitProvider(client, projectId, type, repo) {
58110
58307
  const apiError = isAPIError(err);
58111
58308
  if (apiError && (err.action === "Install GitHub App" || err.code === "repo_not_found")) {
58112
58309
  output_manager_default.error(
58113
- `Failed to connect ${import_chalk5.default.cyan(
58310
+ `Failed to connect ${import_chalk8.default.cyan(
58114
58311
  repo
58115
58312
  )} to project. Make sure there aren't any typos and that you have access to the repository if it's private.`
58116
58313
  );
@@ -58132,7 +58329,7 @@ ${ctaLabel}: ${link_default(ctaUrl)}`;
58132
58329
  output_manager_default.error(message);
58133
58330
  } else if (apiError && err.action === "Add a Login Connection") {
58134
58331
  output_manager_default.error(
58135
- err.message.replace(repo, import_chalk5.default.cyan(repo)) + `
58332
+ err.message.replace(repo, import_chalk8.default.cyan(repo)) + `
58136
58333
  Visit ${link_default(err.link)} for more information.`
58137
58334
  );
58138
58335
  } else {
@@ -58203,7 +58400,7 @@ function parseRepoUrl(originUrl) {
58203
58400
  }
58204
58401
  function printRemoteUrls(remoteUrls) {
58205
58402
  for (const [name, url] of Object.entries(remoteUrls)) {
58206
- output_manager_default.print(` \u2022 ${name}: ${import_chalk5.default.cyan(url)}
58403
+ output_manager_default.print(` \u2022 ${name}: ${import_chalk8.default.cyan(url)}
58207
58404
  `);
58208
58405
  }
58209
58406
  }
@@ -58211,7 +58408,7 @@ async function selectRemoteUrl(client, remoteUrls) {
58211
58408
  const choices = [];
58212
58409
  for (const [urlKey, urlValue] of Object.entries(remoteUrls)) {
58213
58410
  choices.push({
58214
- name: `${urlValue} ${import_chalk5.default.gray(`(${urlKey})`)}`,
58411
+ name: `${urlValue} ${import_chalk8.default.gray(`(${urlKey})`)}`,
58215
58412
  value: urlValue,
58216
58413
  short: urlKey
58217
58414
  });
@@ -58235,7 +58432,7 @@ async function selectAndParseRemoteUrl(client, remoteUrls) {
58235
58432
  }
58236
58433
  const repoInfo = parseRepoUrl(remoteUrl);
58237
58434
  if (!repoInfo) {
58238
- output_manager_default.log(`Connecting Git repository: ${import_chalk5.default.cyan(remoteUrl)}`);
58435
+ output_manager_default.log(`Connecting Git repository: ${import_chalk8.default.cyan(remoteUrl)}`);
58239
58436
  output_manager_default.error(
58240
58437
  `Failed to parse Git repo data from the following remote URL: ${link_default(
58241
58438
  remoteUrl
@@ -58258,7 +58455,7 @@ async function checkExistsAndConnect({
58258
58455
  }) {
58259
58456
  const displayUrl = buildRepoUrl(provider, gitOrg, repo) || repoPath;
58260
58457
  output_manager_default.log(
58261
- `Connecting ${formatProvider(provider)} repository: ${import_chalk5.default.cyan(displayUrl)}`
58458
+ `Connecting ${formatProvider(provider)} repository: ${import_chalk8.default.cyan(displayUrl)}`
58262
58459
  );
58263
58460
  if (!gitProviderLink) {
58264
58461
  const connect = await connectGitProvider(
@@ -58278,7 +58475,7 @@ async function checkExistsAndConnect({
58278
58475
  const isSameRepo = connectedProvider === provider && connectedOrg === gitOrg && connectedRepo === repo;
58279
58476
  if (isSameRepo) {
58280
58477
  output_manager_default.log(
58281
- `${import_chalk5.default.cyan(connectedRepoPath)} is already connected to your project.`
58478
+ `${import_chalk8.default.cyan(connectedRepoPath)} is already connected to your project.`
58282
58479
  );
58283
58480
  return 1;
58284
58481
  }
@@ -58310,7 +58507,7 @@ async function confirmRepoConnect(client, yes, connectedProvider, connectedRepoP
58310
58507
  shouldReplaceProject = await client.input.confirm(
58311
58508
  `Looks like you already have a ${formatProvider(
58312
58509
  connectedProvider
58313
- )} repository connected: ${import_chalk5.default.cyan(
58510
+ )} repository connected: ${import_chalk8.default.cyan(
58314
58511
  connectedRepoPath
58315
58512
  )}. Do you want to replace it?`,
58316
58513
  true
@@ -58370,18 +58567,6 @@ function getGitConfigPath(opts) {
58370
58567
  return join4(absoluteGitCommonDir, "config");
58371
58568
  }
58372
58569
 
58373
- // src/util/output/print-aligned-label.ts
58374
- var import_chalk6 = __toESM(require_source(), 1);
58375
- var ALIGNED_LABEL_WIDTH = 16;
58376
- function printAlignedLabel(label, value, options = {}) {
58377
- const gutter = options.gutter === "\u2713" ? import_chalk6.default.green("\u2713") : options.gutter;
58378
- const prefix = gutter ? `${gutter} ` : " ";
58379
- output_manager_default.print(
58380
- `${prefix}${import_chalk6.default.bold(label.padEnd(ALIGNED_LABEL_WIDTH))}${import_chalk6.default.bold(value)}
58381
- `
58382
- );
58383
- }
58384
-
58385
58570
  // src/util/link/repo.ts
58386
58571
  var home = homedir2();
58387
58572
  async function getRepoLink(client, cwd) {
@@ -58492,9 +58677,9 @@ async function discoverRepoProjects(client, rootPath, {
58492
58677
  return /* @__PURE__ */ new Map();
58493
58678
  });
58494
58679
  const promptAction = existingRemoteName ? "add" : "link";
58495
- const confirmMessage = promptAction === "add" ? `Add Project(s) for Git repository at ${import_chalk7.default.dim(
58680
+ const confirmMessage = promptAction === "add" ? `Add Project(s) for Git repository at ${import_chalk9.default.dim(
58496
58681
  `"${humanizePath(rootPath)}"`
58497
- )}?` : `Link Git repository at ${import_chalk7.default.dim(
58682
+ )}?` : `Link Git repository at ${import_chalk9.default.dim(
58498
58683
  `"${humanizePath(rootPath)}"`
58499
58684
  )} to your Project(s)?`;
58500
58685
  const shouldLink = yes || await client.input.confirm(confirmMessage, true);
@@ -58521,7 +58706,7 @@ async function discoverRepoProjects(client, rootPath, {
58521
58706
  fallback: () => link_default(repoUrl)
58522
58707
  });
58523
58708
  output_manager_default.spinner(
58524
- `Fetching Projects for ${repoUrlLink} under ${import_chalk7.default.bold(org.slug)}\u2026`
58709
+ `Fetching Projects for ${repoUrlLink} under ${import_chalk9.default.bold(org.slug)}\u2026`
58525
58710
  );
58526
58711
  const detectedProjects = await detectedProjectsPromise;
58527
58712
  let projects = await fetchProjectsForRepoUrl(client, repoUrl, org.id);
@@ -58536,7 +58721,7 @@ async function discoverRepoProjects(client, rootPath, {
58536
58721
  }
58537
58722
  if (projects.length === 0) {
58538
58723
  output_manager_default.print(
58539
- ` No Projects are linked to ${repoUrlLink} under ${import_chalk7.default.bold(org.slug)}.
58724
+ ` No Projects are linked to ${repoUrlLink} under ${import_chalk9.default.bold(org.slug)}.
58540
58725
  `
58541
58726
  );
58542
58727
  } else {
@@ -58545,7 +58730,7 @@ async function discoverRepoProjects(client, rootPath, {
58545
58730
  "Project",
58546
58731
  projects.length,
58547
58732
  true
58548
- )} linked to ${repoUrlLink} under ${import_chalk7.default.bold(org.slug)}
58733
+ )} linked to ${repoUrlLink} under ${import_chalk9.default.bold(org.slug)}
58549
58734
  `
58550
58735
  );
58551
58736
  }
@@ -58583,7 +58768,7 @@ async function discoverRepoProjects(client, rootPath, {
58583
58768
  ...projects.map((project) => {
58584
58769
  const dir = project.rootDirectory || ".";
58585
58770
  return {
58586
- name: `${org.slug}/${project.name} ${import_chalk7.default.gray(`(${dir})`)}`,
58771
+ name: `${org.slug}/${project.name} ${import_chalk9.default.gray(`(${dir})`)}`,
58587
58772
  value: project,
58588
58773
  checked: true
58589
58774
  };
@@ -58598,7 +58783,7 @@ async function discoverRepoProjects(client, rootPath, {
58598
58783
  ].filter(Boolean).join("-")
58599
58784
  );
58600
58785
  return {
58601
- name: `${org.slug}/${name} ${import_chalk7.default.gray(`(${rootDirectory || "."} \xB7 ${framework.name})`)}`,
58786
+ name: `${org.slug}/${name} ${import_chalk9.default.gray(`(${rootDirectory || "."} \xB7 ${framework.name})`)}`,
58602
58787
  value: {
58603
58788
  newProject: true,
58604
58789
  rootDirectory,
@@ -58806,17 +58991,11 @@ function findProjectsFromPath(projects, path) {
58806
58991
  }
58807
58992
 
58808
58993
  // src/commands/env/pull.ts
58809
- var import_chalk12 = __toESM(require_source(), 1);
58994
+ var import_chalk13 = __toESM(require_source(), 1);
58810
58995
  var import_fs_extra5 = __toESM(require_lib2(), 1);
58811
58996
  import { closeSync, openSync, readSync } from "fs";
58812
58997
  import { resolve as resolve3 } from "path";
58813
58998
 
58814
- // src/util/output/param.ts
58815
- var import_chalk8 = __toESM(require_source(), 1);
58816
- function param(text) {
58817
- return `${import_chalk8.default.gray('"')}${import_chalk8.default.bold(text)}${import_chalk8.default.gray('"')}`;
58818
- }
58819
-
58820
58999
  // src/util/env/get-env-records.ts
58821
59000
  import { URLSearchParams as URLSearchParams3 } from "url";
58822
59001
  async function getEnvRecords(client, projectId, source, {
@@ -58901,7 +59080,7 @@ var parseEnv = (env) => {
58901
59080
  };
58902
59081
 
58903
59082
  // src/util/env/diff-env-files.ts
58904
- var import_chalk9 = __toESM(require_source(), 1);
59083
+ var import_chalk10 = __toESM(require_source(), 1);
58905
59084
  async function createEnvObject(envPath) {
58906
59085
  const envArr = (await (0, import_fs_extra4.readFile)(envPath, "utf-8")).replace(/"/g, "").split(/\r?\n|\r/).filter((line) => /^[^#]/.test(line)).filter((line) => /=/i.test(line));
58907
59086
  const parsedEnv = parseEnv(envArr);
@@ -58932,10 +59111,10 @@ function findChanges(oldEnv, newEnv) {
58932
59111
  function buildDeltaString(oldEnv, newEnv) {
58933
59112
  const { added, changed, removed } = findChanges(oldEnv, newEnv);
58934
59113
  let deltaString = "";
58935
- deltaString += import_chalk9.default.green(addDeltaSection("+", changed, true));
58936
- deltaString += import_chalk9.default.green(addDeltaSection("+", added));
58937
- deltaString += import_chalk9.default.red(addDeltaSection("-", removed));
58938
- return deltaString ? import_chalk9.default.gray(" Changes:\n") + deltaString + "\n" : deltaString;
59114
+ deltaString += import_chalk10.default.green(addDeltaSection("+", changed, true));
59115
+ deltaString += import_chalk10.default.green(addDeltaSection("+", added));
59116
+ deltaString += import_chalk10.default.red(addDeltaSection("-", removed));
59117
+ return deltaString ? import_chalk10.default.gray(" Changes:\n") + deltaString + "\n" : deltaString;
58939
59118
  }
58940
59119
  function addDeltaSection(prefix, arr, changed = false) {
58941
59120
  if (arr.length === 0)
@@ -58983,12 +59162,12 @@ var import_error_utils2 = __toESM(require_dist(), 1);
58983
59162
  var import_json_parse_better_errors = __toESM(require_json_parse_better_errors(), 1);
58984
59163
 
58985
59164
  // src/util/projects/format-project.ts
58986
- var import_chalk10 = __toESM(require_source(), 1);
59165
+ var import_chalk11 = __toESM(require_source(), 1);
58987
59166
  function formatProject(orgSlug, projectSlug, options) {
58988
59167
  const orgProjectSlug = `${orgSlug}/${projectSlug}`;
58989
59168
  const projectUrl = `https://vercel.com/${orgProjectSlug}`;
58990
- const projectSlugLink = output_manager_default.link(import_chalk10.default.bold(orgProjectSlug), projectUrl, {
58991
- fallback: () => import_chalk10.default.bold(orgProjectSlug),
59169
+ const projectSlugLink = output_manager_default.link(import_chalk11.default.bold(orgProjectSlug), projectUrl, {
59170
+ fallback: () => import_chalk11.default.bold(orgProjectSlug),
58992
59171
  color: false,
58993
59172
  ...options
58994
59173
  });
@@ -59441,7 +59620,7 @@ function parseTarget({
59441
59620
  }
59442
59621
 
59443
59622
  // src/commands/login/future.ts
59444
- var import_chalk11 = __toESM(require_source(), 1);
59623
+ var import_chalk12 = __toESM(require_source(), 1);
59445
59624
  var open = __toESM(require_open(), 1);
59446
59625
  var import_ansi_escapes4 = __toESM(require_ansi_escapes(), 1);
59447
59626
  import readline3 from "readline";
@@ -59722,13 +59901,13 @@ async function performDeviceCodeFlow(client, options) {
59722
59901
  const shouldSkipBrowser = process.env.CI && !isCursorAgent;
59723
59902
  output_manager_default.log(
59724
59903
  `
59725
- Visit ${import_chalk11.default.bold(
59904
+ Visit ${import_chalk12.default.bold(
59726
59905
  output_manager_default.link(
59727
59906
  verification_uri.replace("https://", ""),
59728
59907
  verification_uri_complete,
59729
59908
  { color: false, fallback: () => verification_uri_complete }
59730
59909
  )
59731
- )}${output_manager_default.supportsHyperlink ? ` and enter ${import_chalk11.default.bold(user_code)}` : ""}
59910
+ )}${output_manager_default.supportsHyperlink ? ` and enter ${import_chalk12.default.bold(user_code)}` : ""}
59732
59911
  `
59733
59912
  );
59734
59913
  if (!shouldSkipBrowser) {
@@ -59742,7 +59921,7 @@ async function performDeviceCodeFlow(client, options) {
59742
59921
  if (client.isAgent && client.nonInteractive) {
59743
59922
  output_manager_default.log(
59744
59923
  `
59745
- ${import_chalk11.default.yellow("\u26A0")} ${import_chalk11.default.bold("Browser could not be opened automatically.")}
59924
+ ${import_chalk12.default.yellow("\u26A0")} ${import_chalk12.default.bold("Browser could not be opened automatically.")}
59746
59925
  `
59747
59926
  );
59748
59927
  output_manager_default.log(
@@ -59840,12 +60019,12 @@ async function login(client, telemetry) {
59840
60019
  client.writeToConfigFile();
59841
60020
  output_manager_default.debug(`Saved credentials in "${humanizePath(client.getGlobalPathConfig())}"`);
59842
60021
  output_manager_default.print(`
59843
- ${import_chalk11.default.cyan("Congratulations!")} You are now signed in.
60022
+ ${import_chalk12.default.cyan("Congratulations!")} You are now signed in.
59844
60023
 
59845
60024
  To deploy something, run ${getCommandName()}.
59846
60025
 
59847
60026
  ${emoji("tip")} To deploy every commit automatically,
59848
- connect a Git Repository (${import_chalk11.default.bold(output_manager_default.link("vercel.link/git", "https://vercel.link/git", { color: false }))}).
60027
+ connect a Git Repository (${import_chalk12.default.bold(output_manager_default.link("vercel.link/git", "https://vercel.link/git", { color: false }))}).
59849
60028
  `);
59850
60029
  telemetry.trackState("success");
59851
60030
  return 0;
@@ -59977,7 +60156,7 @@ async function envPullCommandLogic(client, filename, skipConfirmation, environme
59977
60156
  const head = tryReadHeadSync(fullPath, Buffer.byteLength(CONTENTS_PREFIX));
59978
60157
  const exists = typeof head !== "undefined";
59979
60158
  if (head === CONTENTS_PREFIX && !oidcTokenOnly) {
59980
- output_manager_default.log(`Overwriting existing ${import_chalk12.default.bold(filename)} file`);
60159
+ output_manager_default.log(`Overwriting existing ${import_chalk13.default.bold(filename)} file`);
59981
60160
  } else if (exists && !skipConfirmation && !oidcTokenOnly) {
59982
60161
  if (client.nonInteractive) {
59983
60162
  outputActionRequired(client, {
@@ -60005,13 +60184,13 @@ async function envPullCommandLogic(client, filename, skipConfirmation, environme
60005
60184
  }
60006
60185
  }
60007
60186
  const projectSlugLink = formatProject(link.org.slug, link.project.name);
60008
- const downloadMessage = oidcTokenOnly ? `Downloading a fresh \`${import_chalk12.default.cyan(
60187
+ const downloadMessage = oidcTokenOnly ? `Downloading a fresh \`${import_chalk13.default.cyan(
60009
60188
  VERCEL_OIDC_TOKEN
60010
- )}\` for ${projectSlugLink}` : gitBranch ? `Downloading \`${import_chalk12.default.cyan(
60189
+ )}\` for ${projectSlugLink}` : gitBranch ? `Downloading \`${import_chalk13.default.cyan(
60011
60190
  environment
60012
- )}\` environment variables for ${projectSlugLink} and any overrides for branch ${import_chalk12.default.cyan(
60191
+ )}\` environment variables for ${projectSlugLink} and any overrides for branch ${import_chalk13.default.cyan(
60013
60192
  gitBranch
60014
- )}` : `Downloading \`${import_chalk12.default.cyan(
60193
+ )}` : `Downloading \`${import_chalk13.default.cyan(
60015
60194
  environment
60016
60195
  )}\` environment variables for ${projectSlugLink}`;
60017
60196
  output_manager_default.log(downloadMessage);
@@ -60026,13 +60205,10 @@ async function envPullCommandLogic(client, filename, skipConfirmation, environme
60026
60205
  let oldEnv;
60027
60206
  if (exists && !oidcTokenOnly) {
60028
60207
  oldEnv = await createEnvObject(fullPath);
60029
- if (oldEnv) {
60030
- const newEnv = (0, import_json_parse_better_errors.default)(JSON.stringify(records).replace(/\\"/g, ""));
60031
- deltaString = buildDeltaString(oldEnv, newEnv);
60032
- }
60033
60208
  }
60034
60209
  let contents;
60035
60210
  let fileChanged = true;
60211
+ const keptLocalKeys = [];
60036
60212
  if (oidcTokenOnly) {
60037
60213
  const existingContents = exists ? await (0, import_fs_extra5.readFile)(fullPath, "utf8") : "";
60038
60214
  contents = updateOidcTokenContents(
@@ -60041,7 +60217,22 @@ async function envPullCommandLogic(client, filename, skipConfirmation, environme
60041
60217
  );
60042
60218
  fileChanged = contents !== existingContents;
60043
60219
  } else {
60044
- contents = CONTENTS_PREFIX + Object.keys(records).sort().filter((key) => !VARIABLES_TO_IGNORE.includes(key)).map((key) => `${key}="${escapeValue2(records[key])}"`).join("\n") + "\n";
60220
+ const mergedRecords = { ...records };
60221
+ if (oldEnv) {
60222
+ for (const [key, value] of Object.entries(oldEnv)) {
60223
+ if (!(key in mergedRecords) && key !== VERCEL_OIDC_TOKEN && !VARIABLES_TO_IGNORE.includes(key)) {
60224
+ mergedRecords[key] = value;
60225
+ keptLocalKeys.push(key);
60226
+ }
60227
+ }
60228
+ }
60229
+ contents = CONTENTS_PREFIX + Object.keys(mergedRecords).sort().filter((key) => !VARIABLES_TO_IGNORE.includes(key)).map((key) => `${key}="${escapeValue2(mergedRecords[key])}"`).join("\n") + "\n";
60230
+ if (oldEnv) {
60231
+ const newEnv = (0, import_json_parse_better_errors.default)(
60232
+ JSON.stringify(mergedRecords).replace(/\\"/g, "")
60233
+ );
60234
+ deltaString = buildDeltaString(oldEnv, newEnv);
60235
+ }
60045
60236
  }
60046
60237
  if (fileChanged) {
60047
60238
  await (0, import_fs_extra5.outputFile)(fullPath, contents, "utf8");
@@ -60051,6 +60242,13 @@ async function envPullCommandLogic(client, filename, skipConfirmation, environme
60051
60242
  } else if (oldEnv && exists) {
60052
60243
  output_manager_default.log("No changes found.");
60053
60244
  }
60245
+ if (keptLocalKeys.length > 0) {
60246
+ output_manager_default.log(
60247
+ `Kept ${keptLocalKeys.sort().map((key) => import_chalk13.default.bold(key)).join(", ")} (defined locally, not found in the ${import_chalk13.default.cyan(
60248
+ environment
60249
+ )} Environment)`
60250
+ );
60251
+ }
60054
60252
  let isGitIgnoreUpdated = false;
60055
60253
  const fileExistsAfterPull = exists || contents.length > 0;
60056
60254
  if (filename === ".env.local" && fileExistsAfterPull) {
@@ -60125,7 +60323,7 @@ function escapeValue2(value) {
60125
60323
  }
60126
60324
 
60127
60325
  // src/util/projects/find-project-root.ts
60128
- var import_chalk13 = __toESM(require_source(), 1);
60326
+ var import_chalk14 = __toESM(require_source(), 1);
60129
60327
  var import_fs_extra7 = __toESM(require_lib2(), 1);
60130
60328
  import { stat } from "fs/promises";
60131
60329
  import { join as join8, dirname } from "path";
@@ -61072,7 +61270,7 @@ async function resolveProjectCwd(cwd) {
61072
61270
  }
61073
61271
  const result = await tryDetectServices(projectRoot);
61074
61272
  if (result && (result.services?.length ?? 0) > 0) {
61075
- output_manager_default.debug(`Running from project root: ${import_chalk13.default.cyan(projectRoot)}`);
61273
+ output_manager_default.debug(`Running from project root: ${import_chalk14.default.cyan(projectRoot)}`);
61076
61274
  return projectRoot;
61077
61275
  }
61078
61276
  return cwd;
@@ -61226,8 +61424,8 @@ async function getLinkFromDir(dir) {
61226
61424
  }
61227
61425
  }
61228
61426
  async function hasProjectLink(client, projectLink, path) {
61229
- const VERCEL_ORG_ID = getPlatformEnv("ORG_ID");
61230
- const VERCEL_PROJECT_ID = getPlatformEnv("PROJECT_ID");
61427
+ const VERCEL_ORG_ID = getPlatformEnv2("ORG_ID");
61428
+ const VERCEL_PROJECT_ID = getPlatformEnv2("PROJECT_ID");
61231
61429
  if (VERCEL_ORG_ID === projectLink.orgId && VERCEL_PROJECT_ID === projectLink.projectId) {
61232
61430
  return true;
61233
61431
  }
@@ -61256,8 +61454,8 @@ async function hasProjectLink(client, projectLink, path) {
61256
61454
  }
61257
61455
  async function getLinkedProject(client, path = client.cwd, projectName, apiFallback) {
61258
61456
  path = await resolveProjectCwd(path);
61259
- const VERCEL_ORG_ID = getPlatformEnv("ORG_ID");
61260
- const VERCEL_PROJECT_ID = getPlatformEnv("PROJECT_ID");
61457
+ const VERCEL_ORG_ID = getPlatformEnv2("ORG_ID");
61458
+ const VERCEL_PROJECT_ID = getPlatformEnv2("PROJECT_ID");
61261
61459
  const shouldUseEnv = Boolean(VERCEL_ORG_ID && VERCEL_PROJECT_ID);
61262
61460
  if ((VERCEL_ORG_ID || VERCEL_PROJECT_ID) && !shouldUseEnv) {
61263
61461
  output_manager_default.error(
@@ -61780,6 +61978,7 @@ export {
61780
61978
  onExit,
61781
61979
  createPrompt,
61782
61980
  esm_default,
61981
+ Separator,
61783
61982
  esm_default2,
61784
61983
  esm_default3,
61785
61984
  ua_default,
@@ -61790,6 +61989,9 @@ export {
61790
61989
  refreshTokenRequest,
61791
61990
  performDeviceCodeFlow,
61792
61991
  login,
61992
+ modify,
61993
+ applyEdits,
61994
+ init_main,
61793
61995
  require_inherits,
61794
61996
  require_tar_fs,
61795
61997
  require_dist7 as require_dist,
@@ -61802,6 +62004,8 @@ export {
61802
62004
  createGitMeta,
61803
62005
  parseGitConfig,
61804
62006
  pluckRemoteUrls,
62007
+ ALIGNED_LABEL_WIDTH,
62008
+ printAlignedLabel,
61805
62009
  selectOrg,
61806
62010
  createProject,
61807
62011
  require_frameworks,
@@ -61816,7 +62020,6 @@ export {
61816
62020
  printRemoteUrls,
61817
62021
  selectAndParseRemoteUrl,
61818
62022
  checkExistsAndConnect,
61819
- printAlignedLabel,
61820
62023
  getRepoLink,
61821
62024
  resolveGitRemote,
61822
62025
  fetchProjectsForRepoUrl,