vercel 50.37.2 → 50.37.3

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.
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  did_you_mean_default,
16
16
  executeUpgrade,
17
17
  login
18
- } from "./chunks/chunk-LJ7BOV6R.js";
18
+ } from "./chunks/chunk-PBUKJWLL.js";
19
19
  import {
20
20
  getUpdateCommand
21
21
  } from "./chunks/chunk-JFTBLO4O.js";
@@ -27,14 +27,14 @@ import {
27
27
  readConfigFile,
28
28
  writeToAuthConfigFile,
29
29
  writeToConfigFile
30
- } from "./chunks/chunk-GCUHLRDW.js";
30
+ } from "./chunks/chunk-LRGCB3GI.js";
31
31
  import {
32
32
  highlight
33
33
  } from "./chunks/chunk-V5P25P7F.js";
34
34
  import {
35
35
  getScope
36
36
  } from "./chunks/chunk-QIZEWDZG.js";
37
- import "./chunks/chunk-ZZ6SYVWP.js";
37
+ import "./chunks/chunk-NKBY7GFB.js";
38
38
  import {
39
39
  commandNames,
40
40
  commands
package/dist/version.mjs CHANGED
@@ -1 +1 @@
1
- export const version = "50.37.2";
1
+ export const version = "50.37.3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel",
3
- "version": "50.37.2",
3
+ "version": "50.37.3",
4
4
  "type": "module",
5
5
  "preferGlobal": true,
6
6
  "license": "Apache-2.0",
@@ -32,25 +32,25 @@
32
32
  "proxy-agent": "6.4.0",
33
33
  "@vercel/prepare-flags-definitions": "0.2.1",
34
34
  "@vercel/build-utils": "13.12.0",
35
- "@vercel/backends": "0.0.53",
36
- "@vercel/elysia": "0.1.55",
37
35
  "@vercel/detect-agent": "1.2.1",
36
+ "@vercel/elysia": "0.1.55",
38
37
  "@vercel/express": "0.1.65",
38
+ "@vercel/backends": "0.0.53",
39
39
  "@vercel/fastify": "0.1.58",
40
- "@vercel/h3": "0.1.64",
41
40
  "@vercel/go": "3.4.6",
42
- "@vercel/hono": "0.2.58",
43
41
  "@vercel/hydrogen": "1.3.6",
42
+ "@vercel/h3": "0.1.64",
43
+ "@vercel/nestjs": "0.2.59",
44
44
  "@vercel/koa": "0.1.38",
45
45
  "@vercel/next": "4.16.3",
46
46
  "@vercel/node": "5.6.22",
47
- "@vercel/nestjs": "0.2.59",
48
47
  "@vercel/python": "6.28.0",
49
- "@vercel/remix-builder": "5.7.2",
50
- "@vercel/ruby": "2.3.2",
51
48
  "@vercel/redwood": "2.4.12",
49
+ "@vercel/remix-builder": "5.7.2",
50
+ "@vercel/hono": "0.2.58",
51
+ "@vercel/static-build": "2.9.6",
52
52
  "@vercel/rust": "1.0.5",
53
- "@vercel/static-build": "2.9.6"
53
+ "@vercel/ruby": "2.3.2"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@alex_neo/jest-expect-message": "1.0.5",
@@ -178,14 +178,14 @@
178
178
  "write-json-file": "2.2.0",
179
179
  "xdg-app-paths": "5.1.0",
180
180
  "yauzl-promise": "2.1.3",
181
- "@vercel-internals/constants": "1.0.4",
182
- "@vercel-internals/get-package-json": "1.0.0",
183
181
  "@vercel-internals/types": "3.0.6",
184
182
  "@vercel/client": "17.2.65",
185
183
  "@vercel/error-utils": "2.0.3",
186
184
  "@vercel/frameworks": "3.21.1",
187
185
  "@vercel/fs-detectors": "5.12.2",
188
- "@vercel/routing-utils": "6.1.1"
186
+ "@vercel/routing-utils": "6.1.1",
187
+ "@vercel-internals/constants": "1.0.4",
188
+ "@vercel-internals/get-package-json": "1.0.0"
189
189
  },
190
190
  "scripts": {
191
191
  "test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail",
@@ -1,384 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import {
8
- global_path_default
9
- } from "./chunk-AACAZGTQ.js";
10
- import {
11
- printError
12
- } from "./chunk-N7ABINT7.js";
13
- import {
14
- output_manager_default
15
- } from "./chunk-FDJURQMQ.js";
16
- import {
17
- require_source
18
- } from "./chunk-S7KYDPEM.js";
19
- import {
20
- __toESM
21
- } from "./chunk-TZ2YI2VH.js";
22
-
23
- // src/util/agent/auto-install-agentic.ts
24
- var import_chalk2 = __toESM(require_source(), 1);
25
- import { readFile as readFile2, writeFile as writeFile2, readdir } from "fs/promises";
26
- import { access } from "fs/promises";
27
- import { join as join2 } from "path";
28
- import { homedir } from "os";
29
- import { spawn } from "child_process";
30
- import { KNOWN_AGENTS as KNOWN_AGENTS2 } from "@vercel/detect-agent";
31
-
32
- // src/commands/agent/init.ts
33
- var import_chalk = __toESM(require_source(), 1);
34
- import { readFile, writeFile } from "fs/promises";
35
- import { join } from "path";
36
- import { KNOWN_AGENTS } from "@vercel/detect-agent";
37
- var BEST_PRACTICES_START = "<!-- VERCEL BEST PRACTICES START -->";
38
- var BEST_PRACTICES_END = "<!-- VERCEL BEST PRACTICES END -->";
39
- var BEST_PRACTICES_BODY = `## Best practices for developing on Vercel
40
-
41
- These defaults are optimized for AI coding agents (and humans) working on apps that deploy to Vercel.
42
-
43
- - Treat Vercel Functions as stateless + ephemeral (no durable RAM/FS, no background daemons), use Blob or marketplace integrations for preserving state
44
- - Edge Functions (standalone) are deprecated; prefer Vercel Functions
45
- - Don't start new projects on Vercel KV/Postgres (both discontinued); use Marketplace Redis/Postgres instead
46
- - Store secrets in Vercel Env Variables; not in git or \`NEXT_PUBLIC_*\`
47
- - Provision Marketplace native integrations with \`vercel integration add\` (CI/agent-friendly)
48
- - Sync env + project settings with \`vercel env pull\` / \`vercel pull\` when you need local/offline parity
49
- - Use \`waitUntil\` for post-response work; avoid the deprecated Function \`context\` parameter
50
- - Set Function regions near your primary data source; avoid cross-region DB/service roundtrips
51
- - Tune Fluid Compute knobs (e.g., \`maxDuration\`, memory/CPU) for long I/O-heavy calls (LLMs, APIs)
52
- - Use Runtime Cache for fast **regional** caching + tag invalidation (don't treat it as global KV)
53
- - Use Cron Jobs for schedules; cron runs in UTC and triggers your production URL via HTTP GET
54
- - Use Vercel Blob for uploads/media; Use Edge Config for small, globally-read config
55
- - If Enable Deployment Protection is enabled, use a bypass secret to directly access them
56
- - Add OpenTelemetry via \`@vercel/otel\` on Node; don't expect OTEL support on the Edge runtime
57
- - Enable Web Analytics + Speed Insights early
58
- - Use AI Gateway for model routing, set AI_GATEWAY_API_KEY, using a model string (e.g. 'anthropic/claude-sonnet-4.6'), Gateway is already default in AI SDK
59
- needed. Always curl https://ai-gateway.vercel.sh/v1/models first; never trust model IDs from memory
60
- - For durable agent loops or untrusted code: use Workflow (pause/resume/state) + Sandbox; use Vercel MCP for secure infra access`;
61
- var BEST_PRACTICES_CONTENT = `${BEST_PRACTICES_START}
62
- ${BEST_PRACTICES_BODY}
63
- ${BEST_PRACTICES_END}
64
- `;
65
- function getTargetFile(agentName) {
66
- if (agentName === KNOWN_AGENTS.CLAUDE) {
67
- return "CLAUDE.md";
68
- }
69
- return "AGENTS.md";
70
- }
71
- async function agentInit(client, yes) {
72
- const targetFile = getTargetFile(client.agentName);
73
- const filePath = join(client.cwd, targetFile);
74
- let existing = null;
75
- try {
76
- existing = await readFile(filePath, "utf-8");
77
- } catch {
78
- }
79
- const hasMarkers = existing !== null && existing.includes(BEST_PRACTICES_START) && existing.includes(BEST_PRACTICES_END);
80
- const action = hasMarkers ? "update" : existing !== null ? "append" : "create";
81
- const promptMessage = hasMarkers ? `We're going to update Vercel best practices in your ${import_chalk.default.bold(targetFile)}. Proceed?` : `We're going to add Vercel best practices to your ${import_chalk.default.bold(targetFile)}. Proceed?`;
82
- if (!yes && client.stdin.isTTY) {
83
- const confirmed = await client.input.confirm(promptMessage, true);
84
- if (!confirmed) {
85
- output_manager_default.log("Canceled");
86
- return 0;
87
- }
88
- } else if (!yes && !client.stdin.isTTY) {
89
- output_manager_default.error(
90
- "Missing required flag --yes. Use --yes to skip confirmation, or run interactively in a terminal."
91
- );
92
- return 1;
93
- }
94
- output_manager_default.spinner(`Writing Vercel best practices to ${targetFile}`);
95
- try {
96
- if (action === "update") {
97
- const startIdx = existing.indexOf(BEST_PRACTICES_START);
98
- const endIdx = existing.indexOf(BEST_PRACTICES_END) + BEST_PRACTICES_END.length;
99
- const trailingNewline = existing[endIdx] === "\n" ? 1 : 0;
100
- const updated = existing.slice(0, startIdx) + BEST_PRACTICES_CONTENT + existing.slice(endIdx + trailingNewline);
101
- await writeFile(filePath, updated, "utf-8");
102
- output_manager_default.stopSpinner();
103
- output_manager_default.success(
104
- `Updated Vercel best practices in ${import_chalk.default.bold(targetFile)}`
105
- );
106
- } else if (action === "append") {
107
- const separator = existing.endsWith("\n") ? "\n" : "\n\n";
108
- await writeFile(
109
- filePath,
110
- existing + separator + BEST_PRACTICES_CONTENT,
111
- "utf-8"
112
- );
113
- output_manager_default.stopSpinner();
114
- output_manager_default.success(
115
- `Appended Vercel best practices to ${import_chalk.default.bold(targetFile)}`
116
- );
117
- } else {
118
- await writeFile(filePath, BEST_PRACTICES_CONTENT, "utf-8");
119
- output_manager_default.stopSpinner();
120
- output_manager_default.success(
121
- `Created ${import_chalk.default.bold(targetFile)} with Vercel best practices`
122
- );
123
- }
124
- } catch (error) {
125
- output_manager_default.stopSpinner();
126
- printError(error);
127
- return 1;
128
- }
129
- output_manager_default.log(import_chalk.default.dim("Run vercel deploy to ship your project"));
130
- return 0;
131
- }
132
-
133
- // src/util/agent/auto-install-agentic.ts
134
- var PREVIEW_LINES = 5;
135
- var PREFS_FILE = "agent-preferences.json";
136
- var AGENT_TO_TARGET = {
137
- [KNOWN_AGENTS2.CLAUDE]: "claude-code",
138
- [KNOWN_AGENTS2.COWORK]: "claude-code",
139
- [KNOWN_AGENTS2.CURSOR]: "cursor",
140
- [KNOWN_AGENTS2.CURSOR_CLI]: "cursor"
141
- };
142
- async function fileExists(filePath) {
143
- try {
144
- await access(filePath);
145
- return true;
146
- } catch {
147
- return false;
148
- }
149
- }
150
- async function readPrefs() {
151
- try {
152
- const raw = await readFile2(
153
- join2(global_path_default(), PREFS_FILE),
154
- "utf-8"
155
- );
156
- return JSON.parse(raw);
157
- } catch {
158
- return {};
159
- }
160
- }
161
- async function writePrefs(prefs) {
162
- try {
163
- await writeFile2(
164
- join2(global_path_default(), PREFS_FILE),
165
- JSON.stringify(prefs, null, 2),
166
- "utf-8"
167
- );
168
- } catch {
169
- }
170
- }
171
- function getTargetFile2(agentName) {
172
- if (agentName === KNOWN_AGENTS2.CLAUDE) {
173
- return "CLAUDE.md";
174
- }
175
- return "AGENTS.md";
176
- }
177
- function printPreview() {
178
- const lines = BEST_PRACTICES_BODY.split("\n").filter((l) => l.trim() !== "");
179
- const preview = lines.slice(0, PREVIEW_LINES);
180
- const remaining = lines.length - PREVIEW_LINES;
181
- output_manager_default.log("");
182
- for (const line of preview) {
183
- output_manager_default.log(import_chalk2.default.dim(` ${line}`));
184
- }
185
- if (remaining > 0) {
186
- output_manager_default.log(import_chalk2.default.dim(` (+ ${remaining} more lines)`));
187
- }
188
- output_manager_default.log("");
189
- }
190
- async function getPluginTargets(agentName) {
191
- if (agentName && AGENT_TO_TARGET[agentName]) {
192
- return [AGENT_TO_TARGET[agentName]];
193
- }
194
- const home = homedir();
195
- const targets = [];
196
- if (await fileExists(join2(home, ".claude"))) {
197
- targets.push("claude-code");
198
- }
199
- if (await fileExists(join2(home, ".cursor"))) {
200
- targets.push("cursor");
201
- }
202
- return targets;
203
- }
204
- async function isPluginInClaudeRegistry() {
205
- try {
206
- const raw = await readFile2(
207
- join2(homedir(), ".claude", "plugins", "installed_plugins.json"),
208
- "utf-8"
209
- );
210
- const data = JSON.parse(raw);
211
- const plugins = data?.plugins ?? {};
212
- return Object.keys(plugins).some(
213
- (key) => key.toLowerCase().includes("vercel-plugin")
214
- );
215
- } catch {
216
- return false;
217
- }
218
- }
219
- async function isPluginInCursorPlugins() {
220
- const pluginsDir = join2(homedir(), ".cursor", "plugins");
221
- try {
222
- const entries = await readdir(pluginsDir, { withFileTypes: true });
223
- for (const entry of entries) {
224
- if (!entry.isDirectory())
225
- continue;
226
- if (entry.name.includes("vercel-plugin")) {
227
- return true;
228
- }
229
- }
230
- } catch {
231
- return false;
232
- }
233
- return false;
234
- }
235
- async function isPluginInstalledForTarget(target) {
236
- if (target === "claude-code") {
237
- return isPluginInClaudeRegistry();
238
- }
239
- if (target === "cursor") {
240
- return await isPluginInClaudeRegistry() || await isPluginInCursorPlugins();
241
- }
242
- return false;
243
- }
244
- async function confirm(client, message, autoConfirm) {
245
- if (autoConfirm && !client.isAgent) {
246
- return true;
247
- }
248
- if (!client.stdin.isTTY) {
249
- return false;
250
- }
251
- return client.input.confirm(message, true);
252
- }
253
- async function autoInstallAgentTooling(client, options) {
254
- try {
255
- const prefs = await readPrefs();
256
- if (!options?.skipAgentInit && !prefs.agentInitDismissed) {
257
- try {
258
- const targetFile = getTargetFile2(client.agentName);
259
- const filePath = join2(client.cwd, targetFile);
260
- let existing = null;
261
- try {
262
- existing = await readFile2(filePath, "utf-8");
263
- } catch {
264
- }
265
- const hasMarkers = existing !== null && existing.includes(BEST_PRACTICES_START) && existing.includes(BEST_PRACTICES_END);
266
- if (hasMarkers) {
267
- await agentInit(client, true);
268
- } else if (client.isAgent) {
269
- await agentInit(client, true);
270
- } else {
271
- printPreview();
272
- const accepted = await confirm(
273
- client,
274
- `Add Vercel best practices to ${import_chalk2.default.bold(targetFile)}?`,
275
- options?.autoConfirm
276
- );
277
- if (accepted) {
278
- await agentInit(client, true);
279
- } else {
280
- prefs.agentInitDismissed = true;
281
- await writePrefs(prefs);
282
- }
283
- }
284
- } catch (err) {
285
- output_manager_default.debug(`Agent init failed: ${err}`);
286
- }
287
- }
288
- if (!prefs.pluginDismissed) {
289
- const targets = await getPluginTargets(client.agentName);
290
- const uninstalledTargets = [];
291
- for (const target of targets) {
292
- if (!await isPluginInstalledForTarget(target)) {
293
- uninstalledTargets.push(target);
294
- }
295
- }
296
- if (uninstalledTargets.length > 0) {
297
- if (client.isAgent && !client.stdin.isTTY) {
298
- const next = uninstalledTargets.map((target) => ({
299
- command: `npx plugins add vercel/vercel-plugin --target ${target} -y`,
300
- when: `Install Vercel plugin for ${target}`
301
- }));
302
- client.stdout.write(
303
- `${JSON.stringify(
304
- {
305
- status: "action_required",
306
- reason: "plugin_install",
307
- message: "The Vercel plugin enhances your agent experience. Would you like to install it?",
308
- next
309
- },
310
- null,
311
- 2
312
- )}
313
- `
314
- );
315
- prefs.pluginDismissed = true;
316
- await writePrefs(prefs);
317
- return;
318
- }
319
- const accepted = await confirm(
320
- client,
321
- "Install the Vercel plugin?",
322
- options?.autoConfirm
323
- );
324
- if (accepted) {
325
- for (const target of uninstalledTargets) {
326
- output_manager_default.spinner(`Installing Vercel plugin for ${target}...`);
327
- const exitCode = await new Promise((resolve) => {
328
- const child = spawn(
329
- "npx",
330
- [
331
- "plugins",
332
- "add",
333
- "vercel/vercel-plugin",
334
- "--target",
335
- target,
336
- "-y"
337
- ],
338
- { stdio: "pipe" }
339
- );
340
- child.on("close", (c) => resolve(c ?? 1));
341
- child.on("error", () => resolve(1));
342
- });
343
- output_manager_default.stopSpinner();
344
- if (exitCode === 0) {
345
- output_manager_default.success(`Installed Vercel plugin for ${target}`);
346
- } else {
347
- output_manager_default.debug(`Failed to install Vercel plugin for ${target}`);
348
- }
349
- }
350
- } else {
351
- prefs.pluginDismissed = true;
352
- await writePrefs(prefs);
353
- }
354
- }
355
- }
356
- } catch (err) {
357
- output_manager_default.debug(`Auto-install agent tooling failed: ${err}`);
358
- }
359
- }
360
- async function showPluginTipIfNeeded() {
361
- try {
362
- const prefs = await readPrefs();
363
- if (prefs.pluginDismissed)
364
- return;
365
- const targets = await getPluginTargets();
366
- for (const target of targets) {
367
- if (!await isPluginInstalledForTarget(target)) {
368
- output_manager_default.log(
369
- import_chalk2.default.dim(
370
- "Tip: Run `npx plugins add vercel/vercel-plugin` to enhance your agent experience"
371
- )
372
- );
373
- return;
374
- }
375
- }
376
- } catch {
377
- }
378
- }
379
-
380
- export {
381
- agentInit,
382
- autoInstallAgentTooling,
383
- showPluginTipIfNeeded
384
- };