vercel 59.6.2 → 59.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/chunks/{add-SIGUSM3Y.js → add-7O4TM33A.js} +5 -5
  2. package/dist/chunks/{add-HJSEM4YJ.js → add-UT6ZPA4F.js} +2 -2
  3. package/dist/chunks/{add-4GQZ22ZN.js → add-UVMFKSSY.js} +2 -2
  4. package/dist/chunks/{build-XOMJDX4M.js → build-SKKT3DIB.js} +2 -2
  5. package/dist/chunks/{chunk-3F5EGINT.js → chunk-2EH6SZRG.js} +1 -1
  6. package/dist/chunks/{chunk-DE7MBNHQ.js → chunk-2T3IZZTJ.js} +1 -1
  7. package/dist/chunks/{chunk-JH4WQRIU.js → chunk-3PA7LXYM.js} +1 -1
  8. package/dist/chunks/{chunk-R5PULMHT.js → chunk-63OX2DER.js} +1 -1
  9. package/dist/chunks/{chunk-7R6M3BHM.js → chunk-67IIZBBY.js} +1 -1
  10. package/dist/chunks/{chunk-FRZULOVH.js → chunk-7IDPPWDN.js} +1 -1
  11. package/dist/chunks/{chunk-PRH6KRUT.js → chunk-7KSICC3A.js} +1 -1
  12. package/dist/chunks/{chunk-SWI6F4X3.js → chunk-AFKB6VMO.js} +1 -1
  13. package/dist/chunks/{chunk-VJ5NAOWB.js → chunk-BQG777JE.js} +5 -4
  14. package/dist/chunks/{chunk-NGNN6WF2.js → chunk-CBHLLOGZ.js} +2 -2
  15. package/dist/chunks/{chunk-GZQQNLF5.js → chunk-CMRZ4KI4.js} +2 -2
  16. package/dist/chunks/{chunk-GISTGGBO.js → chunk-DG6IMLCF.js} +1 -1
  17. package/dist/chunks/{chunk-O26N2UPI.js → chunk-GGPE5377.js} +1 -1
  18. package/dist/chunks/{chunk-ZNMTDLYH.js → chunk-GK3RE3AC.js} +2 -2
  19. package/dist/chunks/{chunk-37V5P4VO.js → chunk-IFNCPWH5.js} +4 -4
  20. package/dist/chunks/{chunk-2O5J3KMT.js → chunk-KD2N44NG.js} +1 -1
  21. package/dist/chunks/{chunk-WZ2S3A2A.js → chunk-MHCGKUI7.js} +1 -1
  22. package/dist/chunks/{chunk-YJKZQEHS.js → chunk-MUMITVZP.js} +1 -1
  23. package/dist/chunks/{chunk-V3MDDR2X.js → chunk-NJCM5JJN.js} +1 -1
  24. package/dist/chunks/{chunk-LXZVOR6F.js → chunk-SSBYESJ5.js} +1 -1
  25. package/dist/chunks/{chunk-SF3AYAIF.js → chunk-WVPMR7XV.js} +3 -3
  26. package/dist/chunks/{chunk-6M2KZUED.js → chunk-XSYZDMUP.js} +1 -1
  27. package/dist/chunks/{clear-BWT2FJY4.js → clear-X7M4WGBC.js} +2 -2
  28. package/dist/chunks/{compile-vercel-config-DGM4NISW.js → compile-vercel-config-FBOZBWJC.js} +1 -1
  29. package/dist/chunks/{config-RSE6Z4LB.js → config-KGW667XC.js} +3 -3
  30. package/dist/chunks/{config-NJAN3RMU.js → config-RYPSCAR7.js} +2 -2
  31. package/dist/chunks/{constants-WEQVJSYS.js → constants-YMCRE6IG.js} +1 -1
  32. package/dist/chunks/{delete-SSL2PK2F.js → delete-OXYXXPHR.js} +2 -2
  33. package/dist/chunks/{delete-LROBRBAH.js → delete-VK6FTDBI.js} +2 -2
  34. package/dist/chunks/{disable-ASG5JDZR.js → disable-XRJTKNX4.js} +2 -2
  35. package/dist/chunks/{discard-PV47B6IL.js → discard-NAPSPR6Y.js} +2 -2
  36. package/dist/chunks/{edit-5ATYIOLX.js → edit-34GDLPQG.js} +3 -3
  37. package/dist/chunks/{edit-REI7HXGG.js → edit-WLG4GLU3.js} +2 -2
  38. package/dist/chunks/{enable-LZXL7XAG.js → enable-IDKKVXKB.js} +2 -2
  39. package/dist/chunks/{export-ZAZFQU2E.js → export-MPMU3FYY.js} +2 -2
  40. package/dist/chunks/{image-QPHN5V7L.js → image-RZ2A4FWP.js} +3 -3
  41. package/dist/chunks/{import-builders-W3YE2V6A.js → import-builders-GZPE5N44.js} +2 -2
  42. package/dist/chunks/{inspect-RDMC2Z3Q.js → inspect-56S2DKPO.js} +2 -2
  43. package/dist/chunks/{inspect-SJEZVGPK.js → inspect-EVDBNPP4.js} +2 -2
  44. package/dist/chunks/{inspect-FRXJRM6T.js → inspect-KGEMHV2T.js} +2 -2
  45. package/dist/chunks/{inspect-SSOM3FXS.js → inspect-OOV2ORKD.js} +2 -2
  46. package/dist/chunks/{inspect-BFGK72WY.js → inspect-X2Y5FDKR.js} +3 -3
  47. package/dist/chunks/{list-2HTR7Q3J.js → list-FWLSZYMO.js} +2 -2
  48. package/dist/chunks/{list-W33GXKDA.js → list-H357CF7M.js} +3 -3
  49. package/dist/chunks/{list-PHDUZVMR.js → list-TWSOAQRB.js} +1 -1
  50. package/dist/chunks/{login-JWAFHVDG.js → login-54OPNB5E.js} +2 -2
  51. package/dist/chunks/{ls-KDFU224B.js → ls-6JHFSJBJ.js} +2 -2
  52. package/dist/chunks/{ls-RWKNJQNT.js → ls-DU3S2GBJ.js} +2 -2
  53. package/dist/chunks/{ls-KX2VBOGV.js → ls-VDFNIR5H.js} +3 -3
  54. package/dist/chunks/{ls-3AN2DZHN.js → ls-WFMTVJOO.js} +2 -2
  55. package/dist/chunks/{ls-3MH2OCP3.js → ls-WGIRTAVM.js} +2 -2
  56. package/dist/chunks/{ls-D2POUHI7.js → ls-ZMR5RMU4.js} +2 -2
  57. package/dist/chunks/{open-IEYRB6RL.js → open-RCSCNKHF.js} +2 -2
  58. package/dist/chunks/{permissions-ZWZUMEHR.js → permissions-XNN37R4N.js} +4 -4
  59. package/dist/chunks/{publish-UWZYBDHK.js → publish-PLXEACYY.js} +2 -2
  60. package/dist/chunks/{push-IAEQ3FBF.js → push-EFYSB52Q.js} +2 -2
  61. package/dist/chunks/{query-NNOZYSED.js → query-EKTXDOL7.js} +1 -1
  62. package/dist/chunks/{reorder-TKBM244W.js → reorder-OSA7D2RG.js} +2 -2
  63. package/dist/chunks/{reply-FLBSBMTW.js → reply-6M2IYKLK.js} +2 -2
  64. package/dist/chunks/{resolve-GJYPMWUE.js → resolve-MCX5STKN.js} +2 -2
  65. package/dist/chunks/{restore-PNI3TM3U.js → restore-52OEP3NL.js} +2 -2
  66. package/dist/chunks/{rm-FN7LTIIL.js → rm-2VAJFK25.js} +2 -2
  67. package/dist/chunks/{rm-FXA5DLXQ.js → rm-4BJN2LJX.js} +2 -2
  68. package/dist/chunks/{rm-76CSSSSV.js → rm-IYEDZOMN.js} +2 -2
  69. package/dist/chunks/{rm-PGJ4KR6U.js → rm-QW35WHSK.js} +2 -2
  70. package/dist/chunks/{rm-FTE33UHE.js → rm-TXV4GB4L.js} +3 -3
  71. package/dist/chunks/{rule-inspect-LJIGPTWS.js → rule-inspect-WOBAN3Y2.js} +3 -3
  72. package/dist/chunks/{rules-6BMNO6M5.js → rules-CUJRAZYO.js} +6 -6
  73. package/dist/chunks/{schema-HATXEQDP.js → schema-VCGEJAOG.js} +1 -1
  74. package/dist/chunks/{set-C3UQUQ42.js → set-2QSXMDVF.js} +2 -2
  75. package/dist/chunks/{tags-BTVDROFG.js → tags-NHX2VQ7E.js} +2 -2
  76. package/dist/chunks/{update-B6PSOHUW.js → update-EOHXTT4N.js} +5 -5
  77. package/dist/commands/build/index.js +113 -6
  78. package/dist/commands/deploy/index.js +6 -6
  79. package/dist/commands/dev/index.js +321 -43
  80. package/dist/commands/env/index.js +2 -2
  81. package/dist/commands/link/index.js +1 -1
  82. package/dist/commands/list/index.js +2 -2
  83. package/dist/commands-bulk.js +70 -55
  84. package/dist/index.js +8 -8
  85. package/dist/version.mjs +1 -1
  86. package/package.json +47 -47
@@ -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-2EH6SZRG.js";
13
13
  import {
14
14
  getGlobalPathConfig,
15
15
  highlight
@@ -26,15 +26,15 @@ 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-AFKB6VMO.js";
30
30
  import {
31
31
  importBuilders,
32
32
  require_npa
33
- } from "../../chunks/chunk-WZ2S3A2A.js";
33
+ } from "../../chunks/chunk-MHCGKUI7.js";
34
34
  import "../../chunks/chunk-IB5L4LKZ.js";
35
35
  import {
36
36
  pickOverrides
37
- } from "../../chunks/chunk-JH4WQRIU.js";
37
+ } from "../../chunks/chunk-3PA7LXYM.js";
38
38
  import "../../chunks/chunk-5XECIWME.js";
39
39
  import {
40
40
  help
@@ -69,7 +69,7 @@ import {
69
69
  setupAndLink,
70
70
  tryDetectServices,
71
71
  validateConfig
72
- } from "../../chunks/chunk-VJ5NAOWB.js";
72
+ } from "../../chunks/chunk-BQG777JE.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" };
@@ -18060,7 +18060,7 @@ function redirect(it) {
18060
18060
  }
18061
18061
 
18062
18062
  // src/util/dev/services-orchestrator.ts
18063
- var import_ms2 = __toESM(require_ms(), 1);
18063
+ var import_ms3 = __toESM(require_ms(), 1);
18064
18064
  var import_get_port = __toESM(require_get_port(), 1);
18065
18065
  var import_chalk = __toESM(require_source(), 1);
18066
18066
  var import_frameworks = __toESM(require_frameworks(), 1);
@@ -18318,8 +18318,100 @@ function prependNodeRequireOption(nodeOptions, requirePath) {
18318
18318
  return nodeOptions ? `${requireOption} ${nodeOptions}` : requireOption;
18319
18319
  }
18320
18320
 
18321
+ // src/util/dev/runtime-cache.ts
18322
+ var import_ms2 = __toESM(require_ms(), 1);
18323
+ var DEV_RUNTIME_CACHE_PREFIX = "/_svc/_cache/";
18324
+ var DEV_RUNTIME_CACHE_ITEM_PREFIX = `${DEV_RUNTIME_CACHE_PREFIX}v1/suspense-cache/`;
18325
+ var HEADER_CACHE_STATE = "x-vercel-cache-state";
18326
+ var HEADER_CACHE_TAGS = "x-vercel-cache-tags";
18327
+ var HEADER_REVALIDATE = "x-vercel-revalidate";
18328
+ var HEADER_CACHE_ITEM_NAME = "x-vercel-cache-item-name";
18329
+ var TICK_INTERVAL = (0, import_ms2.default)("1m");
18330
+ function getDevRuntimeCacheEnv(origin) {
18331
+ return {
18332
+ RUNTIME_CACHE_ENDPOINT: `${origin}${DEV_RUNTIME_CACHE_ITEM_PREFIX}`,
18333
+ RUNTIME_CACHE_HEADERS: JSON.stringify({
18334
+ authorization: "Bearer vc-dev-token"
18335
+ })
18336
+ };
18337
+ }
18338
+ var RuntimeCacheStore = class {
18339
+ constructor() {
18340
+ this.entries = /* @__PURE__ */ new Map();
18341
+ /** Tag name to the mutation counter of its last expiry. */
18342
+ this.tagExpirations = /* @__PURE__ */ new Map();
18343
+ this.sequence = 0;
18344
+ this.tickTimer = setInterval(() => this.tick(), TICK_INTERVAL);
18345
+ this.tickTimer.unref();
18346
+ }
18347
+ get(key) {
18348
+ const entry = this.entries.get(key);
18349
+ if (!entry)
18350
+ return null;
18351
+ if (this.isStale(entry)) {
18352
+ this.entries.delete(key);
18353
+ return null;
18354
+ }
18355
+ return {
18356
+ value: entry.value,
18357
+ tags: entry.tags,
18358
+ ageSeconds: Math.floor((Date.now() - entry.lastModified) / 1e3)
18359
+ };
18360
+ }
18361
+ set(key, value, options = {}) {
18362
+ const ttlSeconds = options.ttlSeconds;
18363
+ this.entries.set(key, {
18364
+ value,
18365
+ tags: options.tags ?? [],
18366
+ ttlMs: ttlSeconds && ttlSeconds > 0 ? ttlSeconds * 1e3 : null,
18367
+ lastModified: Date.now(),
18368
+ sequence: ++this.sequence
18369
+ });
18370
+ }
18371
+ delete(key) {
18372
+ this.entries.delete(key);
18373
+ }
18374
+ /**
18375
+ * Mark tags as expired. Entries written before the expiration miss on their
18376
+ * next read; entries written after it stay fresh, matching how tag
18377
+ * revalidation works in a deployment.
18378
+ */
18379
+ expireTags(tags) {
18380
+ const sequence = ++this.sequence;
18381
+ for (const tag of tags) {
18382
+ this.tagExpirations.set(tag, sequence);
18383
+ }
18384
+ }
18385
+ size() {
18386
+ return this.entries.size;
18387
+ }
18388
+ stop() {
18389
+ clearInterval(this.tickTimer);
18390
+ }
18391
+ isStale(entry) {
18392
+ if (entry.ttlMs !== null && entry.lastModified + entry.ttlMs <= Date.now()) {
18393
+ return true;
18394
+ }
18395
+ for (const tag of entry.tags) {
18396
+ const expiredAt = this.tagExpirations.get(tag);
18397
+ if (expiredAt !== void 0 && expiredAt > entry.sequence) {
18398
+ return true;
18399
+ }
18400
+ }
18401
+ return false;
18402
+ }
18403
+ /** Drop stale entries so their values don't accumulate over a dev session. */
18404
+ tick() {
18405
+ for (const [key, entry] of this.entries) {
18406
+ if (this.isStale(entry)) {
18407
+ this.entries.delete(key);
18408
+ }
18409
+ }
18410
+ }
18411
+ };
18412
+
18321
18413
  // src/util/dev/services-orchestrator.ts
18322
- var STARTUP_TIMEOUT = (0, import_ms2.default)("5m");
18414
+ var STARTUP_TIMEOUT = (0, import_ms3.default)("5m");
18323
18415
  var ServiceStartError = class extends Error {
18324
18416
  constructor(failures) {
18325
18417
  const dedupeErrorCodes = /* @__PURE__ */ new Set(["PYTHON_EXTERNAL_VENV_DETECTED"]);
@@ -18721,6 +18813,17 @@ var ServicesOrchestrator = class {
18721
18813
  port
18722
18814
  });
18723
18815
  }
18816
+ /**
18817
+ * Every service shares the dev server's Runtime Cache store, so a value one
18818
+ * service writes is readable by the others, like in a deployment. A cache
18819
+ * endpoint the developer configured themselves takes precedence.
18820
+ */
18821
+ applyRuntimeCacheEnv(env) {
18822
+ if (env.RUNTIME_CACHE_ENDPOINT) {
18823
+ return;
18824
+ }
18825
+ Object.assign(env, getDevRuntimeCacheEnv(this.proxyOrigin));
18826
+ }
18724
18827
  getV1StartSpec(service) {
18725
18828
  const framework = import_frameworks.frameworkList.find((f) => f.slug === service.framework);
18726
18829
  const effectiveProcessEnv = cloneEnv(this.envFilesValues, process.env);
@@ -18762,6 +18865,7 @@ var ServicesOrchestrator = class {
18762
18865
  env.VERCEL_QUEUE_TOKEN = "vc-dev-token";
18763
18866
  env.VERCEL_REGION = "dev1";
18764
18867
  }
18868
+ this.applyRuntimeCacheEnv(env);
18765
18869
  if (service.routePrefix && service.routePrefix !== "/") {
18766
18870
  env.VERCEL_SERVICE_ROUTE_PREFIX = service.routePrefix;
18767
18871
  env.VERCEL_SERVICE_ROUTE_PREFIX_STRIP = "1";
@@ -18825,6 +18929,7 @@ var ServicesOrchestrator = class {
18825
18929
  env.VERCEL_QUEUE_TOKEN = "vc-dev-token";
18826
18930
  env.VERCEL_REGION = "dev1";
18827
18931
  }
18932
+ this.applyRuntimeCacheEnv(env);
18828
18933
  const root = service.root || ".";
18829
18934
  return {
18830
18935
  rootPath: path2.join(this.cwd, root),
@@ -19142,18 +19247,18 @@ var ServicesOrchestrator = class {
19142
19247
  };
19143
19248
 
19144
19249
  // src/util/dev/queue-broker.ts
19145
- var import_ms3 = __toESM(require_ms(), 1);
19250
+ var import_ms4 = __toESM(require_ms(), 1);
19146
19251
  import { randomBytes } from "crypto";
19147
19252
  import {
19148
19253
  getServiceQueueTopicConfigs,
19149
19254
  isQueueBackedService as isQueueBackedService2
19150
19255
  } from "@vercel/build-utils";
19151
- var DEFAULT_RETRY_AFTER = (0, import_ms3.default)("1m");
19256
+ var DEFAULT_RETRY_AFTER = (0, import_ms4.default)("1m");
19152
19257
  var DEFAULT_MAX_DELIVERIES = 32;
19153
19258
  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");
19259
+ var DEFAULT_VISIBILITY_TIMEOUT = (0, import_ms4.default)("1m");
19260
+ var DEFAULT_RETENTION = (0, import_ms4.default)("1h");
19261
+ var TICK_INTERVAL2 = (0, import_ms4.default)("1s");
19157
19262
  function topicPatternToRegex(pattern) {
19158
19263
  const parts = pattern.split("*").map((s) => s.replace(/-/g, "\\-"));
19159
19264
  return new RegExp(`^${parts.join("[A-Za-z0-9_\\-]*")}$`);
@@ -19194,7 +19299,7 @@ var QueueBroker = class {
19194
19299
  this.deliveryState.set(group.id, /* @__PURE__ */ new Map());
19195
19300
  }
19196
19301
  }
19197
- this.tickTimer = setInterval(() => this.tick(), TICK_INTERVAL);
19302
+ this.tickTimer = setInterval(() => this.tick(), TICK_INTERVAL2);
19198
19303
  this.tickTimer.unref();
19199
19304
  }
19200
19305
  /**
@@ -20226,8 +20331,10 @@ function errorMessage(err) {
20226
20331
  }
20227
20332
 
20228
20333
  // src/util/dev/server.ts
20229
- var DEV_SERVER_PORT_BIND_TIMEOUT = (0, import_ms4.default)("5m");
20334
+ var DEV_SERVER_PORT_BIND_TIMEOUT = (0, import_ms5.default)("5m");
20230
20335
  var DEV_QUEUES_DEFAULT_VISIBILITY_TIMEOUT_SECONDS = 60;
20336
+ var DEV_RUNTIME_CACHE_MAX_ITEM_SIZE = 2 * 1024 * 1024;
20337
+ var DEV_RUNTIME_CACHE_ONE_YEAR_SECONDS = 31536e3;
20231
20338
  var frameworkRuntimeSet = new Set(
20232
20339
  import_frameworks2.frameworkList.map((f) => f.useRuntime?.use || "@vercel/static-build")
20233
20340
  );
@@ -20510,6 +20617,146 @@ ${partHeaders}\r
20510
20617
  res.writeHead(404);
20511
20618
  res.end("Not Found");
20512
20619
  };
20620
+ /**
20621
+ * Handle `/_svc/_cache/*` routes for the dev Runtime Cache store, which mimics
20622
+ * the Runtime Cache API so `getCache()` works unchanged in `vc dev` and is
20623
+ * shared by every service instead of being process-local.
20624
+ */
20625
+ this.handleRuntimeCacheRoute = async (req, res, pathname) => {
20626
+ const store = this.runtimeCache;
20627
+ if (!store) {
20628
+ res.writeHead(503);
20629
+ res.end("Runtime Cache not initialized");
20630
+ return;
20631
+ }
20632
+ if (!pathname.startsWith(DEV_RUNTIME_CACHE_ITEM_PREFIX)) {
20633
+ res.writeHead(404);
20634
+ res.end("Not Found");
20635
+ return;
20636
+ }
20637
+ const itemPath = pathname.slice(DEV_RUNTIME_CACHE_ITEM_PREFIX.length);
20638
+ const searchParams = new URL2(req.url || "/", "http://localhost").searchParams;
20639
+ if (itemPath === "revalidate") {
20640
+ if (req.method !== "POST") {
20641
+ res.writeHead(405);
20642
+ res.end("Method Not Allowed");
20643
+ return;
20644
+ }
20645
+ const tags = (searchParams.get("tags") || "").split(",").map((tag) => tag.trim()).filter(Boolean);
20646
+ const itemId = searchParams.get("itemId") || void 0;
20647
+ if (tags.length === 0 && !itemId) {
20648
+ res.writeHead(400, { "Content-Type": "application/json" });
20649
+ res.end(JSON.stringify({ error: "No tags or itemId provided" }));
20650
+ return;
20651
+ }
20652
+ if (tags.length > 0) {
20653
+ store.expireTags(tags);
20654
+ output_manager_default.debug(`runtime cache: expired tags "${tags.join(",")}"`);
20655
+ }
20656
+ if (itemId) {
20657
+ store.delete(itemId);
20658
+ output_manager_default.debug(`runtime cache: expired item "${itemId}"`);
20659
+ }
20660
+ res.writeHead(200, { "Content-Type": "application/json" });
20661
+ res.end(JSON.stringify({ revalidated: true }));
20662
+ return;
20663
+ }
20664
+ let key;
20665
+ try {
20666
+ key = decodeURIComponent(itemPath);
20667
+ } catch {
20668
+ res.writeHead(400, { "Content-Type": "application/json" });
20669
+ res.end(JSON.stringify({ error: "Invalid cache key" }));
20670
+ return;
20671
+ }
20672
+ if (!key) {
20673
+ res.writeHead(404);
20674
+ res.end("Not Found");
20675
+ return;
20676
+ }
20677
+ if (req.method === "GET") {
20678
+ const hit = store.get(key);
20679
+ if (!hit) {
20680
+ output_manager_default.debug(`runtime cache: MISS "${key}"`);
20681
+ res.writeHead(404);
20682
+ res.end("Not Found");
20683
+ return;
20684
+ }
20685
+ output_manager_default.debug(`runtime cache: HIT "${key}"`);
20686
+ const headers = {
20687
+ "Content-Type": "application/json",
20688
+ "Content-Length": hit.value.length,
20689
+ [HEADER_CACHE_STATE]: "fresh",
20690
+ Age: String(hit.ageSeconds)
20691
+ };
20692
+ if (hit.tags.length > 0) {
20693
+ headers[HEADER_CACHE_TAGS] = hit.tags.join(",");
20694
+ }
20695
+ res.writeHead(200, headers);
20696
+ res.end(hit.value);
20697
+ return;
20698
+ }
20699
+ if (req.method === "POST") {
20700
+ const revalidateHeader = req.headers[HEADER_REVALIDATE];
20701
+ let ttlSeconds;
20702
+ if (revalidateHeader) {
20703
+ if (revalidateHeader === "Infinity" || ["false", "False", "FALSE", "f", "F"].includes(revalidateHeader)) {
20704
+ ttlSeconds = DEV_RUNTIME_CACHE_ONE_YEAR_SECONDS;
20705
+ } else if (/^[+-]?\d+$/.test(revalidateHeader)) {
20706
+ const parsedRevalidate = Number(revalidateHeader);
20707
+ if (!Number.isSafeInteger(parsedRevalidate) || parsedRevalidate < 0) {
20708
+ res.writeHead(400, { "Content-Type": "application/json" });
20709
+ res.end(JSON.stringify({ error: "Invalid revalidate value" }));
20710
+ return;
20711
+ }
20712
+ if (parsedRevalidate === 0) {
20713
+ res.writeHead(200, { "Content-Type": "application/json" });
20714
+ res.end(JSON.stringify({ success: true }));
20715
+ return;
20716
+ }
20717
+ ttlSeconds = parsedRevalidate;
20718
+ } else {
20719
+ res.writeHead(400, { "Content-Type": "application/json" });
20720
+ res.end(JSON.stringify({ error: "Invalid revalidate value" }));
20721
+ return;
20722
+ }
20723
+ }
20724
+ let value;
20725
+ try {
20726
+ value = await (0, import_raw_body.default)(req, {
20727
+ limit: DEV_RUNTIME_CACHE_MAX_ITEM_SIZE
20728
+ });
20729
+ } catch (err) {
20730
+ if (err.statusCode === 413) {
20731
+ res.writeHead(413, { "Content-Type": "application/json" });
20732
+ res.end(JSON.stringify({ error: "Cache item is too large" }));
20733
+ return;
20734
+ }
20735
+ throw err;
20736
+ }
20737
+ const tagsHeader = req.headers[HEADER_CACHE_TAGS];
20738
+ store.set(key, value, {
20739
+ ttlSeconds,
20740
+ tags: (tagsHeader || "").split(",").map((tag) => tag.trim()).filter(Boolean)
20741
+ });
20742
+ const name = req.headers[HEADER_CACHE_ITEM_NAME];
20743
+ output_manager_default.debug(
20744
+ `runtime cache: SET "${key}"${name ? ` (${name})` : ""} ${value.length} bytes`
20745
+ );
20746
+ res.writeHead(200, { "Content-Type": "application/json" });
20747
+ res.end(JSON.stringify({ success: true }));
20748
+ return;
20749
+ }
20750
+ if (req.method === "DELETE") {
20751
+ store.delete(key);
20752
+ output_manager_default.debug(`runtime cache: DELETE "${key}"`);
20753
+ res.writeHead(200, { "Content-Type": "application/json" });
20754
+ res.end(JSON.stringify({ success: true }));
20755
+ return;
20756
+ }
20757
+ res.writeHead(405);
20758
+ res.end("Method Not Allowed");
20759
+ };
20513
20760
  /**
20514
20761
  * Serve project directory as a v2 deployment.
20515
20762
  */
@@ -20535,6 +20782,13 @@ ${partHeaders}\r
20535
20782
  return;
20536
20783
  }
20537
20784
  }
20785
+ if (callLevel === 0) {
20786
+ const pathname = parsed.pathname || "/";
20787
+ if (pathname.startsWith(DEV_RUNTIME_CACHE_PREFIX)) {
20788
+ await this.handleRuntimeCacheRoute(req, res, pathname);
20789
+ return;
20790
+ }
20791
+ }
20538
20792
  if (callLevel === 0 && this.bulkRedirects) {
20539
20793
  const bulkMatch = resolveBulkRedirect(
20540
20794
  this.bulkRedirects,
@@ -21294,6 +21548,23 @@ Please ensure that ${cmd(err.path)} is properly installed`;
21294
21548
  VERCEL_REGION: "dev1"
21295
21549
  };
21296
21550
  }
21551
+ /**
21552
+ * Point Runtime Cache clients at the dev server's store, unless the developer
21553
+ * already configured a cache endpoint of their own (in their shell or env
21554
+ * files).
21555
+ */
21556
+ getDevRuntimeCacheEnv(env) {
21557
+ if (!this._address || env.RUNTIME_CACHE_ENDPOINT) {
21558
+ return {};
21559
+ }
21560
+ if (process.env.RUNTIME_CACHE_ENDPOINT) {
21561
+ return {
21562
+ RUNTIME_CACHE_ENDPOINT: process.env.RUNTIME_CACHE_ENDPOINT,
21563
+ ...process.env.RUNTIME_CACHE_HEADERS ? { RUNTIME_CACHE_HEADERS: process.env.RUNTIME_CACHE_HEADERS } : {}
21564
+ };
21565
+ }
21566
+ return getDevRuntimeCacheEnv(this.address.origin);
21567
+ }
21297
21568
  getSidecarDevMeta(match) {
21298
21569
  const serviceCount = (this.sidecars ?? []).filter((sidecar) => {
21299
21570
  if (sidecar.builder.use !== match.use)
@@ -21613,7 +21884,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
21613
21884
  return void 0;
21614
21885
  }
21615
21886
  async _getVercelConfig() {
21616
- const { compileVercelConfig } = await import("../../chunks/compile-vercel-config-DGM4NISW.js");
21887
+ const { compileVercelConfig } = await import("../../chunks/compile-vercel-config-FBOZBWJC.js");
21617
21888
  await compileVercelConfig(this.cwd);
21618
21889
  const configPath = getLocalPathConfig(this.cwd);
21619
21890
  const [
@@ -21788,6 +22059,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
21788
22059
  if (this.hasSubscribers()) {
21789
22060
  Object.assign(runEnv, this.getDevQueueEnv());
21790
22061
  }
22062
+ Object.assign(runEnv, this.getDevRuntimeCacheEnv(runEnv));
21791
22063
  this.envConfigs = { buildEnv, runEnv, allEnv };
21792
22064
  if (this.initialDevCommandStarted) {
21793
22065
  await this.runDevCommand();
@@ -21985,6 +22257,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
21985
22257
  }
21986
22258
  }
21987
22259
  this._address = new URL2(replaceLocalhost(address));
22260
+ this.runtimeCache = new RuntimeCacheStore();
21988
22261
  const vercelConfig = await this.getVercelConfig();
21989
22262
  let devCommandPromise;
21990
22263
  const startDevCommand = () => {
@@ -22208,6 +22481,10 @@ Please ensure that ${cmd(err.path)} is properly installed`;
22208
22481
  if (this.queueBroker) {
22209
22482
  this.queueBroker.stop();
22210
22483
  }
22484
+ if (this.runtimeCache) {
22485
+ this.runtimeCache.stop();
22486
+ this.runtimeCache = void 0;
22487
+ }
22211
22488
  ops.push(close(this.server));
22212
22489
  if (this.watcher) {
22213
22490
  debug(`Closing file watcher`);
@@ -22677,6 +22954,7 @@ ${error_code}
22677
22954
  PORT: `${port}`
22678
22955
  }
22679
22956
  );
22957
+ Object.assign(env, this.getDevRuntimeCacheEnv(env));
22680
22958
  const nodeBinPaths = getNodeBinPaths2({ base: this.repoRoot, start: cwd });
22681
22959
  const nodeBinPath = nodeBinPaths.join(path4.delimiter);
22682
22960
  env.PATH = `${nodeBinPath}${path4.delimiter}${env.PATH}`;
@@ -22924,21 +23202,21 @@ function buildMatchEquals(a, b) {
22924
23202
  }
22925
23203
 
22926
23204
  // src/util/env/refresh-oidc-token.ts
22927
- var import_ms5 = __toESM(require_ms(), 1);
23205
+ var import_ms6 = __toESM(require_ms(), 1);
22928
23206
  import { setTimeout as setTimeout2 } from "timers/promises";
22929
23207
  import { decodeJwt } from "jose";
22930
23208
  import { performance } from "perf_hooks";
22931
23209
  var REFRESH_BEFORE_EXPIRY_MILLIS = getMs(
22932
- (0, import_ms5.default)("15m"),
23210
+ (0, import_ms6.default)("15m"),
22933
23211
  process.env.REFRESH_VERCEL_OIDC_TOKEN_BEFORE_EXPIRY_MILLIS
22934
23212
  );
22935
23213
  var THROTTLE_MILLIS = getMs(
22936
- (0, import_ms5.default)("1m"),
23214
+ (0, import_ms6.default)("1m"),
22937
23215
  process.env.REFRESH_VERCEL_OIDC_TOKEN_THROTTLE_MILLIS
22938
23216
  );
22939
23217
  function getMs(defaultValue, overrideValue) {
22940
23218
  if (overrideValue) {
22941
- const result = (0, import_ms5.default)(overrideValue);
23219
+ const result = (0, import_ms6.default)(overrideValue);
22942
23220
  if (Number.isFinite(result) && result > 0)
22943
23221
  return result;
22944
23222
  }
@@ -23248,7 +23526,7 @@ To link your project, run ${getCommandName("dev")} without \`-L\` or \`--local\`
23248
23526
  );
23249
23527
  if (lockResult.existingLock) {
23250
23528
  const { existingLock } = lockResult;
23251
- const startTime = (0, import_ms6.default)(Date.now() - existingLock.startedAt);
23529
+ const startTime = (0, import_ms7.default)(Date.now() - existingLock.startedAt);
23252
23530
  output_manager_default.print(` Port: ${import_chalk3.default.cyan(existingLock.port)}
23253
23531
  `);
23254
23532
  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-67IIZBBY.js";
30
30
  import {
31
31
  validateLsArgs
32
32
  } from "../../chunks/chunk-O75LSD3C.js";
@@ -99,7 +99,7 @@ import {
99
99
  resolveProjectContext,
100
100
  shouldConfirmRotationBeforeDelete,
101
101
  validateEnvValue
102
- } from "../../chunks/chunk-VJ5NAOWB.js";
102
+ } from "../../chunks/chunk-BQG777JE.js";
103
103
  import {
104
104
  addSubcommand,
105
105
  envCommand,
@@ -39,7 +39,7 @@ import {
39
39
  isPromptCanceledError,
40
40
  pull,
41
41
  resolveProjectCwd
42
- } from "../../chunks/chunk-VJ5NAOWB.js";
42
+ } from "../../chunks/chunk-BQG777JE.js";
43
43
  import "../../chunks/chunk-FXD67VN5.js";
44
44
  import {
45
45
  TelemetryClient
@@ -16,7 +16,7 @@ import {
16
16
  } from "../../chunks/chunk-EKPSCRJZ.js";
17
17
  import {
18
18
  formatEnvironment
19
- } from "../../chunks/chunk-7R6M3BHM.js";
19
+ } from "../../chunks/chunk-67IIZBBY.js";
20
20
  import {
21
21
  validateLsArgs
22
22
  } from "../../chunks/chunk-O75LSD3C.js";
@@ -40,7 +40,7 @@ import {
40
40
  getScope,
41
41
  parseTarget,
42
42
  toHost
43
- } from "../../chunks/chunk-VJ5NAOWB.js";
43
+ } from "../../chunks/chunk-BQG777JE.js";
44
44
  import "../../chunks/chunk-FXD67VN5.js";
45
45
  import {
46
46
  TelemetryClient