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

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 +188 -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,193 @@
1
1
  # @mastra/deployer
2
2
 
3
+ ## 0.1.0-alpha.32
4
+
5
+ ### Minor Changes
6
+
7
+ - 5916f9d: Update deps from fixed to ^
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [6fa4bd2]
12
+ - Updated dependencies [e2e76de]
13
+ - Updated dependencies [7f24c29]
14
+ - Updated dependencies [67637ba]
15
+ - Updated dependencies [04f3171]
16
+ - @mastra/core@0.2.0-alpha.86
17
+
18
+ ## 0.0.1-alpha.31
19
+
20
+ ### Patch Changes
21
+
22
+ - c5f2d50: Split deployer package
23
+ - Updated dependencies [e9d1b47]
24
+ - @mastra/core@0.2.0-alpha.85
25
+
26
+ ## 0.0.1-alpha.30
27
+
28
+ ### Patch Changes
29
+
30
+ - e27fe69: Add dir to deployer
31
+
32
+ ## 0.0.1-alpha.29
33
+
34
+ ### Patch Changes
35
+
36
+ - 0696eeb: Cleanup Mastra server
37
+ - 38b7f66: Update deployer logic
38
+ - Updated dependencies [2f17a5f]
39
+ - Updated dependencies [cb290ee]
40
+ - Updated dependencies [b4d7416]
41
+ - Updated dependencies [38b7f66]
42
+ - @mastra/core@0.2.0-alpha.84
43
+
44
+ ## 0.0.1-alpha.28
45
+
46
+ ### Patch Changes
47
+
48
+ - 2ab57d6: Fix: Workflows require a trigger schema otherwise it fails to run in dev
49
+ - 9625602: Use mastra core splitted bundles in other packages
50
+ - Updated dependencies [30322ce]
51
+ - Updated dependencies [78eec7c]
52
+ - Updated dependencies [9625602]
53
+ - Updated dependencies [8769a62]
54
+ - @mastra/core@0.2.0-alpha.83
55
+
56
+ ## 0.0.1-alpha.27
57
+
58
+ ### Patch Changes
59
+
60
+ - 73d112c: Core and deployer fixes
61
+ - ac8c61a: Mastra server vector operations
62
+ - Updated dependencies [73d112c]
63
+ - @mastra/core@0.1.27-alpha.82
64
+
65
+ ## 0.0.1-alpha.26
66
+
67
+ ### Patch Changes
68
+
69
+ - Updated dependencies [9fb3039]
70
+ - @mastra/core@0.1.27-alpha.81
71
+
72
+ ## 0.0.1-alpha.25
73
+
74
+ ### Patch Changes
75
+
76
+ - Updated dependencies [327ece7]
77
+ - @mastra/core@0.1.27-alpha.80
78
+
79
+ ## 0.0.1-alpha.24
80
+
81
+ ### Patch Changes
82
+
83
+ - Updated dependencies [21fe536]
84
+ - @mastra/core@0.1.27-alpha.79
85
+
86
+ ## 0.0.1-alpha.23
87
+
88
+ ### Patch Changes
89
+
90
+ - 88f18d7: Update cors support
91
+
92
+ ## 0.0.1-alpha.22
93
+
94
+ ### Patch Changes
95
+
96
+ - 685108a: Remove syncs and excess rag
97
+ - 685108a: Removing mastra syncs
98
+ - Updated dependencies [685108a]
99
+ - Updated dependencies [685108a]
100
+ - @mastra/core@0.1.27-alpha.78
101
+
102
+ ## 0.0.1-alpha.21
103
+
104
+ ### Patch Changes
105
+
106
+ - cfb966f: Deprecate @mastra/tts for mastra speech providers
107
+ - Updated dependencies [8105fae]
108
+ - @mastra/core@0.1.27-alpha.77
109
+
110
+ ## 0.0.1-alpha.20
111
+
112
+ ### Patch Changes
113
+
114
+ - ae7bf94: Fix loggers messing up deploys
115
+ - ae7bf94: Changeset
116
+ - Updated dependencies [ae7bf94]
117
+ - Updated dependencies [ae7bf94]
118
+ - @mastra/core@0.1.27-alpha.76
119
+
120
+ ## 0.0.1-alpha.19
121
+
122
+ ### Patch Changes
123
+
124
+ - 7064554: deployer fixes
125
+ - Updated dependencies [23dcb23]
126
+ - @mastra/core@0.1.27-alpha.75
127
+
128
+ ## 0.0.1-alpha.18
129
+
130
+ ### Patch Changes
131
+
132
+ - Updated dependencies [7b87567]
133
+ - @mastra/core@0.1.27-alpha.74
134
+
135
+ ## 0.0.1-alpha.17
136
+
137
+ ### Patch Changes
138
+
139
+ - Updated dependencies [3427b95]
140
+ - @mastra/core@0.1.27-alpha.73
141
+
142
+ ## 0.0.1-alpha.16
143
+
144
+ ### Patch Changes
145
+
146
+ - e4d4ede: Better setLogger()
147
+ - Updated dependencies [e4d4ede]
148
+ - Updated dependencies [06b2c0a]
149
+ - @mastra/core@0.1.27-alpha.72
150
+
151
+ ## 0.0.1-alpha.15
152
+
153
+ ### Patch Changes
154
+
155
+ - d9c8dd0: Logger changes for default transports
156
+ - Updated dependencies [d9c8dd0]
157
+ - @mastra/core@0.1.27-alpha.71
158
+
159
+ ## 0.0.1-alpha.14
160
+
161
+ ### Patch Changes
162
+
163
+ - ad2cd74: Deploy fix
164
+
165
+ ## 0.0.1-alpha.13
166
+
167
+ ### Patch Changes
168
+
169
+ - a1774e7: Improve bundling
170
+
171
+ ## 0.0.1-alpha.12
172
+
173
+ ### Patch Changes
174
+
175
+ - 28dceab: Catch apiKey error in dev
176
+
177
+ ## 0.0.1-alpha.11
178
+
179
+ ### Patch Changes
180
+
181
+ - bdaf834: publish packages
182
+
183
+ ## 0.0.1-alpha.10
184
+
185
+ ### Patch Changes
186
+
187
+ - Updated dependencies [dd6d87f]
188
+ - Updated dependencies [04434b6]
189
+ - @mastra/core@0.1.27-alpha.70
190
+
3
191
  ## 0.0.1-alpha.9
4
192
 
5
193
  ### 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';