@mastra/deployer-vercel 1.2.10 → 1.2.11

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @mastra/deployer-vercel
2
2
 
3
+ ## 1.2.11
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`ce93a3c`](https://github.com/mastra-ai/mastra/commit/ce93a3c114ea1cbfbd576f3db41d7c26c9844f5b), [`5718a22`](https://github.com/mastra-ai/mastra/commit/5718a229281dcfd36bcd1f42a242e3717e510a33), [`a211d09`](https://github.com/mastra-ai/mastra/commit/a211d09185dc65a746534914cf38b67f21ee9bac), [`0dca9d0`](https://github.com/mastra-ai/mastra/commit/0dca9d0b1356024a53b72ea6f040db528b126caa), [`6218217`](https://github.com/mastra-ai/mastra/commit/62182171b6cfca0b099f1c6a77a2e65e7639ab86), [`5807d3a`](https://github.com/mastra-ai/mastra/commit/5807d3ae1d259b8b7d6df7e5bf2b485c694af9c8), [`57661af`](https://github.com/mastra-ai/mastra/commit/57661afeca52ff9af4e72675ede2134fa503d5a5), [`05db566`](https://github.com/mastra-ai/mastra/commit/05db566fcbdcbf33d0bffca0c72ec30129e2e3ca), [`57661af`](https://github.com/mastra-ai/mastra/commit/57661afeca52ff9af4e72675ede2134fa503d5a5), [`57661af`](https://github.com/mastra-ai/mastra/commit/57661afeca52ff9af4e72675ede2134fa503d5a5), [`5718a22`](https://github.com/mastra-ai/mastra/commit/5718a229281dcfd36bcd1f42a242e3717e510a33), [`57661af`](https://github.com/mastra-ai/mastra/commit/57661afeca52ff9af4e72675ede2134fa503d5a5), [`d1b7e3a`](https://github.com/mastra-ai/mastra/commit/d1b7e3a978a309a5653eeaa490d2d6c7c53bd093), [`29c584a`](https://github.com/mastra-ai/mastra/commit/29c584a13a88831e5ed1fdeb0ff8e82eae180433), [`c093146`](https://github.com/mastra-ai/mastra/commit/c0931466404d3c521308ea119cb165bb7e695155), [`8124754`](https://github.com/mastra-ai/mastra/commit/8124754ae89fbc69f8136d1df4a91904d0f84c4e), [`d12b2e4`](https://github.com/mastra-ai/mastra/commit/d12b2e4023fd9e3d3e93a9169f5088bcee2a849c)]:
8
+ - @mastra/core@1.54.0
9
+ - @mastra/deployer@1.54.0
10
+
11
+ ## 1.2.11-alpha.0
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [[`0dca9d0`](https://github.com/mastra-ai/mastra/commit/0dca9d0b1356024a53b72ea6f040db528b126caa)]:
16
+ - @mastra/core@1.54.0-alpha.0
17
+ - @mastra/deployer@1.54.0-alpha.0
18
+
3
19
  ## 1.2.10
4
20
 
5
21
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1,69 +1,94 @@
1
- 'use strict';
2
-
3
- var fs = require('fs');
4
- var path = require('path');
5
- var process = require('process');
6
- var url = require('url');
7
- var deployer = require('@mastra/deployer');
8
- var build = require('@mastra/deployer/build');
9
- var esm = require('fs-extra/esm');
10
-
11
- var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
12
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
13
-
14
- var process__default = /*#__PURE__*/_interopDefault(process);
15
-
16
- // src/index.ts
17
-
18
- // src/routes.ts
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
+ get: ((k) => from[k]).bind(null, key),
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
+ value: mod,
21
+ enumerable: true
22
+ }) : target, mod));
23
+ //#endregion
24
+ let fs = require("fs");
25
+ let path = require("path");
26
+ let process = require("process");
27
+ process = __toESM(process, 1);
28
+ let url = require("url");
29
+ let _mastra_deployer = require("@mastra/deployer");
30
+ let _mastra_deployer_build = require("@mastra/deployer/build");
31
+ let fs_extra_esm = require("fs-extra/esm");
32
+ //#region src/routes.ts
19
33
  function getVercelRoutes({ studio }) {
20
- return studio ? [
21
- { src: "^/$", dest: "/index.html" },
22
- { src: "/api/(.*)", dest: "/" },
23
- { src: "/health", dest: "/" },
24
- { handle: "filesystem" },
25
- { src: "/(.*)", dest: "/index.html", check: true }
26
- ] : [{ src: "/(.*)", dest: "/" }];
34
+ return studio ? [
35
+ {
36
+ src: "^/$",
37
+ dest: "/index.html"
38
+ },
39
+ {
40
+ src: "/api/(.*)",
41
+ dest: "/"
42
+ },
43
+ {
44
+ src: "/health",
45
+ dest: "/"
46
+ },
47
+ { handle: "filesystem" },
48
+ {
49
+ src: "/(.*)",
50
+ dest: "/index.html",
51
+ check: true
52
+ }
53
+ ] : [{
54
+ src: "/(.*)",
55
+ dest: "/"
56
+ }];
27
57
  }
28
-
29
- // src/index.ts
30
- var VercelDeployer = class extends deployer.Deployer {
31
- vcConfigOverrides = {};
32
- studio;
33
- constructor(options = {}) {
34
- super({ name: "VERCEL" });
35
- this.outputDir = path.join(".vercel", "output", "functions", "index.func");
36
- this.studio = options.studio ?? false;
37
- const { studio, ...overrides } = options;
38
- this.vcConfigOverrides = { ...overrides };
39
- }
40
- async getUserBundlerOptions(mastraEntryFile, outputDirectory) {
41
- const bundlerOptions = await super.getUserBundlerOptions(mastraEntryFile, outputDirectory);
42
- return {
43
- ...bundlerOptions,
44
- externals: true
45
- };
46
- }
47
- async prepare(outputDirectory) {
48
- await super.prepare(outputDirectory);
49
- this.writeVercelJSON(path.join(outputDirectory, this.outputDir, "..", ".."));
50
- if (this.studio) {
51
- const __filename = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
52
- const __dirname = path.dirname(__filename);
53
- const studioSource = path.join(path.dirname(__dirname), "dist", "studio");
54
- const staticDir = path.join(outputDirectory, ".vercel", "output", "static");
55
- try {
56
- await esm.copy(studioSource, staticDir, { overwrite: true });
57
- } catch (err) {
58
- throw new Error(
59
- `Failed to copy studio assets from "${studioSource}" to "${staticDir}": ${err instanceof Error ? err.message : err}`
60
- );
61
- }
62
- this.injectStudioConfig(staticDir);
63
- }
64
- }
65
- getEntry() {
66
- return `
58
+ //#endregion
59
+ //#region src/index.ts
60
+ var VercelDeployer = class extends _mastra_deployer.Deployer {
61
+ vcConfigOverrides = {};
62
+ studio;
63
+ constructor(options = {}) {
64
+ super({ name: "VERCEL" });
65
+ this.outputDir = (0, path.join)(".vercel", "output", "functions", "index.func");
66
+ this.studio = options.studio ?? false;
67
+ const { studio, ...overrides } = options;
68
+ this.vcConfigOverrides = { ...overrides };
69
+ }
70
+ async getUserBundlerOptions(mastraEntryFile, outputDirectory) {
71
+ return {
72
+ ...await super.getUserBundlerOptions(mastraEntryFile, outputDirectory),
73
+ externals: true
74
+ };
75
+ }
76
+ async prepare(outputDirectory) {
77
+ await super.prepare(outputDirectory);
78
+ this.writeVercelJSON((0, path.join)(outputDirectory, this.outputDir, "..", ".."));
79
+ if (this.studio) {
80
+ const studioSource = (0, path.join)((0, path.dirname)((0, path.dirname)((0, url.fileURLToPath)(require("url").pathToFileURL(__filename).href))), "dist", "studio");
81
+ const staticDir = (0, path.join)(outputDirectory, ".vercel", "output", "static");
82
+ try {
83
+ await (0, fs_extra_esm.copy)(studioSource, staticDir, { overwrite: true });
84
+ } catch (err) {
85
+ throw new Error(`Failed to copy studio assets from "${studioSource}" to "${staticDir}": ${err instanceof Error ? err.message : err}`);
86
+ }
87
+ this.injectStudioConfig(staticDir);
88
+ }
89
+ }
90
+ getEntry() {
91
+ return `
67
92
  import { handle } from 'hono/vercel'
68
93
  import { mastra } from '#mastra';
69
94
  import { createHonoServer, getToolExports } from '#server';
@@ -84,78 +109,73 @@ export const PATCH = handle(app);
84
109
  export const OPTIONS = handle(app);
85
110
  export const HEAD = handle(app);
86
111
  `;
87
- }
88
- injectStudioConfig(staticDir) {
89
- const indexPath = path.join(staticDir, "index.html");
90
- let html = fs.readFileSync(indexPath, "utf-8");
91
- html = build.injectStudioHtmlConfig(html, {
92
- host: `window.location.hostname`,
93
- port: `(window.location.port || (window.location.protocol === 'https:' ? '443' : '80'))`,
94
- protocol: `window.location.protocol.replace(':', '')`,
95
- apiPrefix: `'/api'`,
96
- basePath: "",
97
- hideCloudCta: `'true'`,
98
- templates: `'false'`,
99
- cloudApiEndpoint: `''`,
100
- experimentalFeatures: `'false'`,
101
- telemetryDisabled: `''`,
102
- requestContextPresets: `''`,
103
- experimentalUI: `'false'`,
104
- agentSignals: process__default.default.env.MASTRA_AGENT_SIGNALS === "false" ? `'false'` : `'true'`,
105
- signalsUI: process__default.default.env.MASTRA_SIGNALS_UI === "true" ? `'true'` : `'false'`,
106
- organizationId: `'${build.escapeStudioHtmlValue(process__default.default.env.MASTRA_ORGANIZATION_ID || "")}'`,
107
- platformProjectId: `'${build.escapeStudioHtmlValue(process__default.default.env.MASTRA_PLATFORM_PROJECT_ID || "")}'`,
108
- platformObservabilityEndpoint: `'${build.escapeStudioHtmlValue(process__default.default.env.MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT || "")}'`
109
- });
110
- fs.writeFileSync(indexPath, html);
111
- }
112
- writeVercelJSON(outputDirectory) {
113
- fs.writeFileSync(
114
- path.join(outputDirectory, "config.json"),
115
- JSON.stringify({ version: 3, routes: getVercelRoutes({ studio: this.studio }) })
116
- );
117
- }
118
- async bundle(entryFile, outputDirectory, { toolsPaths, projectRoot }) {
119
- const result = await this._bundle(
120
- this.getEntry(),
121
- entryFile,
122
- { outputDirectory, projectRoot },
123
- toolsPaths,
124
- path.join(outputDirectory, this.outputDir)
125
- );
126
- const nodeVersion = process__default.default.version?.split(".")?.[0]?.replace("v", "") ?? "22";
127
- const vcConfig = {
128
- handler: "index.mjs",
129
- launcherType: "Nodejs",
130
- runtime: `nodejs${nodeVersion}.x`,
131
- shouldAddHelpers: true
132
- };
133
- const { maxDuration, memory, regions } = this.vcConfigOverrides;
134
- if (typeof maxDuration === "number") vcConfig.maxDuration = maxDuration;
135
- if (typeof memory === "number") vcConfig.memory = memory;
136
- if (Array.isArray(regions) && regions.length > 0) vcConfig.regions = regions;
137
- fs.writeFileSync(path.join(outputDirectory, this.outputDir, ".vc-config.json"), JSON.stringify(vcConfig, null, 2));
138
- await esm.move(path.join(outputDirectory, ".vercel", "output"), path.join(process__default.default.cwd(), ".vercel", "output"), {
139
- overwrite: true
140
- });
141
- return result;
142
- }
143
- async deploy() {
144
- this.logger?.info("Deploying to Vercel is deprecated. Please use the Vercel dashboard to deploy.");
145
- }
146
- async lint(entryFile, outputDirectory, toolsPaths) {
147
- await super.lint(entryFile, outputDirectory, toolsPaths);
148
- const hasLibsql = await this.deps.checkDependencies(["@mastra/libsql"]) === `ok`;
149
- if (hasLibsql) {
150
- this.logger.error(
151
- `Vercel Deployer does not support @libsql/client(which may have been installed by @mastra/libsql) as a dependency.
152
- Use other Mastra Storage options instead e.g @mastra/pg`
153
- );
154
- process__default.default.exit(1);
155
- }
156
- }
112
+ }
113
+ injectStudioConfig(staticDir) {
114
+ const indexPath = (0, path.join)(staticDir, "index.html");
115
+ let html = (0, fs.readFileSync)(indexPath, "utf-8");
116
+ /**
117
+ * Use window.location expressions so the SPA constructs the correct same-origin endpoint.
118
+ * Port uses a ternary: window.location.port is '' for default ports (80/443), and the SPA falls back to 4111 for empty strings, so we return the default port explicitly instead.
119
+ */
120
+ html = (0, _mastra_deployer_build.injectStudioHtmlConfig)(html, {
121
+ host: `window.location.hostname`,
122
+ port: `(window.location.port || (window.location.protocol === 'https:' ? '443' : '80'))`,
123
+ protocol: `window.location.protocol.replace(':', '')`,
124
+ apiPrefix: `'/api'`,
125
+ basePath: "",
126
+ hideCloudCta: `'true'`,
127
+ templates: `'false'`,
128
+ cloudApiEndpoint: `''`,
129
+ experimentalFeatures: `'false'`,
130
+ telemetryDisabled: `''`,
131
+ requestContextPresets: `''`,
132
+ experimentalUI: `'false'`,
133
+ agentSignals: process.default.env.MASTRA_AGENT_SIGNALS === "false" ? `'false'` : `'true'`,
134
+ signalsUI: process.default.env.MASTRA_SIGNALS_UI === "true" ? `'true'` : `'false'`,
135
+ organizationId: `'${(0, _mastra_deployer_build.escapeStudioHtmlValue)(process.default.env.MASTRA_ORGANIZATION_ID || "")}'`,
136
+ platformProjectId: `'${(0, _mastra_deployer_build.escapeStudioHtmlValue)(process.default.env.MASTRA_PLATFORM_PROJECT_ID || "")}'`,
137
+ platformObservabilityEndpoint: `'${(0, _mastra_deployer_build.escapeStudioHtmlValue)(process.default.env.MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT || "")}'`
138
+ });
139
+ (0, fs.writeFileSync)(indexPath, html);
140
+ }
141
+ writeVercelJSON(outputDirectory) {
142
+ (0, fs.writeFileSync)((0, path.join)(outputDirectory, "config.json"), JSON.stringify({
143
+ version: 3,
144
+ routes: getVercelRoutes({ studio: this.studio })
145
+ }));
146
+ }
147
+ async bundle(entryFile, outputDirectory, { toolsPaths, projectRoot }) {
148
+ const result = await this._bundle(this.getEntry(), entryFile, {
149
+ outputDirectory,
150
+ projectRoot
151
+ }, toolsPaths, (0, path.join)(outputDirectory, this.outputDir));
152
+ const vcConfig = {
153
+ handler: "index.mjs",
154
+ launcherType: "Nodejs",
155
+ runtime: `nodejs${process.default.version?.split(".")?.[0]?.replace("v", "") ?? "22"}.x`,
156
+ shouldAddHelpers: true
157
+ };
158
+ const { maxDuration, memory, regions } = this.vcConfigOverrides;
159
+ if (typeof maxDuration === "number") vcConfig.maxDuration = maxDuration;
160
+ if (typeof memory === "number") vcConfig.memory = memory;
161
+ if (Array.isArray(regions) && regions.length > 0) vcConfig.regions = regions;
162
+ (0, fs.writeFileSync)((0, path.join)(outputDirectory, this.outputDir, ".vc-config.json"), JSON.stringify(vcConfig, null, 2));
163
+ await (0, fs_extra_esm.move)((0, path.join)(outputDirectory, ".vercel", "output"), (0, path.join)(process.default.cwd(), ".vercel", "output"), { overwrite: true });
164
+ return result;
165
+ }
166
+ async deploy() {
167
+ this.logger?.info("Deploying to Vercel is deprecated. Please use the Vercel dashboard to deploy.");
168
+ }
169
+ async lint(entryFile, outputDirectory, toolsPaths) {
170
+ await super.lint(entryFile, outputDirectory, toolsPaths);
171
+ if (await this.deps.checkDependencies(["@mastra/libsql"]) === `ok`) {
172
+ this.logger.error(`Vercel Deployer does not support @libsql/client(which may have been installed by @mastra/libsql) as a dependency.
173
+ Use other Mastra Storage options instead e.g @mastra/pg`);
174
+ process.default.exit(1);
175
+ }
176
+ }
157
177
  };
158
-
178
+ //#endregion
159
179
  exports.VercelDeployer = VercelDeployer;
160
- //# sourceMappingURL=index.cjs.map
180
+
161
181
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/routes.ts","../src/index.ts"],"names":["Deployer","join","fileURLToPath","dirname","copy","readFileSync","injectStudioHtmlConfig","process","escapeStudioHtmlValue","writeFileSync","move"],"mappings":";;;;;;;;;;;;;;;;;;AAIO,SAAS,eAAA,CAAgB,EAAE,MAAA,EAAO,EAAwB;AAC/D,EAAA,OAAO,MAAA,GACH;AAAA,IACE,EAAE,GAAA,EAAK,KAAA,EAAO,IAAA,EAAM,aAAA,EAAc;AAAA,IAClC,EAAE,GAAA,EAA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A,EAAiB,SAAA,EAAW,QAAQ,CAAA,EAAGA,SAAA,CAAKM,wBAAA,CAAQ,GAAA,EAAI,EAAG,SAAA,EAAW,QAAQ,CAAA,EAAG;AAAA,MAC/F,SAAA,EAAW;AAAA,KACZ,CAAA;AAED,IAAA,OAAO,MAAA;AAAA,EACT;AAAA,EAEA,MAAM,MAAA,GAAwB;AAC5B,IAAA,IAAA,CAAK,MAAA,EAAQ,KAAK,+EAA+E,CAAA;AAAA,EACnG;AAAA,EAEA,MAAM,IAAA,CAAK,SAAA,EAAmB,eAAA,EAAyB,UAAA,EAAkD;AACvG,IAAA,MAAM,KAAA,CAAM,IAAA,CAAK,SAAA,EAAW,eAAA,EAAiB,UAAU,CAAA;AAEvD,IAAA,MAAM,SAAA,GAAa,MAAM,IAAA,CAAK,IAAA,CAAK,kBAAkB,CAAC,gBAAgB,CAAC,CAAA,KAAO,CAAA,EAAA,CAAA;AAE9E,IAAA,IAAI,SAAA,EAAW;AACb,MAAA,IAAA,CAAK,MAAA,CAAO,KAAA;AAAA,QACV,CAAA;AAAA,2DAAA;AAAA,OAEF;AACA,MAAAA,wBAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,IAChB;AAAA,EACF;AACF","file":"index.cjs","sourcesContent":["type VercelRoutesOptions = {\n studio: boolean;\n};\n\nexport function getVercelRoutes({ studio }: VercelRoutesOptions) {\n return studio\n ? [\n { src: '^/$', dest: '/index.html' },\n { src: '/api/(.*)', dest: '/' },\n { src: '/health', dest: '/' },\n { handle: 'filesystem' as const },\n { src: '/(.*)', dest: '/index.html', check: true },\n ]\n : [{ src: '/(.*)', dest: '/' }];\n}\n","import { readFileSync, writeFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport process from 'node:process';\nimport { fileURLToPath } from 'node:url';\nimport type { Config } from '@mastra/core/mastra';\nimport { Deployer } from '@mastra/deployer';\nimport { escapeStudioHtmlValue, injectStudioHtmlConfig } from '@mastra/deployer/build';\nimport { copy, move } from 'fs-extra/esm';\nimport { getVercelRoutes } from './routes';\nimport type { VcConfig, VcConfigOverrides, VercelDeployerOptions } from './types';\n\nexport class VercelDeployer extends Deployer {\n private vcConfigOverrides: VcConfigOverrides = {};\n private studio: boolean;\n\n constructor(options: VercelDeployerOptions = {}) {\n super({ name: 'VERCEL' });\n this.outputDir = join('.vercel', 'output', 'functions', 'index.func');\n this.studio = options.studio ?? false;\n\n const { studio, ...overrides } = options;\n this.vcConfigOverrides = { ...overrides };\n }\n\n protected async getUserBundlerOptions(\n mastraEntryFile: string,\n outputDirectory: string,\n ): Promise<NonNullable<Config['bundler']>> {\n const bundlerOptions = await super.getUserBundlerOptions(mastraEntryFile, outputDirectory);\n\n // Always force externals: true for Vercel deployments.\n // Vercel serverless functions resolve dependencies from node_modules,\n // so bundling them inline serves no purpose. Bundling inline can also cause\n // circular module evaluation deadlocks when dynamic imports produce chunks\n // that depend back on the entry module via static imports, resulting in\n // \"Detected unsettled top-level await\" errors (Node.js exit code 13).\n // See: https://github.com/mastra-ai/mastra/issues/14860\n return {\n ...bundlerOptions,\n externals: true,\n };\n }\n\n async prepare(outputDirectory: string): Promise<void> {\n await super.prepare(outputDirectory);\n\n this.writeVercelJSON(join(outputDirectory, this.outputDir, '..', '..'));\n\n if (this.studio) {\n const __filename = fileURLToPath(import.meta.url);\n const __dirname = dirname(__filename);\n\n const studioSource = join(dirname(__dirname), 'dist', 'studio');\n const staticDir = join(outputDirectory, '.vercel', 'output', 'static');\n\n try {\n await copy(studioSource, staticDir, { overwrite: true });\n } catch (err) {\n throw new Error(\n `Failed to copy studio assets from \"${studioSource}\" to \"${staticDir}\": ${err instanceof Error ? err.message : err}`,\n );\n }\n\n this.injectStudioConfig(staticDir);\n }\n }\n\n private getEntry(): string {\n return `\nimport { handle } from 'hono/vercel'\nimport { mastra } from '#mastra';\nimport { createHonoServer, getToolExports } from '#server';\nimport { tools } from '#tools';\nimport { scoreTracesWorkflow } from '@mastra/core/evals/scoreTraces';\n\nif (mastra.getStorage()) {\n mastra.__registerInternalWorkflow(scoreTracesWorkflow);\n}\n\nconst app = await createHonoServer(mastra, { tools: getToolExports(tools) });\n\nexport const GET = handle(app);\nexport const POST = handle(app);\nexport const PUT = handle(app);\nexport const DELETE = handle(app);\nexport const PATCH = handle(app);\nexport const OPTIONS = handle(app);\nexport const HEAD = handle(app);\n`;\n }\n\n private injectStudioConfig(staticDir: string) {\n const indexPath = join(staticDir, 'index.html');\n let html = readFileSync(indexPath, 'utf-8');\n\n /**\n * Use window.location expressions so the SPA constructs the correct same-origin endpoint.\n * Port uses a ternary: window.location.port is '' for default ports (80/443), and the SPA falls back to 4111 for empty strings, so we return the default port explicitly instead.\n */\n html = injectStudioHtmlConfig(html, {\n host: `window.location.hostname`,\n port: `(window.location.port || (window.location.protocol === 'https:' ? '443' : '80'))`,\n protocol: `window.location.protocol.replace(':', '')`,\n apiPrefix: `'/api'`,\n basePath: '',\n hideCloudCta: `'true'`,\n templates: `'false'`,\n cloudApiEndpoint: `''`,\n experimentalFeatures: `'false'`,\n telemetryDisabled: `''`,\n requestContextPresets: `''`,\n experimentalUI: `'false'`,\n agentSignals: process.env.MASTRA_AGENT_SIGNALS === 'false' ? `'false'` : `'true'`,\n signalsUI: process.env.MASTRA_SIGNALS_UI === 'true' ? `'true'` : `'false'`,\n organizationId: `'${escapeStudioHtmlValue(process.env.MASTRA_ORGANIZATION_ID || '')}'`,\n platformProjectId: `'${escapeStudioHtmlValue(process.env.MASTRA_PLATFORM_PROJECT_ID || '')}'`,\n platformObservabilityEndpoint: `'${escapeStudioHtmlValue(process.env.MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT || '')}'`,\n });\n\n writeFileSync(indexPath, html);\n }\n\n private writeVercelJSON(outputDirectory: string) {\n writeFileSync(\n join(outputDirectory, 'config.json'),\n JSON.stringify({ version: 3, routes: getVercelRoutes({ studio: this.studio }) }),\n );\n }\n\n async bundle(\n entryFile: string,\n outputDirectory: string,\n { toolsPaths, projectRoot }: { toolsPaths: (string | string[])[]; projectRoot: string },\n ): Promise<void> {\n const result = await this._bundle(\n this.getEntry(),\n entryFile,\n { outputDirectory, projectRoot },\n toolsPaths,\n join(outputDirectory, this.outputDir),\n );\n\n const nodeVersion = process.version?.split('.')?.[0]?.replace('v', '') ?? '22';\n\n const vcConfig: VcConfig = {\n handler: 'index.mjs',\n launcherType: 'Nodejs',\n runtime: `nodejs${nodeVersion}.x`,\n shouldAddHelpers: true,\n };\n\n // Merge supported overrides\n const { maxDuration, memory, regions } = this.vcConfigOverrides;\n if (typeof maxDuration === 'number') vcConfig.maxDuration = maxDuration;\n if (typeof memory === 'number') vcConfig.memory = memory;\n if (Array.isArray(regions) && regions.length > 0) vcConfig.regions = regions;\n\n writeFileSync(join(outputDirectory, this.outputDir, '.vc-config.json'), JSON.stringify(vcConfig, null, 2));\n\n await move(join(outputDirectory, '.vercel', 'output'), join(process.cwd(), '.vercel', 'output'), {\n overwrite: true,\n });\n\n return result;\n }\n\n async deploy(): Promise<void> {\n this.logger?.info('Deploying to Vercel is deprecated. Please use the Vercel dashboard to deploy.');\n }\n\n async lint(entryFile: string, outputDirectory: string, toolsPaths: (string | string[])[]): Promise<void> {\n await super.lint(entryFile, outputDirectory, toolsPaths);\n\n const hasLibsql = (await this.deps.checkDependencies(['@mastra/libsql'])) === `ok`;\n\n if (hasLibsql) {\n this.logger.error(\n `Vercel Deployer does not support @libsql/client(which may have been installed by @mastra/libsql) as a dependency. \n\t\t\t\tUse other Mastra Storage options instead e.g @mastra/pg`,\n );\n process.exit(1);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"index.cjs","names":["Deployer"],"sources":["../src/routes.ts","../src/index.ts"],"sourcesContent":["type VercelRoutesOptions = {\n studio: boolean;\n};\n\nexport function getVercelRoutes({ studio }: VercelRoutesOptions) {\n return studio\n ? [\n { src: '^/$', dest: '/index.html' },\n { src: '/api/(.*)', dest: '/' },\n { src: '/health', dest: '/' },\n { handle: 'filesystem' as const },\n { src: '/(.*)', dest: '/index.html', check: true },\n ]\n : [{ src: '/(.*)', dest: '/' }];\n}\n","import { readFileSync, writeFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport process from 'node:process';\nimport { fileURLToPath } from 'node:url';\nimport type { Config } from '@mastra/core/mastra';\nimport { Deployer } from '@mastra/deployer';\nimport { escapeStudioHtmlValue, injectStudioHtmlConfig } from '@mastra/deployer/build';\nimport { copy, move } from 'fs-extra/esm';\nimport { getVercelRoutes } from './routes';\nimport type { VcConfig, VcConfigOverrides, VercelDeployerOptions } from './types';\n\nexport class VercelDeployer extends Deployer {\n private vcConfigOverrides: VcConfigOverrides = {};\n private studio: boolean;\n\n constructor(options: VercelDeployerOptions = {}) {\n super({ name: 'VERCEL' });\n this.outputDir = join('.vercel', 'output', 'functions', 'index.func');\n this.studio = options.studio ?? false;\n\n const { studio, ...overrides } = options;\n this.vcConfigOverrides = { ...overrides };\n }\n\n protected async getUserBundlerOptions(\n mastraEntryFile: string,\n outputDirectory: string,\n ): Promise<NonNullable<Config['bundler']>> {\n const bundlerOptions = await super.getUserBundlerOptions(mastraEntryFile, outputDirectory);\n\n // Always force externals: true for Vercel deployments.\n // Vercel serverless functions resolve dependencies from node_modules,\n // so bundling them inline serves no purpose. Bundling inline can also cause\n // circular module evaluation deadlocks when dynamic imports produce chunks\n // that depend back on the entry module via static imports, resulting in\n // \"Detected unsettled top-level await\" errors (Node.js exit code 13).\n // See: https://github.com/mastra-ai/mastra/issues/14860\n return {\n ...bundlerOptions,\n externals: true,\n };\n }\n\n async prepare(outputDirectory: string): Promise<void> {\n await super.prepare(outputDirectory);\n\n this.writeVercelJSON(join(outputDirectory, this.outputDir, '..', '..'));\n\n if (this.studio) {\n const __filename = fileURLToPath(import.meta.url);\n const __dirname = dirname(__filename);\n\n const studioSource = join(dirname(__dirname), 'dist', 'studio');\n const staticDir = join(outputDirectory, '.vercel', 'output', 'static');\n\n try {\n await copy(studioSource, staticDir, { overwrite: true });\n } catch (err) {\n throw new Error(\n `Failed to copy studio assets from \"${studioSource}\" to \"${staticDir}\": ${err instanceof Error ? err.message : err}`,\n );\n }\n\n this.injectStudioConfig(staticDir);\n }\n }\n\n private getEntry(): string {\n return `\nimport { handle } from 'hono/vercel'\nimport { mastra } from '#mastra';\nimport { createHonoServer, getToolExports } from '#server';\nimport { tools } from '#tools';\nimport { scoreTracesWorkflow } from '@mastra/core/evals/scoreTraces';\n\nif (mastra.getStorage()) {\n mastra.__registerInternalWorkflow(scoreTracesWorkflow);\n}\n\nconst app = await createHonoServer(mastra, { tools: getToolExports(tools) });\n\nexport const GET = handle(app);\nexport const POST = handle(app);\nexport const PUT = handle(app);\nexport const DELETE = handle(app);\nexport const PATCH = handle(app);\nexport const OPTIONS = handle(app);\nexport const HEAD = handle(app);\n`;\n }\n\n private injectStudioConfig(staticDir: string) {\n const indexPath = join(staticDir, 'index.html');\n let html = readFileSync(indexPath, 'utf-8');\n\n /**\n * Use window.location expressions so the SPA constructs the correct same-origin endpoint.\n * Port uses a ternary: window.location.port is '' for default ports (80/443), and the SPA falls back to 4111 for empty strings, so we return the default port explicitly instead.\n */\n html = injectStudioHtmlConfig(html, {\n host: `window.location.hostname`,\n port: `(window.location.port || (window.location.protocol === 'https:' ? '443' : '80'))`,\n protocol: `window.location.protocol.replace(':', '')`,\n apiPrefix: `'/api'`,\n basePath: '',\n hideCloudCta: `'true'`,\n templates: `'false'`,\n cloudApiEndpoint: `''`,\n experimentalFeatures: `'false'`,\n telemetryDisabled: `''`,\n requestContextPresets: `''`,\n experimentalUI: `'false'`,\n agentSignals: process.env.MASTRA_AGENT_SIGNALS === 'false' ? `'false'` : `'true'`,\n signalsUI: process.env.MASTRA_SIGNALS_UI === 'true' ? `'true'` : `'false'`,\n organizationId: `'${escapeStudioHtmlValue(process.env.MASTRA_ORGANIZATION_ID || '')}'`,\n platformProjectId: `'${escapeStudioHtmlValue(process.env.MASTRA_PLATFORM_PROJECT_ID || '')}'`,\n platformObservabilityEndpoint: `'${escapeStudioHtmlValue(process.env.MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT || '')}'`,\n });\n\n writeFileSync(indexPath, html);\n }\n\n private writeVercelJSON(outputDirectory: string) {\n writeFileSync(\n join(outputDirectory, 'config.json'),\n JSON.stringify({ version: 3, routes: getVercelRoutes({ studio: this.studio }) }),\n );\n }\n\n async bundle(\n entryFile: string,\n outputDirectory: string,\n { toolsPaths, projectRoot }: { toolsPaths: (string | string[])[]; projectRoot: string },\n ): Promise<void> {\n const result = await this._bundle(\n this.getEntry(),\n entryFile,\n { outputDirectory, projectRoot },\n toolsPaths,\n join(outputDirectory, this.outputDir),\n );\n\n const nodeVersion = process.version?.split('.')?.[0]?.replace('v', '') ?? '22';\n\n const vcConfig: VcConfig = {\n handler: 'index.mjs',\n launcherType: 'Nodejs',\n runtime: `nodejs${nodeVersion}.x`,\n shouldAddHelpers: true,\n };\n\n // Merge supported overrides\n const { maxDuration, memory, regions } = this.vcConfigOverrides;\n if (typeof maxDuration === 'number') vcConfig.maxDuration = maxDuration;\n if (typeof memory === 'number') vcConfig.memory = memory;\n if (Array.isArray(regions) && regions.length > 0) vcConfig.regions = regions;\n\n writeFileSync(join(outputDirectory, this.outputDir, '.vc-config.json'), JSON.stringify(vcConfig, null, 2));\n\n await move(join(outputDirectory, '.vercel', 'output'), join(process.cwd(), '.vercel', 'output'), {\n overwrite: true,\n });\n\n return result;\n }\n\n async deploy(): Promise<void> {\n this.logger?.info('Deploying to Vercel is deprecated. Please use the Vercel dashboard to deploy.');\n }\n\n async lint(entryFile: string, outputDirectory: string, toolsPaths: (string | string[])[]): Promise<void> {\n await super.lint(entryFile, outputDirectory, toolsPaths);\n\n const hasLibsql = (await this.deps.checkDependencies(['@mastra/libsql'])) === `ok`;\n\n if (hasLibsql) {\n this.logger.error(\n `Vercel Deployer does not support @libsql/client(which may have been installed by @mastra/libsql) as a dependency. \n\t\t\t\tUse other Mastra Storage options instead e.g @mastra/pg`,\n );\n process.exit(1);\n }\n }\n}\n"],"mappings":";;;;;;;;;;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