@mastra/deployer 0.10.15 → 0.11.0-alpha.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.
@@ -1,4 +1,5 @@
1
1
  import { default as babel_2 } from '@babel/core';
2
+ import { BlankEnv } from 'hono/types';
2
3
  import { BlankSchema } from 'hono/types';
3
4
  import type { Config } from '@mastra/core';
4
5
  import { ContentfulStatusCode } from 'hono/utils/http-status';
@@ -31,6 +32,10 @@ import { ServerType } from '@hono/node-server';
31
32
  import { Transform } from 'stream';
32
33
  import { TypedResponse } from 'hono';
33
34
 
35
+ export declare function agentsRouter(bodyLimitOptions: BodyLimitOptions): Hono<BlankEnv, BlankSchema, "/">;
36
+
37
+ export declare function agentsRouterDev(bodyLimitOptions: BodyLimitOptions): Hono<BlankEnv, BlankSchema, "/">;
38
+
34
39
  export declare function aliasHono(): Plugin;
35
40
 
36
41
  /**
@@ -74,6 +79,13 @@ error: string;
74
79
 
75
80
  declare type Bindings = {};
76
81
 
82
+ declare type BodyLimitOptions = {
83
+ maxSize: number;
84
+ onError: (c: Context) => Response;
85
+ };
86
+ export { BodyLimitOptions }
87
+ export { BodyLimitOptions as BodyLimitOptions_alias_1 }
88
+
77
89
  export declare abstract class Bundler extends MastraBundler {
78
90
  protected analyzeOutputDir: string;
79
91
  protected outputDir: string;
@@ -100,7 +112,7 @@ export declare abstract class Bundler extends MastraBundler {
100
112
  }): Promise<void>;
101
113
  protected getBundlerOptions(serverFile: string, mastraEntryFile: string, analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>, toolsPaths: string[]): Promise<InputOptions>;
102
114
  getToolsInputOptions(toolsPaths: string[]): Promise<Record<string, string>>;
103
- protected _bundle(serverFile: string, mastraEntryFile: string, outputDirectory: string, toolsPaths?: string[], bundleLocation?: string, installDependencies?: boolean): Promise<void>;
115
+ protected _bundle(serverFile: string, mastraEntryFile: string, outputDirectory: string, toolsPaths?: string[], bundleLocation?: string): Promise<void>;
104
116
  lint(_entryFile: string, _outputDirectory: string, toolsPaths: string[]): Promise<void>;
105
117
  }
106
118
 
@@ -667,12 +679,20 @@ total_count: number;
667
679
  */
668
680
  export declare const listMcpServerToolsHandler: (c: Context) => Promise<Response>;
669
681
 
682
+ export declare function logsRouter(): Hono<BlankEnv, BlankSchema, "/">;
683
+
670
684
  export declare function loopStreamVNextNetworkHandler(c: Context): Promise<Response>;
671
685
 
672
686
  export declare function loopVNextNetworkHandler(c: Context): Promise<Response>;
673
687
 
674
688
  export declare const matchesOrIncludes: (values: string | string[], value: string) => boolean;
675
689
 
690
+ export declare function mcpRouter(bodyLimitOptions: BodyLimitOptions): Hono<BlankEnv, BlankSchema, "/">;
691
+
692
+ export declare function memoryRoutes(bodyLimitOptions: BodyLimitOptions): Hono<BlankEnv, BlankSchema, "/">;
693
+
694
+ export declare function networksRouter(bodyLimitOptions: BodyLimitOptions): Hono<BlankEnv, BlankSchema, "/">;
695
+
676
696
  export declare function nodeModulesExtensionResolver(): Plugin;
677
697
 
678
698
  /**
@@ -787,6 +807,10 @@ export declare function streamGenerateVNextNetworkHandler(c: Context): Promise<R
787
807
 
788
808
  export declare function streamWorkflowHandler(c: Context): Promise<Response>;
789
809
 
810
+ export declare function telemetryRouter(): Hono<BlankEnv, BlankSchema, "/">;
811
+
812
+ export declare function toolsRouter(bodyLimitOptions: BodyLimitOptions, tools: Record<string, any>): Hono<BlankEnv, BlankSchema, "/">;
813
+
790
814
  declare type TransitiveDependencyResult = {
791
815
  resolutions: Record<string, string>;
792
816
  usedWorkspacePackages: Set<string>;
@@ -819,10 +843,16 @@ declare type Variables = {
819
843
  isDev: boolean;
820
844
  };
821
845
 
846
+ export declare function vectorRouter(bodyLimitOptions: BodyLimitOptions): Hono<BlankEnv, BlankSchema, "/">;
847
+
848
+ export declare function vNextNetworksRouter(bodyLimitOptions: BodyLimitOptions): Hono<BlankEnv, BlankSchema, "/">;
849
+
822
850
  export declare function watchLegacyWorkflowHandler(c: Context): Response | Promise<Response>;
823
851
 
824
852
  export declare function watchWorkflowHandler(c: Context): Response | Promise<Response>;
825
853
 
854
+ export declare function workflowsRouter(bodyLimitOptions: BodyLimitOptions): Hono<BlankEnv, BlankSchema, "/">;
855
+
826
856
  declare type WorkspacePackageInfo = {
827
857
  location: string;
828
858
  dependencies: Record<string, string> | undefined;
@@ -1,4 +1,5 @@
1
1
  import { default as babel_2 } from '@babel/core';
2
+ import { BlankEnv } from 'hono/types';
2
3
  import { BlankSchema } from 'hono/types';
3
4
  import type { Config } from '@mastra/core';
4
5
  import { ContentfulStatusCode } from 'hono/utils/http-status';
@@ -31,6 +32,10 @@ import { ServerType } from '@hono/node-server';
31
32
  import { Transform } from 'stream';
32
33
  import { TypedResponse } from 'hono';
33
34
 
35
+ export declare function agentsRouter(bodyLimitOptions: BodyLimitOptions): Hono<BlankEnv, BlankSchema, "/">;
36
+
37
+ export declare function agentsRouterDev(bodyLimitOptions: BodyLimitOptions): Hono<BlankEnv, BlankSchema, "/">;
38
+
34
39
  export declare function aliasHono(): Plugin;
35
40
 
36
41
  /**
@@ -74,6 +79,13 @@ error: string;
74
79
 
75
80
  declare type Bindings = {};
76
81
 
82
+ declare type BodyLimitOptions = {
83
+ maxSize: number;
84
+ onError: (c: Context) => Response;
85
+ };
86
+ export { BodyLimitOptions }
87
+ export { BodyLimitOptions as BodyLimitOptions_alias_1 }
88
+
77
89
  export declare abstract class Bundler extends MastraBundler {
78
90
  protected analyzeOutputDir: string;
79
91
  protected outputDir: string;
@@ -100,7 +112,7 @@ export declare abstract class Bundler extends MastraBundler {
100
112
  }): Promise<void>;
101
113
  protected getBundlerOptions(serverFile: string, mastraEntryFile: string, analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>, toolsPaths: string[]): Promise<InputOptions>;
102
114
  getToolsInputOptions(toolsPaths: string[]): Promise<Record<string, string>>;
103
- protected _bundle(serverFile: string, mastraEntryFile: string, outputDirectory: string, toolsPaths?: string[], bundleLocation?: string, installDependencies?: boolean): Promise<void>;
115
+ protected _bundle(serverFile: string, mastraEntryFile: string, outputDirectory: string, toolsPaths?: string[], bundleLocation?: string): Promise<void>;
104
116
  lint(_entryFile: string, _outputDirectory: string, toolsPaths: string[]): Promise<void>;
105
117
  }
106
118
 
@@ -667,12 +679,20 @@ total_count: number;
667
679
  */
668
680
  export declare const listMcpServerToolsHandler: (c: Context) => Promise<Response>;
669
681
 
682
+ export declare function logsRouter(): Hono<BlankEnv, BlankSchema, "/">;
683
+
670
684
  export declare function loopStreamVNextNetworkHandler(c: Context): Promise<Response>;
671
685
 
672
686
  export declare function loopVNextNetworkHandler(c: Context): Promise<Response>;
673
687
 
674
688
  export declare const matchesOrIncludes: (values: string | string[], value: string) => boolean;
675
689
 
690
+ export declare function mcpRouter(bodyLimitOptions: BodyLimitOptions): Hono<BlankEnv, BlankSchema, "/">;
691
+
692
+ export declare function memoryRoutes(bodyLimitOptions: BodyLimitOptions): Hono<BlankEnv, BlankSchema, "/">;
693
+
694
+ export declare function networksRouter(bodyLimitOptions: BodyLimitOptions): Hono<BlankEnv, BlankSchema, "/">;
695
+
676
696
  export declare function nodeModulesExtensionResolver(): Plugin;
677
697
 
678
698
  /**
@@ -787,6 +807,10 @@ export declare function streamGenerateVNextNetworkHandler(c: Context): Promise<R
787
807
 
788
808
  export declare function streamWorkflowHandler(c: Context): Promise<Response>;
789
809
 
810
+ export declare function telemetryRouter(): Hono<BlankEnv, BlankSchema, "/">;
811
+
812
+ export declare function toolsRouter(bodyLimitOptions: BodyLimitOptions, tools: Record<string, any>): Hono<BlankEnv, BlankSchema, "/">;
813
+
790
814
  declare type TransitiveDependencyResult = {
791
815
  resolutions: Record<string, string>;
792
816
  usedWorkspacePackages: Set<string>;
@@ -819,10 +843,16 @@ declare type Variables = {
819
843
  isDev: boolean;
820
844
  };
821
845
 
846
+ export declare function vectorRouter(bodyLimitOptions: BodyLimitOptions): Hono<BlankEnv, BlankSchema, "/">;
847
+
848
+ export declare function vNextNetworksRouter(bodyLimitOptions: BodyLimitOptions): Hono<BlankEnv, BlankSchema, "/">;
849
+
822
850
  export declare function watchLegacyWorkflowHandler(c: Context): Response | Promise<Response>;
823
851
 
824
852
  export declare function watchWorkflowHandler(c: Context): Response | Promise<Response>;
825
853
 
854
+ export declare function workflowsRouter(bodyLimitOptions: BodyLimitOptions): Hono<BlankEnv, BlankSchema, "/">;
855
+
826
856
  declare type WorkspacePackageInfo = {
827
857
  location: string;
828
858
  dependencies: Record<string, string> | undefined;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkFK2WUSEN_cjs = require('../chunk-FK2WUSEN.cjs');
3
+ var chunkYVPLA2GR_cjs = require('../chunk-YVPLA2GR.cjs');
4
4
  var chunkM2VZQFTW_cjs = require('../chunk-M2VZQFTW.cjs');
5
5
  var chunkXKH6F4NE_cjs = require('../chunk-XKH6F4NE.cjs');
6
6
  var chunkD2DCFCLH_cjs = require('../chunk-D2DCFCLH.cjs');
@@ -10,15 +10,15 @@ var chunkKCP5ITLV_cjs = require('../chunk-KCP5ITLV.cjs');
10
10
 
11
11
  Object.defineProperty(exports, "createWatcher", {
12
12
  enumerable: true,
13
- get: function () { return chunkFK2WUSEN_cjs.createWatcher; }
13
+ get: function () { return chunkYVPLA2GR_cjs.createWatcher; }
14
14
  });
15
15
  Object.defineProperty(exports, "getServerOptions", {
16
16
  enumerable: true,
17
- get: function () { return chunkFK2WUSEN_cjs.getServerOptions; }
17
+ get: function () { return chunkYVPLA2GR_cjs.getServerOptions; }
18
18
  });
19
19
  Object.defineProperty(exports, "getWatcherInputOptions", {
20
20
  enumerable: true,
21
- get: function () { return chunkFK2WUSEN_cjs.getInputOptions; }
21
+ get: function () { return chunkYVPLA2GR_cjs.getInputOptions; }
22
22
  });
23
23
  Object.defineProperty(exports, "writeTelemetryConfig", {
24
24
  enumerable: true,
@@ -1,4 +1,4 @@
1
- export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-D6736SJL.js';
1
+ export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-LT2BJRBN.js';
2
2
  export { writeTelemetryConfig } from '../chunk-ENT5RDOI.js';
3
3
  export { analyzeBundle, getBundlerOptions } from '../chunk-UYQZMNZL.js';
4
4
  export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-TIC2KT3M.js';
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunkUFVGATV6_cjs = require('../chunk-UFVGATV6.cjs');
3
+ var chunkYFMAWUII_cjs = require('../chunk-YFMAWUII.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "Bundler", {
8
8
  enumerable: true,
9
- get: function () { return chunkUFVGATV6_cjs.Bundler; }
9
+ get: function () { return chunkYFMAWUII_cjs.Bundler; }
10
10
  });
@@ -1 +1 @@
1
- export { Bundler } from '../chunk-D57U647E.js';
1
+ export { Bundler } from '../chunk-HJGC75ZR.js';
@@ -295,7 +295,7 @@ var Bundler = class extends MastraBundler {
295
295
  }
296
296
  return inputs;
297
297
  }
298
- async _bundle(serverFile, mastraEntryFile, outputDirectory, toolsPaths = [], bundleLocation = join(outputDirectory, this.outputDir), installDependencies = true) {
298
+ async _bundle(serverFile, mastraEntryFile, outputDirectory, toolsPaths = [], bundleLocation = join(outputDirectory, this.outputDir)) {
299
299
  this.logger.info("Start bundling Mastra");
300
300
  let analyzedBundleInfo;
301
301
  try {
@@ -462,11 +462,9 @@ export const tools = [${toolsExports.join(", ")}]`
462
462
  this.logger.info("Copying .npmrc file");
463
463
  await this.copyDOTNPMRC({ outputDirectory });
464
464
  this.logger.info("Done copying .npmrc file");
465
- if (installDependencies) {
466
- this.logger.info("Installing dependencies");
467
- await this.installDependencies(outputDirectory);
468
- this.logger.info("Done installing dependencies");
469
- }
465
+ this.logger.info("Installing dependencies");
466
+ await this.installDependencies(outputDirectory);
467
+ this.logger.info("Done installing dependencies");
470
468
  } catch (error) {
471
469
  const message = error instanceof Error ? error.message : String(error);
472
470
  throw new MastraError(
@@ -53,9 +53,16 @@ function nodeModulesExtensionResolver() {
53
53
  }
54
54
  return null;
55
55
  } catch (e) {
56
+ const resolved = safeResolve(id, importer);
57
+ if (resolved) {
58
+ return {
59
+ id: resolved,
60
+ external: true
61
+ };
62
+ }
56
63
  for (const ext of [".mjs", ".js", ".cjs"]) {
57
- const resolved = safeResolve(id + ext, importer);
58
- if (resolved) {
64
+ const resolved2 = safeResolve(id + ext, importer);
65
+ if (resolved2) {
59
66
  const pkgName = getPackageName(id);
60
67
  if (!pkgName) {
61
68
  return null;
@@ -64,7 +71,7 @@ function nodeModulesExtensionResolver() {
64
71
  if (!pkgJsonPath) {
65
72
  return null;
66
73
  }
67
- const newImportWithExtension = resolved.replace(dirname(pkgJsonPath), pkgName);
74
+ const newImportWithExtension = resolved2.replace(dirname(pkgJsonPath), pkgName);
68
75
  return {
69
76
  id: newImportWithExtension,
70
77
  external: true
@@ -169,7 +169,7 @@ var Bundler = class extends bundler.MastraBundler {
169
169
  }
170
170
  async writeInstrumentationFile(outputDirectory, customInstrumentationFile) {
171
171
  const instrumentationFile = path.join(outputDirectory, "instrumentation.mjs");
172
- const __dirname = path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-UFVGATV6.cjs', document.baseURI).href))));
172
+ const __dirname = path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-YFMAWUII.cjs', document.baseURI).href))));
173
173
  if (customInstrumentationFile) {
174
174
  await fsExtra.copy(customInstrumentationFile, instrumentationFile);
175
175
  } else {
@@ -307,7 +307,7 @@ var Bundler = class extends bundler.MastraBundler {
307
307
  }
308
308
  return inputs;
309
309
  }
310
- async _bundle(serverFile, mastraEntryFile, outputDirectory, toolsPaths = [], bundleLocation = path.join(outputDirectory, this.outputDir), installDependencies = true) {
310
+ async _bundle(serverFile, mastraEntryFile, outputDirectory, toolsPaths = [], bundleLocation = path.join(outputDirectory, this.outputDir)) {
311
311
  this.logger.info("Start bundling Mastra");
312
312
  let analyzedBundleInfo;
313
313
  try {
@@ -474,11 +474,9 @@ export const tools = [${toolsExports.join(", ")}]`
474
474
  this.logger.info("Copying .npmrc file");
475
475
  await this.copyDOTNPMRC({ outputDirectory });
476
476
  this.logger.info("Done copying .npmrc file");
477
- if (installDependencies) {
478
- this.logger.info("Installing dependencies");
479
- await this.installDependencies(outputDirectory);
480
- this.logger.info("Done installing dependencies");
481
- }
477
+ this.logger.info("Installing dependencies");
478
+ await this.installDependencies(outputDirectory);
479
+ this.logger.info("Done installing dependencies");
482
480
  } catch (error$1) {
483
481
  const message = error$1 instanceof Error ? error$1.message : String(error$1);
484
482
  throw new error.MastraError(
@@ -80,9 +80,16 @@ function nodeModulesExtensionResolver() {
80
80
  }
81
81
  return null;
82
82
  } catch (e) {
83
+ const resolved = safeResolve(id, importer);
84
+ if (resolved) {
85
+ return {
86
+ id: resolved,
87
+ external: true
88
+ };
89
+ }
83
90
  for (const ext of [".mjs", ".js", ".cjs"]) {
84
- const resolved = safeResolve(id + ext, importer);
85
- if (resolved) {
91
+ const resolved2 = safeResolve(id + ext, importer);
92
+ if (resolved2) {
86
93
  const pkgName = getPackageName(id);
87
94
  if (!pkgName) {
88
95
  return null;
@@ -91,7 +98,7 @@ function nodeModulesExtensionResolver() {
91
98
  if (!pkgJsonPath) {
92
99
  return null;
93
100
  }
94
- const newImportWithExtension = resolved.replace(path.dirname(pkgJsonPath), pkgName);
101
+ const newImportWithExtension = resolved2.replace(path.dirname(pkgJsonPath), pkgName);
95
102
  return {
96
103
  id: newImportWithExtension,
97
104
  external: true
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkUFVGATV6_cjs = require('./chunk-UFVGATV6.cjs');
3
+ var chunkYFMAWUII_cjs = require('./chunk-YFMAWUII.cjs');
4
4
  var chunkXKH6F4NE_cjs = require('./chunk-XKH6F4NE.cjs');
5
5
  var chunkKCP5ITLV_cjs = require('./chunk-KCP5ITLV.cjs');
6
6
  var babel = require('@babel/core');
@@ -33,7 +33,7 @@ var esbuild__default = /*#__PURE__*/_interopDefault(esbuild);
33
33
  var commonjs__default = /*#__PURE__*/_interopDefault(commonjs);
34
34
 
35
35
  // src/deploy/base.ts
36
- var Deployer = class extends chunkUFVGATV6_cjs.Bundler {
36
+ var Deployer = class extends chunkYFMAWUII_cjs.Bundler {
37
37
  deps = new chunkKCP5ITLV_cjs.DepsService();
38
38
  constructor(args) {
39
39
  super(args.name, "DEPLOYER");
package/dist/index.d.cts CHANGED
@@ -6,3 +6,4 @@ export { createChildProcessLogger } from './_tsup-dts-rollup.cjs';
6
6
  export { createPinoStream } from './_tsup-dts-rollup.cjs';
7
7
  export { ApiError } from './_tsup-dts-rollup.cjs';
8
8
  export { ServerBundleOptions } from './_tsup-dts-rollup.cjs';
9
+ export { BodyLimitOptions } from './_tsup-dts-rollup.cjs';
package/dist/index.d.ts CHANGED
@@ -6,3 +6,4 @@ export { createChildProcessLogger } from './_tsup-dts-rollup.js';
6
6
  export { createPinoStream } from './_tsup-dts-rollup.js';
7
7
  export { ApiError } from './_tsup-dts-rollup.js';
8
8
  export { ServerBundleOptions } from './_tsup-dts-rollup.js';
9
+ export { BodyLimitOptions } from './_tsup-dts-rollup.js';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Bundler } from './chunk-D57U647E.js';
1
+ import { Bundler } from './chunk-HJGC75ZR.js';
2
2
  import { recursiveRemoveNonReferencedNodes } from './chunk-UYQZMNZL.js';
3
3
  import { DepsService, FileService } from './chunk-GPD54HBC.js';
4
4
  export { Deps, FileService, createChildProcessLogger, createPinoStream } from './chunk-GPD54HBC.js';