@mastra/deployer 0.0.1-alpha.20 → 0.0.1-alpha.22
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.
- package/CHANGELOG.md +18 -0
- package/README.md +159 -0
- package/dist/index.js +22 -2
- package/dist/server/index.js +0 -51
- package/package.json +2 -2
- package/src/build/bundle.ts +24 -1
- package/src/server/index.ts +0 -40
- package/vitest.config.ts +1 -1
- package/src/server/handlers/syncs.ts +0 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @mastra/deployer
|
|
2
2
|
|
|
3
|
+
## 0.0.1-alpha.22
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 685108a: Remove syncs and excess rag
|
|
8
|
+
- 685108a: Removing mastra syncs
|
|
9
|
+
- Updated dependencies [685108a]
|
|
10
|
+
- Updated dependencies [685108a]
|
|
11
|
+
- @mastra/core@0.1.27-alpha.78
|
|
12
|
+
|
|
13
|
+
## 0.0.1-alpha.21
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- cfb966f: Deprecate @mastra/tts for mastra speech providers
|
|
18
|
+
- Updated dependencies [8105fae]
|
|
19
|
+
- @mastra/core@0.1.27-alpha.77
|
|
20
|
+
|
|
3
21
|
## 0.0.1-alpha.20
|
|
4
22
|
|
|
5
23
|
### 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
|
package/dist/index.js
CHANGED
|
@@ -248,14 +248,34 @@ var bundleStep = new Step({
|
|
|
248
248
|
"@mastra/rag",
|
|
249
249
|
"@mastra/evals",
|
|
250
250
|
"@mastra/mcp",
|
|
251
|
-
"@mastra/tts",
|
|
252
251
|
"@mastra/firecrawl",
|
|
253
252
|
"@mastra/github",
|
|
254
253
|
"@mastra/stabilityai",
|
|
254
|
+
// Your deployer packages
|
|
255
255
|
"@mastra/deployer",
|
|
256
256
|
"@mastra/deployer-cloudflare",
|
|
257
257
|
"@mastra/deployer-netlify",
|
|
258
|
-
"@mastra/deployer-vercel"
|
|
258
|
+
"@mastra/deployer-vercel",
|
|
259
|
+
// Your speech packages
|
|
260
|
+
"@mastra/speech-elevenlabs",
|
|
261
|
+
"@mastra/speech-openai",
|
|
262
|
+
"@mastra/speech-playai",
|
|
263
|
+
"@mastra/speech-azure",
|
|
264
|
+
"@mastra/speech-deepgram",
|
|
265
|
+
"@mastra/speech-google",
|
|
266
|
+
"@mastra/speech-ibm",
|
|
267
|
+
"@mastra/speech-murf",
|
|
268
|
+
"@mastra/speech-speechify",
|
|
269
|
+
"@mastra/speech-replicate",
|
|
270
|
+
// Your vector store packages
|
|
271
|
+
"@mastra/vector-astra",
|
|
272
|
+
"@mastra/vector-chroma",
|
|
273
|
+
"@mastra/vector-libsql",
|
|
274
|
+
"@mastra/vector-pg",
|
|
275
|
+
"@mastra/vector-pinecone",
|
|
276
|
+
"@mastra/vector-qdrant",
|
|
277
|
+
"@mastra/vector-upstash",
|
|
278
|
+
"@mastra/vector-vectorize"
|
|
259
279
|
],
|
|
260
280
|
plugins
|
|
261
281
|
};
|
package/dist/server/index.js
CHANGED
|
@@ -8988,20 +8988,6 @@ async function rootHandler(c2) {
|
|
|
8988
8988
|
return c2.text("Hello to the Mastra API!");
|
|
8989
8989
|
}
|
|
8990
8990
|
|
|
8991
|
-
// src/server/handlers/syncs.ts
|
|
8992
|
-
async function executeSyncHandler(c2) {
|
|
8993
|
-
try {
|
|
8994
|
-
const mastra = c2.get("mastra");
|
|
8995
|
-
const syncId = c2.req.param("syncId");
|
|
8996
|
-
const { runId, params: syncParams } = await c2.req.json();
|
|
8997
|
-
validateBody({ params: syncParams });
|
|
8998
|
-
const result = await mastra.sync(syncId, syncParams, runId);
|
|
8999
|
-
return c2.json(result);
|
|
9000
|
-
} catch (error) {
|
|
9001
|
-
return handleError(error, "Error executing sync");
|
|
9002
|
-
}
|
|
9003
|
-
}
|
|
9004
|
-
|
|
9005
8991
|
// src/server/handlers/tools.ts
|
|
9006
8992
|
async function getToolsHandler(c2) {
|
|
9007
8993
|
try {
|
|
@@ -9826,43 +9812,6 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
9826
9812
|
}),
|
|
9827
9813
|
executeWorkflowHandler
|
|
9828
9814
|
);
|
|
9829
|
-
app.post(
|
|
9830
|
-
"/api/syncs/:syncId/execute",
|
|
9831
|
-
n({
|
|
9832
|
-
description: "Execute a sync",
|
|
9833
|
-
tags: ["syncs"],
|
|
9834
|
-
parameters: [
|
|
9835
|
-
{
|
|
9836
|
-
name: "syncId",
|
|
9837
|
-
in: "path",
|
|
9838
|
-
required: true,
|
|
9839
|
-
schema: { type: "string" }
|
|
9840
|
-
}
|
|
9841
|
-
],
|
|
9842
|
-
requestBody: {
|
|
9843
|
-
required: true,
|
|
9844
|
-
content: {
|
|
9845
|
-
"application/json": {
|
|
9846
|
-
schema: {
|
|
9847
|
-
type: "object",
|
|
9848
|
-
properties: {
|
|
9849
|
-
input: { type: "object" }
|
|
9850
|
-
}
|
|
9851
|
-
}
|
|
9852
|
-
}
|
|
9853
|
-
}
|
|
9854
|
-
},
|
|
9855
|
-
responses: {
|
|
9856
|
-
200: {
|
|
9857
|
-
description: "Sync execution result"
|
|
9858
|
-
},
|
|
9859
|
-
404: {
|
|
9860
|
-
description: "Sync not found"
|
|
9861
|
-
}
|
|
9862
|
-
}
|
|
9863
|
-
}),
|
|
9864
|
-
executeSyncHandler
|
|
9865
|
-
);
|
|
9866
9815
|
app.get(
|
|
9867
9816
|
"/api/logs",
|
|
9868
9817
|
n({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/deployer",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.22",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"esbuild": "^0.24.2",
|
|
26
26
|
"fs-extra": "^11.2.0",
|
|
27
27
|
"zod": "^3.24.1",
|
|
28
|
-
"@mastra/core": "0.1.27-alpha.
|
|
28
|
+
"@mastra/core": "0.1.27-alpha.78"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@hono/node-server": "^1.13.7",
|
package/src/build/bundle.ts
CHANGED
|
@@ -140,14 +140,37 @@ const bundleStep = new Step({
|
|
|
140
140
|
'@mastra/rag',
|
|
141
141
|
'@mastra/evals',
|
|
142
142
|
'@mastra/mcp',
|
|
143
|
-
'@mastra/tts',
|
|
144
143
|
'@mastra/firecrawl',
|
|
145
144
|
'@mastra/github',
|
|
146
145
|
'@mastra/stabilityai',
|
|
146
|
+
|
|
147
|
+
// Your deployer packages
|
|
147
148
|
'@mastra/deployer',
|
|
148
149
|
'@mastra/deployer-cloudflare',
|
|
149
150
|
'@mastra/deployer-netlify',
|
|
150
151
|
'@mastra/deployer-vercel',
|
|
152
|
+
|
|
153
|
+
// Your speech packages
|
|
154
|
+
'@mastra/speech-elevenlabs',
|
|
155
|
+
'@mastra/speech-openai',
|
|
156
|
+
'@mastra/speech-playai',
|
|
157
|
+
'@mastra/speech-azure',
|
|
158
|
+
'@mastra/speech-deepgram',
|
|
159
|
+
'@mastra/speech-google',
|
|
160
|
+
'@mastra/speech-ibm',
|
|
161
|
+
'@mastra/speech-murf',
|
|
162
|
+
'@mastra/speech-speechify',
|
|
163
|
+
'@mastra/speech-replicate',
|
|
164
|
+
|
|
165
|
+
// Your vector store packages
|
|
166
|
+
'@mastra/vector-astra',
|
|
167
|
+
'@mastra/vector-chroma',
|
|
168
|
+
'@mastra/vector-libsql',
|
|
169
|
+
'@mastra/vector-pg',
|
|
170
|
+
'@mastra/vector-pinecone',
|
|
171
|
+
'@mastra/vector-qdrant',
|
|
172
|
+
'@mastra/vector-upstash',
|
|
173
|
+
'@mastra/vector-vectorize',
|
|
151
174
|
],
|
|
152
175
|
plugins,
|
|
153
176
|
};
|
package/src/server/index.ts
CHANGED
|
@@ -34,7 +34,6 @@ import {
|
|
|
34
34
|
updateThreadHandler,
|
|
35
35
|
} from './handlers/memory.js';
|
|
36
36
|
import { rootHandler } from './handlers/root.js';
|
|
37
|
-
import { executeSyncHandler } from './handlers/syncs.js';
|
|
38
37
|
import {
|
|
39
38
|
executeAgentToolHandler,
|
|
40
39
|
executeToolHandler,
|
|
@@ -648,45 +647,6 @@ export async function createHonoServer(
|
|
|
648
647
|
executeWorkflowHandler,
|
|
649
648
|
);
|
|
650
649
|
|
|
651
|
-
// Sync routes
|
|
652
|
-
app.post(
|
|
653
|
-
'/api/syncs/:syncId/execute',
|
|
654
|
-
describeRoute({
|
|
655
|
-
description: 'Execute a sync',
|
|
656
|
-
tags: ['syncs'],
|
|
657
|
-
parameters: [
|
|
658
|
-
{
|
|
659
|
-
name: 'syncId',
|
|
660
|
-
in: 'path',
|
|
661
|
-
required: true,
|
|
662
|
-
schema: { type: 'string' },
|
|
663
|
-
},
|
|
664
|
-
],
|
|
665
|
-
requestBody: {
|
|
666
|
-
required: true,
|
|
667
|
-
content: {
|
|
668
|
-
'application/json': {
|
|
669
|
-
schema: {
|
|
670
|
-
type: 'object',
|
|
671
|
-
properties: {
|
|
672
|
-
input: { type: 'object' },
|
|
673
|
-
},
|
|
674
|
-
},
|
|
675
|
-
},
|
|
676
|
-
},
|
|
677
|
-
},
|
|
678
|
-
responses: {
|
|
679
|
-
200: {
|
|
680
|
-
description: 'Sync execution result',
|
|
681
|
-
},
|
|
682
|
-
404: {
|
|
683
|
-
description: 'Sync not found',
|
|
684
|
-
},
|
|
685
|
-
},
|
|
686
|
-
}),
|
|
687
|
-
executeSyncHandler,
|
|
688
|
-
);
|
|
689
|
-
|
|
690
650
|
// Log routes
|
|
691
651
|
app.get(
|
|
692
652
|
'/api/logs',
|
package/vitest.config.ts
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Context } from 'hono';
|
|
2
|
-
|
|
3
|
-
import { handleError } from './error';
|
|
4
|
-
import { validateBody } from './utils';
|
|
5
|
-
|
|
6
|
-
export async function executeSyncHandler(c: Context) {
|
|
7
|
-
try {
|
|
8
|
-
const mastra = c.get('mastra');
|
|
9
|
-
const syncId = c.req.param('syncId');
|
|
10
|
-
const { runId, params: syncParams } = await c.req.json();
|
|
11
|
-
|
|
12
|
-
validateBody({ params: syncParams });
|
|
13
|
-
|
|
14
|
-
const result = await mastra.sync(syncId, syncParams, runId);
|
|
15
|
-
return c.json(result);
|
|
16
|
-
} catch (error) {
|
|
17
|
-
return handleError(error, 'Error executing sync');
|
|
18
|
-
}
|
|
19
|
-
}
|