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
  } from "../../chunks/chunk-2HSQ7YUK.js";
10
10
  import {
11
11
  getUpdateCommand
12
- } from "../../chunks/chunk-KNSDQCVQ.js";
12
+ } from "../../chunks/chunk-MBH4DFF7.js";
13
13
  import {
14
14
  highlight
15
15
  } from "../../chunks/chunk-V5P25P7F.js";
@@ -26,23 +26,23 @@ import {
26
26
  require_mime_types,
27
27
  require_npa,
28
28
  staticFiles
29
- } from "../../chunks/chunk-GAJ2ESDD.js";
29
+ } from "../../chunks/chunk-FN36GZDS.js";
30
30
  import "../../chunks/chunk-IB5L4LKZ.js";
31
31
  import {
32
32
  pickOverrides
33
- } from "../../chunks/chunk-MV65GD4L.js";
33
+ } from "../../chunks/chunk-N4VWB5RV.js";
34
34
  import "../../chunks/chunk-24FCBXI4.js";
35
35
  import {
36
36
  displayDetectedServices,
37
37
  printProjectNotFoundError,
38
38
  readConfig,
39
39
  setupAndLink
40
- } from "../../chunks/chunk-QMZO4CEP.js";
41
- import "../../chunks/chunk-QH7WYDEP.js";
40
+ } from "../../chunks/chunk-KODCUW77.js";
41
+ import "../../chunks/chunk-IC4YEIGW.js";
42
42
  import {
43
43
  getLocalPathConfig
44
- } from "../../chunks/chunk-DKE73NGN.js";
45
- import "../../chunks/chunk-HMFUXSD7.js";
44
+ } from "../../chunks/chunk-C6E2RJS7.js";
45
+ import "../../chunks/chunk-VSD5BID5.js";
46
46
  import {
47
47
  help
48
48
  } from "../../chunks/chunk-QY63UKTP.js";
@@ -71,11 +71,11 @@ import {
71
71
  resolveProjectCwd,
72
72
  tryDetectServices,
73
73
  validateConfig
74
- } from "../../chunks/chunk-I4NRKN2Z.js";
74
+ } from "../../chunks/chunk-THMFJODG.js";
75
75
  import {
76
76
  buildCommandWithYes,
77
77
  outputActionRequired
78
- } from "../../chunks/chunk-2QBF3ZL3.js";
78
+ } from "../../chunks/chunk-CB3I3QIT.js";
79
79
  import {
80
80
  TelemetryClient
81
81
  } from "../../chunks/chunk-ECCWJHC6.js";
@@ -18338,9 +18338,14 @@ var ServicesOrchestrator = class {
18338
18338
  this.proxyOrigin = options.proxyOrigin;
18339
18339
  this.envFilesValues = options.env;
18340
18340
  this.useImplicitEnvInjection = options.useImplicitEnvInjection;
18341
- this.pythonServiceCount = options.services.filter(
18342
- (s) => s.runtime === "python"
18343
- ).length;
18341
+ this.preferServiceBuilder = options.preferServiceBuilder ?? false;
18342
+ const pythonWorkspaces = options.services.filter((service) => service.runtime === "python").map(
18343
+ (service) => path3.resolve(
18344
+ this.cwd,
18345
+ (0, import_fs_detectors2.isExperimentalServiceV2)(service) ? service.root || "." : service.workspace || "."
18346
+ )
18347
+ );
18348
+ this.pythonServiceCount = new Set(pythonWorkspaces).size;
18344
18349
  this.hasQueueServices = options.services.filter(isExperimentalService).some(isQueueBackedService);
18345
18350
  }
18346
18351
  // Synchronously SIGKILL every tracked process group. Used from
@@ -18630,8 +18635,7 @@ var ServicesOrchestrator = class {
18630
18635
  rootPath: path3.join(this.cwd, workspace),
18631
18636
  rootLabel: workspace,
18632
18637
  framework,
18633
- // Prefer the framework's useRuntime, falling back to the resolved builder.
18634
- builderSpec: framework?.useRuntime?.use || service.builder?.use,
18638
+ builderSpec: this.preferServiceBuilder ? service.builder?.use || framework?.useRuntime?.use : framework?.useRuntime?.use || service.builder?.use,
18635
18639
  entrypoint: getEntrypointForService(
18636
18640
  service.builder?.src,
18637
18641
  service.entrypoint,
@@ -19018,12 +19022,18 @@ var QueueBroker = class {
19018
19022
  if (!isQueueBackedService2(service))
19019
19023
  continue;
19020
19024
  const topicConfigs = getServiceQueueTopicConfigs(service);
19025
+ const consumerGroup = service.consumer ?? service.name;
19021
19026
  for (const topicConfig of topicConfigs) {
19022
19027
  const topicPattern = topicConfig.topic;
19023
- const id = `${service.name}::${topicPattern}`;
19028
+ const id = `${consumerGroup}::${topicPattern}`;
19029
+ if (this.deliveryState.has(id)) {
19030
+ throw new Error(
19031
+ `Queue consumer "${consumerGroup}" is configured more than once for topic "${topicPattern}"`
19032
+ );
19033
+ }
19024
19034
  const group = {
19025
19035
  id,
19026
- name: service.name,
19036
+ name: consumerGroup,
19027
19037
  topicPattern,
19028
19038
  topicRegex: topicPatternToRegex(topicPattern),
19029
19039
  serviceOriginFn: () => this.getServiceOrigin(service.name),
@@ -19134,7 +19144,9 @@ var QueueBroker = class {
19134
19144
  };
19135
19145
  }
19136
19146
  receiveMessages(queueName, consumerGroup, options) {
19137
- const group = this.consumerGroups.find((g) => g.name === consumerGroup);
19147
+ const group = this.consumerGroups.find(
19148
+ (g) => g.name === consumerGroup && g.topicRegex.test(queueName)
19149
+ );
19138
19150
  if (!group)
19139
19151
  return [];
19140
19152
  const groupDeliveries = this.deliveryState.get(group.id);
@@ -19374,6 +19386,50 @@ var QueueBroker = class {
19374
19386
  }
19375
19387
  };
19376
19388
 
19389
+ // src/util/dev/dev-sidecars.ts
19390
+ function toOrchestratorService(sidecar) {
19391
+ const { type: _type, ...subscriber } = sidecar;
19392
+ return {
19393
+ ...subscriber,
19394
+ schema: "experimentalServices",
19395
+ type: "worker",
19396
+ trigger: "queue"
19397
+ };
19398
+ }
19399
+ async function collectBuilderDevSidecars({
19400
+ builds,
19401
+ workPath
19402
+ }) {
19403
+ const builderSpecs = new Set(builds.map((build) => build.use));
19404
+ const buildersWithPkgs = await importBuilders(builderSpecs, workPath);
19405
+ const nestedSidecars = await Promise.all(
19406
+ builds.map((build) => {
19407
+ const builder = buildersWithPkgs.get(build.use)?.builder;
19408
+ if (!builder) {
19409
+ throw new Error(`Failed to load Builder "${build.use}"`);
19410
+ }
19411
+ return builder.getDevSidecars?.({ workPath, build }) ?? [];
19412
+ })
19413
+ );
19414
+ const sidecars = nestedSidecars.flat();
19415
+ const names = /* @__PURE__ */ new Set();
19416
+ for (const sidecar of sidecars) {
19417
+ const { name, type } = sidecar;
19418
+ if (type !== "subscriber") {
19419
+ throw new Error(
19420
+ `Development sidecar "${name}" has unsupported type "${type}"`
19421
+ );
19422
+ }
19423
+ if (names.has(name)) {
19424
+ throw new Error(
19425
+ `Multiple builders contributed a development sidecar named "${name}"`
19426
+ );
19427
+ }
19428
+ names.add(name);
19429
+ }
19430
+ return sidecars;
19431
+ }
19432
+
19377
19433
  // src/util/dev/headers.ts
19378
19434
  function nodeHeadersToFetchHeaders(nodeHeaders) {
19379
19435
  const headers = new Headers();
@@ -19504,6 +19560,7 @@ var DevCommandExitError = class extends Error {
19504
19560
  };
19505
19561
  var DevServer = class {
19506
19562
  constructor(cwd, options) {
19563
+ this.initialDevCommandStarted = false;
19507
19564
  this.responseTransformsByReq = /* @__PURE__ */ new WeakMap();
19508
19565
  this.clearVercelConfigPromise = () => {
19509
19566
  this.getVercelConfigPromise = null;
@@ -19576,7 +19633,7 @@ var DevServer = class {
19576
19633
  };
19577
19634
  /**
19578
19635
  * Handle /_svc/_queues/* routes for the dev queue broker, which mimics
19579
- * the Vercel Queues v3 API so workers can be used in vc dev unchanged.
19636
+ * the Vercel Queues v3 API so subscribers can be used in vc dev unchanged.
19580
19637
  */
19581
19638
  this.handleQueuesRoute = async (req, res, pathname) => {
19582
19639
  if (!this.queueBroker) {
@@ -19771,7 +19828,7 @@ ${partHeaders}\r
19771
19828
  debug(`Rewriting URL from "${req.url}" to "${location}"`);
19772
19829
  req.url = location;
19773
19830
  }
19774
- if (callLevel === 0 && this.orchestrator) {
19831
+ if (callLevel === 0 && this.queueBroker) {
19775
19832
  const pathname = parsed.pathname || "/";
19776
19833
  if (pathname.startsWith("/_svc/_queues/")) {
19777
19834
  await this.handleQueuesRoute(req, res, pathname);
@@ -20233,6 +20290,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
20233
20290
  isDev: true,
20234
20291
  requestPath,
20235
20292
  devCacheDir,
20293
+ ...this.getSidecarDevMeta(match),
20236
20294
  env: {
20237
20295
  ...envConfigs.runEnv,
20238
20296
  VERCEL_DEBUG_PREFIX: output_manager_default.debugEnabled ? "[builder]" : void 0
@@ -20491,10 +20549,68 @@ Please ensure that ${cmd(err.path)} is properly installed`;
20491
20549
  return this._address;
20492
20550
  }
20493
20551
  shouldUseServicesOrchestrator() {
20494
- if (!this.services || this.services.length === 0) {
20495
- return false;
20552
+ return Boolean(this.services && this.services.length > 0);
20553
+ }
20554
+ hasSubscribers() {
20555
+ return Boolean(this.sidecars?.length);
20556
+ }
20557
+ getDevQueueEnv() {
20558
+ return {
20559
+ // Existing vercel-runtime compatibility contract.
20560
+ VERCEL_HAS_WORKER_SERVICES: "1",
20561
+ VERCEL_QUEUE_BASE_URL: `${this.address.origin}/_svc/_queues`,
20562
+ VERCEL_QUEUE_TOKEN: "vc-dev-token"
20563
+ };
20564
+ }
20565
+ getSidecarDevMeta(match) {
20566
+ const serviceCount = (this.sidecars ?? []).filter((sidecar) => {
20567
+ if (sidecar.builder.use !== match.use)
20568
+ return false;
20569
+ return !sidecar.workspace || sidecar.workspace === ".";
20570
+ }).length;
20571
+ return serviceCount > 0 ? { serviceCount } : {};
20572
+ }
20573
+ async setupBuilderDevSidecars() {
20574
+ if (this.shouldUseServicesOrchestrator()) {
20575
+ return;
20496
20576
  }
20497
- return true;
20577
+ const sidecars = this.sidecars ?? [];
20578
+ if (sidecars.length === 0) {
20579
+ return;
20580
+ }
20581
+ Object.assign(this.envConfigs.runEnv, this.getDevQueueEnv());
20582
+ const services = sidecars.map(toOrchestratorService);
20583
+ const orchestrator = new ServicesOrchestrator({
20584
+ services,
20585
+ cwd: this.cwd,
20586
+ repoRoot: this.repoRoot,
20587
+ env: this.envConfigs.allEnv,
20588
+ proxyOrigin: this.address.origin,
20589
+ useImplicitEnvInjection: false,
20590
+ preferServiceBuilder: true
20591
+ });
20592
+ const queueBroker = new QueueBroker(
20593
+ services,
20594
+ (name) => orchestrator.getServiceOrigin(name)
20595
+ );
20596
+ this.sidecarOrchestrator = orchestrator;
20597
+ this.queueBroker = queueBroker;
20598
+ try {
20599
+ await orchestrator.startAll();
20600
+ } catch (err) {
20601
+ queueBroker.stop();
20602
+ this.queueBroker = void 0;
20603
+ await orchestrator.stopAll();
20604
+ this.sidecarOrchestrator = void 0;
20605
+ this.sidecars = [];
20606
+ throw err;
20607
+ }
20608
+ output_manager_default.log(
20609
+ `Started ${sidecars.length} development ${(0, import_pluralize2.default)(
20610
+ "sidecar",
20611
+ sidecars.length
20612
+ )}`
20613
+ );
20498
20614
  }
20499
20615
  async exit(code = 1) {
20500
20616
  await this.stop(code);
@@ -20758,7 +20874,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
20758
20874
  return void 0;
20759
20875
  }
20760
20876
  async _getVercelConfig() {
20761
- const { compileVercelConfig } = await import("../../chunks/compile-vercel-config-OKONVGZI.js");
20877
+ const { compileVercelConfig } = await import("../../chunks/compile-vercel-config-65QWHKPO.js");
20762
20878
  await compileVercelConfig(this.cwd);
20763
20879
  const configPath = getLocalPathConfig(this.cwd);
20764
20880
  const [
@@ -20797,7 +20913,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
20797
20913
  trailingSlash,
20798
20914
  workPath: this.cwd
20799
20915
  });
20800
- let {
20916
+ const {
20801
20917
  builders,
20802
20918
  warnings,
20803
20919
  errors,
@@ -20817,9 +20933,6 @@ Please ensure that ${cmd(err.path)} is properly installed`;
20817
20933
  );
20818
20934
  }
20819
20935
  if (builders) {
20820
- if (this.devCommand || this.services && this.services.length > 0) {
20821
- builders = builders.filter(filterFrontendBuilds);
20822
- }
20823
20936
  vercelConfig.builds = vercelConfig.builds || [];
20824
20937
  vercelConfig.builds.push(...builders);
20825
20938
  delete vercelConfig.functions;
@@ -20851,6 +20964,12 @@ Please ensure that ${cmd(err.path)} is properly installed`;
20851
20964
  routes.push(...defaultRoutes || []);
20852
20965
  vercelConfig.routes = routes;
20853
20966
  }
20967
+ if (this.sidecars === void 0) {
20968
+ this.sidecars = this.shouldUseServicesOrchestrator() ? [] : await collectBuilderDevSidecars({
20969
+ builds: vercelConfig.builds ?? [],
20970
+ workPath: this.cwd
20971
+ });
20972
+ }
20854
20973
  if (Array.isArray(vercelConfig.builds)) {
20855
20974
  if (this.devCommand || this.services && this.services.length > 0) {
20856
20975
  vercelConfig.builds = vercelConfig.builds.filter(filterFrontendBuilds);
@@ -20911,8 +21030,13 @@ Please ensure that ${cmd(err.path)} is properly installed`;
20911
21030
  if (this.projectSettings?.autoExposeSystemEnvs) {
20912
21031
  runEnv["VERCEL_REGION"] = "dev1";
20913
21032
  }
21033
+ if (this.hasSubscribers()) {
21034
+ Object.assign(runEnv, this.getDevQueueEnv());
21035
+ }
20914
21036
  this.envConfigs = { buildEnv, runEnv, allEnv };
20915
- await this.runDevCommand();
21037
+ if (this.initialDevCommandStarted) {
21038
+ await this.runDevCommand();
21039
+ }
20916
21040
  return vercelConfig;
20917
21041
  }
20918
21042
  async readJsonFile(filePath) {
@@ -21058,6 +21182,12 @@ Please ensure that ${cmd(err.path)} is properly installed`;
21058
21182
  this._address = new URL(replaceLocalhost(address));
21059
21183
  const vercelConfig = await this.getVercelConfig();
21060
21184
  let devCommandPromise;
21185
+ const startDevCommand = () => {
21186
+ this.initialDevCommandStarted = true;
21187
+ devCommandPromise = this.runDevCommand();
21188
+ void devCommandPromise.catch(() => {
21189
+ });
21190
+ };
21061
21191
  if (this.shouldUseServicesOrchestrator()) {
21062
21192
  this.orchestrator = new ServicesOrchestrator({
21063
21193
  services: this.services || [],
@@ -21094,8 +21224,8 @@ Please ensure that ${cmd(err.path)} is properly installed`;
21094
21224
  output_manager_default.print(` ${link_default(addressFormatted)}
21095
21225
  `);
21096
21226
  }
21097
- } else {
21098
- devCommandPromise = this.runDevCommand();
21227
+ } else if (!this.hasSubscribers()) {
21228
+ startDevCommand();
21099
21229
  }
21100
21230
  const files = await staticFiles(this.cwd, {});
21101
21231
  this.files = {};
@@ -21109,6 +21239,10 @@ Please ensure that ${cmd(err.path)} is properly installed`;
21109
21239
  }
21110
21240
  }
21111
21241
  await this.updateBuildMatches(vercelConfig, true);
21242
+ await this.setupBuilderDevSidecars();
21243
+ if (!this.shouldUseServicesOrchestrator() && !devCommandPromise) {
21244
+ startDevCommand();
21245
+ }
21112
21246
  const blockingBuilds = Array.from(this.buildMatches.values()).filter(
21113
21247
  needsBlockingBuild
21114
21248
  );
@@ -21141,9 +21275,9 @@ Please ensure that ${cmd(err.path)} is properly installed`;
21141
21275
  await (0, import_once.default)(this.watcher, "ready");
21142
21276
  this.server.on("upgrade", async (req, socket, head) => {
21143
21277
  await this.startPromise;
21144
- if (this.orchestrator) {
21278
+ if (this.orchestrator || this.sidecarOrchestrator) {
21145
21279
  const pathname2 = url3.parse(req.url || "/").pathname || "/";
21146
- const service = this.orchestrator.getServiceForRoute(pathname2);
21280
+ const service = this.orchestrator?.getServiceForRoute(pathname2) || this.sidecarOrchestrator?.getServiceForRoute(pathname2);
21147
21281
  if (service) {
21148
21282
  const target = `http://${service.host}:${service.port}`;
21149
21283
  output_manager_default.debug(
@@ -21152,32 +21286,34 @@ Please ensure that ${cmd(err.path)} is properly installed`;
21152
21286
  this.proxy.ws(req, socket, head, { target });
21153
21287
  return;
21154
21288
  }
21155
- const vercelConfig2 = await this.getVercelConfig();
21156
- if (vercelConfig2.experimentalServicesV2 || vercelConfig2.services) {
21157
- const routeResult = await devRouter(
21158
- req.url || "/",
21159
- req.method,
21160
- vercelConfig2.routes,
21161
- this,
21162
- vercelConfig2
21163
- );
21164
- if (isServiceDestination(routeResult.matched_route)) {
21165
- const { service: serviceName } = routeResult.matched_route.destination;
21166
- const origin = this.orchestrator.getServiceOrigin(serviceName);
21167
- if (origin) {
21168
- output_manager_default.debug(
21169
- `Detected "upgrade" event, proxying to service "${serviceName}" at ${origin}`
21170
- );
21171
- this.proxy.ws(req, socket, head, { target: origin });
21172
- return;
21289
+ if (this.orchestrator) {
21290
+ const vercelConfig2 = await this.getVercelConfig();
21291
+ if (vercelConfig2.experimentalServicesV2 || vercelConfig2.services) {
21292
+ const routeResult = await devRouter(
21293
+ req.url || "/",
21294
+ req.method,
21295
+ vercelConfig2.routes,
21296
+ this,
21297
+ vercelConfig2
21298
+ );
21299
+ if (isServiceDestination(routeResult.matched_route)) {
21300
+ const { service: serviceName } = routeResult.matched_route.destination;
21301
+ const origin = this.orchestrator.getServiceOrigin(serviceName);
21302
+ if (origin) {
21303
+ output_manager_default.debug(
21304
+ `Detected "upgrade" event, proxying to service "${serviceName}" at ${origin}`
21305
+ );
21306
+ this.proxy.ws(req, socket, head, { target: origin });
21307
+ return;
21308
+ }
21173
21309
  }
21174
21310
  }
21311
+ output_manager_default.debug(
21312
+ `Detected "upgrade" event, but no matching service found for ${pathname2}`
21313
+ );
21314
+ socket.destroy();
21315
+ return;
21175
21316
  }
21176
- output_manager_default.debug(
21177
- `Detected "upgrade" event, but no matching service found for ${pathname2}`
21178
- );
21179
- socket.destroy();
21180
- return;
21181
21317
  }
21182
21318
  if (this.devProcessOrigin) {
21183
21319
  const target = this.devProcessOrigin;
@@ -21188,7 +21324,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
21188
21324
  const pathname = url3.parse(req.url || "/").pathname || "/";
21189
21325
  for (const match of this.buildMatches.values()) {
21190
21326
  const { builder } = match.builderWithPkg;
21191
- if (typeof builder.startDevServer === "function") {
21327
+ if ((builder.version === 3 || builder.version === -1) && typeof builder.startDevServer === "function") {
21192
21328
  try {
21193
21329
  const result = await builder.startDevServer({
21194
21330
  files: this.files,
@@ -21200,6 +21336,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
21200
21336
  isDev: true,
21201
21337
  requestPath: pathname,
21202
21338
  devCacheDir: this.devCacheDir,
21339
+ ...this.getSidecarDevMeta(match),
21203
21340
  env: { ...this.envConfigs.runEnv },
21204
21341
  buildEnv: { ...this.envConfigs.buildEnv }
21205
21342
  }
@@ -21252,6 +21389,9 @@ Please ensure that ${cmd(err.path)} is properly installed`;
21252
21389
  if (this.orchestrator) {
21253
21390
  ops.push(this.orchestrator.stopAll());
21254
21391
  }
21392
+ if (this.sidecarOrchestrator) {
21393
+ ops.push(this.sidecarOrchestrator.stopAll());
21394
+ }
21255
21395
  if (this.queueBroker) {
21256
21396
  this.queueBroker.stop();
21257
21397
  }
@@ -21673,11 +21813,13 @@ ${error_code}
21673
21813
  return;
21674
21814
  }
21675
21815
  this.currentDevCommand = devCommand2;
21676
- if (!devCommand2) {
21677
- return;
21678
- }
21679
21816
  if (this.devProcess) {
21680
21817
  await treeKill(this.devProcess.pid);
21818
+ this.devProcess = void 0;
21819
+ this.devProcessOrigin = void 0;
21820
+ }
21821
+ if (!devCommand2) {
21822
+ return;
21681
21823
  }
21682
21824
  output_manager_default.log(`Running Dev Command ${import_chalk2.default.cyan.bold(`\u201C${devCommand2}\u201D`)}`);
21683
21825
  const port = await (0, import_get_port2.default)();
@@ -21693,6 +21835,7 @@ ${error_code}
21693
21835
  },
21694
21836
  process.env,
21695
21837
  this.envConfigs.allEnv,
21838
+ this.hasSubscribers() ? this.getDevQueueEnv() : void 0,
21696
21839
  {
21697
21840
  PORT: `${port}`
21698
21841
  }
@@ -5,11 +5,12 @@ const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
+ CHECKBOX_INSTRUCTIONS,
8
9
  ellipsis,
9
10
  getCustomEnvironments,
10
11
  readStandardInput,
11
12
  require_dist as require_dist3
12
- } from "../../chunks/chunk-ZZIAWRCX.js";
13
+ } from "../../chunks/chunk-W346YNDN.js";
13
14
  import {
14
15
  getInvalidSubcommand
15
16
  } from "../../chunks/chunk-VGIMO3ZK.js";
@@ -22,7 +23,7 @@ import {
22
23
  import {
23
24
  formatEnvironment,
24
25
  validateLsArgs
25
- } from "../../chunks/chunk-TLKTTWDA.js";
26
+ } from "../../chunks/chunk-36OUS2KE.js";
26
27
  import {
27
28
  validateJsonOutput
28
29
  } from "../../chunks/chunk-XPKWKPWA.js";
@@ -31,17 +32,17 @@ import {
31
32
  } from "../../chunks/chunk-YPQSDAEW.js";
32
33
  import {
33
34
  getCommandAliases
34
- } from "../../chunks/chunk-AUYY7RD3.js";
35
- import "../../chunks/chunk-3EMRC44D.js";
35
+ } from "../../chunks/chunk-NZ73KKYG.js";
36
+ import "../../chunks/chunk-5OT26JZN.js";
36
37
  import "../../chunks/chunk-7C7MMT4J.js";
37
38
  import "../../chunks/chunk-RLJA2KI7.js";
38
39
  import "../../chunks/chunk-JJWESW5Y.js";
39
- import "../../chunks/chunk-QKR7GNAK.js";
40
+ import "../../chunks/chunk-DREO3DFB.js";
40
41
  import "../../chunks/chunk-5AJNUXWP.js";
41
42
  import "../../chunks/chunk-7S3QUMIG.js";
42
43
  import "../../chunks/chunk-22GUZ5KG.js";
43
44
  import "../../chunks/chunk-IDMKFYEA.js";
44
- import "../../chunks/chunk-4UZF3U4N.js";
45
+ import "../../chunks/chunk-HA7C7SDO.js";
45
46
  import {
46
47
  require_execa
47
48
  } from "../../chunks/chunk-24FCBXI4.js";
@@ -52,7 +53,7 @@ import {
52
53
  stamp_default
53
54
  } from "../../chunks/chunk-64IF634X.js";
54
55
  import "../../chunks/chunk-VXYGCOKL.js";
55
- import "../../chunks/chunk-43I5EAPY.js";
56
+ import "../../chunks/chunk-3JOLICSO.js";
56
57
  import {
57
58
  help
58
59
  } from "../../chunks/chunk-QY63UKTP.js";
@@ -78,7 +79,7 @@ import {
78
79
  require_frameworks,
79
80
  runSubcommand,
80
81
  updateSubcommand
81
- } from "../../chunks/chunk-I4NRKN2Z.js";
82
+ } from "../../chunks/chunk-THMFJODG.js";
82
83
  import {
83
84
  buildCommandWithYes,
84
85
  buildEnvAddCommandWithPreservedArgs,
@@ -89,7 +90,7 @@ import {
89
90
  getPreservedArgsForEnvUpdate,
90
91
  outputActionRequired,
91
92
  outputAgentError
92
- } from "../../chunks/chunk-2QBF3ZL3.js";
93
+ } from "../../chunks/chunk-CB3I3QIT.js";
93
94
  import {
94
95
  TelemetryClient,
95
96
  require_dist as require_dist2
@@ -435,17 +436,6 @@ var SENSITIVE_VALUE_HINT = "Sensitive values cannot be read later";
435
436
  var SENSITIVE_SECRET_PROMPT = `Store as sensitive? ${import_chalk.default.dim(
436
437
  SENSITIVE_VALUE_HINT
437
438
  )}`;
438
- var CHECKBOX_INSTRUCTIONS = [
439
- " ",
440
- import_chalk.default.cyan("<space>"),
441
- import_chalk.default.dim(" select, "),
442
- import_chalk.default.cyan("<enter>"),
443
- import_chalk.default.dim(" confirm, "),
444
- import_chalk.default.cyan("<a>"),
445
- import_chalk.default.dim(" toggle all, "),
446
- import_chalk.default.cyan("<i>"),
447
- import_chalk.default.dim(" invert")
448
- ].join("");
449
439
  function filterEnvChoicesForSensitivity(choices, opts) {
450
440
  if (opts.isSensitive) {
451
441
  return choices.filter((c) => c.value !== "development");
@@ -11,28 +11,30 @@ import {
11
11
  addSubcommand7 as addSubcommand,
12
12
  getCommandAliases,
13
13
  linkCommand
14
- } from "../../chunks/chunk-AUYY7RD3.js";
15
- import "../../chunks/chunk-3EMRC44D.js";
14
+ } from "../../chunks/chunk-NZ73KKYG.js";
15
+ import "../../chunks/chunk-5OT26JZN.js";
16
16
  import "../../chunks/chunk-7C7MMT4J.js";
17
17
  import "../../chunks/chunk-RLJA2KI7.js";
18
18
  import "../../chunks/chunk-JJWESW5Y.js";
19
- import "../../chunks/chunk-QKR7GNAK.js";
19
+ import "../../chunks/chunk-DREO3DFB.js";
20
20
  import "../../chunks/chunk-5AJNUXWP.js";
21
21
  import "../../chunks/chunk-7S3QUMIG.js";
22
22
  import "../../chunks/chunk-22GUZ5KG.js";
23
23
  import "../../chunks/chunk-IDMKFYEA.js";
24
- import "../../chunks/chunk-4UZF3U4N.js";
24
+ import "../../chunks/chunk-HA7C7SDO.js";
25
25
  import {
26
26
  ensureLink
27
- } from "../../chunks/chunk-XCL7I6W5.js";
28
- import "../../chunks/chunk-QMZO4CEP.js";
29
- import "../../chunks/chunk-QH7WYDEP.js";
30
- import "../../chunks/chunk-DKE73NGN.js";
31
- import "../../chunks/chunk-43I5EAPY.js";
27
+ } from "../../chunks/chunk-ZHDXN5V3.js";
28
+ import "../../chunks/chunk-KODCUW77.js";
29
+ import "../../chunks/chunk-IC4YEIGW.js";
30
+ import {
31
+ isPromptCanceledError
32
+ } from "../../chunks/chunk-C6E2RJS7.js";
33
+ import "../../chunks/chunk-3JOLICSO.js";
32
34
  import {
33
35
  detectExplicitScope,
34
36
  getScope
35
- } from "../../chunks/chunk-HMFUXSD7.js";
37
+ } from "../../chunks/chunk-VSD5BID5.js";
36
38
  import {
37
39
  help
38
40
  } from "../../chunks/chunk-QY63UKTP.js";
@@ -42,8 +44,8 @@ import {
42
44
  ensureRepoLink,
43
45
  pull,
44
46
  resolveProjectCwd
45
- } from "../../chunks/chunk-I4NRKN2Z.js";
46
- import "../../chunks/chunk-2QBF3ZL3.js";
47
+ } from "../../chunks/chunk-THMFJODG.js";
48
+ import "../../chunks/chunk-CB3I3QIT.js";
47
49
  import {
48
50
  TelemetryClient
49
51
  } from "../../chunks/chunk-ECCWJHC6.js";
@@ -146,6 +148,17 @@ async function refreshOidcTokenAfterLink(client, cwd) {
146
148
  }
147
149
  }
148
150
  async function link(client) {
151
+ try {
152
+ return await client.withEscapePromptCancellation(() => linkProject(client));
153
+ } catch (error) {
154
+ if (isPromptCanceledError(error)) {
155
+ output_manager_default.print(" Canceled.\n");
156
+ return 0;
157
+ }
158
+ throw error;
159
+ }
160
+ }
161
+ async function linkProject(client) {
149
162
  let parsedArgs = null;
150
163
  const flagsSpecification = getFlagsSpecification(linkCommand.options);
151
164
  try {
@@ -181,6 +194,9 @@ async function link(client) {
181
194
  try {
182
195
  await addRepoLink(client, client.cwd, { yes: yes2 });
183
196
  } catch (err) {
197
+ if (isPromptCanceledError(err)) {
198
+ throw err;
199
+ }
184
200
  output_manager_default.prettyError(err);
185
201
  return 1;
186
202
  }
@@ -222,22 +238,23 @@ async function link(client) {
222
238
  try {
223
239
  await ensureRepoLink(client, cwd, { yes, overwrite: true });
224
240
  } catch (err) {
241
+ if (isPromptCanceledError(err)) {
242
+ throw err;
243
+ }
225
244
  output_manager_default.prettyError(err);
226
245
  return 1;
227
246
  }
228
247
  } else {
229
248
  const explicitScopeProvided = detectExplicitScope(client);
230
- if (explicitScopeProvided) {
231
- await getScope(client, { resolveLocalScope: true });
232
- }
249
+ const selectedOrg = explicitScopeProvided ? (await getScope(client, { resolveLocalScope: true })).org : void 0;
233
250
  const linkNonInteractive = client.nonInteractive || client.argv.includes("--non-interactive");
234
251
  const link2 = await ensureLink("link", client, cwd, {
235
252
  autoConfirm: yes,
236
253
  forceDelete: true,
254
+ selectedOrg,
237
255
  projectName: parsedArgs.flags["--project"],
238
256
  successEmoji: "success",
239
257
  nonInteractive: linkNonInteractive,
240
- searchAcrossTeams: !explicitScopeProvided,
241
258
  pullEnv: false
242
259
  });
243
260
  if (typeof link2 === "number") {