@mastra/deployer 0.2.1-alpha.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/_tsup-dts-rollup.d.cts +60 -18
  2. package/dist/_tsup-dts-rollup.d.ts +60 -18
  3. package/dist/build/analyze.cjs +2 -2
  4. package/dist/build/analyze.js +1 -1
  5. package/dist/build/bundler.cjs +3 -3
  6. package/dist/build/bundler.js +1 -1
  7. package/dist/build/index.cjs +14 -14
  8. package/dist/build/index.js +4 -4
  9. package/dist/bundler/index.cjs +2 -2
  10. package/dist/bundler/index.js +1 -1
  11. package/dist/chunk-3H66SAKS.cjs +139 -0
  12. package/dist/{chunk-SL5KZNFT.js → chunk-7XQJJPRM.js} +26 -13
  13. package/dist/{chunk-72GFPLLU.js → chunk-DZ4D3KXZ.js} +4 -6
  14. package/dist/{chunk-YLIG5BNH.cjs → chunk-GLTC4BEQ.cjs} +42 -78
  15. package/dist/{chunk-J2F3DJTF.cjs → chunk-HLGZCQQW.cjs} +40 -22
  16. package/dist/{chunk-VPY2RQUP.js → chunk-HRR4D2GM.js} +29 -11
  17. package/dist/{chunk-TQSSPVHI.js → chunk-JNF4CXZJ.js} +42 -78
  18. package/dist/{chunk-PT5XTSU2.js → chunk-JNNKML56.js} +13 -1
  19. package/dist/{chunk-4LYFNYJ4.cjs → chunk-JSFQUYK4.cjs} +13 -1
  20. package/dist/{chunk-YJMYF7RI.cjs → chunk-PMHXFDK2.cjs} +8 -10
  21. package/dist/{chunk-VPP5727D.cjs → chunk-PRZC7CEM.cjs} +27 -14
  22. package/dist/chunk-XO6KJHXC.js +128 -0
  23. package/dist/index.cjs +16 -12
  24. package/dist/index.js +11 -7
  25. package/dist/server/index.cjs +183 -40
  26. package/dist/server/index.js +183 -40
  27. package/dist/validator/custom-resolver.cjs +33 -0
  28. package/dist/validator/custom-resolver.d.cts +1 -0
  29. package/dist/validator/custom-resolver.d.ts +1 -0
  30. package/dist/validator/custom-resolver.js +31 -0
  31. package/dist/validator/loader.cjs +7 -0
  32. package/dist/validator/loader.d.cts +1 -0
  33. package/dist/validator/loader.d.ts +1 -0
  34. package/dist/validator/loader.js +4 -0
  35. package/package.json +14 -3
  36. package/dist/chunk-AC67BJSW.js +0 -260
  37. package/dist/chunk-QFYK5AS3.cjs +0 -292
@@ -7,22 +7,29 @@ import type { IDeployer } from '@mastra/core/deployer';
7
7
  import { InputOption } from 'rollup';
8
8
  import { InputOptions } from 'rollup';
9
9
  import type { Logger } from '@mastra/core/logger';
10
- import type { Logger as Logger_2 } from '@mastra/core';
11
- import type { Mastra } from '@mastra/core';
10
+ import { Logger as Logger_2 } from '@mastra/core';
11
+ import { Mastra } from '@mastra/core/mastra';
12
+ import type { Mastra as Mastra_2 } from '@mastra/core';
12
13
  import { MastraBase } from '@mastra/core/base';
13
14
  import { MastraBundler } from '@mastra/core/bundler';
14
15
  import type { MastraDeployer } from '@mastra/core';
15
- import type { MastraVector } from '@mastra/core/vector';
16
+ import { MastraTTS } from '@mastra/core/tts';
17
+ import { MastraVector } from '@mastra/core/vector';
16
18
  import { OutputOptions } from 'rollup';
17
19
  import { Plugin } from 'rollup';
18
20
  import { PluginContext } from 'rollup';
19
21
  import { RenderedChunk } from 'rollup';
22
+ import type { ResolveHookContext } from 'node:module';
20
23
  import { RollupBuild } from 'rollup';
21
24
  import { RollupOutput } from 'rollup';
22
25
  import { RollupWatcher } from 'rollup';
23
26
  import { ServerType } from '@hono/node-server';
27
+ import { Step } from '@mastra/core';
28
+ import { StepExecutionContext } from '@mastra/core';
24
29
  import { Transform } from 'stream';
25
30
  import { TypedResponse } from 'hono';
31
+ import { Workflow } from '@mastra/core/workflows';
32
+ import { WorkflowContext } from '@mastra/core';
26
33
 
27
34
  export declare function aliasHono(): Plugin;
28
35
 
@@ -68,6 +75,7 @@ export declare abstract class Bundler extends MastraBundler {
68
75
  externalDependencies: Set<string>;
69
76
  }>;
70
77
  protected installDependencies(outputDirectory: string, rootDir?: string): Promise<void>;
78
+ protected copyPublic(mastraDir: string, outputDirectory: string): Promise<void>;
71
79
  protected _bundle(serverFile: string, mastraEntryFile: string, outputDirectory: string, bundleLocation?: string): Promise<void>;
72
80
  }
73
81
 
@@ -92,7 +100,7 @@ export { createChildProcessLogger }
92
100
  export { createChildProcessLogger as createChildProcessLogger_alias_1 }
93
101
  export { createChildProcessLogger as createChildProcessLogger_alias_2 }
94
102
 
95
- export declare function createHonoServer(mastra: Mastra, options?: {
103
+ export declare function createHonoServer(mastra: Mastra_2, options?: {
96
104
  playground?: boolean;
97
105
  swaggerUI?: boolean;
98
106
  apiReqLogs?: boolean;
@@ -103,7 +111,7 @@ export declare function createHonoServer(mastra: Mastra, options?: {
103
111
 
104
112
  export declare function createIndex(c: Context): Promise<Response>;
105
113
 
106
- export declare function createNodeServer(mastra: Mastra, options?: {
114
+ export declare function createNodeServer(mastra: Mastra_2, options?: {
107
115
  playground?: boolean;
108
116
  swaggerUI?: boolean;
109
117
  apiReqLogs?: boolean;
@@ -114,6 +122,8 @@ export { createPinoStream }
114
122
  export { createPinoStream as createPinoStream_alias_1 }
115
123
  export { createPinoStream as createPinoStream_alias_2 }
116
124
 
125
+ export declare function createRunHandler(c: Context): Promise<Response>;
126
+
117
127
  export declare function createThreadHandler(c: Context): Promise<Response>;
118
128
 
119
129
  declare function createWatcher(inputOptions: InputOptions, outputOptions: OutputOptions): Promise<RollupWatcher>;
@@ -169,8 +179,6 @@ export declare function executeAgentToolHandler(c: Context): Promise<Response>;
169
179
 
170
180
  export declare function executeToolHandler(tools: Record<string, any>): (c: Context) => Promise<Response>;
171
181
 
172
- export declare function executeWorkflowHandler(c: Context): Promise<Response>;
173
-
174
182
  export declare class FileEnvService extends EnvService {
175
183
  private filePath;
176
184
  constructor(filePath: string);
@@ -225,6 +233,8 @@ declare function getDeployer(entryFile: string, outputDir: string): Promise<Mast
225
233
  export { getDeployer }
226
234
  export { getDeployer as getDeployer_alias_1 }
227
235
 
236
+ export declare function getDeployerBundler(entryFile: string): Promise<RollupBuild>;
237
+
228
238
  export declare function getEvalsByAgentIdHandler(c: Context): Promise<Response>;
229
239
 
230
240
  declare function getInputOptions(entryFile: string, analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>, platform: 'node' | 'browser'): Promise<InputOptions>;
@@ -252,6 +262,10 @@ export declare function getMessagesHandler(c: Context): Promise<Response>;
252
262
  */
253
263
  export declare function getSpeakersHandler(c: Context): Promise<Response>;
254
264
 
265
+ export declare function getTelemetryBundler(entryFile: string, result: {
266
+ hasCustomConfig: false;
267
+ }): Promise<RollupBuild>;
268
+
255
269
  export declare function getTelemetryHandler(c: Context): Promise<Response>;
256
270
 
257
271
  export declare function getThreadByIdHandler(c: Context): Promise<Response>;
@@ -288,8 +302,6 @@ export declare const html = "\n<!doctype html>\n<html lang=\"en\">\n <head>\n
288
302
 
289
303
  export declare function isNodeBuiltin(dep: string): boolean;
290
304
 
291
- export declare function libSqlFix(): Plugin;
292
-
293
305
  /**
294
306
  * Convert speech to text using the agent's voice provider
295
307
  */
@@ -297,6 +309,26 @@ export declare function listenHandler(c: Context): Promise<Response>;
297
309
 
298
310
  export declare function listIndexes(c: Context): Promise<Response>;
299
311
 
312
+ export declare const mastra: Mastra<{
313
+ weatherAgent: any;
314
+ }, Record<string, Workflow<Step<string, any, any, StepExecutionContext<any, WorkflowContext<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>, Record<string, MastraVector>, Record<string, MastraTTS>, Logger_2>;
315
+
316
+ export declare const mastra_alias_1: Mastra<{
317
+ weatherAgent: any;
318
+ }, Record<string, Workflow<Step<string, any, any, StepExecutionContext<any, WorkflowContext<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>, Record<string, MastraVector>, Record<string, MastraTTS>, Logger_2>;
319
+
320
+ export declare const mastra_alias_2: Mastra<{
321
+ weatherAgent: any;
322
+ }, Record<string, Workflow<Step<string, any, any, StepExecutionContext<any, WorkflowContext<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>, Record<string, MastraVector>, Record<string, MastraTTS>, Logger_2>;
323
+
324
+ export declare const mastra_alias_3: Mastra<{
325
+ weatherAgent: any;
326
+ }, Record<string, Workflow<Step<string, any, any, StepExecutionContext<any, WorkflowContext<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>, Record<string, MastraVector>, Record<string, MastraTTS>, Logger_2>;
327
+
328
+ export declare const mastra_alias_4: Mastra<{
329
+ weatherAgent: any;
330
+ }, Record<string, Workflow<Step<string, any, any, StepExecutionContext<any, WorkflowContext<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>, Record<string, MastraVector>, Record<string, MastraTTS>, Logger_2>;
331
+
300
332
  declare type NormalizedInputOptions = Omit<Partial<InputOptions>, 'plugins' | 'input' | 'external'> & {
301
333
  plugins?: Plugin[];
302
334
  input: InputOption;
@@ -307,7 +339,11 @@ export declare function notFoundHandler(): void;
307
339
 
308
340
  export declare function pino(): {
309
341
  name: string;
310
- resolveId(this: PluginContext, id: string, importee: string | undefined): Promise<void>;
342
+ resolveId(this: PluginContext, id: string, importee: string | undefined): Promise<{
343
+ id: string;
344
+ external: true;
345
+ moduleSideEffects: false;
346
+ } | undefined>;
311
347
  renderChunk(this: PluginContext, code: string, chunk: RenderedChunk): {
312
348
  code: string;
313
349
  map: null;
@@ -326,9 +362,15 @@ export declare function removeDeployer(): babel_2.PluginObj;
326
362
 
327
363
  export declare function removeDeployer_alias_1(mastraEntry: string): Plugin;
328
364
 
329
- export declare function resumeWorkflowHandler(c: Context): Promise<Response>;
365
+ export declare function resolve(specifier: string, context: ResolveHookContext, nextResolve: (specifier: string, context: ResolveHookContext) => Promise<{
366
+ url: string;
367
+ }>): Promise<{
368
+ url: string;
369
+ }>;
330
370
 
331
- export declare function rewriteLibsqlImport(): babel_2.PluginObj;
371
+ export declare function resumeAsyncWorkflowHandler(c: Context): Promise<Response>;
372
+
373
+ export declare function resumeWorkflowHandler(c: Context): Promise<Response>;
332
374
 
333
375
  export declare function rootHandler(c: Context): Promise<Response & TypedResponse<"Hello to the Mastra API!", ContentfulStatusCode, "text">>;
334
376
 
@@ -341,13 +383,11 @@ export declare function setAgentInstructionsHandler(c: Context): Promise<Respons
341
383
  */
342
384
  export declare function speakHandler(c: Context): Promise<Response>;
343
385
 
344
- export declare function startWorkflowRunHandler(c: Context): Promise<Response & TypedResponse< {
345
- runId: string;
346
- }, ContentfulStatusCode, "json">>;
386
+ export declare function startAsyncWorkflowHandler(c: Context): Promise<Response>;
347
387
 
348
- export declare function streamGenerateHandler(c: Context): Promise<Response | undefined>;
388
+ export declare function startWorkflowRunHandler(c: Context): Promise<Response>;
349
389
 
350
- export declare function telemetryFix(): Plugin;
390
+ export declare function streamGenerateHandler(c: Context): Promise<Response | undefined>;
351
391
 
352
392
  export declare function updateThreadHandler(c: Context): Promise<Response>;
353
393
 
@@ -357,10 +397,12 @@ export declare function upsertMastraDir({ dir }: {
357
397
 
358
398
  export declare function upsertVectors(c: Context): Promise<Response>;
359
399
 
400
+ export declare function validate(file: string): Promise<void>;
401
+
360
402
  export declare function validateBody(body: Record<string, unknown>): void;
361
403
 
362
404
  declare type Variables = {
363
- mastra: Mastra;
405
+ mastra: Mastra_2;
364
406
  clients: Set<{
365
407
  controller: ReadableStreamDefaultController;
366
408
  }>;
@@ -7,22 +7,29 @@ import type { IDeployer } from '@mastra/core/deployer';
7
7
  import { InputOption } from 'rollup';
8
8
  import { InputOptions } from 'rollup';
9
9
  import type { Logger } from '@mastra/core/logger';
10
- import type { Logger as Logger_2 } from '@mastra/core';
11
- import type { Mastra } from '@mastra/core';
10
+ import { Logger as Logger_2 } from '@mastra/core';
11
+ import { Mastra } from '@mastra/core/mastra';
12
+ import type { Mastra as Mastra_2 } from '@mastra/core';
12
13
  import { MastraBase } from '@mastra/core/base';
13
14
  import { MastraBundler } from '@mastra/core/bundler';
14
15
  import type { MastraDeployer } from '@mastra/core';
15
- import type { MastraVector } from '@mastra/core/vector';
16
+ import { MastraTTS } from '@mastra/core/tts';
17
+ import { MastraVector } from '@mastra/core/vector';
16
18
  import { OutputOptions } from 'rollup';
17
19
  import { Plugin } from 'rollup';
18
20
  import { PluginContext } from 'rollup';
19
21
  import { RenderedChunk } from 'rollup';
22
+ import type { ResolveHookContext } from 'node:module';
20
23
  import { RollupBuild } from 'rollup';
21
24
  import { RollupOutput } from 'rollup';
22
25
  import { RollupWatcher } from 'rollup';
23
26
  import { ServerType } from '@hono/node-server';
27
+ import { Step } from '@mastra/core';
28
+ import { StepExecutionContext } from '@mastra/core';
24
29
  import { Transform } from 'stream';
25
30
  import { TypedResponse } from 'hono';
31
+ import { Workflow } from '@mastra/core/workflows';
32
+ import { WorkflowContext } from '@mastra/core';
26
33
 
27
34
  export declare function aliasHono(): Plugin;
28
35
 
@@ -68,6 +75,7 @@ export declare abstract class Bundler extends MastraBundler {
68
75
  externalDependencies: Set<string>;
69
76
  }>;
70
77
  protected installDependencies(outputDirectory: string, rootDir?: string): Promise<void>;
78
+ protected copyPublic(mastraDir: string, outputDirectory: string): Promise<void>;
71
79
  protected _bundle(serverFile: string, mastraEntryFile: string, outputDirectory: string, bundleLocation?: string): Promise<void>;
72
80
  }
73
81
 
@@ -92,7 +100,7 @@ export { createChildProcessLogger }
92
100
  export { createChildProcessLogger as createChildProcessLogger_alias_1 }
93
101
  export { createChildProcessLogger as createChildProcessLogger_alias_2 }
94
102
 
95
- export declare function createHonoServer(mastra: Mastra, options?: {
103
+ export declare function createHonoServer(mastra: Mastra_2, options?: {
96
104
  playground?: boolean;
97
105
  swaggerUI?: boolean;
98
106
  apiReqLogs?: boolean;
@@ -103,7 +111,7 @@ export declare function createHonoServer(mastra: Mastra, options?: {
103
111
 
104
112
  export declare function createIndex(c: Context): Promise<Response>;
105
113
 
106
- export declare function createNodeServer(mastra: Mastra, options?: {
114
+ export declare function createNodeServer(mastra: Mastra_2, options?: {
107
115
  playground?: boolean;
108
116
  swaggerUI?: boolean;
109
117
  apiReqLogs?: boolean;
@@ -114,6 +122,8 @@ export { createPinoStream }
114
122
  export { createPinoStream as createPinoStream_alias_1 }
115
123
  export { createPinoStream as createPinoStream_alias_2 }
116
124
 
125
+ export declare function createRunHandler(c: Context): Promise<Response>;
126
+
117
127
  export declare function createThreadHandler(c: Context): Promise<Response>;
118
128
 
119
129
  declare function createWatcher(inputOptions: InputOptions, outputOptions: OutputOptions): Promise<RollupWatcher>;
@@ -169,8 +179,6 @@ export declare function executeAgentToolHandler(c: Context): Promise<Response>;
169
179
 
170
180
  export declare function executeToolHandler(tools: Record<string, any>): (c: Context) => Promise<Response>;
171
181
 
172
- export declare function executeWorkflowHandler(c: Context): Promise<Response>;
173
-
174
182
  export declare class FileEnvService extends EnvService {
175
183
  private filePath;
176
184
  constructor(filePath: string);
@@ -225,6 +233,8 @@ declare function getDeployer(entryFile: string, outputDir: string): Promise<Mast
225
233
  export { getDeployer }
226
234
  export { getDeployer as getDeployer_alias_1 }
227
235
 
236
+ export declare function getDeployerBundler(entryFile: string): Promise<RollupBuild>;
237
+
228
238
  export declare function getEvalsByAgentIdHandler(c: Context): Promise<Response>;
229
239
 
230
240
  declare function getInputOptions(entryFile: string, analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>, platform: 'node' | 'browser'): Promise<InputOptions>;
@@ -252,6 +262,10 @@ export declare function getMessagesHandler(c: Context): Promise<Response>;
252
262
  */
253
263
  export declare function getSpeakersHandler(c: Context): Promise<Response>;
254
264
 
265
+ export declare function getTelemetryBundler(entryFile: string, result: {
266
+ hasCustomConfig: false;
267
+ }): Promise<RollupBuild>;
268
+
255
269
  export declare function getTelemetryHandler(c: Context): Promise<Response>;
256
270
 
257
271
  export declare function getThreadByIdHandler(c: Context): Promise<Response>;
@@ -288,8 +302,6 @@ export declare const html = "\n<!doctype html>\n<html lang=\"en\">\n <head>\n
288
302
 
289
303
  export declare function isNodeBuiltin(dep: string): boolean;
290
304
 
291
- export declare function libSqlFix(): Plugin;
292
-
293
305
  /**
294
306
  * Convert speech to text using the agent's voice provider
295
307
  */
@@ -297,6 +309,26 @@ export declare function listenHandler(c: Context): Promise<Response>;
297
309
 
298
310
  export declare function listIndexes(c: Context): Promise<Response>;
299
311
 
312
+ export declare const mastra: Mastra<{
313
+ weatherAgent: any;
314
+ }, Record<string, Workflow<Step<string, any, any, StepExecutionContext<any, WorkflowContext<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>, Record<string, MastraVector>, Record<string, MastraTTS>, Logger_2>;
315
+
316
+ export declare const mastra_alias_1: Mastra<{
317
+ weatherAgent: any;
318
+ }, Record<string, Workflow<Step<string, any, any, StepExecutionContext<any, WorkflowContext<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>, Record<string, MastraVector>, Record<string, MastraTTS>, Logger_2>;
319
+
320
+ export declare const mastra_alias_2: Mastra<{
321
+ weatherAgent: any;
322
+ }, Record<string, Workflow<Step<string, any, any, StepExecutionContext<any, WorkflowContext<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>, Record<string, MastraVector>, Record<string, MastraTTS>, Logger_2>;
323
+
324
+ export declare const mastra_alias_3: Mastra<{
325
+ weatherAgent: any;
326
+ }, Record<string, Workflow<Step<string, any, any, StepExecutionContext<any, WorkflowContext<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>, Record<string, MastraVector>, Record<string, MastraTTS>, Logger_2>;
327
+
328
+ export declare const mastra_alias_4: Mastra<{
329
+ weatherAgent: any;
330
+ }, Record<string, Workflow<Step<string, any, any, StepExecutionContext<any, WorkflowContext<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>, Record<string, MastraVector>, Record<string, MastraTTS>, Logger_2>;
331
+
300
332
  declare type NormalizedInputOptions = Omit<Partial<InputOptions>, 'plugins' | 'input' | 'external'> & {
301
333
  plugins?: Plugin[];
302
334
  input: InputOption;
@@ -307,7 +339,11 @@ export declare function notFoundHandler(): void;
307
339
 
308
340
  export declare function pino(): {
309
341
  name: string;
310
- resolveId(this: PluginContext, id: string, importee: string | undefined): Promise<void>;
342
+ resolveId(this: PluginContext, id: string, importee: string | undefined): Promise<{
343
+ id: string;
344
+ external: true;
345
+ moduleSideEffects: false;
346
+ } | undefined>;
311
347
  renderChunk(this: PluginContext, code: string, chunk: RenderedChunk): {
312
348
  code: string;
313
349
  map: null;
@@ -326,9 +362,15 @@ export declare function removeDeployer(): babel_2.PluginObj;
326
362
 
327
363
  export declare function removeDeployer_alias_1(mastraEntry: string): Plugin;
328
364
 
329
- export declare function resumeWorkflowHandler(c: Context): Promise<Response>;
365
+ export declare function resolve(specifier: string, context: ResolveHookContext, nextResolve: (specifier: string, context: ResolveHookContext) => Promise<{
366
+ url: string;
367
+ }>): Promise<{
368
+ url: string;
369
+ }>;
330
370
 
331
- export declare function rewriteLibsqlImport(): babel_2.PluginObj;
371
+ export declare function resumeAsyncWorkflowHandler(c: Context): Promise<Response>;
372
+
373
+ export declare function resumeWorkflowHandler(c: Context): Promise<Response>;
332
374
 
333
375
  export declare function rootHandler(c: Context): Promise<Response & TypedResponse<"Hello to the Mastra API!", ContentfulStatusCode, "text">>;
334
376
 
@@ -341,13 +383,11 @@ export declare function setAgentInstructionsHandler(c: Context): Promise<Respons
341
383
  */
342
384
  export declare function speakHandler(c: Context): Promise<Response>;
343
385
 
344
- export declare function startWorkflowRunHandler(c: Context): Promise<Response & TypedResponse< {
345
- runId: string;
346
- }, ContentfulStatusCode, "json">>;
386
+ export declare function startAsyncWorkflowHandler(c: Context): Promise<Response>;
347
387
 
348
- export declare function streamGenerateHandler(c: Context): Promise<Response | undefined>;
388
+ export declare function startWorkflowRunHandler(c: Context): Promise<Response>;
349
389
 
350
- export declare function telemetryFix(): Plugin;
390
+ export declare function streamGenerateHandler(c: Context): Promise<Response | undefined>;
351
391
 
352
392
  export declare function updateThreadHandler(c: Context): Promise<Response>;
353
393
 
@@ -357,10 +397,12 @@ export declare function upsertMastraDir({ dir }: {
357
397
 
358
398
  export declare function upsertVectors(c: Context): Promise<Response>;
359
399
 
400
+ export declare function validate(file: string): Promise<void>;
401
+
360
402
  export declare function validateBody(body: Record<string, unknown>): void;
361
403
 
362
404
  declare type Variables = {
363
- mastra: Mastra;
405
+ mastra: Mastra_2;
364
406
  clients: Set<{
365
407
  controller: ReadableStreamDefaultController;
366
408
  }>;
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunkYLIG5BNH_cjs = require('../chunk-YLIG5BNH.cjs');
3
+ var chunkGLTC4BEQ_cjs = require('../chunk-GLTC4BEQ.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "analyzeBundle", {
8
8
  enumerable: true,
9
- get: function () { return chunkYLIG5BNH_cjs.analyzeBundle; }
9
+ get: function () { return chunkGLTC4BEQ_cjs.analyzeBundle; }
10
10
  });
@@ -1 +1 @@
1
- export { analyzeBundle } from '../chunk-TQSSPVHI.js';
1
+ export { analyzeBundle } from '../chunk-JNF4CXZJ.js';
@@ -1,14 +1,14 @@
1
1
  'use strict';
2
2
 
3
- var chunkQFYK5AS3_cjs = require('../chunk-QFYK5AS3.cjs');
3
+ var chunk3H66SAKS_cjs = require('../chunk-3H66SAKS.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "createBundler", {
8
8
  enumerable: true,
9
- get: function () { return chunkQFYK5AS3_cjs.createBundler; }
9
+ get: function () { return chunk3H66SAKS_cjs.createBundler; }
10
10
  });
11
11
  Object.defineProperty(exports, "getInputOptions", {
12
12
  enumerable: true,
13
- get: function () { return chunkQFYK5AS3_cjs.getInputOptions; }
13
+ get: function () { return chunk3H66SAKS_cjs.getInputOptions; }
14
14
  });
@@ -1 +1 @@
1
- export { createBundler, getInputOptions } from '../chunk-AC67BJSW.js';
1
+ export { createBundler, getInputOptions } from '../chunk-XO6KJHXC.js';
@@ -1,49 +1,49 @@
1
1
  'use strict';
2
2
 
3
- var chunkYJMYF7RI_cjs = require('../chunk-YJMYF7RI.cjs');
4
- var chunkVPP5727D_cjs = require('../chunk-VPP5727D.cjs');
5
- var chunkYLIG5BNH_cjs = require('../chunk-YLIG5BNH.cjs');
6
- var chunkQFYK5AS3_cjs = require('../chunk-QFYK5AS3.cjs');
3
+ var chunkPMHXFDK2_cjs = require('../chunk-PMHXFDK2.cjs');
4
+ var chunkPRZC7CEM_cjs = require('../chunk-PRZC7CEM.cjs');
5
+ var chunkGLTC4BEQ_cjs = require('../chunk-GLTC4BEQ.cjs');
6
+ var chunk3H66SAKS_cjs = require('../chunk-3H66SAKS.cjs');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "FileService", {
11
11
  enumerable: true,
12
- get: function () { return chunkYJMYF7RI_cjs.FileService; }
12
+ get: function () { return chunkPMHXFDK2_cjs.FileService; }
13
13
  });
14
14
  Object.defineProperty(exports, "createWatcher", {
15
15
  enumerable: true,
16
- get: function () { return chunkYJMYF7RI_cjs.createWatcher; }
16
+ get: function () { return chunkPMHXFDK2_cjs.createWatcher; }
17
17
  });
18
18
  Object.defineProperty(exports, "getBundler", {
19
19
  enumerable: true,
20
- get: function () { return chunkYJMYF7RI_cjs.getBundler; }
20
+ get: function () { return chunkPMHXFDK2_cjs.getBundler; }
21
21
  });
22
22
  Object.defineProperty(exports, "getWatcher", {
23
23
  enumerable: true,
24
- get: function () { return chunkYJMYF7RI_cjs.getWatcher; }
24
+ get: function () { return chunkPMHXFDK2_cjs.getWatcher; }
25
25
  });
26
26
  Object.defineProperty(exports, "getWatcherInputOptions", {
27
27
  enumerable: true,
28
- get: function () { return chunkYJMYF7RI_cjs.getInputOptions; }
28
+ get: function () { return chunkPMHXFDK2_cjs.getInputOptions; }
29
29
  });
30
30
  Object.defineProperty(exports, "Deps", {
31
31
  enumerable: true,
32
- get: function () { return chunkVPP5727D_cjs.Deps; }
32
+ get: function () { return chunkPRZC7CEM_cjs.Deps; }
33
33
  });
34
34
  Object.defineProperty(exports, "writeTelemetryConfig", {
35
35
  enumerable: true,
36
- get: function () { return chunkVPP5727D_cjs.writeTelemetryConfig; }
36
+ get: function () { return chunkPRZC7CEM_cjs.writeTelemetryConfig; }
37
37
  });
38
38
  Object.defineProperty(exports, "analyzeBundle", {
39
39
  enumerable: true,
40
- get: function () { return chunkYLIG5BNH_cjs.analyzeBundle; }
40
+ get: function () { return chunkGLTC4BEQ_cjs.analyzeBundle; }
41
41
  });
42
42
  Object.defineProperty(exports, "createBundler", {
43
43
  enumerable: true,
44
- get: function () { return chunkQFYK5AS3_cjs.createBundler; }
44
+ get: function () { return chunk3H66SAKS_cjs.createBundler; }
45
45
  });
46
46
  Object.defineProperty(exports, "getBundlerInputOptions", {
47
47
  enumerable: true,
48
- get: function () { return chunkQFYK5AS3_cjs.getInputOptions; }
48
+ get: function () { return chunk3H66SAKS_cjs.getInputOptions; }
49
49
  });
@@ -1,4 +1,4 @@
1
- export { FileService, createWatcher, getBundler, getWatcher, getInputOptions as getWatcherInputOptions } from '../chunk-72GFPLLU.js';
2
- export { Deps, writeTelemetryConfig } from '../chunk-SL5KZNFT.js';
3
- export { analyzeBundle } from '../chunk-TQSSPVHI.js';
4
- export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-AC67BJSW.js';
1
+ export { FileService, createWatcher, getBundler, getWatcher, getInputOptions as getWatcherInputOptions } from '../chunk-DZ4D3KXZ.js';
2
+ export { Deps, writeTelemetryConfig } from '../chunk-7XQJJPRM.js';
3
+ export { analyzeBundle } from '../chunk-JNF4CXZJ.js';
4
+ export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-XO6KJHXC.js';
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunkJ2F3DJTF_cjs = require('../chunk-J2F3DJTF.cjs');
3
+ var chunkHLGZCQQW_cjs = require('../chunk-HLGZCQQW.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "Bundler", {
8
8
  enumerable: true,
9
- get: function () { return chunkJ2F3DJTF_cjs.Bundler; }
9
+ get: function () { return chunkHLGZCQQW_cjs.Bundler; }
10
10
  });
@@ -1 +1 @@
1
- export { Bundler } from '../chunk-VPY2RQUP.js';
1
+ export { Bundler } from '../chunk-HRR4D2GM.js';
@@ -0,0 +1,139 @@
1
+ 'use strict';
2
+
3
+ var chunkJSFQUYK4_cjs = require('./chunk-JSFQUYK4.cjs');
4
+ var alias = require('@rollup/plugin-alias');
5
+ var commonjs = require('@rollup/plugin-commonjs');
6
+ var json = require('@rollup/plugin-json');
7
+ var nodeResolve = require('@rollup/plugin-node-resolve');
8
+ var url = require('url');
9
+ var rollup = require('rollup');
10
+ var esbuild = require('rollup-plugin-esbuild');
11
+
12
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
13
+
14
+ var alias__default = /*#__PURE__*/_interopDefault(alias);
15
+ var commonjs__default = /*#__PURE__*/_interopDefault(commonjs);
16
+ var json__default = /*#__PURE__*/_interopDefault(json);
17
+ var nodeResolve__default = /*#__PURE__*/_interopDefault(nodeResolve);
18
+ var esbuild__default = /*#__PURE__*/_interopDefault(esbuild);
19
+
20
+ async function getInputOptions(entryFile, analyzedBundleInfo, platform) {
21
+ let nodeResolvePlugin = platform === "node" ? nodeResolve__default.default({
22
+ preferBuiltins: true,
23
+ exportConditions: ["node", "import", "require"],
24
+ mainFields: ["module", "main"]
25
+ }) : nodeResolve__default.default({
26
+ preferBuiltins: false,
27
+ exportConditions: ["browser", "import", "require"],
28
+ mainFields: ["module", "main"],
29
+ browser: true
30
+ });
31
+ const externalsCopy = /* @__PURE__ */ new Set();
32
+ for (const external of analyzedBundleInfo.externalDependencies) {
33
+ if (external.startsWith("@")) {
34
+ const [scope, name] = external.split("/", 3);
35
+ externalsCopy.add(`${scope}/${name}`);
36
+ externalsCopy.add(`${scope}/${name}/*`);
37
+ } else {
38
+ externalsCopy.add(external);
39
+ externalsCopy.add(`${external}/*`);
40
+ }
41
+ }
42
+ const externals = Array.from(externalsCopy);
43
+ const normalizedEntryFile = entryFile.replaceAll("\\", "/");
44
+ return {
45
+ logLevel: process.env.MASTRA_BUNDLER_DEBUG === "true" ? "debug" : "silent",
46
+ treeshake: "smallest",
47
+ preserveSymlinks: true,
48
+ external: externals,
49
+ plugins: [
50
+ {
51
+ name: "alias-optimized-deps",
52
+ // @ts-ignore
53
+ resolveId(id) {
54
+ if (!analyzedBundleInfo.dependencies.has(id)) {
55
+ return null;
56
+ }
57
+ const isInvalidChunk = analyzedBundleInfo.invalidChunks.has(analyzedBundleInfo.dependencies.get(id));
58
+ if (isInvalidChunk) {
59
+ return {
60
+ id,
61
+ external: true
62
+ };
63
+ }
64
+ return {
65
+ id: ".mastra/.build/" + analyzedBundleInfo.dependencies.get(id),
66
+ external: false
67
+ };
68
+ }
69
+ },
70
+ alias__default.default({
71
+ entries: [
72
+ {
73
+ find: /^\#server$/,
74
+ replacement: url.fileURLToPath(undefined("@mastra/deployer/server")).replaceAll("\\", "/")
75
+ },
76
+ { find: /^\#mastra$/, replacement: normalizedEntryFile }
77
+ ]
78
+ }),
79
+ esbuild__default.default({
80
+ target: "node20",
81
+ platform,
82
+ minify: false,
83
+ define: {
84
+ "process.env.NODE_ENV": JSON.stringify("production")
85
+ }
86
+ }),
87
+ commonjs__default.default({
88
+ extensions: [".js", ".ts"],
89
+ transformMixedEsModules: true,
90
+ esmExternals(id) {
91
+ return externals.includes(id);
92
+ }
93
+ }),
94
+ nodeResolvePlugin,
95
+ // for debugging
96
+ // {
97
+ // name: 'logger',
98
+ // //@ts-ignore
99
+ // resolveId(id, ...args) {
100
+ // console.log({ id, args });
101
+ // },
102
+ // // @ts-ignore
103
+ // transform(code, id) {
104
+ // if (code.includes('class Duplexify ')) {
105
+ // console.log({ duplex: id });
106
+ // }
107
+ // },
108
+ // },
109
+ json__default.default(),
110
+ chunkJSFQUYK4_cjs.removeDeployer(entryFile),
111
+ // treeshake unused imports
112
+ esbuild__default.default({
113
+ include: entryFile,
114
+ target: "node20",
115
+ platform,
116
+ minify: false
117
+ })
118
+ ].filter(Boolean)
119
+ };
120
+ }
121
+ async function createBundler(inputOptions, outputOptions) {
122
+ const bundler = await rollup.rollup(inputOptions);
123
+ return {
124
+ write: () => {
125
+ return bundler.write({
126
+ ...outputOptions,
127
+ format: "esm",
128
+ entryFileNames: "[name].mjs",
129
+ chunkFileNames: "[name].mjs"
130
+ });
131
+ },
132
+ close: () => {
133
+ return bundler.close();
134
+ }
135
+ };
136
+ }
137
+
138
+ exports.createBundler = createBundler;
139
+ exports.getInputOptions = getInputOptions;