@mastra/deployer-cloudflare 0.0.0-error-handler-fix-20251020202607 → 0.0.0-esbuild-bundle-worker-20260807182016

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
@@ -1,170 +1,272 @@
1
- import { writeFile } from 'fs/promises';
2
- import { join } from 'path';
3
- import { Deployer } from '@mastra/deployer';
4
- import virtual from '@rollup/plugin-virtual';
5
- import * as babel from '@babel/core';
6
- import { transformSync } from '@babel/core';
7
-
8
- // src/index.ts
9
- function mastraInstanceWrapper() {
10
- const exportName = "mastra";
11
- const className = "Mastra";
12
- const t = babel.types;
13
- return {
14
- name: "wrap-mastra",
15
- visitor: {
16
- ExportNamedDeclaration(path) {
17
- if (t.isVariableDeclaration(path.node?.declaration)) {
18
- for (const declaration of path.node.declaration.declarations) {
19
- if (t.isIdentifier(declaration?.id, { name: exportName }) && t.isNewExpression(declaration?.init) && t.isIdentifier(declaration.init.callee, { name: className })) {
20
- declaration.init = t.arrowFunctionExpression([], declaration.init);
21
- break;
22
- }
23
- }
24
- }
25
- }
26
- }
27
- };
1
+ import { builtinModules } from "module";
2
+ import { writeFile } from "fs/promises";
3
+ import { join, relative } from "path";
4
+ import { Deployer } from "@mastra/deployer";
5
+ import virtual from "@rollup/plugin-virtual";
6
+ import * as babel from "@babel/core";
7
+ import { transformSync } from "@babel/core";
8
+ //#region src/babel/mastra-instance-wrapper.ts
9
+ /**
10
+ * Babel plugin that transforms Mastra exports for Cloudflare Workers compatibility.
11
+ *
12
+ * This plugin:
13
+ * 1. Identifies named exports of the 'mastra' variable
14
+ * 2. Checks if the export is a new instance of the 'Mastra' class
15
+ * 3. Wraps the Mastra instantiation in an arrow function to ensure proper initialization
16
+ * in the Cloudflare Workers environment
17
+ *
18
+ * The transformation ensures the Mastra instance is properly scoped and initialized
19
+ * for each request in the Cloudflare Workers environment.
20
+ *
21
+ * @returns {PluginObject} A Babel plugin object with a visitor that performs the transformation
22
+ *
23
+ * @example
24
+ * // Before transformation:
25
+ * export const mastra = new Mastra();
26
+ *
27
+ * // After transformation:
28
+ * export const mastra = () => new Mastra();
29
+ */
30
+ function mastraInstanceWrapper$1() {
31
+ const exportName = "mastra";
32
+ const className = "Mastra";
33
+ const t = babel.types;
34
+ return {
35
+ name: "wrap-mastra",
36
+ visitor: { ExportNamedDeclaration(path) {
37
+ if (t.isVariableDeclaration(path.node?.declaration)) {
38
+ for (const declaration of path.node.declaration.declarations) if (t.isIdentifier(declaration?.id, { name: exportName }) && t.isNewExpression(declaration?.init) && t.isIdentifier(declaration.init.callee, { name: className })) {
39
+ declaration.init = t.arrowFunctionExpression([], declaration.init);
40
+ break;
41
+ }
42
+ }
43
+ } }
44
+ };
28
45
  }
29
-
30
- // src/plugins/mastra-instance-wrapper.ts
31
- function mastraInstanceWrapper2(mastraEntryFile) {
32
- return {
33
- name: "mastra-wrapper",
34
- transform(code, id) {
35
- if (id !== mastraEntryFile) {
36
- return null;
37
- }
38
- const result = transformSync(code, {
39
- filename: id,
40
- babelrc: false,
41
- configFile: false,
42
- plugins: [mastraInstanceWrapper]
43
- });
44
- if (!result?.code) {
45
- throw new Error("mastra-wrapper plugin did not return code, there is likely a bug in the plugin.");
46
- }
47
- return {
48
- code: result.code,
49
- map: result?.map
50
- };
51
- }
52
- };
46
+ //#endregion
47
+ //#region src/plugins/mastra-instance-wrapper.ts
48
+ function mastraInstanceWrapper(mastraEntryFile) {
49
+ return {
50
+ name: "mastra-wrapper",
51
+ transform(code, id) {
52
+ if (id !== mastraEntryFile) return null;
53
+ const result = transformSync(code, {
54
+ filename: id,
55
+ babelrc: false,
56
+ configFile: false,
57
+ plugins: [mastraInstanceWrapper$1]
58
+ });
59
+ if (!result?.code) throw new Error("mastra-wrapper plugin did not return code, there is likely a bug in the plugin.");
60
+ return {
61
+ code: result.code,
62
+ map: result?.map
63
+ };
64
+ }
65
+ };
66
+ }
67
+ //#endregion
68
+ //#region src/babel/postgres-store-instance-checker.ts
69
+ /**
70
+ * Babel plugin that enforces singleton PostgresStore instances in Cloudflare Workers.
71
+ *
72
+ * This plugin:
73
+ * 1. Scans for all `new PostgresStore()` instantiations
74
+ * 2. Records their file locations
75
+ * 3. Throws an error if multiple instances are found
76
+ *
77
+ * Cloudflare Workers should only create one PostgresStore instance to avoid connection
78
+ * pool exhaustion and ensure proper resource management.
79
+ *
80
+ * @returns {PluginObject} A Babel plugin object that validates PostgresStore usage
81
+ *
82
+ * @example
83
+ * // Throws error if multiple instances found:
84
+ * const store1 = new PostgresStore();
85
+ * const store2 = new PostgresStore(); // Error thrown here
86
+ */
87
+ function postgresStoreInstanceChecker$1() {
88
+ const t = babel.types;
89
+ const instances = [];
90
+ return {
91
+ name: "postgresstore-instance-checker",
92
+ visitor: { NewExpression(path, state) {
93
+ if (t.isIdentifier(path.node.callee) && path.node.callee.name === "PostgresStore") {
94
+ const filename = state.file?.opts?.filename || "unknown file";
95
+ const location = path.node.loc ? `${filename}: line ${path.node.loc.start.line}, column ${path.node.loc.start.column}` : "unknown location";
96
+ instances.push({
97
+ path,
98
+ location
99
+ });
100
+ }
101
+ } },
102
+ post() {
103
+ if (instances.length > 1) {
104
+ const errorMessage = [
105
+ `Found ${instances.length} PostgresStore instantiations:`,
106
+ ...instances.map((instance, i) => ` ${i + 1}. At ${instance.location}`),
107
+ "Only one PostgresStore instance should be created per Cloudflare Worker."
108
+ ].join("\n");
109
+ throw instances[instances.length - 1]?.path.buildCodeFrameError(errorMessage);
110
+ }
111
+ }
112
+ };
53
113
  }
114
+ //#endregion
115
+ //#region src/plugins/postgres-store-instance-checker.ts
54
116
  function postgresStoreInstanceChecker() {
55
- const t = babel.types;
56
- const instances = [];
57
- return {
58
- name: "postgresstore-instance-checker",
59
- visitor: {
60
- NewExpression(path, state) {
61
- if (t.isIdentifier(path.node.callee) && path.node.callee.name === "PostgresStore") {
62
- const filename = state.file?.opts?.filename || "unknown file";
63
- const location = path.node.loc ? `${filename}: line ${path.node.loc.start.line}, column ${path.node.loc.start.column}` : "unknown location";
64
- instances.push({
65
- path,
66
- location
67
- });
68
- }
69
- }
70
- },
71
- post() {
72
- if (instances.length > 1) {
73
- const errorMessage = [
74
- `Found ${instances.length} PostgresStore instantiations:`,
75
- ...instances.map((instance, i) => ` ${i + 1}. At ${instance.location}`),
76
- "Only one PostgresStore instance should be created per Cloudflare Worker."
77
- ].join("\n");
78
- const lastInstance = instances[instances.length - 1];
79
- throw lastInstance?.path.buildCodeFrameError(errorMessage);
80
- }
81
- }
82
- };
117
+ return {
118
+ name: "postgres-store-instance-checker",
119
+ transform(code, id) {
120
+ const result = transformSync(code, {
121
+ filename: id,
122
+ babelrc: false,
123
+ configFile: false,
124
+ plugins: [postgresStoreInstanceChecker$1]
125
+ });
126
+ if (!result || typeof result.code !== "string") return null;
127
+ return {
128
+ code: result.code,
129
+ map: result.map ? result.map : null
130
+ };
131
+ }
132
+ };
83
133
  }
84
-
85
- // src/plugins/postgres-store-instance-checker.ts
86
- function postgresStoreInstanceChecker2() {
87
- return {
88
- name: "postgres-store-instance-checker",
89
- transform(code, id) {
90
- const result = transformSync(code, {
91
- filename: id,
92
- babelrc: false,
93
- configFile: false,
94
- plugins: [postgresStoreInstanceChecker]
95
- });
96
- if (!result || typeof result.code !== "string") {
97
- return null;
98
- }
99
- return {
100
- code: result.code,
101
- map: result.map ?? null
102
- };
103
- }
104
- };
134
+ //#endregion
135
+ //#region src/index.ts
136
+ const nodeBuiltins = new Set(builtinModules);
137
+ /**
138
+ * Rollup plugin that marks bare Node.js builtin imports (e.g. `process`, `path`)
139
+ * as external. Cloudflare Workers with `nodejs_compat` provides these at runtime,
140
+ * so they must not be resolved to npm polyfill packages during bundling.
141
+ */
142
+ function nodeBuiltinsExternal() {
143
+ return {
144
+ name: "node-builtins-external",
145
+ resolveId(id) {
146
+ if (nodeBuiltins.has(id)) return {
147
+ id,
148
+ external: true
149
+ };
150
+ return null;
151
+ }
152
+ };
105
153
  }
106
-
107
- // src/index.ts
108
154
  var CloudflareDeployer = class extends Deployer {
109
- routes = [];
110
- workerNamespace;
111
- env;
112
- projectName;
113
- d1Databases;
114
- kvNamespaces;
115
- constructor({
116
- env,
117
- projectName = "mastra",
118
- routes,
119
- workerNamespace,
120
- d1Databases,
121
- kvNamespaces
122
- }) {
123
- super({ name: "CLOUDFLARE" });
124
- this.projectName = projectName;
125
- this.routes = routes;
126
- this.workerNamespace = workerNamespace;
127
- if (env) {
128
- this.env = env;
129
- }
130
- if (d1Databases) this.d1Databases = d1Databases;
131
- if (kvNamespaces) this.kvNamespaces = kvNamespaces;
132
- }
133
- async writeFiles(outputDirectory) {
134
- const env = await this.loadEnvVars();
135
- const envsAsObject = Object.assign({}, Object.fromEntries(env.entries()), this.env);
136
- const cfWorkerName = this.projectName;
137
- const wranglerConfig = {
138
- name: cfWorkerName,
139
- main: "./index.mjs",
140
- compatibility_date: "2025-04-01",
141
- compatibility_flags: ["nodejs_compat", "nodejs_compat_populate_process_env"],
142
- observability: {
143
- logs: {
144
- enabled: true
145
- }
146
- },
147
- vars: envsAsObject
148
- };
149
- if (!this.workerNamespace && this.routes) {
150
- wranglerConfig.routes = this.routes;
151
- }
152
- if (this.d1Databases?.length) {
153
- wranglerConfig.d1_databases = this.d1Databases;
154
- }
155
- if (this.kvNamespaces?.length) {
156
- wranglerConfig.kv_namespaces = this.kvNamespaces;
157
- }
158
- await writeFile(join(outputDirectory, this.outputDir, "wrangler.json"), JSON.stringify(wranglerConfig));
159
- }
160
- getEntry() {
161
- return `
155
+ userConfig;
156
+ constructor(userConfig) {
157
+ super({ name: "CLOUDFLARE" });
158
+ this.platform = "browser";
159
+ this.userConfig = { ...userConfig };
160
+ if (userConfig.workerNamespace) console.warn("[CloudflareDeployer]: `workerNamespace` is no longer used");
161
+ if (!userConfig.name && userConfig.projectName) {
162
+ this.userConfig.name = userConfig.projectName;
163
+ console.warn("[CloudflareDeployer]: `projectName` is deprecated, use `name` instead");
164
+ }
165
+ if (!userConfig.d1_databases && userConfig.d1Databases) {
166
+ this.userConfig.d1_databases = userConfig.d1Databases;
167
+ console.warn("[CloudflareDeployer]: `d1Databases` is deprecated, use `d1_databases` instead");
168
+ }
169
+ if (!userConfig.kv_namespaces && userConfig.kvNamespaces) {
170
+ this.userConfig.kv_namespaces = userConfig.kvNamespaces;
171
+ console.warn("[CloudflareDeployer]: `kvNamespaces` is deprecated, use `kv_namespaces` instead");
172
+ }
173
+ }
174
+ async writeFiles(outputDirectory) {
175
+ const { vars: userVars, alias: userAlias, projectName: _projectName, workerNamespace: _workerNamespace, d1Databases: _d1Databases, kvNamespaces: _kvNamespaces, ...userConfig } = this.userConfig;
176
+ const loadedEnvVars = await this.loadEnvVars();
177
+ const envsAsObject = Object.assign({}, userVars);
178
+ if (loadedEnvVars.size > 0) {
179
+ const envKeys = [...loadedEnvVars.keys()].join(", ");
180
+ this.logger.warn(`Environment variables from .env (${envKeys}) were not written to wrangler.jsonc.
181
+ Upload them as Cloudflare Secrets instead:
182
+ npx wrangler secret bulk .env`);
183
+ }
184
+ const typescriptStubPath = "typescript-stub.mjs";
185
+ await writeFile(join(outputDirectory, this.outputDir, typescriptStubPath), `// Stub for TypeScript - not available at runtime in Cloudflare Workers
186
+ // The @mastra/agent-builder package will fall back to basic validation
187
+ export default {};
188
+ export const createSourceFile = () => null;
189
+ export const createProgram = () => null;
190
+ export const findConfigFile = () => null;
191
+ export const readConfigFile = () => ({ error: new Error('TypeScript not available') });
192
+ export const parseJsonConfigFileContent = () => ({ errors: [new Error('TypeScript not available')], fileNames: [], options: {} });
193
+ export const flattenDiagnosticMessageText = (message) => typeof message === 'string' ? message : message?.messageText || '';
194
+ export const ScriptTarget = { Latest: 99 };
195
+ export const ModuleKind = { ESNext: 99 };
196
+ export const JsxEmit = { ReactJSX: 4 };
197
+ export const DiagnosticCategory = { Warning: 0, Error: 1, Suggestion: 2, Message: 3 };
198
+ export const sys = {
199
+ fileExists: () => false,
200
+ readFile: () => undefined,
201
+ };
202
+ `);
203
+ const execaStubPath = "execa-stub.mjs";
204
+ await writeFile(join(outputDirectory, this.outputDir, execaStubPath), `// Stub for execa - not available at runtime in Cloudflare Workers
205
+ export const execa = () => { throw new Error('execa is not available in Cloudflare Workers'); };
206
+ export const execaNode = execa;
207
+ export const execaSync = execa;
208
+ export const execaCommand = execa;
209
+ export const execaCommandSync = execa;
210
+ export const $ = execa;
211
+ `);
212
+ const readableStreamStubPath = "readable-stream-stub.mjs";
213
+ await writeFile(join(outputDirectory, this.outputDir, readableStreamStubPath), `// Redirect readable-stream to native node:stream (available via nodejs_compat)
214
+ import stream from 'node:stream';
215
+ export const { Readable, Writable, Duplex, Transform, PassThrough, Stream, pipeline, finished } = stream;
216
+ export default stream;
217
+ `);
218
+ const moduleStubPath = "module-stub.mjs";
219
+ await writeFile(join(outputDirectory, this.outputDir, moduleStubPath), `// Stub for module.createRequire in Cloudflare Workers
220
+ export function createRequire() {
221
+ const req = specifier => {
222
+ throw new Error(\`require(\${specifier}) is not available in Cloudflare Workers\`);
223
+ };
224
+ req.resolve = specifier => specifier;
225
+ return req;
226
+ }
227
+ export default { createRequire };
228
+ `);
229
+ const wranglerConfig = {
230
+ name: "mastra",
231
+ compatibility_date: "2025-04-01",
232
+ compatibility_flags: ["nodejs_compat", "nodejs_compat_populate_process_env"],
233
+ observability: { logs: { enabled: true } },
234
+ ...userConfig,
235
+ main: "./index.mjs",
236
+ vars: envsAsObject,
237
+ alias: {
238
+ typescript: `./${typescriptStubPath}`,
239
+ execa: `./${execaStubPath}`,
240
+ "readable-stream": `./${readableStreamStubPath}`,
241
+ module: `./${moduleStubPath}`,
242
+ "node:module": `./${moduleStubPath}`,
243
+ ...userAlias
244
+ }
245
+ };
246
+ await writeFile(join(outputDirectory, this.outputDir, "wrangler.json"), JSON.stringify(wranglerConfig, null, 2));
247
+ const projectRoot = join(outputDirectory, "../");
248
+ const jsoncFilePath = join(projectRoot, "wrangler.jsonc");
249
+ const mainFilePath = join(outputDirectory, this.outputDir, "index.mjs");
250
+ const tsStubFilePath = join(outputDirectory, this.outputDir, typescriptStubPath);
251
+ const moduleStubFilePath = join(outputDirectory, this.outputDir, moduleStubPath);
252
+ const wranglerJsoncConfig = {
253
+ placeholder: "PLACEHOLDER",
254
+ $schema: "./node_modules/wrangler/config-schema.json",
255
+ ...wranglerConfig,
256
+ main: `./${relative(projectRoot, mainFilePath)}`,
257
+ alias: {
258
+ ...wranglerConfig.alias,
259
+ typescript: `./${relative(projectRoot, tsStubFilePath)}`,
260
+ module: `./${relative(projectRoot, moduleStubFilePath)}`,
261
+ "node:module": `./${relative(projectRoot, moduleStubFilePath)}`
262
+ }
263
+ };
264
+ await writeFile(jsoncFilePath, JSON.stringify(wranglerJsoncConfig, null, 2).replace(/"placeholder": "PLACEHOLDER",/, "/* This file was auto-generated through Mastra. Edit the CloudflareDeployer() instance directly. */"));
265
+ }
266
+ getEntry() {
267
+ return `
162
268
  import '#polyfills';
163
- import { evaluate } from '@mastra/core/eval';
164
- import { AvailableHooks, registerHook } from '@mastra/core/hooks';
165
- import { TABLE_EVALS } from '@mastra/core/storage';
166
- import { scoreTracesWorkflow } from '@mastra/core/scores/scoreTraces';
167
- import { checkEvalStorageFields } from '@mastra/core/utils';
269
+ import { scoreTracesWorkflow } from '@mastra/core/evals/scoreTraces';
168
270
 
169
271
  export default {
170
272
  fetch: async (request, env, context) => {
@@ -177,98 +279,69 @@ var CloudflareDeployer = class extends Deployer {
177
279
  _mastra.__registerInternalWorkflow(scoreTracesWorkflow);
178
280
  }
179
281
 
180
- registerHook(AvailableHooks.ON_GENERATION, ({ input, output, metric, runId, agentName, instructions }) => {
181
- evaluate({
182
- agentName,
183
- input,
184
- metric,
185
- output,
186
- runId,
187
- globalRunId: runId,
188
- instructions,
189
- });
190
- });
191
-
192
- registerHook(AvailableHooks.ON_EVALUATION, async traceObject => {
193
- const storage = _mastra.getStorage();
194
- if (storage) {
195
- // Check for required fields
196
- const logger = _mastra?.getLogger();
197
- const areFieldsValid = checkEvalStorageFields(traceObject, logger);
198
- if (!areFieldsValid) return;
199
-
200
- await storage.insert({
201
- tableName: TABLE_EVALS,
202
- record: {
203
- input: traceObject.input,
204
- output: traceObject.output,
205
- result: JSON.stringify(traceObject.result || {}),
206
- agent_name: traceObject.agentName,
207
- metric_name: traceObject.metricName,
208
- instructions: traceObject.instructions,
209
- test_info: null,
210
- global_run_id: traceObject.globalRunId,
211
- run_id: traceObject.runId,
212
- created_at: new Date().toISOString(),
213
- },
214
- });
215
- }
216
- });
217
-
218
- const app = await createHonoServer(_mastra, { tools: getToolExports(tools) });
282
+ const app = await createHonoServer(_mastra, { tools: getToolExports(tools), browserStream: false });
219
283
  return app.fetch(request, env, context);
220
284
  }
221
285
  }
222
286
  `;
287
+ }
288
+ async prepare(outputDirectory) {
289
+ await super.prepare(outputDirectory);
290
+ await this.writeFiles(outputDirectory);
291
+ }
292
+ async getBundlerOptions(serverFile, mastraEntryFile, analyzedBundleInfo, toolsPaths, bundlerOptions) {
293
+ const inputOptions = await super.getBundlerOptions(serverFile, mastraEntryFile, analyzedBundleInfo, toolsPaths, {
294
+ ...bundlerOptions,
295
+ enableEsmShim: false
296
+ });
297
+ const hasPostgresStore = await this.deps.checkDependencies(["@mastra/pg"]) === `ok`;
298
+ if (Array.isArray(inputOptions.plugins)) {
299
+ inputOptions.plugins = [
300
+ nodeBuiltinsExternal(),
301
+ virtual({ "#polyfills": `
302
+ try {
303
+ if (!process.versions) {
304
+ Object.defineProperty(process, 'versions', { value: {}, configurable: true });
223
305
  }
224
- async prepare(outputDirectory) {
225
- await super.prepare(outputDirectory);
226
- await this.writeFiles(outputDirectory);
227
- }
228
- async getBundlerOptions(serverFile, mastraEntryFile, analyzedBundleInfo, toolsPaths, { enableSourcemap = false } = {}) {
229
- const inputOptions = await super.getBundlerOptions(serverFile, mastraEntryFile, analyzedBundleInfo, toolsPaths, {
230
- enableSourcemap,
231
- enableEsmShim: false
232
- });
233
- const hasPostgresStore = await this.deps.checkDependencies(["@mastra/pg"]) === `ok`;
234
- if (Array.isArray(inputOptions.plugins)) {
235
- inputOptions.plugins = [
236
- virtual({
237
- "#polyfills": `
238
- process.versions = process.versions || {};
239
- process.versions.node = '${process.versions.node}';
240
- `
241
- }),
242
- ...inputOptions.plugins,
243
- mastraInstanceWrapper2(mastraEntryFile)
244
- ];
245
- if (hasPostgresStore) {
246
- inputOptions.plugins.push(postgresStoreInstanceChecker2());
247
- }
248
- }
249
- return inputOptions;
250
- }
251
- async bundle(entryFile, outputDirectory, { toolsPaths, projectRoot }) {
252
- return this._bundle(this.getEntry(), entryFile, { outputDirectory, projectRoot, enableEsmShim: false }, toolsPaths);
253
- }
254
- async deploy() {
255
- this.logger?.info("Deploying to Cloudflare failed. Please use the Cloudflare dashboard to deploy.");
256
- }
257
- async tagWorker() {
258
- throw new Error("tagWorker method is no longer supported. Use the Cloudflare dashboard or API directly.");
259
- }
260
- async lint(entryFile, outputDirectory, toolsPaths) {
261
- await super.lint(entryFile, outputDirectory, toolsPaths);
262
- const hasLibsql = await this.deps.checkDependencies(["@mastra/libsql"]) === `ok`;
263
- if (hasLibsql) {
264
- this.logger.error(
265
- "Cloudflare Deployer does not support @libsql/client (which may have been installed by @mastra/libsql) as a dependency. Please use Cloudflare D1 instead: @mastra/cloudflare-d1."
266
- );
267
- process.exit(1);
268
- }
306
+ if (!process.versions.node) {
307
+ Object.defineProperty(process.versions, 'node', { value: '${process.versions.node}', configurable: true });
269
308
  }
309
+ } catch {}
310
+ ` }),
311
+ ...inputOptions.plugins,
312
+ mastraInstanceWrapper(mastraEntryFile)
313
+ ];
314
+ if (hasPostgresStore) inputOptions.plugins.push(postgresStoreInstanceChecker());
315
+ }
316
+ return inputOptions;
317
+ }
318
+ async bundle(entryFile, outputDirectory, { toolsPaths, projectRoot }) {
319
+ return this._bundle(this.getEntry(), entryFile, {
320
+ outputDirectory,
321
+ projectRoot,
322
+ enableEsmShim: false
323
+ }, toolsPaths);
324
+ }
325
+ async deploy() {
326
+ this.logger?.info("Deploying to Cloudflare failed. Please use the Cloudflare dashboard to deploy.");
327
+ }
328
+ /**
329
+ * TODO: Remove this method in the next major version
330
+ *
331
+ * @deprecated
332
+ */
333
+ async tagWorker() {
334
+ throw new Error("tagWorker method is no longer supported. Use the Cloudflare dashboard or API directly.");
335
+ }
336
+ async lint(entryFile, outputDirectory, toolsPaths) {
337
+ await super.lint(entryFile, outputDirectory, toolsPaths);
338
+ if (await this.deps.checkDependencies(["@mastra/libsql"]) === `ok`) {
339
+ this.logger.error("Cloudflare Deployer does not support @libsql/client (which may have been installed by @mastra/libsql) as a dependency. Please use Cloudflare D1 instead: @mastra/cloudflare-d1.");
340
+ process.exit(1);
341
+ }
342
+ }
270
343
  };
271
-
344
+ //#endregion
272
345
  export { CloudflareDeployer };
273
- //# sourceMappingURL=index.js.map
346
+
274
347
  //# sourceMappingURL=index.js.map