@mastra/deployer 0.17.0-alpha.8 → 0.17.1-alpha.0
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 +102 -0
- package/dist/server/handlers/routes/workflows/handlers.d.ts +1 -0
- package/dist/server/handlers/routes/workflows/handlers.d.ts.map +1 -1
- package/dist/server/handlers/routes/workflows/router.d.ts.map +1 -1
- package/dist/server/index.cjs +89 -1
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +90 -2
- package/dist/server/index.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,107 @@
|
|
|
1
1
|
# @mastra/deployer
|
|
2
2
|
|
|
3
|
+
## 0.17.1-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix workflow resuming issue in the playground ([#7988](https://github.com/mastra-ai/mastra/pull/7988))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`fd00e63`](https://github.com/mastra-ai/mastra/commit/fd00e63759cbcca3473c40cac9843280b0557cff), [`ab610f6`](https://github.com/mastra-ai/mastra/commit/ab610f6f41dbfe6c9502368671485ca7a0aac09b), [`e6bda5f`](https://github.com/mastra-ai/mastra/commit/e6bda5f954ee8493ea18adc1a883f0a5b785ad9b)]:
|
|
10
|
+
- @mastra/core@0.17.1-alpha.0
|
|
11
|
+
- @mastra/server@0.17.1-alpha.0
|
|
12
|
+
|
|
13
|
+
## 0.17.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- Remove original AgentNetwork ([#7919](https://github.com/mastra-ai/mastra/pull/7919))
|
|
18
|
+
|
|
19
|
+
- The `IBundler` and subsequently the `IDeployer` interface changed, making the third argument of `bundle()` an object. ([#7619](https://github.com/mastra-ai/mastra/pull/7619))
|
|
20
|
+
|
|
21
|
+
```diff
|
|
22
|
+
- bundle(entryFile: string, outputDirectory: string, toolsPaths: (string | string[])[]): Promise<void>;
|
|
23
|
+
+ bundle(entryFile: string, outputDirectory: string, options: { toolsPaths: (string | string[])[]; projectRoot: string }): Promise<void>;
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
If you're just using the deployer inside `src/mastra/index.ts` you're safe to upgrade, no changes needed.
|
|
27
|
+
|
|
28
|
+
- Improved workspace dependency resolution during development and builds. This makes the build process more reliable when working with monorepos and workspace packages, reducing potential bundling errors and improving development experience. ([#7619](https://github.com/mastra-ai/mastra/pull/7619))
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- dependencies updates: ([#6887](https://github.com/mastra-ai/mastra/pull/6887))
|
|
33
|
+
- Updated dependency [`@babel/core@^7.28.4` ↗︎](https://www.npmjs.com/package/@babel/core/v/7.28.4) (from `^7.28.0`, in `dependencies`)
|
|
34
|
+
|
|
35
|
+
- dependencies updates: ([#7538](https://github.com/mastra-ai/mastra/pull/7538))
|
|
36
|
+
- Updated dependency [`esbuild@^0.25.9` ↗︎](https://www.npmjs.com/package/esbuild/v/0.25.9) (from `^0.25.8`, in `dependencies`)
|
|
37
|
+
|
|
38
|
+
- dependencies updates: ([#7803](https://github.com/mastra-ai/mastra/pull/7803))
|
|
39
|
+
- Updated dependency [`rollup@~4.50.1` ↗︎](https://www.npmjs.com/package/rollup/v/4.50.1) (from `~4.50.0`, in `dependencies`)
|
|
40
|
+
|
|
41
|
+
- dependencies updates: ([#7861](https://github.com/mastra-ai/mastra/pull/7861))
|
|
42
|
+
- Updated dependency [`hono@^4.9.7` ↗︎](https://www.npmjs.com/package/hono/v/4.9.7) (from `^4.9.6`, in `dependencies`)
|
|
43
|
+
|
|
44
|
+
- clean up console logs in monorepo ([#7926](https://github.com/mastra-ai/mastra/pull/7926))
|
|
45
|
+
|
|
46
|
+
- feat: add requiresAuth option for custom API routes ([#7703](https://github.com/mastra-ai/mastra/pull/7703))
|
|
47
|
+
|
|
48
|
+
Added a new `requiresAuth` option to the `ApiRoute` type that allows users to explicitly control authentication requirements for custom endpoints.
|
|
49
|
+
- By default, all custom routes require authentication (`requiresAuth: true`)
|
|
50
|
+
- Set `requiresAuth: false` to make a route publicly accessible without authentication
|
|
51
|
+
- The auth middleware now checks this configuration before applying authentication
|
|
52
|
+
|
|
53
|
+
Example usage:
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
const customRoutes: ApiRoute[] = [
|
|
57
|
+
{
|
|
58
|
+
path: '/api/public-endpoint',
|
|
59
|
+
method: 'GET',
|
|
60
|
+
requiresAuth: false, // No authentication required
|
|
61
|
+
handler: async c => c.json({ message: 'Public access' }),
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
path: '/api/protected-endpoint',
|
|
65
|
+
method: 'GET',
|
|
66
|
+
requiresAuth: true, // Authentication required (default)
|
|
67
|
+
handler: async c => c.json({ message: 'Protected access' }),
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
This addresses issue #7674 where custom endpoints were not being protected by the authentication system.
|
|
73
|
+
|
|
74
|
+
- Improve default /api route by giving helpful information ([#7826](https://github.com/mastra-ai/mastra/pull/7826))
|
|
75
|
+
|
|
76
|
+
- Resumable streams ([#7949](https://github.com/mastra-ai/mastra/pull/7949))
|
|
77
|
+
|
|
78
|
+
- Add support for running the Mastra dev server over HTTPS for local development. ([#7871](https://github.com/mastra-ai/mastra/pull/7871))
|
|
79
|
+
- Add `--https` flag for `mastra dev`. This automatically creates a local key and certificate for you.
|
|
80
|
+
- Alternatively, you can provide your own key and cert through `server.https`:
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
// src/mastra/index.ts
|
|
84
|
+
import { Mastra } from '@mastra/core/mastra';
|
|
85
|
+
import fs from 'node:fs';
|
|
86
|
+
|
|
87
|
+
export const mastra = new Mastra({
|
|
88
|
+
server: {
|
|
89
|
+
https: {
|
|
90
|
+
key: fs.readFileSync('path/to/key.pem'),
|
|
91
|
+
cert: fs.readFileSync('path/to/cert.pem'),
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
- Fix watcher by using main mastra instead of analzyed one ([#7952](https://github.com/mastra-ai/mastra/pull/7952))
|
|
98
|
+
|
|
99
|
+
- Playground ui -pass runtimeContext to client SDK get methods ([#7767](https://github.com/mastra-ai/mastra/pull/7767))
|
|
100
|
+
|
|
101
|
+
- Updated dependencies [[`197cbb2`](https://github.com/mastra-ai/mastra/commit/197cbb248fc8cb4bbf61bf70b770f1388b445df2), [`a1bb887`](https://github.com/mastra-ai/mastra/commit/a1bb887e8bfae44230f487648da72e96ef824561), [`6590763`](https://github.com/mastra-ai/mastra/commit/65907630ef4bf4127067cecd1cb21b56f55d5f1b), [`fb84c21`](https://github.com/mastra-ai/mastra/commit/fb84c21859d09bdc8f158bd5412bdc4b5835a61c), [`3779975`](https://github.com/mastra-ai/mastra/commit/3779975a1ea301c9077ea2d595e5506699c900a6), [`5802bf5`](https://github.com/mastra-ai/mastra/commit/5802bf57f6182e4b67c28d7d91abed349a8d14f3), [`5bda53a`](https://github.com/mastra-ai/mastra/commit/5bda53a9747bfa7d876d754fc92c83a06e503f62), [`c2eade3`](https://github.com/mastra-ai/mastra/commit/c2eade3508ef309662f065e5f340d7840295dd53), [`f26a8fd`](https://github.com/mastra-ai/mastra/commit/f26a8fd99fcb0497a5d86c28324430d7f6a5fb83), [`8a3f5e4`](https://github.com/mastra-ai/mastra/commit/8a3f5e4212ec36b302957deb4bd47005ab598382), [`222965a`](https://github.com/mastra-ai/mastra/commit/222965a98ce8197b86673ec594244650b5960257), [`6047778`](https://github.com/mastra-ai/mastra/commit/6047778e501df460648f31decddf8e443f36e373), [`a0f5f1c`](https://github.com/mastra-ai/mastra/commit/a0f5f1ca39c3c5c6d26202e9fcab986b4fe14568), [`9d4fc09`](https://github.com/mastra-ai/mastra/commit/9d4fc09b2ad55caa7738c7ceb3a905e454f74cdd), [`05c7abf`](https://github.com/mastra-ai/mastra/commit/05c7abfe105a015b7760c9bf33ff4419727502a0), [`0324ceb`](https://github.com/mastra-ai/mastra/commit/0324ceb8af9d16c12a531f90e575f6aab797ac81), [`d75ccf0`](https://github.com/mastra-ai/mastra/commit/d75ccf06dfd2582b916aa12624e3cd61b279edf1), [`0f9d227`](https://github.com/mastra-ai/mastra/commit/0f9d227890a98db33865abbea39daf407cd55ef7), [`b356f5f`](https://github.com/mastra-ai/mastra/commit/b356f5f7566cb3edb755d91f00b72fc1420b2a37), [`de056a0`](https://github.com/mastra-ai/mastra/commit/de056a02cbb43f6aa0380ab2150ea404af9ec0dd), [`f5ce05f`](https://github.com/mastra-ai/mastra/commit/f5ce05f831d42c69559bf4c0fdb46ccb920fc3a3), [`b6688b7`](https://github.com/mastra-ai/mastra/commit/b6688b75e49a4286d612aa2098e39c6118db2d07), [`60c9cec`](https://github.com/mastra-ai/mastra/commit/60c9cec7048a79a87440f7840c383875bd710d93), [`c93532a`](https://github.com/mastra-ai/mastra/commit/c93532a340b80e4dd946d4c138d9381de5f70399), [`6cb1fcb`](https://github.com/mastra-ai/mastra/commit/6cb1fcbc8d0378ffed0d17784c96e68f30cb0272), [`aee4f00`](https://github.com/mastra-ai/mastra/commit/aee4f00e61e1a42e81a6d74ff149dbe69e32695a), [`9f6f30f`](https://github.com/mastra-ai/mastra/commit/9f6f30f04ec6648bbca798ea8aad59317c40d8db), [`547c621`](https://github.com/mastra-ai/mastra/commit/547c62104af3f7a551b3754e9cbdf0a3fbba15e4), [`897995e`](https://github.com/mastra-ai/mastra/commit/897995e630d572fe2891e7ede817938cabb43251), [`0fed8f2`](https://github.com/mastra-ai/mastra/commit/0fed8f2aa84b167b3415ea6f8f70755775132c8d), [`4f9ea8c`](https://github.com/mastra-ai/mastra/commit/4f9ea8c95ea74ba9abbf3b2ab6106c7d7bc45689), [`c4dbd12`](https://github.com/mastra-ai/mastra/commit/c4dbd12a05e75db124c5d8abff3d893ea1b88c30), [`1a1fbe6`](https://github.com/mastra-ai/mastra/commit/1a1fbe66efb7d94abc373ed0dd9676adb8122454), [`d706fad`](https://github.com/mastra-ai/mastra/commit/d706fad6e6e4b72357b18d229ba38e6c913c0e70), [`87fd07f`](https://github.com/mastra-ai/mastra/commit/87fd07ff35387a38728967163460231b5d33ae3b), [`5c3768f`](https://github.com/mastra-ai/mastra/commit/5c3768fa959454232ad76715c381f4aac00c6881), [`2685a78`](https://github.com/mastra-ai/mastra/commit/2685a78f224b8b04e20d4fab5ac1adb638190071), [`36f39c0`](https://github.com/mastra-ai/mastra/commit/36f39c00dc794952dc3c11aab91c2fa8bca74b11), [`239b5a4`](https://github.com/mastra-ai/mastra/commit/239b5a497aeae2e8b4d764f46217cfff2284788e), [`8a3f5e4`](https://github.com/mastra-ai/mastra/commit/8a3f5e4212ec36b302957deb4bd47005ab598382)]:
|
|
102
|
+
- @mastra/core@0.17.0
|
|
103
|
+
- @mastra/server@0.17.0
|
|
104
|
+
|
|
3
105
|
## 0.17.0-alpha.8
|
|
4
106
|
|
|
5
107
|
### Patch Changes
|
|
@@ -8,6 +8,7 @@ export declare function watchWorkflowHandler(c: Context): Response | Promise<Res
|
|
|
8
8
|
export declare function streamWorkflowHandler(c: Context): Promise<Response>;
|
|
9
9
|
export declare function observeStreamWorkflowHandler(c: Context): Promise<Response>;
|
|
10
10
|
export declare function streamVNextWorkflowHandler(c: Context): Promise<Response>;
|
|
11
|
+
export declare function resumeStreamWorkflowHandler(c: Context): Promise<Response>;
|
|
11
12
|
export declare function resumeAsyncWorkflowHandler(c: Context): Promise<Response>;
|
|
12
13
|
export declare function resumeWorkflowHandler(c: Context): Promise<Response>;
|
|
13
14
|
export declare function getWorkflowRunsHandler(c: Context): Promise<Response>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../../../src/server/handlers/routes/workflows/handlers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../../../src/server/handlers/routes/workflows/handlers.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAMpC,wBAAsB,mBAAmB,CAAC,CAAC,EAAE,OAAO,qBAYnD;AAED,wBAAsB,sBAAsB,CAAC,CAAC,EAAE,OAAO,qBActD;AAED,wBAAsB,wBAAwB,CAAC,CAAC,EAAE,OAAO,qBAgBxD;AAED,wBAAsB,yBAAyB,CAAC,CAAC,EAAE,OAAO,qBAoBzD;AAED,wBAAsB,uBAAuB,CAAC,CAAC,EAAE,OAAO,qBAoBvD;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,gCA4C9C;AAED,wBAAsB,qBAAqB,CAAC,CAAC,EAAE,OAAO,qBA6CrD;AAED,wBAAsB,4BAA4B,CAAC,CAAC,EAAE,OAAO,qBA6C5D;AAED,wBAAsB,0BAA0B,CAAC,CAAC,EAAE,OAAO,qBA6C1D;AAED,wBAAsB,2BAA2B,CAAC,CAAC,EAAE,OAAO,qBA4C3D;AAED,wBAAsB,0BAA0B,CAAC,CAAC,EAAE,OAAO,qBAwB1D;AAED,wBAAsB,qBAAqB,CAAC,CAAC,EAAE,OAAO,qBAwBrD;AAED,wBAAsB,sBAAsB,CAAC,CAAC,EAAE,OAAO,qBAmBtD;AAED,wBAAsB,yBAAyB,CAAC,CAAC,EAAE,OAAO,qBAezD;AAED,wBAAsB,oCAAoC,CAAC,CAAC,EAAE,OAAO,qBAepE;AAED,wBAAsB,wBAAwB,CAAC,CAAC,EAAE,OAAO,qBAgBxD;AAED,wBAAsB,2BAA2B,CAAC,CAAC,EAAE,OAAO,qBAmB3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/server/handlers/routes/workflows/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/server/handlers/routes/workflows/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAgCvD,wBAAgB,eAAe,CAAC,gBAAgB,EAAE,gBAAgB,8EAq4BjE"}
|
package/dist/server/index.cjs
CHANGED
|
@@ -9743,7 +9743,7 @@ async function streamVNextWorkflowHandler(c2) {
|
|
|
9743
9743
|
const runtimeContext = c2.get("runtimeContext");
|
|
9744
9744
|
const logger2 = mastra.getLogger();
|
|
9745
9745
|
const workflowId = c2.req.param("workflowId");
|
|
9746
|
-
const { inputData } = await c2.req.json();
|
|
9746
|
+
const { inputData, closeOnSuspend } = await c2.req.json();
|
|
9747
9747
|
const runId = c2.req.query("runId");
|
|
9748
9748
|
c2.header("Transfer-Encoding", "chunked");
|
|
9749
9749
|
return streaming.stream(
|
|
@@ -9755,6 +9755,47 @@ async function streamVNextWorkflowHandler(c2) {
|
|
|
9755
9755
|
workflowId,
|
|
9756
9756
|
runId,
|
|
9757
9757
|
inputData,
|
|
9758
|
+
runtimeContext,
|
|
9759
|
+
closeOnSuspend
|
|
9760
|
+
});
|
|
9761
|
+
const reader = result.getReader();
|
|
9762
|
+
stream7.onAbort(() => {
|
|
9763
|
+
void reader.cancel("request aborted");
|
|
9764
|
+
});
|
|
9765
|
+
let chunkResult;
|
|
9766
|
+
while ((chunkResult = await reader.read()) && !chunkResult.done) {
|
|
9767
|
+
await stream7.write(JSON.stringify(chunkResult.value) + "");
|
|
9768
|
+
}
|
|
9769
|
+
} catch (err) {
|
|
9770
|
+
logger2.error("Error in workflow VNext stream: " + (err?.message ?? "Unknown error"));
|
|
9771
|
+
}
|
|
9772
|
+
},
|
|
9773
|
+
async (err) => {
|
|
9774
|
+
logger2.error("Error in workflow VNext stream: " + err?.message);
|
|
9775
|
+
}
|
|
9776
|
+
);
|
|
9777
|
+
} catch (error) {
|
|
9778
|
+
return handleError(error, "Error streaming workflow");
|
|
9779
|
+
}
|
|
9780
|
+
}
|
|
9781
|
+
async function resumeStreamWorkflowHandler(c2) {
|
|
9782
|
+
try {
|
|
9783
|
+
const mastra = c2.get("mastra");
|
|
9784
|
+
const runtimeContext = c2.get("runtimeContext");
|
|
9785
|
+
const logger2 = mastra.getLogger();
|
|
9786
|
+
const workflowId = c2.req.param("workflowId");
|
|
9787
|
+
const { step, resumeData } = await c2.req.json();
|
|
9788
|
+
const runId = c2.req.query("runId");
|
|
9789
|
+
c2.header("Transfer-Encoding", "chunked");
|
|
9790
|
+
return streaming.stream(
|
|
9791
|
+
c2,
|
|
9792
|
+
async (stream7) => {
|
|
9793
|
+
try {
|
|
9794
|
+
const result = await workflows.resumeStreamWorkflowHandler({
|
|
9795
|
+
mastra,
|
|
9796
|
+
workflowId,
|
|
9797
|
+
runId,
|
|
9798
|
+
body: { step, resumeData },
|
|
9758
9799
|
runtimeContext
|
|
9759
9800
|
});
|
|
9760
9801
|
const reader = result.getReader();
|
|
@@ -10528,6 +10569,49 @@ function workflowsRouter(bodyLimitOptions) {
|
|
|
10528
10569
|
}),
|
|
10529
10570
|
resumeWorkflowHandler
|
|
10530
10571
|
);
|
|
10572
|
+
router.post(
|
|
10573
|
+
"/:workflowId/resume-stream",
|
|
10574
|
+
w({
|
|
10575
|
+
description: "Resume a suspended workflow that uses streamVNext",
|
|
10576
|
+
tags: ["workflows"],
|
|
10577
|
+
parameters: [
|
|
10578
|
+
{
|
|
10579
|
+
name: "workflowId",
|
|
10580
|
+
in: "path",
|
|
10581
|
+
required: true,
|
|
10582
|
+
schema: { type: "string" }
|
|
10583
|
+
},
|
|
10584
|
+
{
|
|
10585
|
+
name: "runId",
|
|
10586
|
+
in: "query",
|
|
10587
|
+
required: true,
|
|
10588
|
+
schema: { type: "string" }
|
|
10589
|
+
}
|
|
10590
|
+
],
|
|
10591
|
+
requestBody: {
|
|
10592
|
+
required: true,
|
|
10593
|
+
content: {
|
|
10594
|
+
"application/json": {
|
|
10595
|
+
schema: {
|
|
10596
|
+
type: "object",
|
|
10597
|
+
properties: {
|
|
10598
|
+
step: {
|
|
10599
|
+
oneOf: [{ type: "string" }, { type: "array", items: { type: "string" } }]
|
|
10600
|
+
},
|
|
10601
|
+
resumeData: { type: "object" },
|
|
10602
|
+
runtimeContext: {
|
|
10603
|
+
type: "object",
|
|
10604
|
+
description: "Runtime context for the workflow execution"
|
|
10605
|
+
}
|
|
10606
|
+
},
|
|
10607
|
+
required: ["step"]
|
|
10608
|
+
}
|
|
10609
|
+
}
|
|
10610
|
+
}
|
|
10611
|
+
}
|
|
10612
|
+
}),
|
|
10613
|
+
resumeStreamWorkflowHandler
|
|
10614
|
+
);
|
|
10531
10615
|
router.post(
|
|
10532
10616
|
"/:workflowId/resume-async",
|
|
10533
10617
|
bodyLimit.bodyLimit(bodyLimitOptions),
|
|
@@ -10678,6 +10762,10 @@ function workflowsRouter(bodyLimitOptions) {
|
|
|
10678
10762
|
runtimeContext: {
|
|
10679
10763
|
type: "object",
|
|
10680
10764
|
description: "Runtime context for the workflow execution"
|
|
10765
|
+
},
|
|
10766
|
+
closeOnSuspend: {
|
|
10767
|
+
type: "boolean",
|
|
10768
|
+
description: "Close the stream on suspend"
|
|
10681
10769
|
}
|
|
10682
10770
|
}
|
|
10683
10771
|
}
|