@mastra/deployer 0.0.1-alpha.9 → 0.1.0-alpha.33

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 (87) hide show
  1. package/CHANGELOG.md +195 -0
  2. package/README.md +159 -0
  3. package/dist/build/index.d.ts +57 -6
  4. package/dist/build/index.js +1 -0
  5. package/dist/chunk-PGK75D2J.js +593 -0
  6. package/dist/index.d.ts +33 -4
  7. package/dist/index.js +159 -5
  8. package/dist/server/index.d.ts +12 -7
  9. package/dist/server/index.js +1243 -6843
  10. package/global.d.ts +1 -0
  11. package/package.json +35 -27
  12. package/src/build/babel/fix-libsql.ts +41 -0
  13. package/src/build/babel/get-deployer.ts +54 -0
  14. package/src/build/babel/remove-deployer.ts +39 -0
  15. package/src/build/bundle.ts +129 -211
  16. package/src/build/deployer.ts +71 -0
  17. package/src/build/deps.ts +16 -10
  18. package/src/build/index.ts +3 -5
  19. package/src/build/plugins/fix-libsql.ts +69 -0
  20. package/src/build/plugins/remove-deployer.ts +37 -0
  21. package/src/build/plugins/telemetry-fix.ts +54 -0
  22. package/src/deploy/base.ts +32 -148
  23. package/src/deploy/log.ts +1 -19
  24. package/src/index.ts +3 -3
  25. package/src/server/handlers/agents.ts +24 -15
  26. package/src/server/handlers/client.ts +2 -2
  27. package/src/server/handlers/error.ts +5 -5
  28. package/src/server/handlers/logs.ts +20 -5
  29. package/src/server/handlers/memory.ts +19 -37
  30. package/src/server/handlers/root.ts +1 -1
  31. package/src/server/handlers/tools.ts +1 -27
  32. package/src/server/handlers/vector.ts +149 -0
  33. package/src/server/handlers/workflows.ts +5 -4
  34. package/src/server/index.ts +276 -136
  35. package/src/server/openapi.json +152 -67
  36. package/tsconfig.json +2 -7
  37. package/vitest.config.ts +1 -1
  38. package/dist/build/bundle.d.ts +0 -8
  39. package/dist/build/bundle.d.ts.map +0 -1
  40. package/dist/build/deps.d.ts +0 -25
  41. package/dist/build/deps.d.ts.map +0 -1
  42. package/dist/build/env.d.ts +0 -14
  43. package/dist/build/env.d.ts.map +0 -1
  44. package/dist/build/fs.d.ts +0 -22
  45. package/dist/build/fs.d.ts.map +0 -1
  46. package/dist/build/index.d.ts.map +0 -1
  47. package/dist/build/utils.d.ts +0 -4
  48. package/dist/build/utils.d.ts.map +0 -1
  49. package/dist/deploy/base.d.ts +0 -38
  50. package/dist/deploy/base.d.ts.map +0 -1
  51. package/dist/deploy/index.d.ts +0 -3
  52. package/dist/deploy/index.d.ts.map +0 -1
  53. package/dist/deploy/log.d.ts +0 -24
  54. package/dist/deploy/log.d.ts.map +0 -1
  55. package/dist/deployer.cjs.development.js +0 -3684
  56. package/dist/deployer.cjs.development.js.map +0 -1
  57. package/dist/deployer.cjs.production.min.js +0 -2
  58. package/dist/deployer.cjs.production.min.js.map +0 -1
  59. package/dist/deployer.esm.js +0 -3649
  60. package/dist/deployer.esm.js.map +0 -1
  61. package/dist/index.d.ts.map +0 -1
  62. package/dist/server/handlers/agents.d.ts +0 -8
  63. package/dist/server/handlers/agents.d.ts.map +0 -1
  64. package/dist/server/handlers/client.d.ts +0 -7
  65. package/dist/server/handlers/client.d.ts.map +0 -1
  66. package/dist/server/handlers/error.d.ts +0 -7
  67. package/dist/server/handlers/error.d.ts.map +0 -1
  68. package/dist/server/handlers/logs.d.ts +0 -4
  69. package/dist/server/handlers/logs.d.ts.map +0 -1
  70. package/dist/server/handlers/memory.d.ts +0 -17
  71. package/dist/server/handlers/memory.d.ts.map +0 -1
  72. package/dist/server/handlers/root.d.ts +0 -3
  73. package/dist/server/handlers/root.d.ts.map +0 -1
  74. package/dist/server/handlers/syncs.d.ts +0 -3
  75. package/dist/server/handlers/syncs.d.ts.map +0 -1
  76. package/dist/server/handlers/tools.d.ts +0 -7
  77. package/dist/server/handlers/tools.d.ts.map +0 -1
  78. package/dist/server/handlers/utils.d.ts +0 -2
  79. package/dist/server/handlers/utils.d.ts.map +0 -1
  80. package/dist/server/handlers/workflows.d.ts +0 -11
  81. package/dist/server/handlers/workflows.d.ts.map +0 -1
  82. package/dist/server/index.d.ts.map +0 -1
  83. package/dist/server/types.d.ts +0 -5
  84. package/dist/server/types.d.ts.map +0 -1
  85. package/dist/server/welcome.d.ts +0 -2
  86. package/dist/server/welcome.d.ts.map +0 -1
  87. package/src/server/handlers/syncs.ts +0 -19
package/CHANGELOG.md CHANGED
@@ -1,5 +1,200 @@
1
1
  # @mastra/deployer
2
2
 
3
+ ## 0.1.0-alpha.33
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [7365b6c]
8
+ - @mastra/core@0.2.0-alpha.87
9
+
10
+ ## 0.1.0-alpha.32
11
+
12
+ ### Minor Changes
13
+
14
+ - 5916f9d: Update deps from fixed to ^
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [6fa4bd2]
19
+ - Updated dependencies [e2e76de]
20
+ - Updated dependencies [7f24c29]
21
+ - Updated dependencies [67637ba]
22
+ - Updated dependencies [04f3171]
23
+ - @mastra/core@0.2.0-alpha.86
24
+
25
+ ## 0.0.1-alpha.31
26
+
27
+ ### Patch Changes
28
+
29
+ - c5f2d50: Split deployer package
30
+ - Updated dependencies [e9d1b47]
31
+ - @mastra/core@0.2.0-alpha.85
32
+
33
+ ## 0.0.1-alpha.30
34
+
35
+ ### Patch Changes
36
+
37
+ - e27fe69: Add dir to deployer
38
+
39
+ ## 0.0.1-alpha.29
40
+
41
+ ### Patch Changes
42
+
43
+ - 0696eeb: Cleanup Mastra server
44
+ - 38b7f66: Update deployer logic
45
+ - Updated dependencies [2f17a5f]
46
+ - Updated dependencies [cb290ee]
47
+ - Updated dependencies [b4d7416]
48
+ - Updated dependencies [38b7f66]
49
+ - @mastra/core@0.2.0-alpha.84
50
+
51
+ ## 0.0.1-alpha.28
52
+
53
+ ### Patch Changes
54
+
55
+ - 2ab57d6: Fix: Workflows require a trigger schema otherwise it fails to run in dev
56
+ - 9625602: Use mastra core splitted bundles in other packages
57
+ - Updated dependencies [30322ce]
58
+ - Updated dependencies [78eec7c]
59
+ - Updated dependencies [9625602]
60
+ - Updated dependencies [8769a62]
61
+ - @mastra/core@0.2.0-alpha.83
62
+
63
+ ## 0.0.1-alpha.27
64
+
65
+ ### Patch Changes
66
+
67
+ - 73d112c: Core and deployer fixes
68
+ - ac8c61a: Mastra server vector operations
69
+ - Updated dependencies [73d112c]
70
+ - @mastra/core@0.1.27-alpha.82
71
+
72
+ ## 0.0.1-alpha.26
73
+
74
+ ### Patch Changes
75
+
76
+ - Updated dependencies [9fb3039]
77
+ - @mastra/core@0.1.27-alpha.81
78
+
79
+ ## 0.0.1-alpha.25
80
+
81
+ ### Patch Changes
82
+
83
+ - Updated dependencies [327ece7]
84
+ - @mastra/core@0.1.27-alpha.80
85
+
86
+ ## 0.0.1-alpha.24
87
+
88
+ ### Patch Changes
89
+
90
+ - Updated dependencies [21fe536]
91
+ - @mastra/core@0.1.27-alpha.79
92
+
93
+ ## 0.0.1-alpha.23
94
+
95
+ ### Patch Changes
96
+
97
+ - 88f18d7: Update cors support
98
+
99
+ ## 0.0.1-alpha.22
100
+
101
+ ### Patch Changes
102
+
103
+ - 685108a: Remove syncs and excess rag
104
+ - 685108a: Removing mastra syncs
105
+ - Updated dependencies [685108a]
106
+ - Updated dependencies [685108a]
107
+ - @mastra/core@0.1.27-alpha.78
108
+
109
+ ## 0.0.1-alpha.21
110
+
111
+ ### Patch Changes
112
+
113
+ - cfb966f: Deprecate @mastra/tts for mastra speech providers
114
+ - Updated dependencies [8105fae]
115
+ - @mastra/core@0.1.27-alpha.77
116
+
117
+ ## 0.0.1-alpha.20
118
+
119
+ ### Patch Changes
120
+
121
+ - ae7bf94: Fix loggers messing up deploys
122
+ - ae7bf94: Changeset
123
+ - Updated dependencies [ae7bf94]
124
+ - Updated dependencies [ae7bf94]
125
+ - @mastra/core@0.1.27-alpha.76
126
+
127
+ ## 0.0.1-alpha.19
128
+
129
+ ### Patch Changes
130
+
131
+ - 7064554: deployer fixes
132
+ - Updated dependencies [23dcb23]
133
+ - @mastra/core@0.1.27-alpha.75
134
+
135
+ ## 0.0.1-alpha.18
136
+
137
+ ### Patch Changes
138
+
139
+ - Updated dependencies [7b87567]
140
+ - @mastra/core@0.1.27-alpha.74
141
+
142
+ ## 0.0.1-alpha.17
143
+
144
+ ### Patch Changes
145
+
146
+ - Updated dependencies [3427b95]
147
+ - @mastra/core@0.1.27-alpha.73
148
+
149
+ ## 0.0.1-alpha.16
150
+
151
+ ### Patch Changes
152
+
153
+ - e4d4ede: Better setLogger()
154
+ - Updated dependencies [e4d4ede]
155
+ - Updated dependencies [06b2c0a]
156
+ - @mastra/core@0.1.27-alpha.72
157
+
158
+ ## 0.0.1-alpha.15
159
+
160
+ ### Patch Changes
161
+
162
+ - d9c8dd0: Logger changes for default transports
163
+ - Updated dependencies [d9c8dd0]
164
+ - @mastra/core@0.1.27-alpha.71
165
+
166
+ ## 0.0.1-alpha.14
167
+
168
+ ### Patch Changes
169
+
170
+ - ad2cd74: Deploy fix
171
+
172
+ ## 0.0.1-alpha.13
173
+
174
+ ### Patch Changes
175
+
176
+ - a1774e7: Improve bundling
177
+
178
+ ## 0.0.1-alpha.12
179
+
180
+ ### Patch Changes
181
+
182
+ - 28dceab: Catch apiKey error in dev
183
+
184
+ ## 0.0.1-alpha.11
185
+
186
+ ### Patch Changes
187
+
188
+ - bdaf834: publish packages
189
+
190
+ ## 0.0.1-alpha.10
191
+
192
+ ### Patch Changes
193
+
194
+ - Updated dependencies [dd6d87f]
195
+ - Updated dependencies [04434b6]
196
+ - @mastra/core@0.1.27-alpha.70
197
+
3
198
  ## 0.0.1-alpha.9
4
199
 
5
200
  ### Patch Changes
package/README.md ADDED
@@ -0,0 +1,159 @@
1
+ # @mastra/deployer
2
+
3
+ Core deployment infrastructure for Mastra applications, handling build, packaging, and deployment processes.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @mastra/deployer
9
+ ```
10
+
11
+ ## Overview
12
+
13
+ The `@mastra/deployer` package provides the foundational deployment infrastructure for Mastra applications. It handles:
14
+
15
+ - Project building and bundling
16
+ - Dependency management
17
+ - Environment configuration
18
+ - Development and production deployments
19
+
20
+ ## Usage
21
+
22
+ ```typescript
23
+ import { Deployer } from '@mastra/deployer';
24
+
25
+ // Create a deployer instance
26
+ const deployer = new Deployer({
27
+ dir: '/path/to/project',
28
+ type: 'Deploy', // or 'Dev' for development mode
29
+ });
30
+
31
+ // Install dependencies
32
+ await deployer.install();
33
+
34
+ // Write package.json
35
+ await deployer.writePackageJson();
36
+
37
+ // Get Mastra instance
38
+ const { mastra } = await deployer.getMastra();
39
+ ```
40
+
41
+ ## Configuration
42
+
43
+ ### Required Parameters
44
+
45
+ - `dir`: Project directory path
46
+ - `type`: Deployment type ('Deploy' or 'Dev')
47
+
48
+ ## Features
49
+
50
+ ### Project Structure Management
51
+
52
+ - Creates and manages `.mastra` directory
53
+ - Handles package.json generation and updates
54
+ - Manages project dependencies
55
+
56
+ ### Dependency Management
57
+
58
+ - Automatic dependency installation
59
+ - Workspace dependency resolution
60
+ - Version management for @mastra packages
61
+
62
+ ### Environment Handling
63
+
64
+ - Support for multiple environment files:
65
+ - `.env`
66
+ - `.env.development`
67
+ - `.env.local`
68
+ - Environment variable validation and processing
69
+
70
+ ### Build Process
71
+
72
+ - Project bundling
73
+ - Asset management
74
+ - Source code transformation
75
+
76
+ ### Development Support
77
+
78
+ - Development server configuration
79
+ - Hot reloading capabilities
80
+ - Debug logging
81
+
82
+ ## Project Structure
83
+
84
+ The deployer creates and manages the following structure:
85
+
86
+ ```
87
+ your-project/
88
+ ├── .mastra/
89
+ │ ├── package.json
90
+ │ ├── mastra.mjs
91
+ │ └── index.mjs
92
+ ├── .env
93
+ ├── .env.development
94
+ ├── .env.local
95
+ └── package.json
96
+ ```
97
+
98
+ ## Package.json Management
99
+
100
+ The deployer automatically manages dependencies in the `.mastra/package.json`:
101
+
102
+ ```json
103
+ {
104
+ "name": "server",
105
+ "version": "1.0.0",
106
+ "type": "module",
107
+ "dependencies": {
108
+ "@mastra/loggers": "latest",
109
+ "hono": "4.6.17",
110
+ "@hono/node-server": "^1.13.7",
111
+ "superjson": "^2.2.2",
112
+ "zod-to-json-schema": "^3.24.1"
113
+ }
114
+ }
115
+ ```
116
+
117
+ ## Methods
118
+
119
+ ### `install()`
120
+
121
+ Installs and updates project dependencies.
122
+
123
+ ### `writePackageJson()`
124
+
125
+ Generates or updates the package.json in the .mastra directory.
126
+
127
+ ### `getMastra()`
128
+
129
+ Returns the Mastra instance for the project.
130
+
131
+ ### `getMastraPath()`
132
+
133
+ Returns the path to the .mastra directory.
134
+
135
+ ## Error Handling
136
+
137
+ The deployer includes comprehensive error handling for:
138
+
139
+ - Dependency installation failures
140
+ - File system operations
141
+ - Environment configuration issues
142
+ - Build process errors
143
+
144
+ ## Logging
145
+
146
+ Built-in logging support through @mastra/core:
147
+
148
+ - Debug information
149
+ - Installation progress
150
+ - Build status
151
+ - Error reporting
152
+
153
+ ## Related Packages
154
+
155
+ - `@mastra/core`: Core Mastra functionality
156
+ - `@mastra/loggers`: Logging infrastructure
157
+ - Deployer implementations:
158
+ - `@mastra/deployer-cloudflare`
159
+ - Other platform-specific deployers
@@ -1,6 +1,57 @@
1
- export * from './fs.js';
2
- export * from './env.js';
3
- export * from './utils.js';
4
- export * from './bundle.js';
5
- export * from './deps.js';
6
- //# sourceMappingURL=index.d.ts.map
1
+ import * as rollup from 'rollup';
2
+ import { InputOptions, Plugin, InputOption } from 'rollup';
3
+ import { MastraBase } from '@mastra/core/base';
4
+
5
+ declare class Deps extends MastraBase {
6
+ private packageManager;
7
+ constructor();
8
+ private findLockFile;
9
+ private getPackageManager;
10
+ install({ dir, packages }: {
11
+ dir?: string;
12
+ packages?: string[];
13
+ }): Promise<unknown>;
14
+ installPackages(packages: string[]): Promise<unknown>;
15
+ checkDependencies(dependencies: string[]): Promise<string>;
16
+ getProjectName(): Promise<any>;
17
+ getPackageVersion(): Promise<string | undefined>;
18
+ addScriptsToPackageJson(scripts: Record<string, string>): Promise<void>;
19
+ }
20
+
21
+ type NormalizedInputOptions = Omit<Partial<InputOptions>, 'plugins' | 'input' | 'external'> & {
22
+ plugins?: Plugin[];
23
+ input: InputOption;
24
+ external?: (string | RegExp)[];
25
+ };
26
+ declare function getBundler(inputOptions: NormalizedInputOptions, args?: {
27
+ platform?: 'node' | 'browser';
28
+ dir?: string;
29
+ }): Promise<rollup.RollupBuild>;
30
+ declare function getWatcher(inputOptions: NormalizedInputOptions, args?: {
31
+ platform?: 'node' | 'browser';
32
+ dir?: string;
33
+ }): Promise<rollup.RollupWatcher>;
34
+
35
+ declare class FileService {
36
+ /**
37
+ *
38
+ * @param inputFile the file in the starter files directory to copy
39
+ * @param outputFilePath the destination path
40
+ * @param replaceIfExists flag to replace if it exists
41
+ * @returns
42
+ */
43
+ copyStarterFile(inputFile: string, outputFilePath: string, replaceIfExists?: boolean): Promise<boolean>;
44
+ setupEnvFile({ dbUrl }: {
45
+ dbUrl: string;
46
+ }): Promise<void>;
47
+ getFirstExistingFile(files: string[]): string;
48
+ replaceValuesInFile({ filePath, replacements, }: {
49
+ filePath: string;
50
+ replacements: {
51
+ search: string;
52
+ replace: string;
53
+ }[];
54
+ }): void;
55
+ }
56
+
57
+ export { Deps, FileService, getBundler, getWatcher };
@@ -0,0 +1 @@
1
+ export { Deps, FileService, getBundler, getWatcher } from '../chunk-PGK75D2J.js';