vercel 59.6.2 → 59.9.1

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 (89) hide show
  1. package/dist/chunks/{add-HJSEM4YJ.js → add-6YKY5LGR.js} +2 -2
  2. package/dist/chunks/{add-4GQZ22ZN.js → add-DGK2A56E.js} +2 -2
  3. package/dist/chunks/{add-SIGUSM3Y.js → add-QZ5FW7LT.js} +5 -5
  4. package/dist/chunks/{build-XOMJDX4M.js → build-YFUXHSMU.js} +2 -2
  5. package/dist/chunks/{chunk-GISTGGBO.js → chunk-22GK226I.js} +3 -3
  6. package/dist/chunks/{chunk-WZ2S3A2A.js → chunk-2TXLG52H.js} +19 -3
  7. package/dist/chunks/{chunk-PRH6KRUT.js → chunk-3E62ATUY.js} +1 -1
  8. package/dist/chunks/{chunk-LXZVOR6F.js → chunk-52P3DIMH.js} +1 -1
  9. package/dist/chunks/{chunk-FRZULOVH.js → chunk-62XYUSRS.js} +1 -1
  10. package/dist/chunks/{chunk-V3MDDR2X.js → chunk-7PMXNOZH.js} +1 -1
  11. package/dist/chunks/{chunk-YJKZQEHS.js → chunk-DSBOE2OV.js} +1 -1
  12. package/dist/chunks/{chunk-R5PULMHT.js → chunk-FEQJSISH.js} +1 -1
  13. package/dist/chunks/{chunk-ZNMTDLYH.js → chunk-FME4CIZL.js} +2 -2
  14. package/dist/chunks/{chunk-SF3AYAIF.js → chunk-H43VTKRO.js} +4 -4
  15. package/dist/chunks/{chunk-3F5EGINT.js → chunk-HK2IYHVR.js} +1 -1
  16. package/dist/chunks/{chunk-2YRAWYGE.js → chunk-I526H4AS.js} +17 -0
  17. package/dist/chunks/{chunk-JH4WQRIU.js → chunk-I7ZVTKXM.js} +1 -1
  18. package/dist/chunks/{chunk-SWI6F4X3.js → chunk-IWNFDR3C.js} +5 -1
  19. package/dist/chunks/{chunk-YJUO3EKH.js → chunk-KJBZ5ZST.js} +0 -1
  20. package/dist/chunks/{chunk-37V5P4VO.js → chunk-LD3Q3MUI.js} +6 -6
  21. package/dist/chunks/{chunk-7HE63HCR.js → chunk-LDZFKXIR.js} +5 -1
  22. package/dist/chunks/{chunk-VJ5NAOWB.js → chunk-OHQJEOP7.js} +312 -192
  23. package/dist/chunks/{chunk-NGNN6WF2.js → chunk-PGTGT7AU.js} +3 -3
  24. package/dist/chunks/{chunk-GZQQNLF5.js → chunk-PIFTX5CY.js} +2 -2
  25. package/dist/chunks/{chunk-7R6M3BHM.js → chunk-QWOCOZMS.js} +1 -1
  26. package/dist/chunks/{chunk-6M2KZUED.js → chunk-T3MRP74K.js} +1 -1
  27. package/dist/chunks/{chunk-DE7MBNHQ.js → chunk-XN75ARAD.js} +1 -1
  28. package/dist/chunks/{chunk-2O5J3KMT.js → chunk-ZCAFRSCD.js} +1 -1
  29. package/dist/chunks/{clear-BWT2FJY4.js → clear-LHNLYPZB.js} +2 -2
  30. package/dist/chunks/{compile-vercel-config-DGM4NISW.js → compile-vercel-config-6KPIBWNU.js} +1 -1
  31. package/dist/chunks/{config-RSE6Z4LB.js → config-CNP7P3VD.js} +5 -5
  32. package/dist/chunks/{config-NJAN3RMU.js → config-UETLVP5G.js} +2 -2
  33. package/dist/chunks/config-validator.mjs +1 -1
  34. package/dist/chunks/{delete-SSL2PK2F.js → delete-BYCZJBHH.js} +2 -2
  35. package/dist/chunks/{delete-LROBRBAH.js → delete-MB7H2LWR.js} +2 -2
  36. package/dist/chunks/{disable-ASG5JDZR.js → disable-OCDW6U2Q.js} +2 -2
  37. package/dist/chunks/{discard-PV47B6IL.js → discard-DWPG5UX5.js} +2 -2
  38. package/dist/chunks/{edit-REI7HXGG.js → edit-ATX4K4OL.js} +2 -2
  39. package/dist/chunks/{edit-5ATYIOLX.js → edit-NOZXPAV3.js} +3 -3
  40. package/dist/chunks/{enable-LZXL7XAG.js → enable-BO5DALIP.js} +2 -2
  41. package/dist/chunks/{export-ZAZFQU2E.js → export-RS6X5DZW.js} +2 -2
  42. package/dist/chunks/{image-QPHN5V7L.js → image-QCNVSQFC.js} +3 -3
  43. package/dist/chunks/{import-builders-W3YE2V6A.js → import-builders-H4VASUQQ.js} +2 -2
  44. package/dist/chunks/{inspect-BFGK72WY.js → inspect-BOLFZZBM.js} +3 -3
  45. package/dist/chunks/{inspect-SJEZVGPK.js → inspect-GPLZZEW2.js} +2 -2
  46. package/dist/chunks/{inspect-SSOM3FXS.js → inspect-HHXFMDN2.js} +2 -2
  47. package/dist/chunks/{inspect-RDMC2Z3Q.js → inspect-LZUSSUNE.js} +2 -2
  48. package/dist/chunks/{inspect-FRXJRM6T.js → inspect-XXHIV73A.js} +2 -2
  49. package/dist/chunks/{list-PHDUZVMR.js → list-H7ED7LCU.js} +1 -1
  50. package/dist/chunks/{list-2HTR7Q3J.js → list-THFMP23I.js} +2 -2
  51. package/dist/chunks/{list-W33GXKDA.js → list-XDRILJOZ.js} +3 -3
  52. package/dist/chunks/{login-JWAFHVDG.js → login-6KR5DCYM.js} +2 -2
  53. package/dist/chunks/{ls-3MH2OCP3.js → ls-5QFIXKF3.js} +2 -2
  54. package/dist/chunks/{ls-KX2VBOGV.js → ls-5RGCKNYB.js} +3 -3
  55. package/dist/chunks/{ls-KDFU224B.js → ls-CBFHIORN.js} +2 -2
  56. package/dist/chunks/{ls-D2POUHI7.js → ls-GRY6G2OR.js} +2 -2
  57. package/dist/chunks/{ls-3AN2DZHN.js → ls-LXVF34KZ.js} +2 -2
  58. package/dist/chunks/{ls-RWKNJQNT.js → ls-PKN53PLB.js} +2 -2
  59. package/dist/chunks/{open-IEYRB6RL.js → open-Q7GEQR5J.js} +2 -2
  60. package/dist/chunks/{permissions-ZWZUMEHR.js → permissions-6SA56V2A.js} +4 -4
  61. package/dist/chunks/{publish-UWZYBDHK.js → publish-TYGP2WTZ.js} +2 -2
  62. package/dist/chunks/{push-IAEQ3FBF.js → push-5KTXEM2H.js} +2 -2
  63. package/dist/chunks/{query-NNOZYSED.js → query-DSYDUL7N.js} +1 -1
  64. package/dist/chunks/{reorder-TKBM244W.js → reorder-BEQAMXC3.js} +2 -2
  65. package/dist/chunks/{reply-FLBSBMTW.js → reply-GSQ5PVE4.js} +2 -2
  66. package/dist/chunks/{resolve-GJYPMWUE.js → resolve-AG4SS62T.js} +2 -2
  67. package/dist/chunks/{restore-PNI3TM3U.js → restore-LARYR55K.js} +2 -2
  68. package/dist/chunks/{rm-FN7LTIIL.js → rm-F5SIKHU2.js} +2 -2
  69. package/dist/chunks/{rm-PGJ4KR6U.js → rm-FG63ON57.js} +2 -2
  70. package/dist/chunks/{rm-76CSSSSV.js → rm-FPAFEN2E.js} +2 -2
  71. package/dist/chunks/{rm-FTE33UHE.js → rm-GPHZ3GID.js} +3 -3
  72. package/dist/chunks/{rm-FXA5DLXQ.js → rm-ZKG56ZEW.js} +3 -3
  73. package/dist/chunks/{rule-inspect-LJIGPTWS.js → rule-inspect-JS4BK6GZ.js} +3 -3
  74. package/dist/chunks/{rules-6BMNO6M5.js → rules-SMIGLNUR.js} +6 -6
  75. package/dist/chunks/{schema-HATXEQDP.js → schema-FRSEAOYM.js} +1 -1
  76. package/dist/chunks/{set-C3UQUQ42.js → set-E46SNNNI.js} +3 -3
  77. package/dist/chunks/{tags-BTVDROFG.js → tags-CMBXR3FL.js} +2 -2
  78. package/dist/chunks/{update-B6PSOHUW.js → update-M5WXFGQ4.js} +5 -5
  79. package/dist/commands/build/index.js +115 -7
  80. package/dist/commands/deploy/index.js +8 -8
  81. package/dist/commands/dev/index.js +335 -46
  82. package/dist/commands/env/index.js +4 -4
  83. package/dist/commands/link/index.js +3 -3
  84. package/dist/commands/list/index.js +3 -3
  85. package/dist/commands-bulk.js +92 -65
  86. package/dist/help.js +1 -1
  87. package/dist/index.js +9 -9
  88. package/dist/version.mjs +1 -1
  89. package/package.json +50 -50
@@ -9,7 +9,7 @@ import {
9
9
  } from "../../chunks/chunk-2HSQ7YUK.js";
10
10
  import {
11
11
  getUpdateCommand
12
- } from "../../chunks/chunk-3F5EGINT.js";
12
+ } from "../../chunks/chunk-HK2IYHVR.js";
13
13
  import {
14
14
  getGlobalPathConfig,
15
15
  highlight
@@ -26,19 +26,19 @@ import {
26
26
  require_get_files,
27
27
  require_mime_types,
28
28
  require_service_schedules
29
- } from "../../chunks/chunk-SWI6F4X3.js";
29
+ } from "../../chunks/chunk-IWNFDR3C.js";
30
30
  import {
31
31
  importBuilders,
32
32
  require_npa
33
- } from "../../chunks/chunk-WZ2S3A2A.js";
33
+ } from "../../chunks/chunk-2TXLG52H.js";
34
34
  import "../../chunks/chunk-IB5L4LKZ.js";
35
35
  import {
36
36
  pickOverrides
37
- } from "../../chunks/chunk-JH4WQRIU.js";
37
+ } from "../../chunks/chunk-I7ZVTKXM.js";
38
38
  import "../../chunks/chunk-5XECIWME.js";
39
39
  import {
40
40
  help
41
- } from "../../chunks/chunk-2YRAWYGE.js";
41
+ } from "../../chunks/chunk-I526H4AS.js";
42
42
  import {
43
43
  VERCEL_DIR,
44
44
  VERCEL_OIDC_TOKEN,
@@ -69,7 +69,7 @@ import {
69
69
  setupAndLink,
70
70
  tryDetectServices,
71
71
  validateConfig
72
- } from "../../chunks/chunk-VJ5NAOWB.js";
72
+ } from "../../chunks/chunk-OHQJEOP7.js";
73
73
  import "../../chunks/chunk-FXD67VN5.js";
74
74
  import {
75
75
  TelemetryClient
@@ -5133,32 +5133,32 @@ var require_ms2 = __commonJS({
5133
5133
  return void 0;
5134
5134
  }
5135
5135
  }
5136
- function fmtShort(ms7) {
5137
- if (ms7 >= d) {
5138
- return Math.round(ms7 / d) + "d";
5136
+ function fmtShort(ms8) {
5137
+ if (ms8 >= d) {
5138
+ return Math.round(ms8 / d) + "d";
5139
5139
  }
5140
- if (ms7 >= h) {
5141
- return Math.round(ms7 / h) + "h";
5140
+ if (ms8 >= h) {
5141
+ return Math.round(ms8 / h) + "h";
5142
5142
  }
5143
- if (ms7 >= m) {
5144
- return Math.round(ms7 / m) + "m";
5143
+ if (ms8 >= m) {
5144
+ return Math.round(ms8 / m) + "m";
5145
5145
  }
5146
- if (ms7 >= s) {
5147
- return Math.round(ms7 / s) + "s";
5146
+ if (ms8 >= s) {
5147
+ return Math.round(ms8 / s) + "s";
5148
5148
  }
5149
- return ms7 + "ms";
5149
+ return ms8 + "ms";
5150
5150
  }
5151
- function fmtLong(ms7) {
5152
- return plural3(ms7, d, "day") || plural3(ms7, h, "hour") || plural3(ms7, m, "minute") || plural3(ms7, s, "second") || ms7 + " ms";
5151
+ function fmtLong(ms8) {
5152
+ return plural3(ms8, d, "day") || plural3(ms8, h, "hour") || plural3(ms8, m, "minute") || plural3(ms8, s, "second") || ms8 + " ms";
5153
5153
  }
5154
- function plural3(ms7, n, name) {
5155
- if (ms7 < n) {
5154
+ function plural3(ms8, n, name) {
5155
+ if (ms8 < n) {
5156
5156
  return;
5157
5157
  }
5158
- if (ms7 < n * 1.5) {
5159
- return Math.floor(ms7 / n) + " " + name;
5158
+ if (ms8 < n * 1.5) {
5159
+ return Math.floor(ms8 / n) + " " + name;
5160
5160
  }
5161
- return Math.ceil(ms7 / n) + " " + name + "s";
5161
+ return Math.ceil(ms8 / n) + " " + name + "s";
5162
5162
  }
5163
5163
  }
5164
5164
  });
@@ -5191,8 +5191,8 @@ var require_debug = __commonJS({
5191
5191
  return;
5192
5192
  var self = debug;
5193
5193
  var curr = +/* @__PURE__ */ new Date();
5194
- var ms7 = curr - (prevTime || curr);
5195
- self.diff = ms7;
5194
+ var ms8 = curr - (prevTime || curr);
5195
+ self.diff = ms8;
5196
5196
  self.prev = prevTime;
5197
5197
  self.curr = curr;
5198
5198
  prevTime = curr;
@@ -16758,7 +16758,7 @@ import path5 from "path";
16758
16758
 
16759
16759
  // src/commands/dev/dev.ts
16760
16760
  var import_chalk3 = __toESM(require_source(), 1);
16761
- var import_ms6 = __toESM(require_ms(), 1);
16761
+ var import_ms7 = __toESM(require_ms(), 1);
16762
16762
  var import_fs_extra2 = __toESM(require_lib(), 1);
16763
16763
  var import_fs_detectors3 = __toESM(require_dist3(), 1);
16764
16764
  var import_frameworks3 = __toESM(require_frameworks(), 1);
@@ -16766,7 +16766,7 @@ import { resolve as resolve2, join as join6 } from "path";
16766
16766
 
16767
16767
  // src/util/dev/server.ts
16768
16768
  var import_fs_extra = __toESM(require_lib(), 1);
16769
- var import_ms4 = __toESM(require_ms(), 1);
16769
+ var import_ms5 = __toESM(require_ms(), 1);
16770
16770
  var import_chalk2 = __toESM(require_source(), 1);
16771
16771
  import url3, { URL as URL2 } from "url";
16772
16772
  import http from "http";
@@ -16788,8 +16788,8 @@ import path4, { isAbsolute as isAbsolute3, basename, dirname as dirname3, extnam
16788
16788
 
16789
16789
  // src/util/dev/port-utils.ts
16790
16790
  var import_is_port_reachable = __toESM(require_is_port_reachable(), 1);
16791
- function sleep(ms7) {
16792
- return new Promise((resolve3) => setTimeout(resolve3, ms7));
16791
+ function sleep(ms8) {
16792
+ return new Promise((resolve3) => setTimeout(resolve3, ms8));
16793
16793
  }
16794
16794
  async function getReachableHostOnPort(port) {
16795
16795
  const optsIpv4 = { host: "127.0.0.1" };
@@ -17473,7 +17473,8 @@ import {
17473
17473
  FileFsRef,
17474
17474
  normalizePath as normalizePath2,
17475
17475
  isBackendFramework,
17476
- isPythonFramework
17476
+ isPythonFramework,
17477
+ getNodeExecPath
17477
17478
  } from "@vercel/build-utils";
17478
17479
 
17479
17480
  // src/util/tree-kill.ts
@@ -17532,7 +17533,8 @@ async function deserializeBuildOutputs(serialized) {
17532
17533
  async function createBuildProcess(match, envConfigs, workPath) {
17533
17534
  output_manager_default.debug(`Creating build process for "${match.entrypoint}"`);
17534
17535
  const builderWorkerPath = join(__dirname, "builder-worker.cjs");
17535
- const PATH = `${dirname(process.execPath)}${delimiter}${process.env.PATH}`;
17536
+ const nodeExecPath = getNodeExecPath();
17537
+ const PATH = `${dirname(nodeExecPath)}${delimiter}${process.env.PATH}`;
17536
17538
  const env = {
17537
17539
  ...process.env,
17538
17540
  PATH,
@@ -17541,6 +17543,7 @@ async function createBuildProcess(match, envConfigs, workPath) {
17541
17543
  const buildProcess = fork(builderWorkerPath, [], {
17542
17544
  cwd: workPath,
17543
17545
  execArgv: [],
17546
+ execPath: nodeExecPath,
17544
17547
  env
17545
17548
  });
17546
17549
  match.buildProcess = buildProcess;
@@ -17673,6 +17676,11 @@ async function executeBuild(vercelConfig, devServer, files, match, requestPath,
17673
17676
  'The result of "builder.build()" must not contain `maxDuration`'
17674
17677
  );
17675
17678
  }
17679
+ if (output.affinity) {
17680
+ throw new Error(
17681
+ 'The result of "builder.build()" must not contain `affinity`'
17682
+ );
17683
+ }
17676
17684
  if (output.maxConcurrency) {
17677
17685
  throw new Error(
17678
17686
  'The result of "builder.build()" must not contain `maxConcurrency`'
@@ -17688,6 +17696,9 @@ async function executeBuild(vercelConfig, devServer, files, match, requestPath,
17688
17696
  if (func.maxDuration) {
17689
17697
  output.maxDuration = func.maxDuration;
17690
17698
  }
17699
+ if (func.affinity) {
17700
+ output.affinity = func.affinity;
17701
+ }
17691
17702
  if (func.maxConcurrency) {
17692
17703
  output.maxConcurrency = func.maxConcurrency;
17693
17704
  }
@@ -18060,7 +18071,7 @@ function redirect(it) {
18060
18071
  }
18061
18072
 
18062
18073
  // src/util/dev/services-orchestrator.ts
18063
- var import_ms2 = __toESM(require_ms(), 1);
18074
+ var import_ms3 = __toESM(require_ms(), 1);
18064
18075
  var import_get_port = __toESM(require_get_port(), 1);
18065
18076
  var import_chalk = __toESM(require_source(), 1);
18066
18077
  var import_frameworks = __toESM(require_frameworks(), 1);
@@ -18318,8 +18329,100 @@ function prependNodeRequireOption(nodeOptions, requirePath) {
18318
18329
  return nodeOptions ? `${requireOption} ${nodeOptions}` : requireOption;
18319
18330
  }
18320
18331
 
18332
+ // src/util/dev/runtime-cache.ts
18333
+ var import_ms2 = __toESM(require_ms(), 1);
18334
+ var DEV_RUNTIME_CACHE_PREFIX = "/_svc/_cache/";
18335
+ var DEV_RUNTIME_CACHE_ITEM_PREFIX = `${DEV_RUNTIME_CACHE_PREFIX}v1/suspense-cache/`;
18336
+ var HEADER_CACHE_STATE = "x-vercel-cache-state";
18337
+ var HEADER_CACHE_TAGS = "x-vercel-cache-tags";
18338
+ var HEADER_REVALIDATE = "x-vercel-revalidate";
18339
+ var HEADER_CACHE_ITEM_NAME = "x-vercel-cache-item-name";
18340
+ var TICK_INTERVAL = (0, import_ms2.default)("1m");
18341
+ function getDevRuntimeCacheEnv(origin) {
18342
+ return {
18343
+ RUNTIME_CACHE_ENDPOINT: `${origin}${DEV_RUNTIME_CACHE_ITEM_PREFIX}`,
18344
+ RUNTIME_CACHE_HEADERS: JSON.stringify({
18345
+ authorization: "Bearer vc-dev-token"
18346
+ })
18347
+ };
18348
+ }
18349
+ var RuntimeCacheStore = class {
18350
+ constructor() {
18351
+ this.entries = /* @__PURE__ */ new Map();
18352
+ /** Tag name to the mutation counter of its last expiry. */
18353
+ this.tagExpirations = /* @__PURE__ */ new Map();
18354
+ this.sequence = 0;
18355
+ this.tickTimer = setInterval(() => this.tick(), TICK_INTERVAL);
18356
+ this.tickTimer.unref();
18357
+ }
18358
+ get(key) {
18359
+ const entry = this.entries.get(key);
18360
+ if (!entry)
18361
+ return null;
18362
+ if (this.isStale(entry)) {
18363
+ this.entries.delete(key);
18364
+ return null;
18365
+ }
18366
+ return {
18367
+ value: entry.value,
18368
+ tags: entry.tags,
18369
+ ageSeconds: Math.floor((Date.now() - entry.lastModified) / 1e3)
18370
+ };
18371
+ }
18372
+ set(key, value, options = {}) {
18373
+ const ttlSeconds = options.ttlSeconds;
18374
+ this.entries.set(key, {
18375
+ value,
18376
+ tags: options.tags ?? [],
18377
+ ttlMs: ttlSeconds && ttlSeconds > 0 ? ttlSeconds * 1e3 : null,
18378
+ lastModified: Date.now(),
18379
+ sequence: ++this.sequence
18380
+ });
18381
+ }
18382
+ delete(key) {
18383
+ this.entries.delete(key);
18384
+ }
18385
+ /**
18386
+ * Mark tags as expired. Entries written before the expiration miss on their
18387
+ * next read; entries written after it stay fresh, matching how tag
18388
+ * revalidation works in a deployment.
18389
+ */
18390
+ expireTags(tags) {
18391
+ const sequence = ++this.sequence;
18392
+ for (const tag of tags) {
18393
+ this.tagExpirations.set(tag, sequence);
18394
+ }
18395
+ }
18396
+ size() {
18397
+ return this.entries.size;
18398
+ }
18399
+ stop() {
18400
+ clearInterval(this.tickTimer);
18401
+ }
18402
+ isStale(entry) {
18403
+ if (entry.ttlMs !== null && entry.lastModified + entry.ttlMs <= Date.now()) {
18404
+ return true;
18405
+ }
18406
+ for (const tag of entry.tags) {
18407
+ const expiredAt = this.tagExpirations.get(tag);
18408
+ if (expiredAt !== void 0 && expiredAt > entry.sequence) {
18409
+ return true;
18410
+ }
18411
+ }
18412
+ return false;
18413
+ }
18414
+ /** Drop stale entries so their values don't accumulate over a dev session. */
18415
+ tick() {
18416
+ for (const [key, entry] of this.entries) {
18417
+ if (this.isStale(entry)) {
18418
+ this.entries.delete(key);
18419
+ }
18420
+ }
18421
+ }
18422
+ };
18423
+
18321
18424
  // src/util/dev/services-orchestrator.ts
18322
- var STARTUP_TIMEOUT = (0, import_ms2.default)("5m");
18425
+ var STARTUP_TIMEOUT = (0, import_ms3.default)("5m");
18323
18426
  var ServiceStartError = class extends Error {
18324
18427
  constructor(failures) {
18325
18428
  const dedupeErrorCodes = /* @__PURE__ */ new Set(["PYTHON_EXTERNAL_VENV_DETECTED"]);
@@ -18721,6 +18824,17 @@ var ServicesOrchestrator = class {
18721
18824
  port
18722
18825
  });
18723
18826
  }
18827
+ /**
18828
+ * Every service shares the dev server's Runtime Cache store, so a value one
18829
+ * service writes is readable by the others, like in a deployment. A cache
18830
+ * endpoint the developer configured themselves takes precedence.
18831
+ */
18832
+ applyRuntimeCacheEnv(env) {
18833
+ if (env.RUNTIME_CACHE_ENDPOINT) {
18834
+ return;
18835
+ }
18836
+ Object.assign(env, getDevRuntimeCacheEnv(this.proxyOrigin));
18837
+ }
18724
18838
  getV1StartSpec(service) {
18725
18839
  const framework = import_frameworks.frameworkList.find((f) => f.slug === service.framework);
18726
18840
  const effectiveProcessEnv = cloneEnv(this.envFilesValues, process.env);
@@ -18762,6 +18876,7 @@ var ServicesOrchestrator = class {
18762
18876
  env.VERCEL_QUEUE_TOKEN = "vc-dev-token";
18763
18877
  env.VERCEL_REGION = "dev1";
18764
18878
  }
18879
+ this.applyRuntimeCacheEnv(env);
18765
18880
  if (service.routePrefix && service.routePrefix !== "/") {
18766
18881
  env.VERCEL_SERVICE_ROUTE_PREFIX = service.routePrefix;
18767
18882
  env.VERCEL_SERVICE_ROUTE_PREFIX_STRIP = "1";
@@ -18825,6 +18940,7 @@ var ServicesOrchestrator = class {
18825
18940
  env.VERCEL_QUEUE_TOKEN = "vc-dev-token";
18826
18941
  env.VERCEL_REGION = "dev1";
18827
18942
  }
18943
+ this.applyRuntimeCacheEnv(env);
18828
18944
  const root = service.root || ".";
18829
18945
  return {
18830
18946
  rootPath: path2.join(this.cwd, root),
@@ -19142,18 +19258,18 @@ var ServicesOrchestrator = class {
19142
19258
  };
19143
19259
 
19144
19260
  // src/util/dev/queue-broker.ts
19145
- var import_ms3 = __toESM(require_ms(), 1);
19261
+ var import_ms4 = __toESM(require_ms(), 1);
19146
19262
  import { randomBytes } from "crypto";
19147
19263
  import {
19148
19264
  getServiceQueueTopicConfigs,
19149
19265
  isQueueBackedService as isQueueBackedService2
19150
19266
  } from "@vercel/build-utils";
19151
- var DEFAULT_RETRY_AFTER = (0, import_ms3.default)("1m");
19267
+ var DEFAULT_RETRY_AFTER = (0, import_ms4.default)("1m");
19152
19268
  var DEFAULT_MAX_DELIVERIES = 32;
19153
19269
  var DEFAULT_INITIAL_DELAY = 0;
19154
- var DEFAULT_VISIBILITY_TIMEOUT = (0, import_ms3.default)("1m");
19155
- var DEFAULT_RETENTION = (0, import_ms3.default)("1h");
19156
- var TICK_INTERVAL = (0, import_ms3.default)("1s");
19270
+ var DEFAULT_VISIBILITY_TIMEOUT = (0, import_ms4.default)("1m");
19271
+ var DEFAULT_RETENTION = (0, import_ms4.default)("1h");
19272
+ var TICK_INTERVAL2 = (0, import_ms4.default)("1s");
19157
19273
  function topicPatternToRegex(pattern) {
19158
19274
  const parts = pattern.split("*").map((s) => s.replace(/-/g, "\\-"));
19159
19275
  return new RegExp(`^${parts.join("[A-Za-z0-9_\\-]*")}$`);
@@ -19194,7 +19310,7 @@ var QueueBroker = class {
19194
19310
  this.deliveryState.set(group.id, /* @__PURE__ */ new Map());
19195
19311
  }
19196
19312
  }
19197
- this.tickTimer = setInterval(() => this.tick(), TICK_INTERVAL);
19313
+ this.tickTimer = setInterval(() => this.tick(), TICK_INTERVAL2);
19198
19314
  this.tickTimer.unref();
19199
19315
  }
19200
19316
  /**
@@ -20226,8 +20342,10 @@ function errorMessage(err) {
20226
20342
  }
20227
20343
 
20228
20344
  // src/util/dev/server.ts
20229
- var DEV_SERVER_PORT_BIND_TIMEOUT = (0, import_ms4.default)("5m");
20345
+ var DEV_SERVER_PORT_BIND_TIMEOUT = (0, import_ms5.default)("5m");
20230
20346
  var DEV_QUEUES_DEFAULT_VISIBILITY_TIMEOUT_SECONDS = 60;
20347
+ var DEV_RUNTIME_CACHE_MAX_ITEM_SIZE = 2 * 1024 * 1024;
20348
+ var DEV_RUNTIME_CACHE_ONE_YEAR_SECONDS = 31536e3;
20231
20349
  var frameworkRuntimeSet = new Set(
20232
20350
  import_frameworks2.frameworkList.map((f) => f.useRuntime?.use || "@vercel/static-build")
20233
20351
  );
@@ -20510,6 +20628,146 @@ ${partHeaders}\r
20510
20628
  res.writeHead(404);
20511
20629
  res.end("Not Found");
20512
20630
  };
20631
+ /**
20632
+ * Handle `/_svc/_cache/*` routes for the dev Runtime Cache store, which mimics
20633
+ * the Runtime Cache API so `getCache()` works unchanged in `vc dev` and is
20634
+ * shared by every service instead of being process-local.
20635
+ */
20636
+ this.handleRuntimeCacheRoute = async (req, res, pathname) => {
20637
+ const store = this.runtimeCache;
20638
+ if (!store) {
20639
+ res.writeHead(503);
20640
+ res.end("Runtime Cache not initialized");
20641
+ return;
20642
+ }
20643
+ if (!pathname.startsWith(DEV_RUNTIME_CACHE_ITEM_PREFIX)) {
20644
+ res.writeHead(404);
20645
+ res.end("Not Found");
20646
+ return;
20647
+ }
20648
+ const itemPath = pathname.slice(DEV_RUNTIME_CACHE_ITEM_PREFIX.length);
20649
+ const searchParams = new URL2(req.url || "/", "http://localhost").searchParams;
20650
+ if (itemPath === "revalidate") {
20651
+ if (req.method !== "POST") {
20652
+ res.writeHead(405);
20653
+ res.end("Method Not Allowed");
20654
+ return;
20655
+ }
20656
+ const tags = (searchParams.get("tags") || "").split(",").map((tag) => tag.trim()).filter(Boolean);
20657
+ const itemId = searchParams.get("itemId") || void 0;
20658
+ if (tags.length === 0 && !itemId) {
20659
+ res.writeHead(400, { "Content-Type": "application/json" });
20660
+ res.end(JSON.stringify({ error: "No tags or itemId provided" }));
20661
+ return;
20662
+ }
20663
+ if (tags.length > 0) {
20664
+ store.expireTags(tags);
20665
+ output_manager_default.debug(`runtime cache: expired tags "${tags.join(",")}"`);
20666
+ }
20667
+ if (itemId) {
20668
+ store.delete(itemId);
20669
+ output_manager_default.debug(`runtime cache: expired item "${itemId}"`);
20670
+ }
20671
+ res.writeHead(200, { "Content-Type": "application/json" });
20672
+ res.end(JSON.stringify({ revalidated: true }));
20673
+ return;
20674
+ }
20675
+ let key;
20676
+ try {
20677
+ key = decodeURIComponent(itemPath);
20678
+ } catch {
20679
+ res.writeHead(400, { "Content-Type": "application/json" });
20680
+ res.end(JSON.stringify({ error: "Invalid cache key" }));
20681
+ return;
20682
+ }
20683
+ if (!key) {
20684
+ res.writeHead(404);
20685
+ res.end("Not Found");
20686
+ return;
20687
+ }
20688
+ if (req.method === "GET") {
20689
+ const hit = store.get(key);
20690
+ if (!hit) {
20691
+ output_manager_default.debug(`runtime cache: MISS "${key}"`);
20692
+ res.writeHead(404);
20693
+ res.end("Not Found");
20694
+ return;
20695
+ }
20696
+ output_manager_default.debug(`runtime cache: HIT "${key}"`);
20697
+ const headers = {
20698
+ "Content-Type": "application/json",
20699
+ "Content-Length": hit.value.length,
20700
+ [HEADER_CACHE_STATE]: "fresh",
20701
+ Age: String(hit.ageSeconds)
20702
+ };
20703
+ if (hit.tags.length > 0) {
20704
+ headers[HEADER_CACHE_TAGS] = hit.tags.join(",");
20705
+ }
20706
+ res.writeHead(200, headers);
20707
+ res.end(hit.value);
20708
+ return;
20709
+ }
20710
+ if (req.method === "POST") {
20711
+ const revalidateHeader = req.headers[HEADER_REVALIDATE];
20712
+ let ttlSeconds;
20713
+ if (revalidateHeader) {
20714
+ if (revalidateHeader === "Infinity" || ["false", "False", "FALSE", "f", "F"].includes(revalidateHeader)) {
20715
+ ttlSeconds = DEV_RUNTIME_CACHE_ONE_YEAR_SECONDS;
20716
+ } else if (/^[+-]?\d+$/.test(revalidateHeader)) {
20717
+ const parsedRevalidate = Number(revalidateHeader);
20718
+ if (!Number.isSafeInteger(parsedRevalidate) || parsedRevalidate < 0) {
20719
+ res.writeHead(400, { "Content-Type": "application/json" });
20720
+ res.end(JSON.stringify({ error: "Invalid revalidate value" }));
20721
+ return;
20722
+ }
20723
+ if (parsedRevalidate === 0) {
20724
+ res.writeHead(200, { "Content-Type": "application/json" });
20725
+ res.end(JSON.stringify({ success: true }));
20726
+ return;
20727
+ }
20728
+ ttlSeconds = parsedRevalidate;
20729
+ } else {
20730
+ res.writeHead(400, { "Content-Type": "application/json" });
20731
+ res.end(JSON.stringify({ error: "Invalid revalidate value" }));
20732
+ return;
20733
+ }
20734
+ }
20735
+ let value;
20736
+ try {
20737
+ value = await (0, import_raw_body.default)(req, {
20738
+ limit: DEV_RUNTIME_CACHE_MAX_ITEM_SIZE
20739
+ });
20740
+ } catch (err) {
20741
+ if (err.statusCode === 413) {
20742
+ res.writeHead(413, { "Content-Type": "application/json" });
20743
+ res.end(JSON.stringify({ error: "Cache item is too large" }));
20744
+ return;
20745
+ }
20746
+ throw err;
20747
+ }
20748
+ const tagsHeader = req.headers[HEADER_CACHE_TAGS];
20749
+ store.set(key, value, {
20750
+ ttlSeconds,
20751
+ tags: (tagsHeader || "").split(",").map((tag) => tag.trim()).filter(Boolean)
20752
+ });
20753
+ const name = req.headers[HEADER_CACHE_ITEM_NAME];
20754
+ output_manager_default.debug(
20755
+ `runtime cache: SET "${key}"${name ? ` (${name})` : ""} ${value.length} bytes`
20756
+ );
20757
+ res.writeHead(200, { "Content-Type": "application/json" });
20758
+ res.end(JSON.stringify({ success: true }));
20759
+ return;
20760
+ }
20761
+ if (req.method === "DELETE") {
20762
+ store.delete(key);
20763
+ output_manager_default.debug(`runtime cache: DELETE "${key}"`);
20764
+ res.writeHead(200, { "Content-Type": "application/json" });
20765
+ res.end(JSON.stringify({ success: true }));
20766
+ return;
20767
+ }
20768
+ res.writeHead(405);
20769
+ res.end("Method Not Allowed");
20770
+ };
20513
20771
  /**
20514
20772
  * Serve project directory as a v2 deployment.
20515
20773
  */
@@ -20535,6 +20793,13 @@ ${partHeaders}\r
20535
20793
  return;
20536
20794
  }
20537
20795
  }
20796
+ if (callLevel === 0) {
20797
+ const pathname = parsed.pathname || "/";
20798
+ if (pathname.startsWith(DEV_RUNTIME_CACHE_PREFIX)) {
20799
+ await this.handleRuntimeCacheRoute(req, res, pathname);
20800
+ return;
20801
+ }
20802
+ }
20538
20803
  if (callLevel === 0 && this.bulkRedirects) {
20539
20804
  const bulkMatch = resolveBulkRedirect(
20540
20805
  this.bulkRedirects,
@@ -21294,6 +21559,23 @@ Please ensure that ${cmd(err.path)} is properly installed`;
21294
21559
  VERCEL_REGION: "dev1"
21295
21560
  };
21296
21561
  }
21562
+ /**
21563
+ * Point Runtime Cache clients at the dev server's store, unless the developer
21564
+ * already configured a cache endpoint of their own (in their shell or env
21565
+ * files).
21566
+ */
21567
+ getDevRuntimeCacheEnv(env) {
21568
+ if (!this._address || env.RUNTIME_CACHE_ENDPOINT) {
21569
+ return {};
21570
+ }
21571
+ if (process.env.RUNTIME_CACHE_ENDPOINT) {
21572
+ return {
21573
+ RUNTIME_CACHE_ENDPOINT: process.env.RUNTIME_CACHE_ENDPOINT,
21574
+ ...process.env.RUNTIME_CACHE_HEADERS ? { RUNTIME_CACHE_HEADERS: process.env.RUNTIME_CACHE_HEADERS } : {}
21575
+ };
21576
+ }
21577
+ return getDevRuntimeCacheEnv(this.address.origin);
21578
+ }
21297
21579
  getSidecarDevMeta(match) {
21298
21580
  const serviceCount = (this.sidecars ?? []).filter((sidecar) => {
21299
21581
  if (sidecar.builder.use !== match.use)
@@ -21613,7 +21895,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
21613
21895
  return void 0;
21614
21896
  }
21615
21897
  async _getVercelConfig() {
21616
- const { compileVercelConfig } = await import("../../chunks/compile-vercel-config-DGM4NISW.js");
21898
+ const { compileVercelConfig } = await import("../../chunks/compile-vercel-config-6KPIBWNU.js");
21617
21899
  await compileVercelConfig(this.cwd);
21618
21900
  const configPath = getLocalPathConfig(this.cwd);
21619
21901
  const [
@@ -21788,6 +22070,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
21788
22070
  if (this.hasSubscribers()) {
21789
22071
  Object.assign(runEnv, this.getDevQueueEnv());
21790
22072
  }
22073
+ Object.assign(runEnv, this.getDevRuntimeCacheEnv(runEnv));
21791
22074
  this.envConfigs = { buildEnv, runEnv, allEnv };
21792
22075
  if (this.initialDevCommandStarted) {
21793
22076
  await this.runDevCommand();
@@ -21985,6 +22268,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
21985
22268
  }
21986
22269
  }
21987
22270
  this._address = new URL2(replaceLocalhost(address));
22271
+ this.runtimeCache = new RuntimeCacheStore();
21988
22272
  const vercelConfig = await this.getVercelConfig();
21989
22273
  let devCommandPromise;
21990
22274
  const startDevCommand = () => {
@@ -22208,6 +22492,10 @@ Please ensure that ${cmd(err.path)} is properly installed`;
22208
22492
  if (this.queueBroker) {
22209
22493
  this.queueBroker.stop();
22210
22494
  }
22495
+ if (this.runtimeCache) {
22496
+ this.runtimeCache.stop();
22497
+ this.runtimeCache = void 0;
22498
+ }
22211
22499
  ops.push(close(this.server));
22212
22500
  if (this.watcher) {
22213
22501
  debug(`Closing file watcher`);
@@ -22677,6 +22965,7 @@ ${error_code}
22677
22965
  PORT: `${port}`
22678
22966
  }
22679
22967
  );
22968
+ Object.assign(env, this.getDevRuntimeCacheEnv(env));
22680
22969
  const nodeBinPaths = getNodeBinPaths2({ base: this.repoRoot, start: cwd });
22681
22970
  const nodeBinPath = nodeBinPaths.join(path4.delimiter);
22682
22971
  env.PATH = `${nodeBinPath}${path4.delimiter}${env.PATH}`;
@@ -22924,21 +23213,21 @@ function buildMatchEquals(a, b) {
22924
23213
  }
22925
23214
 
22926
23215
  // src/util/env/refresh-oidc-token.ts
22927
- var import_ms5 = __toESM(require_ms(), 1);
23216
+ var import_ms6 = __toESM(require_ms(), 1);
22928
23217
  import { setTimeout as setTimeout2 } from "timers/promises";
22929
23218
  import { decodeJwt } from "jose";
22930
23219
  import { performance } from "perf_hooks";
22931
23220
  var REFRESH_BEFORE_EXPIRY_MILLIS = getMs(
22932
- (0, import_ms5.default)("15m"),
23221
+ (0, import_ms6.default)("15m"),
22933
23222
  process.env.REFRESH_VERCEL_OIDC_TOKEN_BEFORE_EXPIRY_MILLIS
22934
23223
  );
22935
23224
  var THROTTLE_MILLIS = getMs(
22936
- (0, import_ms5.default)("1m"),
23225
+ (0, import_ms6.default)("1m"),
22937
23226
  process.env.REFRESH_VERCEL_OIDC_TOKEN_THROTTLE_MILLIS
22938
23227
  );
22939
23228
  function getMs(defaultValue, overrideValue) {
22940
23229
  if (overrideValue) {
22941
- const result = (0, import_ms5.default)(overrideValue);
23230
+ const result = (0, import_ms6.default)(overrideValue);
22942
23231
  if (Number.isFinite(result) && result > 0)
22943
23232
  return result;
22944
23233
  }
@@ -23248,7 +23537,7 @@ To link your project, run ${getCommandName("dev")} without \`-L\` or \`--local\`
23248
23537
  );
23249
23538
  if (lockResult.existingLock) {
23250
23539
  const { existingLock } = lockResult;
23251
- const startTime = (0, import_ms6.default)(Date.now() - existingLock.startedAt);
23540
+ const startTime = (0, import_ms7.default)(Date.now() - existingLock.startedAt);
23252
23541
  output_manager_default.print(` Port: ${import_chalk3.default.cyan(existingLock.port)}
23253
23542
  `);
23254
23543
  output_manager_default.print(` PID: ${import_chalk3.default.cyan(existingLock.pid)}
@@ -26,7 +26,7 @@ import {
26
26
  } from "../../chunks/chunk-7ST552E3.js";
27
27
  import {
28
28
  formatEnvironment
29
- } from "../../chunks/chunk-7R6M3BHM.js";
29
+ } from "../../chunks/chunk-QWOCOZMS.js";
30
30
  import {
31
31
  validateLsArgs
32
32
  } from "../../chunks/chunk-O75LSD3C.js";
@@ -38,7 +38,7 @@ import {
38
38
  } from "../../chunks/chunk-YPQSDAEW.js";
39
39
  import {
40
40
  getCommandAliases
41
- } from "../../chunks/chunk-7HE63HCR.js";
41
+ } from "../../chunks/chunk-LDZFKXIR.js";
42
42
  import "../../chunks/chunk-7Q45OKWR.js";
43
43
  import "../../chunks/chunk-GY5I4AYD.js";
44
44
  import "../../chunks/chunk-CJV7J7B5.js";
@@ -66,7 +66,7 @@ import "../../chunks/chunk-VXYGCOKL.js";
66
66
  import "../../chunks/chunk-FWKSJYDV.js";
67
67
  import {
68
68
  help
69
- } from "../../chunks/chunk-2YRAWYGE.js";
69
+ } from "../../chunks/chunk-I526H4AS.js";
70
70
  import {
71
71
  ENV_VISIBILITY_DEPRECATION_MESSAGE,
72
72
  SENSITIVE_ENV_VALUE_PLACEHOLDER,
@@ -99,7 +99,7 @@ import {
99
99
  resolveProjectContext,
100
100
  shouldConfirmRotationBeforeDelete,
101
101
  validateEnvValue
102
- } from "../../chunks/chunk-VJ5NAOWB.js";
102
+ } from "../../chunks/chunk-OHQJEOP7.js";
103
103
  import {
104
104
  addSubcommand,
105
105
  envCommand,
@@ -11,7 +11,7 @@ import {
11
11
  addSubcommand8 as addSubcommand,
12
12
  getCommandAliases,
13
13
  linkCommand
14
- } from "../../chunks/chunk-7HE63HCR.js";
14
+ } from "../../chunks/chunk-LDZFKXIR.js";
15
15
  import "../../chunks/chunk-7Q45OKWR.js";
16
16
  import "../../chunks/chunk-GY5I4AYD.js";
17
17
  import "../../chunks/chunk-CJV7J7B5.js";
@@ -29,7 +29,7 @@ import "../../chunks/chunk-VP5Y3SZG.js";
29
29
  import "../../chunks/chunk-FWKSJYDV.js";
30
30
  import {
31
31
  help
32
- } from "../../chunks/chunk-2YRAWYGE.js";
32
+ } from "../../chunks/chunk-I526H4AS.js";
33
33
  import {
34
34
  addRepoLink,
35
35
  detectExplicitScope,
@@ -39,7 +39,7 @@ import {
39
39
  isPromptCanceledError,
40
40
  pull,
41
41
  resolveProjectCwd
42
- } from "../../chunks/chunk-VJ5NAOWB.js";
42
+ } from "../../chunks/chunk-OHQJEOP7.js";
43
43
  import "../../chunks/chunk-FXD67VN5.js";
44
44
  import {
45
45
  TelemetryClient