@mastra/deployer 0.3.5-alpha.0 → 0.4.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.
@@ -3,16 +3,18 @@ import { BlankSchema } from 'hono/types';
3
3
  import type { Config } from '@mastra/core';
4
4
  import { ContentfulStatusCode } from 'hono/utils/http-status';
5
5
  import type { Context } from 'hono';
6
+ import type { ContextWithMastra } from '@mastra/core/server';
6
7
  import { Hono } from 'hono';
7
8
  import type { IDeployer } from '@mastra/core/deployer';
9
+ import type { IMastraLogger } from '@mastra/core/logger';
8
10
  import { InputOptions } from 'rollup';
9
- import type { Logger } from '@mastra/core';
10
- import type { Logger as Logger_2 } from '@mastra/core/logger';
11
11
  import type { Mastra } from '@mastra/core';
12
+ import type { MastraAuthConfig } from '@mastra/core/server';
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
16
  import type { MastraVector } from '@mastra/core/vector';
17
+ import type { Next } from 'hono';
16
18
  import { OutputOptions } from 'rollup';
17
19
  import type { Plugin } from 'rollup';
18
20
  import { PluginContext } from 'rollup';
@@ -39,7 +41,7 @@ export declare function aliasHono(): Plugin;
39
41
  *
40
42
  * This helps identify which dependencies need to be externalized vs bundled.
41
43
  */
42
- declare function analyzeBundle(entry: string, mastraEntry: string, outputDir: string, platform: 'node' | 'browser', logger: Logger): Promise<{
44
+ declare function analyzeBundle(entry: string, mastraEntry: string, outputDir: string, platform: 'node' | 'browser', logger: IMastraLogger): Promise<{
43
45
  invalidChunks: Set<string>;
44
46
  dependencies: Map<string, string>;
45
47
  externalDependencies: Set<string>;
@@ -60,6 +62,16 @@ declare interface ArchitectureOptions {
60
62
  libc?: string[];
61
63
  }
62
64
 
65
+ export declare const authenticationMiddleware: (c: ContextWithMastra, next: Next) => Promise<void | (Response & TypedResponse< {
66
+ error: string;
67
+ }, 401, "json">)>;
68
+
69
+ export declare const authorizationMiddleware: (c: ContextWithMastra, next: Next) => Promise<void | (Response & TypedResponse< {
70
+ error: string;
71
+ }, 403, "json">) | (Response & TypedResponse< {
72
+ error: string;
73
+ }, 500, "json">)>;
74
+
63
75
  declare type Bindings = {};
64
76
 
65
77
  export declare abstract class Bundler extends MastraBundler {
@@ -88,13 +100,17 @@ export declare abstract class Bundler extends MastraBundler {
88
100
  lint(_entryFile: string, _outputDirectory: string, toolsPaths: string[]): Promise<void>;
89
101
  }
90
102
 
103
+ export declare const canAccessPublicly: (path: string, method: string, authConfig: MastraAuthConfig) => boolean;
104
+
105
+ export declare const checkRules: (rules: MastraAuthConfig["rules"], path: string, method: string, user: unknown) => Promise<boolean>;
106
+
91
107
  /**
92
108
  * Collects all transitive workspace dependencies and their TGZ paths
93
109
  */
94
110
  export declare const collectTransitiveWorkspaceDependencies: ({ workspaceMap, initialDependencies, logger, }: {
95
111
  workspaceMap: Map<string, WorkspacePackageInfo>;
96
112
  initialDependencies: Set<string>;
97
- logger: Logger;
113
+ logger: IMastraLogger;
98
114
  }) => TransitiveDependencyResult;
99
115
 
100
116
  declare function createBundler(inputOptions: InputOptions, outputOptions: Partial<OutputOptions> & {
@@ -107,7 +123,7 @@ export { createBundler }
107
123
  export { createBundler as createBundler_alias_1 }
108
124
 
109
125
  declare function createChildProcessLogger({ logger, root }: {
110
- logger: Logger_2;
126
+ logger: IMastraLogger;
111
127
  root: string;
112
128
  }): ({ cmd, args, env }: {
113
129
  cmd: string;
@@ -125,23 +141,23 @@ export declare function createHonoServer(mastra: Mastra, options?: ServerBundleO
125
141
 
126
142
  export declare function createIndex(c: Context): Promise<Response>;
127
143
 
144
+ export declare function createLegacyWorkflowRunHandler(c: Context): Promise<Response>;
145
+
128
146
  export declare function createNodeServer(mastra: Mastra, options?: ServerBundleOptions): Promise<ServerType>;
129
147
 
130
- declare const createPinoStream: (logger: Logger_2) => Transform;
148
+ declare const createPinoStream: (logger: IMastraLogger) => Transform;
131
149
  export { createPinoStream }
132
150
  export { createPinoStream as createPinoStream_alias_1 }
133
151
  export { createPinoStream as createPinoStream_alias_2 }
134
152
 
135
- export declare function createRunHandler(c: Context): Promise<Response>;
136
-
137
153
  export declare function createThreadHandler(c: Context): Promise<Response>;
138
154
 
139
- export declare function createVNextWorkflowRunHandler(c: Context): Promise<Response>;
140
-
141
155
  declare function createWatcher(inputOptions: InputOptions, outputOptions: OutputOptions): Promise<RollupWatcher>;
142
156
  export { createWatcher }
143
157
  export { createWatcher as createWatcher_alias_1 }
144
158
 
159
+ export declare function createWorkflowRunHandler(c: Context): Promise<Response>;
160
+
145
161
  /**
146
162
  * Creates a map of workspace packages with their metadata for dependency resolution
147
163
  * @returns Map of package names to their location, dependencies and version
@@ -152,6 +168,8 @@ export declare const createWorkspacePackageMap: () => Promise<Map<string, {
152
168
  version: string | undefined;
153
169
  }>>;
154
170
 
171
+ export declare const defaultAuthConfig: MastraAuthConfig;
172
+
155
173
  export declare function deleteIndex(c: Context): Promise<Response>;
156
174
 
157
175
  export declare function deleteThreadHandler(c: Context): Promise<Response>;
@@ -353,6 +371,12 @@ declare function getInputOptions_2(entryFile: string, platform: 'node' | 'browse
353
371
  export { getInputOptions_2 as getInputOptions_alias_1 }
354
372
  export { getInputOptions_2 as getWatcherInputOptions }
355
373
 
374
+ export declare function getLegacyWorkflowByIdHandler(c: Context): Promise<Response>;
375
+
376
+ export declare function getLegacyWorkflowRunsHandler(c: Context): Promise<Response>;
377
+
378
+ export declare function getLegacyWorkflowsHandler(c: Context): Promise<Response>;
379
+
356
380
  export declare function getLiveEvalsByAgentIdHandler(c: Context): Promise<Response & TypedResponse< {
357
381
  id: string;
358
382
  name: any;
@@ -531,12 +555,6 @@ export declare function getToolsHandler(c: Context): Promise<Response>;
531
555
 
532
556
  export declare const getVector: (c: Context, vectorName: string) => MastraVector;
533
557
 
534
- export declare function getVNextWorkflowByIdHandler(c: Context): Promise<Response>;
535
-
536
- export declare function getVNextWorkflowRunsHandler(c: Context): Promise<Response>;
537
-
538
- export declare function getVNextWorkflowsHandler(c: Context): Promise<Response>;
539
-
540
558
  export declare function getWorkflowByIdHandler(c: Context): Promise<Response>;
541
559
 
542
560
  export declare function getWorkflowRunsHandler(c: Context): Promise<Response>;
@@ -593,16 +611,22 @@ total_count: number;
593
611
  */
594
612
  export declare const listMcpServerToolsHandler: (c: Context) => Promise<Response>;
595
613
 
614
+ export declare const matchesOrIncludes: (values: string | string[], value: string) => boolean;
615
+
596
616
  /**
597
617
  * Creates TGZ packages for workspace dependencies in the workspace-module directory
598
618
  */
599
619
  export declare const packWorkspaceDependencies: ({ workspaceMap, usedWorkspacePackages, bundleOutputDir, logger, }: {
600
620
  workspaceMap: Map<string, WorkspacePackageInfo>;
601
621
  bundleOutputDir: string;
602
- logger: Logger;
622
+ logger: IMastraLogger;
603
623
  usedWorkspacePackages: Set<string>;
604
624
  }) => Promise<void>;
605
625
 
626
+ export declare const pathMatchesPattern: (path: string, pattern: string) => boolean;
627
+
628
+ export declare const pathMatchesRule: (path: string, rulePath: string | RegExp | string[] | undefined) => boolean;
629
+
606
630
  export declare function pino(): {
607
631
  name: string;
608
632
  resolveId(this: PluginContext, id: string, importee: string | undefined): Promise<{
@@ -651,11 +675,11 @@ export declare function resolve(specifier: string, context: ResolveHookContext,
651
675
  url: string;
652
676
  }>;
653
677
 
654
- export declare function resumeAsyncVNextWorkflowHandler(c: Context): Promise<Response>;
678
+ export declare function resumeAsyncLegacyWorkflowHandler(c: Context): Promise<Response>;
655
679
 
656
680
  export declare function resumeAsyncWorkflowHandler(c: Context): Promise<Response>;
657
681
 
658
- export declare function resumeVNextWorkflowHandler(c: Context): Promise<Response>;
682
+ export declare function resumeLegacyWorkflowHandler(c: Context): Promise<Response>;
659
683
 
660
684
  export declare function resumeWorkflowHandler(c: Context): Promise<Response>;
661
685
 
@@ -677,11 +701,11 @@ export declare function setAgentInstructionsHandler(c: Context): Promise<Respons
677
701
  */
678
702
  export declare function speakHandler(c: Context): Promise<Response>;
679
703
 
680
- export declare function startAsyncVNextWorkflowHandler(c: Context): Promise<Response>;
704
+ export declare function startAsyncLegacyWorkflowHandler(c: Context): Promise<Response>;
681
705
 
682
706
  export declare function startAsyncWorkflowHandler(c: Context): Promise<Response>;
683
707
 
684
- export declare function startVNextWorkflowRunHandler(c: Context): Promise<Response>;
708
+ export declare function startLegacyWorkflowRunHandler(c: Context): Promise<Response>;
685
709
 
686
710
  export declare function startWorkflowRunHandler(c: Context): Promise<Response>;
687
711
 
@@ -721,7 +745,7 @@ declare type Variables = {
721
745
  isDev: boolean;
722
746
  };
723
747
 
724
- export declare function watchVNextWorkflowHandler(c: Context): Response | Promise<Response>;
748
+ export declare function watchLegacyWorkflowHandler(c: Context): Response | Promise<Response>;
725
749
 
726
750
  export declare function watchWorkflowHandler(c: Context): Response | Promise<Response>;
727
751
 
@@ -3,16 +3,18 @@ import { BlankSchema } from 'hono/types';
3
3
  import type { Config } from '@mastra/core';
4
4
  import { ContentfulStatusCode } from 'hono/utils/http-status';
5
5
  import type { Context } from 'hono';
6
+ import type { ContextWithMastra } from '@mastra/core/server';
6
7
  import { Hono } from 'hono';
7
8
  import type { IDeployer } from '@mastra/core/deployer';
9
+ import type { IMastraLogger } from '@mastra/core/logger';
8
10
  import { InputOptions } from 'rollup';
9
- import type { Logger } from '@mastra/core';
10
- import type { Logger as Logger_2 } from '@mastra/core/logger';
11
11
  import type { Mastra } from '@mastra/core';
12
+ import type { MastraAuthConfig } from '@mastra/core/server';
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
16
  import type { MastraVector } from '@mastra/core/vector';
17
+ import type { Next } from 'hono';
16
18
  import { OutputOptions } from 'rollup';
17
19
  import type { Plugin } from 'rollup';
18
20
  import { PluginContext } from 'rollup';
@@ -39,7 +41,7 @@ export declare function aliasHono(): Plugin;
39
41
  *
40
42
  * This helps identify which dependencies need to be externalized vs bundled.
41
43
  */
42
- declare function analyzeBundle(entry: string, mastraEntry: string, outputDir: string, platform: 'node' | 'browser', logger: Logger): Promise<{
44
+ declare function analyzeBundle(entry: string, mastraEntry: string, outputDir: string, platform: 'node' | 'browser', logger: IMastraLogger): Promise<{
43
45
  invalidChunks: Set<string>;
44
46
  dependencies: Map<string, string>;
45
47
  externalDependencies: Set<string>;
@@ -60,6 +62,16 @@ declare interface ArchitectureOptions {
60
62
  libc?: string[];
61
63
  }
62
64
 
65
+ export declare const authenticationMiddleware: (c: ContextWithMastra, next: Next) => Promise<void | (Response & TypedResponse< {
66
+ error: string;
67
+ }, 401, "json">)>;
68
+
69
+ export declare const authorizationMiddleware: (c: ContextWithMastra, next: Next) => Promise<void | (Response & TypedResponse< {
70
+ error: string;
71
+ }, 403, "json">) | (Response & TypedResponse< {
72
+ error: string;
73
+ }, 500, "json">)>;
74
+
63
75
  declare type Bindings = {};
64
76
 
65
77
  export declare abstract class Bundler extends MastraBundler {
@@ -88,13 +100,17 @@ export declare abstract class Bundler extends MastraBundler {
88
100
  lint(_entryFile: string, _outputDirectory: string, toolsPaths: string[]): Promise<void>;
89
101
  }
90
102
 
103
+ export declare const canAccessPublicly: (path: string, method: string, authConfig: MastraAuthConfig) => boolean;
104
+
105
+ export declare const checkRules: (rules: MastraAuthConfig["rules"], path: string, method: string, user: unknown) => Promise<boolean>;
106
+
91
107
  /**
92
108
  * Collects all transitive workspace dependencies and their TGZ paths
93
109
  */
94
110
  export declare const collectTransitiveWorkspaceDependencies: ({ workspaceMap, initialDependencies, logger, }: {
95
111
  workspaceMap: Map<string, WorkspacePackageInfo>;
96
112
  initialDependencies: Set<string>;
97
- logger: Logger;
113
+ logger: IMastraLogger;
98
114
  }) => TransitiveDependencyResult;
99
115
 
100
116
  declare function createBundler(inputOptions: InputOptions, outputOptions: Partial<OutputOptions> & {
@@ -107,7 +123,7 @@ export { createBundler }
107
123
  export { createBundler as createBundler_alias_1 }
108
124
 
109
125
  declare function createChildProcessLogger({ logger, root }: {
110
- logger: Logger_2;
126
+ logger: IMastraLogger;
111
127
  root: string;
112
128
  }): ({ cmd, args, env }: {
113
129
  cmd: string;
@@ -125,23 +141,23 @@ export declare function createHonoServer(mastra: Mastra, options?: ServerBundleO
125
141
 
126
142
  export declare function createIndex(c: Context): Promise<Response>;
127
143
 
144
+ export declare function createLegacyWorkflowRunHandler(c: Context): Promise<Response>;
145
+
128
146
  export declare function createNodeServer(mastra: Mastra, options?: ServerBundleOptions): Promise<ServerType>;
129
147
 
130
- declare const createPinoStream: (logger: Logger_2) => Transform;
148
+ declare const createPinoStream: (logger: IMastraLogger) => Transform;
131
149
  export { createPinoStream }
132
150
  export { createPinoStream as createPinoStream_alias_1 }
133
151
  export { createPinoStream as createPinoStream_alias_2 }
134
152
 
135
- export declare function createRunHandler(c: Context): Promise<Response>;
136
-
137
153
  export declare function createThreadHandler(c: Context): Promise<Response>;
138
154
 
139
- export declare function createVNextWorkflowRunHandler(c: Context): Promise<Response>;
140
-
141
155
  declare function createWatcher(inputOptions: InputOptions, outputOptions: OutputOptions): Promise<RollupWatcher>;
142
156
  export { createWatcher }
143
157
  export { createWatcher as createWatcher_alias_1 }
144
158
 
159
+ export declare function createWorkflowRunHandler(c: Context): Promise<Response>;
160
+
145
161
  /**
146
162
  * Creates a map of workspace packages with their metadata for dependency resolution
147
163
  * @returns Map of package names to their location, dependencies and version
@@ -152,6 +168,8 @@ export declare const createWorkspacePackageMap: () => Promise<Map<string, {
152
168
  version: string | undefined;
153
169
  }>>;
154
170
 
171
+ export declare const defaultAuthConfig: MastraAuthConfig;
172
+
155
173
  export declare function deleteIndex(c: Context): Promise<Response>;
156
174
 
157
175
  export declare function deleteThreadHandler(c: Context): Promise<Response>;
@@ -353,6 +371,12 @@ declare function getInputOptions_2(entryFile: string, platform: 'node' | 'browse
353
371
  export { getInputOptions_2 as getInputOptions_alias_1 }
354
372
  export { getInputOptions_2 as getWatcherInputOptions }
355
373
 
374
+ export declare function getLegacyWorkflowByIdHandler(c: Context): Promise<Response>;
375
+
376
+ export declare function getLegacyWorkflowRunsHandler(c: Context): Promise<Response>;
377
+
378
+ export declare function getLegacyWorkflowsHandler(c: Context): Promise<Response>;
379
+
356
380
  export declare function getLiveEvalsByAgentIdHandler(c: Context): Promise<Response & TypedResponse< {
357
381
  id: string;
358
382
  name: any;
@@ -531,12 +555,6 @@ export declare function getToolsHandler(c: Context): Promise<Response>;
531
555
 
532
556
  export declare const getVector: (c: Context, vectorName: string) => MastraVector;
533
557
 
534
- export declare function getVNextWorkflowByIdHandler(c: Context): Promise<Response>;
535
-
536
- export declare function getVNextWorkflowRunsHandler(c: Context): Promise<Response>;
537
-
538
- export declare function getVNextWorkflowsHandler(c: Context): Promise<Response>;
539
-
540
558
  export declare function getWorkflowByIdHandler(c: Context): Promise<Response>;
541
559
 
542
560
  export declare function getWorkflowRunsHandler(c: Context): Promise<Response>;
@@ -593,16 +611,22 @@ total_count: number;
593
611
  */
594
612
  export declare const listMcpServerToolsHandler: (c: Context) => Promise<Response>;
595
613
 
614
+ export declare const matchesOrIncludes: (values: string | string[], value: string) => boolean;
615
+
596
616
  /**
597
617
  * Creates TGZ packages for workspace dependencies in the workspace-module directory
598
618
  */
599
619
  export declare const packWorkspaceDependencies: ({ workspaceMap, usedWorkspacePackages, bundleOutputDir, logger, }: {
600
620
  workspaceMap: Map<string, WorkspacePackageInfo>;
601
621
  bundleOutputDir: string;
602
- logger: Logger;
622
+ logger: IMastraLogger;
603
623
  usedWorkspacePackages: Set<string>;
604
624
  }) => Promise<void>;
605
625
 
626
+ export declare const pathMatchesPattern: (path: string, pattern: string) => boolean;
627
+
628
+ export declare const pathMatchesRule: (path: string, rulePath: string | RegExp | string[] | undefined) => boolean;
629
+
606
630
  export declare function pino(): {
607
631
  name: string;
608
632
  resolveId(this: PluginContext, id: string, importee: string | undefined): Promise<{
@@ -651,11 +675,11 @@ export declare function resolve(specifier: string, context: ResolveHookContext,
651
675
  url: string;
652
676
  }>;
653
677
 
654
- export declare function resumeAsyncVNextWorkflowHandler(c: Context): Promise<Response>;
678
+ export declare function resumeAsyncLegacyWorkflowHandler(c: Context): Promise<Response>;
655
679
 
656
680
  export declare function resumeAsyncWorkflowHandler(c: Context): Promise<Response>;
657
681
 
658
- export declare function resumeVNextWorkflowHandler(c: Context): Promise<Response>;
682
+ export declare function resumeLegacyWorkflowHandler(c: Context): Promise<Response>;
659
683
 
660
684
  export declare function resumeWorkflowHandler(c: Context): Promise<Response>;
661
685
 
@@ -677,11 +701,11 @@ export declare function setAgentInstructionsHandler(c: Context): Promise<Respons
677
701
  */
678
702
  export declare function speakHandler(c: Context): Promise<Response>;
679
703
 
680
- export declare function startAsyncVNextWorkflowHandler(c: Context): Promise<Response>;
704
+ export declare function startAsyncLegacyWorkflowHandler(c: Context): Promise<Response>;
681
705
 
682
706
  export declare function startAsyncWorkflowHandler(c: Context): Promise<Response>;
683
707
 
684
- export declare function startVNextWorkflowRunHandler(c: Context): Promise<Response>;
708
+ export declare function startLegacyWorkflowRunHandler(c: Context): Promise<Response>;
685
709
 
686
710
  export declare function startWorkflowRunHandler(c: Context): Promise<Response>;
687
711
 
@@ -721,7 +745,7 @@ declare type Variables = {
721
745
  isDev: boolean;
722
746
  };
723
747
 
724
- export declare function watchVNextWorkflowHandler(c: Context): Response | Promise<Response>;
748
+ export declare function watchLegacyWorkflowHandler(c: Context): Response | Promise<Response>;
725
749
 
726
750
  export declare function watchWorkflowHandler(c: Context): Response | Promise<Response>;
727
751