@mastra/mcp-docs-server 1.1.35-alpha.2 → 1.1.35-alpha.21
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/course/03-agent-memory/18-advanced-configuration-semantic-recall.md +48 -4
- package/.docs/docs/agents/background-tasks.md +62 -2
- package/.docs/docs/agents/processors.md +34 -2
- package/.docs/docs/agents/response-caching.md +148 -0
- package/.docs/docs/agents/using-tools.md +8 -0
- package/.docs/docs/editor/tools.md +1 -1
- package/.docs/docs/index.md +2 -2
- package/.docs/docs/mastra-platform/configuration.md +1 -1
- package/.docs/docs/mastra-platform/overview.md +1 -1
- package/.docs/docs/memory/observational-memory.md +63 -14
- package/.docs/docs/memory/overview.md +2 -1
- package/.docs/docs/memory/semantic-recall.md +68 -6
- package/.docs/docs/observability/logging.md +2 -2
- package/.docs/docs/observability/metrics/overview.md +4 -4
- package/.docs/docs/observability/overview.md +6 -6
- package/.docs/docs/observability/tracing/bridges/otel.md +25 -0
- package/.docs/docs/observability/tracing/exporters/arize.md +5 -5
- package/.docs/docs/observability/tracing/exporters/braintrust.md +37 -0
- package/.docs/docs/observability/tracing/exporters/langfuse.md +21 -0
- package/.docs/docs/observability/tracing/exporters/{cloud.md → mastra-platform.md} +28 -26
- package/.docs/docs/observability/tracing/exporters/{default.md → mastra-storage.md} +56 -19
- package/.docs/docs/observability/tracing/exporters/otel.md +79 -2
- package/.docs/docs/observability/tracing/overview.md +30 -29
- package/.docs/docs/observability/tracing/processors/sensitive-data-filter.md +6 -6
- package/.docs/docs/server/mastra-server.md +30 -19
- package/.docs/docs/studio/observability.md +4 -4
- package/.docs/docs/studio/overview.md +4 -0
- package/.docs/docs/workflows/suspend-and-resume.md +28 -1
- package/.docs/guides/deployment/inngest.md +29 -8
- package/.docs/guides/guide/web-search.md +7 -7
- package/.docs/guides/migrations/mastra-cloud.md +6 -6
- package/.docs/guides/migrations/upgrade-to-v1/tracing.md +19 -17
- package/.docs/models/gateways/azure-openai.md +94 -23
- package/.docs/models/gateways/netlify.md +3 -1
- package/.docs/models/gateways/openrouter.md +5 -1
- package/.docs/models/gateways/vercel.md +2 -1
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/deepinfra.md +2 -1
- package/.docs/models/providers/deepseek.md +3 -1
- package/.docs/models/providers/digitalocean.md +10 -2
- package/.docs/models/providers/firepass.md +71 -0
- package/.docs/models/providers/google.md +3 -2
- package/.docs/models/providers/kilo.md +5 -3
- package/.docs/models/providers/kiro.md +110 -0
- package/.docs/models/providers/llmgateway.md +8 -2
- package/.docs/models/providers/nebius.md +37 -55
- package/.docs/models/providers/openai.md +2 -0
- package/.docs/models/providers/opencode-go.md +2 -4
- package/.docs/models/providers/opencode.md +3 -3
- package/.docs/models/providers/poe.md +4 -1
- package/.docs/models/providers/qiniu-ai.md +2 -2
- package/.docs/models/providers/wafer.ai.md +2 -1
- package/.docs/models/providers/xiaomi-token-plan-ams.md +6 -5
- package/.docs/models/providers/xiaomi-token-plan-cn.md +6 -5
- package/.docs/models/providers/xiaomi-token-plan-sgp.md +6 -5
- package/.docs/models/providers/xiaomi.md +2 -2
- package/.docs/models/providers/zenmux.md +1 -1
- package/.docs/models/providers.md +1 -0
- package/.docs/reference/agents/agent.md +2 -0
- package/.docs/reference/cli/mastra.md +464 -0
- package/.docs/reference/client-js/agents.md +26 -1
- package/.docs/reference/client-js/responses.md +4 -0
- package/.docs/reference/configuration.md +6 -6
- package/.docs/reference/editor/tool-provider.md +3 -3
- package/.docs/reference/harness/harness-class.md +23 -8
- package/.docs/reference/index.md +3 -0
- package/.docs/reference/memory/observational-memory.md +11 -1
- package/.docs/reference/observability/metrics/automatic-metrics.md +2 -4
- package/.docs/reference/observability/tracing/bridges/datadog.md +2 -2
- package/.docs/reference/observability/tracing/bridges/otel.md +26 -4
- package/.docs/reference/observability/tracing/configuration.md +6 -3
- package/.docs/reference/observability/tracing/exporters/arize.md +1 -1
- package/.docs/reference/observability/tracing/exporters/braintrust.md +2 -0
- package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +3 -1
- package/.docs/reference/observability/tracing/exporters/console-exporter.md +2 -2
- package/.docs/reference/observability/tracing/exporters/default-exporter.md +7 -1
- package/.docs/reference/observability/tracing/exporters/mastra-platform-exporter.md +263 -0
- package/.docs/reference/observability/tracing/exporters/mastra-storage-exporter.md +194 -0
- package/.docs/reference/observability/tracing/exporters/otel.md +12 -8
- package/.docs/reference/observability/tracing/instances.md +2 -2
- package/.docs/reference/observability/tracing/interfaces.md +37 -2
- package/.docs/reference/observability/tracing/processors/sensitive-data-filter.md +22 -0
- package/.docs/reference/observability/tracing/span-filtering.md +2 -2
- package/.docs/reference/processors/processor-interface.md +74 -12
- package/.docs/reference/processors/provider-history-compat.md +132 -0
- package/.docs/reference/processors/response-cache.md +114 -0
- package/.docs/reference/processors/tool-call-filter.md +28 -0
- package/.docs/reference/storage/clickhouse.md +8 -8
- package/.docs/reference/storage/cloudflare-d1.md +1 -1
- package/.docs/reference/storage/cloudflare.md +1 -1
- package/.docs/reference/storage/composite.md +1 -1
- package/.docs/reference/storage/convex.md +1 -1
- package/.docs/reference/storage/duckdb.md +3 -3
- package/.docs/reference/storage/dynamodb.md +1 -1
- package/.docs/reference/storage/lance.md +1 -1
- package/.docs/reference/storage/libsql.md +1 -1
- package/.docs/reference/storage/postgresql.md +1 -1
- package/.docs/reference/storage/upstash.md +1 -1
- package/.docs/reference/streaming/ChunkType.md +44 -0
- package/.docs/reference/streaming/agents/stream.md +18 -2
- package/.docs/reference/tools/create-tool.md +46 -0
- package/.docs/reference/tools/mcp-client.md +47 -0
- package/.docs/reference/workflows/workflow-state-reader.md +113 -0
- package/CHANGELOG.md +71 -0
- package/package.json +4 -4
|
@@ -518,6 +518,50 @@ Emitted when the task throws or times out. Triggers a continuation turn when con
|
|
|
518
518
|
|
|
519
519
|
**payload.completedAt** (`Date`): Timestamp at which the task failed
|
|
520
520
|
|
|
521
|
+
### background-task-suspended
|
|
522
|
+
|
|
523
|
+
Emitted when a tool calls `suspend()` from inside its background execution. Pauses the task's workflow run with its snapshot persisted; resume with `mastra.backgroundTaskManager.resume(taskId, resumeData)`.
|
|
524
|
+
|
|
525
|
+
When consumed by [`Agent.streamUntilIdle()`](https://mastra.ai/reference/streaming/agents/streamUntilIdle), this chunk drops the task from the loop's wait set without queuing a continuation — the agent's response ends, and the resumed task's eventual completion injects into the message list for the next user turn.
|
|
526
|
+
|
|
527
|
+
**type** (`"background-task-suspended"`): Chunk type identifier
|
|
528
|
+
|
|
529
|
+
**payload** (`BackgroundTaskSuspendedPayload`): Suspension details for the task
|
|
530
|
+
|
|
531
|
+
**payload.taskId** (`string`): Unique identifier for the background task
|
|
532
|
+
|
|
533
|
+
**payload.toolName** (`string`): Name of the tool that was executed
|
|
534
|
+
|
|
535
|
+
**payload.toolCallId** (`string`): Tool-call ID from the originating LLM tool call
|
|
536
|
+
|
|
537
|
+
**payload.runId** (`string`): Run ID of the agent that dispatched the task
|
|
538
|
+
|
|
539
|
+
**payload.agentId** (`string`): ID of the agent that dispatched the task
|
|
540
|
+
|
|
541
|
+
**payload.suspendData** (`unknown`): Whatever the tool passed to \`suspend(data)\`
|
|
542
|
+
|
|
543
|
+
### background-task-resumed
|
|
544
|
+
|
|
545
|
+
Emitted when a suspended task is resumed via `mastra.backgroundTaskManager.resume(taskId, resumeData)`. The task transitions back to `running` and the tool's `execute` is restarted with `resumeData` populated.
|
|
546
|
+
|
|
547
|
+
**type** (`"background-task-resumed"`): Chunk type identifier
|
|
548
|
+
|
|
549
|
+
**payload** (`BackgroundTaskResumedPayload`): Resume details for the task
|
|
550
|
+
|
|
551
|
+
**payload.taskId** (`string`): Unique identifier for the background task
|
|
552
|
+
|
|
553
|
+
**payload.toolName** (`string`): Name of the tool that was executed
|
|
554
|
+
|
|
555
|
+
**payload.toolCallId** (`string`): Tool-call ID from the originating LLM tool call
|
|
556
|
+
|
|
557
|
+
**payload.runId** (`string`): Run ID of the agent that dispatched the task
|
|
558
|
+
|
|
559
|
+
**payload.agentId** (`string`): ID of the agent that dispatched the task
|
|
560
|
+
|
|
561
|
+
**payload.startedAt** (`Date`): Timestamp at which the task resumed
|
|
562
|
+
|
|
563
|
+
**payload.args** (`Record<string, unknown>`): Original tool arguments
|
|
564
|
+
|
|
521
565
|
### background-task-cancelled
|
|
522
566
|
|
|
523
567
|
Emitted when the task is cancelled before completing. Triggers a continuation turn when consumed by [`Agent.streamUntilIdle()`](https://mastra.ai/reference/streaming/agents/streamUntilIdle).
|
|
@@ -333,9 +333,9 @@ await agent.stream('message for agent', {
|
|
|
333
333
|
})
|
|
334
334
|
```
|
|
335
335
|
|
|
336
|
-
##
|
|
336
|
+
## Responses WebSocket transport
|
|
337
337
|
|
|
338
|
-
Opt into
|
|
338
|
+
Opt into Responses WebSocket streaming with provider options. This only applies to streaming calls and is supported for direct OpenAI models and Azure OpenAI Responses deployments. If WebSocket streaming is unavailable, Mastra falls back to HTTP streaming. By default, Mastra closes the WebSocket when the stream finishes.
|
|
339
339
|
|
|
340
340
|
```ts
|
|
341
341
|
const stream = await agent.stream('Hello', {
|
|
@@ -351,6 +351,20 @@ const stream = await agent.stream('Hello', {
|
|
|
351
351
|
})
|
|
352
352
|
```
|
|
353
353
|
|
|
354
|
+
For Azure OpenAI, configure the gateway with `useResponsesAPI: true`, then use `providerOptions.azure.transport`.
|
|
355
|
+
|
|
356
|
+
```ts
|
|
357
|
+
const stream = await agent.stream('Hello', {
|
|
358
|
+
providerOptions: {
|
|
359
|
+
azure: {
|
|
360
|
+
transport: 'websocket',
|
|
361
|
+
store: false,
|
|
362
|
+
websocket: { closeOnFinish: true },
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
})
|
|
366
|
+
```
|
|
367
|
+
|
|
354
368
|
To keep the connection open after the stream finishes, set `closeOnFinish: false` and close it manually.
|
|
355
369
|
|
|
356
370
|
```ts
|
|
@@ -367,6 +381,8 @@ const stream = await agent.stream('Hello', {
|
|
|
367
381
|
stream.transport?.close()
|
|
368
382
|
```
|
|
369
383
|
|
|
384
|
+
Responses WebSocket connections run one response at a time. Mastra rejects overlapping continuation requests that include `previous_response_id` on the same WebSocket transport. Wait for the active stream to finish before sending the next turn in the response chain.
|
|
385
|
+
|
|
370
386
|
## Related
|
|
371
387
|
|
|
372
388
|
- [Generating responses](https://mastra.ai/docs/agents/overview)
|
|
@@ -173,6 +173,50 @@ The tool still returns the full `execute` result to your application, while the
|
|
|
173
173
|
- `type: 'json'`
|
|
174
174
|
- `type: 'content'` with parts like `text`, `image-url`, `image-data`, `file-url`, `file-data`, `file-id`, `image-file-id`, or `custom`
|
|
175
175
|
|
|
176
|
+
## Example with `transform`
|
|
177
|
+
|
|
178
|
+
Use `transform` when the tool should keep raw inputs or outputs for runtime behavior, but display streams or transcript messages should receive a smaller or safer shape.
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
import { createTool } from '@mastra/core/tools'
|
|
182
|
+
import { z } from 'zod'
|
|
183
|
+
|
|
184
|
+
export const customerTool = createTool({
|
|
185
|
+
id: 'lookup-customer',
|
|
186
|
+
description: 'Looks up a customer',
|
|
187
|
+
inputSchema: z.object({
|
|
188
|
+
customerId: z.string(),
|
|
189
|
+
internalPath: z.string(),
|
|
190
|
+
}),
|
|
191
|
+
outputSchema: z.object({
|
|
192
|
+
displayName: z.string(),
|
|
193
|
+
apiKey: z.string(),
|
|
194
|
+
debugScore: z.number(),
|
|
195
|
+
}),
|
|
196
|
+
execute: async () => {
|
|
197
|
+
return {
|
|
198
|
+
displayName: 'Acme',
|
|
199
|
+
apiKey: 'secret-value',
|
|
200
|
+
debugScore: 0.97,
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
transform: {
|
|
204
|
+
display: {
|
|
205
|
+
input: ({ input }) => ({ customerId: input?.customerId }),
|
|
206
|
+
output: ({ output }) => ({ displayName: output?.displayName }),
|
|
207
|
+
error: () => ({ message: 'Customer lookup failed' }),
|
|
208
|
+
},
|
|
209
|
+
transcript: {
|
|
210
|
+
input: ({ input }) => ({ customerId: input?.customerId }),
|
|
211
|
+
output: ({ output }) => ({ displayName: output?.displayName }),
|
|
212
|
+
error: () => ({ message: 'Customer lookup failed' }),
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
})
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
The tool still receives the raw `inputSchema` value and returns the raw `execute` result. Mastra applies `display` transforms to streamed UI payloads and `transcript` transforms to user-visible transcript messages.
|
|
219
|
+
|
|
176
220
|
## Example with MCP annotations
|
|
177
221
|
|
|
178
222
|
When exposing tools via MCP (Model Context Protocol), you can add annotations to describe tool behavior and customize how clients display the tool. These MCP-specific properties are grouped under the `mcp` property:
|
|
@@ -224,6 +268,8 @@ export const weatherTool = createTool({
|
|
|
224
268
|
|
|
225
269
|
**toModelOutput** (`(output: TSchemaOut) => unknown`): Optional function that transforms the tool's \`execute\` output before it is sent back to the model. Use this to return \`text\`, \`json\`, or \`content\`-shaped outputs (including multimodal parts like images/files) to the model while still keeping the full raw output in your application code.
|
|
226
270
|
|
|
271
|
+
**transform** (`ToolPayloadTransform`): Optional target-aware transform for tool payloads before they leave runtime for display streams or user-visible transcript messages. Configure \`display\` and \`transcript\` transforms for phases such as \`input\`, \`inputDelta\`, \`output\`, \`error\`, \`approval\`, \`suspend\`, and \`resume\`.
|
|
272
|
+
|
|
227
273
|
**suspendSchema** (`StandardJSONSchemaV1`): A Standard JSON Schema defining the structure of the payload passed to \`suspend()\`. This payload is returned to the client when the tool suspends execution.
|
|
228
274
|
|
|
229
275
|
**resumeSchema** (`StandardJSONSchemaV1`): A Standard JSON Schema defining the expected structure of \`resumeData\` when the tool is resumed. Used by the agent to extract data from user messages when \`autoResumeSuspendedTools\` is enabled.
|
|
@@ -987,6 +987,53 @@ await agent.generate('Hello!', {
|
|
|
987
987
|
})
|
|
988
988
|
```
|
|
989
989
|
|
|
990
|
+
## Handling auth failures inside custom fetch
|
|
991
|
+
|
|
992
|
+
A custom `fetch` should not `throw` when authentication is unavailable. The Streamable HTTP transport in the MCP SDK opens a long-lived `GET /mcp` "standalone listener" stream in the background to receive server-pushed notifications. Errors on that stream are retried with exponential backoff, and a thrown `fetch` or a cleanly-closed stream can produce an indefinite reconnect loop at roughly one attempt per second.
|
|
993
|
+
|
|
994
|
+
Return a synthetic `Response` instead. The [MCP Streamable HTTP specification](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports) defines `405 Method Not Allowed` as the signal a server returns when it does not offer the GET SSE stream, and the SDK honors it as a terminal status that stops the listener cleanly. Use this to disable the listener when your server does not push notifications.
|
|
995
|
+
|
|
996
|
+
The following pattern waits for an auth token on POST requests, attaches it to outgoing headers, and short-circuits the GET listener with a synthetic 405:
|
|
997
|
+
|
|
998
|
+
```typescript
|
|
999
|
+
async function waitForToken(timeoutMs = 5000): Promise<string | null> {
|
|
1000
|
+
// Replace with your token lookup. Return null if no token is available.
|
|
1001
|
+
return getAuthToken({ timeoutMs })
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
const mcpClient = new MCPClient({
|
|
1005
|
+
servers: {
|
|
1006
|
+
apiServer: {
|
|
1007
|
+
url: new URL('https://api.example.com/mcp'),
|
|
1008
|
+
fetch: async (url, init) => {
|
|
1009
|
+
const method = (init?.method || 'GET').toUpperCase()
|
|
1010
|
+
|
|
1011
|
+
// The SDK opens a background GET stream for server-pushed notifications.
|
|
1012
|
+
// If your server does not use it, short-circuit with 405 to stop reconnect attempts.
|
|
1013
|
+
if (method === 'GET') {
|
|
1014
|
+
return new Response(null, { status: 405, statusText: 'Method Not Allowed' })
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
// POST: wait for the token, then forward the request with an Authorization header.
|
|
1018
|
+
const token = await waitForToken()
|
|
1019
|
+
if (!token) {
|
|
1020
|
+
// Forward the request without a token and let the server reject it.
|
|
1021
|
+
// The SDK surfaces non-2xx POST responses as errors to the caller of
|
|
1022
|
+
// tools/list, tools/call, etc., which is the desired behavior here.
|
|
1023
|
+
return fetch(url, init)
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
const headers = new Headers(init?.headers)
|
|
1027
|
+
headers.set('authorization', `Bearer ${token}`)
|
|
1028
|
+
return fetch(url, { ...init, headers })
|
|
1029
|
+
},
|
|
1030
|
+
},
|
|
1031
|
+
},
|
|
1032
|
+
})
|
|
1033
|
+
```
|
|
1034
|
+
|
|
1035
|
+
Return `405` for the GET listener only when your server does not push notifications back to the client. If your server uses the standalone GET stream, attach the auth token on `GET` requests as well and let the request through.
|
|
1036
|
+
|
|
990
1037
|
## Using SSE request headers
|
|
991
1038
|
|
|
992
1039
|
When using the legacy SSE MCP transport, you must configure both `requestInit` and `eventSourceInit` due to a bug in the MCP SDK. Alternatively, you can use a custom `fetch` function which will be automatically used for both POST requests and SSE connections:
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Workflow state reader
|
|
2
|
+
|
|
3
|
+
Workflow state reader helpers inspect the public `WorkflowState` returned by `workflow.getWorkflowRunById()`. Use them to recover suspended runs, inspect resume labels, and read step payloads or outputs without parsing raw workflow snapshots.
|
|
4
|
+
|
|
5
|
+
## Usage example
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { createWorkflowStateReader } from '@mastra/core/workflows'
|
|
9
|
+
|
|
10
|
+
const state = await workflow.getWorkflowRunById('run-123')
|
|
11
|
+
|
|
12
|
+
if (state) {
|
|
13
|
+
const reader = createWorkflowStateReader(state)
|
|
14
|
+
const suspendedStep = reader.getSuspendedStep()
|
|
15
|
+
const labels = reader.getResumeLabels()
|
|
16
|
+
|
|
17
|
+
console.log(reader.getStatus())
|
|
18
|
+
console.log(reader.getStepOutput('extract-data'))
|
|
19
|
+
console.log(suspendedStep?.path)
|
|
20
|
+
console.log(labels.approve)
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Functions
|
|
25
|
+
|
|
26
|
+
### `createWorkflowStateReader(state)`
|
|
27
|
+
|
|
28
|
+
Creates a reader object with methods bound to one `WorkflowState`.
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
const reader = createWorkflowStateReader(state)
|
|
32
|
+
const suspendedStep = reader.getSuspendedStep()
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### `getWorkflowStepOutput(state, stepId)`
|
|
36
|
+
|
|
37
|
+
Returns the output for a step ID, including nested workflow dot paths such as `parent.child`. For `foreach` steps, returns one entry per iteration; suspended iterations can have `undefined` output entries.
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
const output = getWorkflowStepOutput(state, 'extract-data')
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### `getWorkflowStepPayload(state, stepId)`
|
|
44
|
+
|
|
45
|
+
Returns the payload that was passed to a step. For `foreach` steps, returns one entry per iteration.
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
const payload = getWorkflowStepPayload(state, 'extract-data')
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### `getWorkflowSuspendedStep(state)`
|
|
52
|
+
|
|
53
|
+
Returns the first suspended step from the workflow state. When multiple steps are suspended, ordering follows the order stored in `suspendedPaths`.
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
const suspendedStep = getWorkflowSuspendedStep(state)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### `getWorkflowSuspendedSteps(state)`
|
|
60
|
+
|
|
61
|
+
Returns all suspended steps from the workflow state. Each result includes the top-level step ID, resume path, execution path, suspend payload, suspend output, and matching resume labels.
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
const suspendedSteps = getWorkflowSuspendedSteps(state)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### `getWorkflowResumeLabel(state, label)`
|
|
68
|
+
|
|
69
|
+
Returns a resume label by name.
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
const label = getWorkflowResumeLabel(state, 'approve')
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### `getWorkflowResumeLabels(state)`
|
|
76
|
+
|
|
77
|
+
Returns all resume labels from the workflow state.
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
const labels = getWorkflowResumeLabels(state)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Reader methods
|
|
84
|
+
|
|
85
|
+
`createWorkflowStateReader(state)` returns the following methods:
|
|
86
|
+
|
|
87
|
+
**getStatus** (`() => WorkflowRunStatus`): Returns the workflow run status.
|
|
88
|
+
|
|
89
|
+
**getResult** (`() => WorkflowState["result"]`): Returns the terminal workflow result when it exists.
|
|
90
|
+
|
|
91
|
+
**getError** (`() => WorkflowState["error"]`): Returns the terminal workflow error when it exists.
|
|
92
|
+
|
|
93
|
+
**getStepOutput** (`(stepId: string) => any | Array<any | undefined> | undefined`): Returns the output for a step ID or nested workflow dot path.
|
|
94
|
+
|
|
95
|
+
**getStepPayload** (`(stepId: string) => any | Array<any | undefined> | undefined`): Returns the payload for a step ID or nested workflow dot path.
|
|
96
|
+
|
|
97
|
+
**getSuspendedStep** (`() => { stepId: string; path: string[]; executionPath?: number[]; step?: NonNullable<WorkflowState["steps"]>[string]; payload?: any; suspendPayload?: any; suspendOutput?: any; resumeLabels: Record<string, { stepId: string; foreachIndex?: number }> } | undefined`): Returns the first suspended step.
|
|
98
|
+
|
|
99
|
+
**getSuspendedSteps** (`() => Array<{ stepId: string; path: string[]; executionPath?: number[]; step?: NonNullable<WorkflowState["steps"]>[string]; payload?: any; suspendPayload?: any; suspendOutput?: any; resumeLabels: Record<string, { stepId: string; foreachIndex?: number }> }>`): Returns all suspended steps.
|
|
100
|
+
|
|
101
|
+
**getResumeLabel** (`(label: string) => { stepId: string; foreachIndex?: number } | undefined`): Returns a resume label by name.
|
|
102
|
+
|
|
103
|
+
**getResumeLabels** (`() => Record<string, { stepId: string; foreachIndex?: number }>`): Returns all resume labels.
|
|
104
|
+
|
|
105
|
+
## Notes
|
|
106
|
+
|
|
107
|
+
`requestContext` and `tracingContext` are only returned by `workflow.getWorkflowRunById()` when explicitly requested with `fields`.
|
|
108
|
+
|
|
109
|
+
## Related
|
|
110
|
+
|
|
111
|
+
- [Suspend & resume](https://mastra.ai/docs/workflows/suspend-and-resume)
|
|
112
|
+
- [Snapshots](https://mastra.ai/docs/workflows/snapshots)
|
|
113
|
+
- [Workflow class](https://mastra.ai/reference/workflows/workflow)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,76 @@
|
|
|
1
1
|
# @mastra/mcp-docs-server
|
|
2
2
|
|
|
3
|
+
## 1.1.35-alpha.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`7ad5585`](https://github.com/mastra-ai/mastra/commit/7ad55856406f1de398dc713f6a9eaa78b2784bb6), [`210ea7a`](https://github.com/mastra-ai/mastra/commit/210ea7af559791b73a44fc9c12179908aaa3183f), [`83218c8`](https://github.com/mastra-ai/mastra/commit/83218c88b37773c9424fbe733b37be556e55e94d), [`265ec9f`](https://github.com/mastra-ai/mastra/commit/265ec9f887b5c81255c873a76ff7796f16e4f99b), [`6ce80bf`](https://github.com/mastra-ai/mastra/commit/6ce80bf4872a891e0bddf8b80561a80584efb14b), [`9268531`](https://github.com/mastra-ai/mastra/commit/9268531e7ec4be98beeba3b3ae8be0a7ea380662), [`13ead79`](https://github.com/mastra-ai/mastra/commit/13ead79149486b88144db7e11e6ff551caef5be1), [`bd36d8e`](https://github.com/mastra-ai/mastra/commit/bd36d8eb6de8c9a0310352649dbd4b06703c2299), [`8ac9141`](https://github.com/mastra-ai/mastra/commit/8ac9141439caa8fdd674944c4d84f29b3c730296)]:
|
|
8
|
+
- @mastra/core@1.33.0-alpha.10
|
|
9
|
+
|
|
10
|
+
## 1.1.35-alpha.18
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [[`5688881`](https://github.com/mastra-ai/mastra/commit/5688881669c7ed157f31ac77f6fc5f8d95ceea32)]:
|
|
15
|
+
- @mastra/core@1.33.0-alpha.9
|
|
16
|
+
|
|
17
|
+
## 1.1.35-alpha.16
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [[`7c275a8`](https://github.com/mastra-ai/mastra/commit/7c275a810595e1a6c41ccc39720531ab65734700), [`890b24c`](https://github.com/mastra-ai/mastra/commit/890b24cc7d32ed6aa4dfe253e54dc6bf4099f690), [`0f48ebf`](https://github.com/mastra-ai/mastra/commit/0f48ebfc7ac7897b2092a189f45751924cf56d1c), [`f180e49`](https://github.com/mastra-ai/mastra/commit/f180e4990e71b04c9a475b523584071712f0048f), [`9260e01`](https://github.com/mastra-ai/mastra/commit/9260e015276fb1b500f7878ee452b47476bf1583), [`2f6c54e`](https://github.com/mastra-ai/mastra/commit/2f6c54e17c041cac1def54baaa6b771647836414), [`e06a159`](https://github.com/mastra-ai/mastra/commit/e06a1598ca07a6c3778aefc2a2d288363c6294ff), [`db34bc6`](https://github.com/mastra-ai/mastra/commit/db34bc6fb36cf125bda0c46be4d3fdc774b70cc4)]:
|
|
22
|
+
- @mastra/core@1.33.0-alpha.8
|
|
23
|
+
- @mastra/mcp@1.7.0
|
|
24
|
+
|
|
25
|
+
## 1.1.35-alpha.14
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- Updated dependencies [[`6742347`](https://github.com/mastra-ai/mastra/commit/6742347d71955d7639adc9ddf6ff8282de7ee3ba), [`7b0ad1f`](https://github.com/mastra-ai/mastra/commit/7b0ad1f5c53dc118c6da12ae82ae2587037dc2b8), [`62666c3`](https://github.com/mastra-ai/mastra/commit/62666c367eaeac3941ead454b1d38810cc855721), [`4af2160`](https://github.com/mastra-ai/mastra/commit/4af2160322f4718cac421930cce85641e9512389), [`136c959`](https://github.com/mastra-ai/mastra/commit/136c9592fb0eeb0cd212f28629d8a29b7557a2fc), [`4df7cc7`](https://github.com/mastra-ai/mastra/commit/4df7cc79342fd065fe7fdeef93c094db14b12bcd), [`aca3121`](https://github.com/mastra-ai/mastra/commit/aca31211233dac25459f140ea4fcfb3a5af64c18), [`9cdf38e`](https://github.com/mastra-ai/mastra/commit/9cdf38e58506e1109c8b38f97cd7770978a4218e), [`990851e`](https://github.com/mastra-ai/mastra/commit/990851edcb0e30be5c2c18b6532f1a876cc2d335), [`6068a6c`](https://github.com/mastra-ai/mastra/commit/6068a6c42950fad3ebfc92346417896ba60803d2), [`00106be`](https://github.com/mastra-ai/mastra/commit/00106bede59b81e5b0e9cd6aad8d3b5dbc336387), [`e2a079c`](https://github.com/mastra-ai/mastra/commit/e2a079cc3755b1895f7bd5dc36e9be81b11c7c22), [`534a456`](https://github.com/mastra-ai/mastra/commit/534a456a25e4df1e5407e7e632f4cb3b1fa14f9d), [`36bae07`](https://github.com/mastra-ai/mastra/commit/36bae07c0e70b1b3006f2fd20830e8883dcbd066)]:
|
|
30
|
+
- @mastra/core@1.33.0-alpha.7
|
|
31
|
+
|
|
32
|
+
## 1.1.35-alpha.12
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- Updated dependencies [[`b560d6f`](https://github.com/mastra-ai/mastra/commit/b560d6f88b9b904b15c10f75c949eb145bc27684), [`36b3bbf`](https://github.com/mastra-ai/mastra/commit/36b3bbf5a8d59f7e23d47e29340e76c681b4929c), [`b275631`](https://github.com/mastra-ai/mastra/commit/b275631dc10541a482b2e2d4a3e3cfa843bd5fa1)]:
|
|
37
|
+
- @mastra/core@1.33.0-alpha.6
|
|
38
|
+
|
|
39
|
+
## 1.1.35-alpha.11
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- Updated dependencies [[`bae019e`](https://github.com/mastra-ai/mastra/commit/bae019ecb6694da96909f7ec7b9eb3a0a33aa887), [`33f5061`](https://github.com/mastra-ai/mastra/commit/33f5061cd1c0335020c3faae61ce96de822854fa), [`99869ec`](https://github.com/mastra-ai/mastra/commit/99869ecb1f2aa6dfcc44fa4e843e5ee0344efa64), [`d86f031`](https://github.com/mastra-ai/mastra/commit/d86f031eb6b0b2570145afafea664e59bf688962)]:
|
|
44
|
+
- @mastra/core@1.33.0-alpha.5
|
|
45
|
+
|
|
46
|
+
## 1.1.35-alpha.9
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- Updated dependencies [[`9f17410`](https://github.com/mastra-ai/mastra/commit/9f1741080def23d42ee50b39887a385ae316a3c6), [`c6eb39e`](https://github.com/mastra-ai/mastra/commit/c6eb39ea6dca381c6563cb240237fbe608e02f93), [`900d086`](https://github.com/mastra-ai/mastra/commit/900d086bb737b9cf2fcf68f11b0389b801a2738c), [`4c0e286`](https://github.com/mastra-ai/mastra/commit/4c0e28637c9cfb4f416549b55e97ebfa13319dfc), [`25184ff`](https://github.com/mastra-ai/mastra/commit/25184ffaf1293ec95119426eb1a1f8d38831b96c), [`aebde9c`](https://github.com/mastra-ai/mastra/commit/aebde9cfacf56592c6b6350cae721740fe090b8a)]:
|
|
51
|
+
- @mastra/core@1.33.0-alpha.4
|
|
52
|
+
|
|
53
|
+
## 1.1.35-alpha.7
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- Updated dependencies [[`087e413`](https://github.com/mastra-ai/mastra/commit/087e4133e5d6efa36619e9556c16750e4179c047), [`087e413`](https://github.com/mastra-ai/mastra/commit/087e4133e5d6efa36619e9556c16750e4179c047), [`087e413`](https://github.com/mastra-ai/mastra/commit/087e4133e5d6efa36619e9556c16750e4179c047)]:
|
|
58
|
+
- @mastra/core@1.33.0-alpha.3
|
|
59
|
+
|
|
60
|
+
## 1.1.35-alpha.6
|
|
61
|
+
|
|
62
|
+
### Patch Changes
|
|
63
|
+
|
|
64
|
+
- Updated dependencies [[`d1fdbd0`](https://github.com/mastra-ai/mastra/commit/d1fdbd012add5623cb7e6b7f882b605ab358bbb4), [`d91ebe2`](https://github.com/mastra-ai/mastra/commit/d91ebe28ee065d8f2ed6df741c3c07f58d359529)]:
|
|
65
|
+
- @mastra/core@1.33.0-alpha.2
|
|
66
|
+
|
|
67
|
+
## 1.1.35-alpha.4
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- Updated dependencies [[`dccd8f1`](https://github.com/mastra-ai/mastra/commit/dccd8f1f8b8f1ad203b77556207e5529567c616d)]:
|
|
72
|
+
- @mastra/core@1.33.0-alpha.1
|
|
73
|
+
|
|
3
74
|
## 1.1.35-alpha.1
|
|
4
75
|
|
|
5
76
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.1.35-alpha.
|
|
3
|
+
"version": "1.1.35-alpha.21",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"jsdom": "^26.1.0",
|
|
30
30
|
"local-pkg": "^1.1.2",
|
|
31
31
|
"zod": "^4.3.6",
|
|
32
|
-
"@mastra/core": "1.33.0-alpha.
|
|
32
|
+
"@mastra/core": "1.33.0-alpha.10",
|
|
33
33
|
"@mastra/mcp": "^1.7.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"tsx": "^4.21.0",
|
|
47
47
|
"typescript": "^6.0.3",
|
|
48
48
|
"vitest": "4.1.5",
|
|
49
|
-
"@
|
|
49
|
+
"@mastra/core": "1.33.0-alpha.10",
|
|
50
50
|
"@internal/types-builder": "0.0.67",
|
|
51
|
-
"@
|
|
51
|
+
"@internal/lint": "0.0.92"
|
|
52
52
|
},
|
|
53
53
|
"homepage": "https://mastra.ai",
|
|
54
54
|
"repository": {
|