@mastra/mcp-docs-server 0.13.11-alpha.3 → 0.13.12-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/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +19 -19
- package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +2 -0
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +29 -29
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +28 -28
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +37 -37
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +33 -33
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +33 -33
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +37 -37
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Flance.md +22 -22
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +23 -23
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +24 -24
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Frag.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +8 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +29 -29
- package/.docs/organized/changelogs/create-mastra.md +19 -19
- package/.docs/organized/changelogs/mastra.md +43 -43
- package/.docs/raw/reference/agents/agent.mdx +1 -1
- package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +1 -1
- package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +1 -1
- package/.docs/raw/reference/agents/getDefaultVNextStreamOptions.mdx +1 -1
- package/.docs/raw/reference/cli/scorers.mdx +160 -0
- package/.docs/raw/reference/templates.mdx +3 -3
- package/.docs/raw/reference/tools/create-tool.mdx +2 -2
- package/.docs/raw/reference/workflows/branch.mdx +1 -1
- package/.docs/raw/reference/workflows/create-run.mdx +4 -4
- package/.docs/raw/reference/workflows/execute.mdx +2 -2
- package/.docs/raw/reference/workflows/foreach.mdx +1 -1
- package/.docs/raw/reference/workflows/run-methods/cancel.mdx +58 -0
- package/.docs/raw/reference/workflows/{resume.mdx → run-methods/resume.mdx} +7 -5
- package/.docs/raw/reference/workflows/{start.mdx → run-methods/start.mdx} +5 -5
- package/.docs/raw/reference/workflows/{stream.mdx → run-methods/stream.mdx} +6 -3
- package/.docs/raw/reference/workflows/{streamVNext.mdx → run-methods/streamVNext.mdx} +7 -8
- package/.docs/raw/reference/workflows/{watch.mdx → run-methods/watch.mdx} +12 -12
- package/.docs/raw/reference/workflows/run.mdx +104 -0
- package/.docs/raw/reference/workflows/step.mdx +0 -1
- package/.docs/raw/reference/workflows/workflow.mdx +3 -2
- package/.docs/raw/{reference/workflows → server-db}/snapshots.mdx +2 -2
- package/.docs/raw/workflows/overview.mdx +3 -3
- package/.docs/raw/workflows-legacy/overview.mdx +8 -8
- package/package.json +5 -5
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Run Class | Workflows | Mastra Docs"
|
|
3
|
+
description: Documentation for the Run class in Mastra, which represents a workflow execution instance.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Run Class
|
|
7
|
+
|
|
8
|
+
The `Run` class represents a workflow execution instance, providing methods to start, resume, stream, and monitor workflow execution.
|
|
9
|
+
|
|
10
|
+
## Usage example
|
|
11
|
+
|
|
12
|
+
```typescript showLineNumbers copy
|
|
13
|
+
const run = await workflow.createRunAsync();
|
|
14
|
+
|
|
15
|
+
const result = await run.start({
|
|
16
|
+
inputData: { value: "initial data" }
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
if (result.status === "suspended") {
|
|
20
|
+
const resumedResult = await run.resume({
|
|
21
|
+
resumeData: { value: "resume data" }
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Run Methods
|
|
27
|
+
|
|
28
|
+
<PropertiesTable
|
|
29
|
+
content={[
|
|
30
|
+
{
|
|
31
|
+
name: "start",
|
|
32
|
+
type: "(options?: StartOptions) => Promise<WorkflowResult>",
|
|
33
|
+
description: "Starts workflow execution with input data",
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "resume",
|
|
38
|
+
type: "(options?: ResumeOptions) => Promise<WorkflowResult>",
|
|
39
|
+
description: "Resumes a suspended workflow from a specific step",
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "stream",
|
|
44
|
+
type: "(options?: StreamOptions) => Promise<StreamResult>",
|
|
45
|
+
description: "Monitors workflow execution as a stream of events",
|
|
46
|
+
required: true,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "streamVNext",
|
|
50
|
+
type: "(options?: StreamOptions) => MastraWorkflowStream",
|
|
51
|
+
description: "Enables real-time streaming with enhanced features",
|
|
52
|
+
required: true,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "watch",
|
|
56
|
+
type: "(callback: WatchCallback, type?: WatchType) => UnwatchFunction",
|
|
57
|
+
description: "Monitors workflow execution with callback-based events",
|
|
58
|
+
required: true,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "cancel",
|
|
62
|
+
type: "() => Promise<void>",
|
|
63
|
+
description: "Cancels the workflow execution",
|
|
64
|
+
required: true,
|
|
65
|
+
}
|
|
66
|
+
]}
|
|
67
|
+
/>
|
|
68
|
+
|
|
69
|
+
## Run Status
|
|
70
|
+
|
|
71
|
+
A workflow run's `status` indicates its current execution state. The possible values are:
|
|
72
|
+
|
|
73
|
+
<PropertiesTable
|
|
74
|
+
content={[
|
|
75
|
+
{
|
|
76
|
+
name: "success",
|
|
77
|
+
type: "string",
|
|
78
|
+
description:
|
|
79
|
+
"All steps finished executing successfully, with a valid result output",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "failed",
|
|
83
|
+
type: "string",
|
|
84
|
+
description:
|
|
85
|
+
"Workflow execution encountered an error during execution, with error details available",
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "suspended",
|
|
89
|
+
type: "string",
|
|
90
|
+
description:
|
|
91
|
+
"Workflow execution is paused waiting for resume, with suspended step information",
|
|
92
|
+
},
|
|
93
|
+
]}
|
|
94
|
+
/>
|
|
95
|
+
|
|
96
|
+
## Related
|
|
97
|
+
|
|
98
|
+
- [Running workflows](../../examples/workflows/running-workflows.mdx)
|
|
99
|
+
- [Run.start()](./run-methods/start.mdx)
|
|
100
|
+
- [Run.resume()](./run-methods/resume.mdx)
|
|
101
|
+
- [Run.stream()](./run-methods/stream.mdx)
|
|
102
|
+
- [Run.streamVNext()](./run-methods/streamVNext.mdx)
|
|
103
|
+
- [Run.watch()](./run-methods/watch.mdx)
|
|
104
|
+
- [Run.cancel()](./run-methods/cancel.mdx)
|
|
@@ -13,7 +13,7 @@ The `Workflow` class enables you to create state machines for complex sequences
|
|
|
13
13
|
import { createWorkflow } from "@mastra/core/workflows";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
|
|
16
|
-
const workflow = createWorkflow({
|
|
16
|
+
export const workflow = createWorkflow({
|
|
17
17
|
id: "test-workflow",
|
|
18
18
|
inputSchema: z.object({
|
|
19
19
|
value: z.string(),
|
|
@@ -89,4 +89,5 @@ if (result.status === "suspended") {
|
|
|
89
89
|
|
|
90
90
|
## Related
|
|
91
91
|
|
|
92
|
-
- [
|
|
92
|
+
- [Step Class](./step.mdx)
|
|
93
|
+
- [Control flow](../../docs/workflows/control-flow.mdx)
|
|
@@ -79,7 +79,7 @@ Mastra persists snapshots to the configured storage system. By default, snapshot
|
|
|
79
79
|
The snapshots are stored in the `workflow_snapshots` table and identified uniquely by the `run_id` for the associated run when using libsql.
|
|
80
80
|
Utilizing a persistence layer allows for the snapshots to be persisted across workflow runs, allowing for advanced human-in-the-loop functionality.
|
|
81
81
|
|
|
82
|
-
Read more about [libsql storage](
|
|
82
|
+
Read more about [libsql storage](../../reference/storage/libsql.mdx) and [upstash storage](../../reference/storage/upstash.mdx) here.
|
|
83
83
|
|
|
84
84
|
### Saving Snapshots
|
|
85
85
|
|
|
@@ -206,4 +206,4 @@ run.watch(async ({ activePaths }) => {
|
|
|
206
206
|
|
|
207
207
|
- [Suspend and resume](../../docs/workflows/suspend-and-resume.mdx)
|
|
208
208
|
- [Human in the loop example](../../examples/workflows/human-in-the-loop.mdx)
|
|
209
|
-
- [
|
|
209
|
+
- [WorkflowRun.watch()](../../reference/workflows/run-methods/watch.mdx)
|
|
@@ -179,7 +179,7 @@ if (result.status === 'success') {
|
|
|
179
179
|
console.log(`output value: ${result.result.output}`);
|
|
180
180
|
}
|
|
181
181
|
```
|
|
182
|
-
> see [createRunAsync](/reference/workflows/create-run) and [start](/reference/workflows/start) for more information.
|
|
182
|
+
> see [createRunAsync](/reference/workflows/create-run) and [start](/reference/workflows/run-methods/start) for more information.
|
|
183
183
|
|
|
184
184
|
To trigger this workflow, run the following:
|
|
185
185
|
|
|
@@ -277,7 +277,7 @@ for await (const chunk of result.stream) {
|
|
|
277
277
|
}
|
|
278
278
|
```
|
|
279
279
|
|
|
280
|
-
> See [stream](/reference/workflows/stream) and [messages](/reference/workflows/stream#messages) for more information.
|
|
280
|
+
> See [stream](/reference/workflows/run-methods/stream) and [messages](/reference/workflows/run-methods/stream#messages) for more information.
|
|
281
281
|
|
|
282
282
|
### Watch Workflow
|
|
283
283
|
|
|
@@ -299,7 +299,7 @@ const result = await run.start({
|
|
|
299
299
|
});
|
|
300
300
|
```
|
|
301
301
|
|
|
302
|
-
> See [watch](/reference/workflows/watch) for more information.
|
|
302
|
+
> See [watch](/reference/workflows/run-methods/watch) for more information.
|
|
303
303
|
|
|
304
304
|
## More resources
|
|
305
305
|
|
|
@@ -7,14 +7,14 @@ description: "Workflows in Mastra help you orchestrate complex sequences of oper
|
|
|
7
7
|
|
|
8
8
|
All the legacy workflow documentation is available on the links below.
|
|
9
9
|
|
|
10
|
-
- [Steps](/docs/workflows-legacy/steps
|
|
11
|
-
- [Control Flow](/docs/workflows-legacy/control-flow
|
|
12
|
-
- [Variables](/docs/workflows-legacy/variables
|
|
13
|
-
- [Suspend & Resume](/docs/workflows-legacy/suspend-and-resume
|
|
14
|
-
- [Dynamic Workflows](/docs/workflows-legacy/dynamic-workflows
|
|
15
|
-
- [Error Handling](/docs/workflows-legacy/error-handling
|
|
16
|
-
- [Nested Workflows](/docs/workflows-legacy/nested-workflows
|
|
17
|
-
- [Runtime/Dynamic Variables](/docs/workflows-legacy/runtime-variables
|
|
10
|
+
- [Steps](/docs/workflows-legacy/steps.mdx)
|
|
11
|
+
- [Control Flow](/docs/workflows-legacy/control-flow.mdx)
|
|
12
|
+
- [Variables](/docs/workflows-legacy/variables.mdx)
|
|
13
|
+
- [Suspend & Resume](/docs/workflows-legacy/suspend-and-resume.mdx)
|
|
14
|
+
- [Dynamic Workflows](/docs/workflows-legacy/dynamic-workflows.mdx)
|
|
15
|
+
- [Error Handling](/docs/workflows-legacy/error-handling.mdx)
|
|
16
|
+
- [Nested Workflows](/docs/workflows-legacy/nested-workflows.mdx)
|
|
17
|
+
- [Runtime/Dynamic Variables](/docs/workflows-legacy/runtime-variables.mdx)
|
|
18
18
|
|
|
19
19
|
Workflows in Mastra help you orchestrate complex sequences of operations with features like branching, parallel execution, resource suspension, and more.
|
|
20
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.12-alpha.0",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"uuid": "^11.1.0",
|
|
33
33
|
"zod": "^3.25.67",
|
|
34
34
|
"zod-to-json-schema": "^3.24.5",
|
|
35
|
-
"@mastra/core": "0.13.
|
|
36
|
-
"@mastra/mcp": "^0.10.11
|
|
35
|
+
"@mastra/core": "0.13.3-alpha.0",
|
|
36
|
+
"@mastra/mcp": "^0.10.11"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@hono/node-server": "^1.17.1",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"tsx": "^4.19.4",
|
|
49
49
|
"typescript": "^5.8.3",
|
|
50
50
|
"vitest": "^3.2.4",
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
51
|
+
"@mastra/core": "0.13.3-alpha.0",
|
|
52
|
+
"@internal/lint": "0.0.29"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"prepare-docs": "cross-env PREPARE=true node dist/prepare-docs/prepare.js",
|