@mastra/mcp-docs-server 0.13.17-alpha.4 → 0.13.17-alpha.5
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/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +10 -0
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +9 -0
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fauth.md +6 -0
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fcloud.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +12 -12
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +11 -0
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +15 -15
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +12 -12
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +6 -0
- package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fgithub.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Flance.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmem0.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +10 -5
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Frag.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fragie.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +6 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +9 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +9 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +10 -10
- package/.docs/organized/changelogs/create-mastra.md +7 -7
- package/.docs/organized/changelogs/mastra.md +13 -13
- package/.docs/organized/code-examples/heads-up-game.md +32 -56
- package/.docs/raw/workflows/suspend-and-resume.mdx +64 -7
- package/CHANGELOG.md +1813 -0
- package/dist/stdio.js +13 -0
- package/dist/tools/blog.d.ts.map +1 -1
- package/package.json +15 -5
|
@@ -30,17 +30,15 @@ To pause execution at a specific step until user input is received, use the `
|
|
|
30
30
|
|
|
31
31
|

|
|
32
32
|
|
|
33
|
-
```typescript {
|
|
33
|
+
```typescript {16} filename="src/mastra/workflows/test-workflow.ts" showLineNumbers copy
|
|
34
34
|
const step1 = createStep({
|
|
35
35
|
id: "step-1",
|
|
36
|
-
description: "Test suspend",
|
|
37
36
|
inputSchema: z.object({
|
|
38
37
|
input: z.string()
|
|
39
38
|
}),
|
|
40
39
|
outputSchema: z.object({
|
|
41
40
|
output: z.string()
|
|
42
41
|
}),
|
|
43
|
-
suspendSchema: z.object({}),
|
|
44
42
|
resumeSchema: z.object({
|
|
45
43
|
city: z.string()
|
|
46
44
|
}),
|
|
@@ -48,15 +46,16 @@ const step1 = createStep({
|
|
|
48
46
|
const { city } = resumeData ?? {};
|
|
49
47
|
|
|
50
48
|
if (!city) {
|
|
51
|
-
await suspend({});
|
|
52
|
-
return { output: "" };
|
|
49
|
+
return await suspend({});
|
|
53
50
|
}
|
|
54
51
|
|
|
55
52
|
return { output: "" };
|
|
56
53
|
}
|
|
57
54
|
});
|
|
58
55
|
|
|
59
|
-
export const testWorkflow = createWorkflow({
|
|
56
|
+
export const testWorkflow = createWorkflow({
|
|
57
|
+
// ...
|
|
58
|
+
})
|
|
60
59
|
.then(step1)
|
|
61
60
|
.commit();
|
|
62
61
|
```
|
|
@@ -88,9 +87,10 @@ if (result.status === "suspended") {
|
|
|
88
87
|
}
|
|
89
88
|
});
|
|
90
89
|
}
|
|
91
|
-
|
|
92
90
|
```
|
|
93
91
|
|
|
92
|
+
> See [Run Workflow Results](/docs/workflows/overview#run-workflow-results) for more details.
|
|
93
|
+
|
|
94
94
|
In this case, the logic resumes the first step listed in the `suspended` array. A `step` can also be defined using it's `id`, for example: 'step-1'.
|
|
95
95
|
|
|
96
96
|
```json
|
|
@@ -111,6 +111,63 @@ In this case, the logic resumes the first step listed in the `suspended` array.
|
|
|
111
111
|
}
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
+
## Providing user feedback with suspend
|
|
115
|
+
|
|
116
|
+
When a workflow is suspended, feedback can be surfaced to the user through the `suspendSchema`. Include a reason in the `suspend` payload to explain why the workflow paused.
|
|
117
|
+
|
|
118
|
+
```typescript {13,23} filename="src/mastra/workflows/test-workflow.ts" showLineNumbers copy
|
|
119
|
+
import { createWorkflow, createStep } from "@mastra/core/workflows";
|
|
120
|
+
import { z } from "zod";
|
|
121
|
+
|
|
122
|
+
const step1 = createStep({
|
|
123
|
+
id: "step-1",
|
|
124
|
+
inputSchema: z.object({
|
|
125
|
+
value: z.string()
|
|
126
|
+
}),
|
|
127
|
+
resumeSchema: z.object({
|
|
128
|
+
confirm: z.boolean()
|
|
129
|
+
}),
|
|
130
|
+
suspendSchema: z.object({
|
|
131
|
+
reason: z.string()
|
|
132
|
+
}),
|
|
133
|
+
outputSchema: z.object({
|
|
134
|
+
value: z.string()
|
|
135
|
+
}),
|
|
136
|
+
execute: async ({ resumeData, suspend }) => {
|
|
137
|
+
const { confirm } = resumeData ?? {};
|
|
138
|
+
|
|
139
|
+
if (!confirm) {
|
|
140
|
+
return await suspend({
|
|
141
|
+
reason: "Confirm to continue"
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return { value: "" };
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
export const testWorkflow = createWorkflow({
|
|
150
|
+
// ...
|
|
151
|
+
})
|
|
152
|
+
.then(step1)
|
|
153
|
+
.commit();
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
In this case, the reason provided explains that the user must confirm to continue.
|
|
158
|
+
|
|
159
|
+
```json
|
|
160
|
+
{
|
|
161
|
+
"step-1": {
|
|
162
|
+
// ...
|
|
163
|
+
"status": "suspended",
|
|
164
|
+
"suspendPayload": {
|
|
165
|
+
"reason": "Confirm to continue"
|
|
166
|
+
},
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
114
171
|
> See [Run Workflow Results](/docs/workflows/overview#run-workflow-results) for more details.
|
|
115
172
|
|
|
116
173
|
## Resuming a workflow with `resume()`
|