@mastra/mcp-docs-server 1.3.10-alpha.8 → 1.3.10-alpha.9
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/docs/harness/durable-agents.md +1 -1
- package/.docs/docs/signals/thread-streams.md +34 -3
- package/.docs/integrations/observability/opentelemetry.md +27 -4
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/inceptron.md +2 -2
- package/.docs/models/providers/kilo.md +7 -7
- package/.docs/models/providers/llmgateway-providers.md +1 -3
- package/.docs/models/providers/llmgateway.md +1 -2
- package/.docs/models/providers/nano-gpt.md +13 -13
- package/.docs/reference/agents/agent.md +3 -1
- package/.docs/reference/agents/durable-agent.md +17 -9
- package/.docs/reference/client-js/agents.md +2 -0
- package/.docs/reference/processors/provider-history-compat.md +13 -13
- package/.docs/reference/streaming/ChunkType.md +18 -0
- package/package.json +3 -3
|
@@ -172,7 +172,7 @@ for await (const chunk of output.fullStream) {
|
|
|
172
172
|
|
|
173
173
|
Calling `observe(runId)` without an offset is the supported general reconnect flow. It replays all available cached events before delivering live events. For a completed run, observation replays the retained events and closes. If the run is unknown or its history has been cleared and no live run remains, observation closes without events. The HTTP observe endpoint returns an empty, closed stream in this case rather than waiting for its idle timeout.
|
|
174
174
|
|
|
175
|
-
The optional `offset` is an inclusive, zero-based PubSub event index, not a chunk number, and the public stream doesn't expose it. If an offset skips earlier text deltas, aggregated text is partial and structured output may be invalid. On transports with numeric offset support, an offset beyond the highest retained index also skips live events with lower indexes. A live run waits for the published index to reach the requested offset. A completed run with a retained terminal event closes even when the offset skips every event. See [`observe(runId, options?)`](https://mastra.ai/reference/agents/durable-agent) for the full offset and transport behavior.
|
|
175
|
+
The optional `offset` is an inclusive, zero-based PubSub event index, not a chunk number, and the public stream doesn't expose it. If an offset skips earlier text deltas, aggregated text is partial and structured output may be invalid. On transports with numeric offset support, an offset beyond the highest retained index also skips live events with lower indexes. A live run waits for the published index to reach the requested offset. A completed run with a retained terminal event closes even when the offset skips every event. Evented agents on a cross-process PubSub, such as Redis Streams, need a server cache shared by every process, such as `RedisServerCache`, for offsets to skip earlier events. See [`observe(runId, options?)`](https://mastra.ai/reference/agents/durable-agent) for the full offset and transport behavior.
|
|
176
176
|
|
|
177
177
|
Replay isn't a permanent execution archive. Events remain available only until [cleanup](#cleanup) clears them or the cache removes them. A workflow snapshot can't reconstruct cleared stream events, and disabling caching prevents historical replay.
|
|
178
178
|
|
|
@@ -51,13 +51,42 @@ Pass `withInitialHistory: true` to begin with a `thread-history` chunk, which ca
|
|
|
51
51
|
|
|
52
52
|
Use `runId` to group chunks from the same run. The exception is [`thread-history`](https://mastra.ai/reference/streaming/ChunkType), which has an empty `runId` because its messages can span several runs. The subscription's [`activeRunId()`](https://mastra.ai/reference/agents/agent) returns the active run's ID or `null`.
|
|
53
53
|
|
|
54
|
-
The public stream
|
|
54
|
+
The public subscription stream includes `AgentChunkType`. `withInitialHistory` adds `ThreadHistoryChunk`, and `withRunStatus: true` adds `ThreadRunStatusChunk`. Both options default to `false`. The [ChunkType reference](https://mastra.ai/reference/streaming/ChunkType) lists the fields for model output, tool calls and results, approvals, aborts, and errors. To observe queue counts, use [`subscribeThreadEvents()`](https://mastra.ai/reference/signals/thread-events) separately.
|
|
55
|
+
|
|
56
|
+
### Detect when a run finishes
|
|
57
|
+
|
|
58
|
+
Pass `withRunStatus: true` to opt in to run outcomes. Existing subscriptions don't receive these chunks by default.
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
const subscription = await agent.subscribeToThread({
|
|
62
|
+
resourceId: 'user-123',
|
|
63
|
+
threadId: 'thread-456',
|
|
64
|
+
withRunStatus: true,
|
|
65
|
+
})
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
A [`thread-run-status`](https://mastra.ai/reference/streaming/ChunkType) chunk identifies the run's outcome independently of its output:
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
const chunk = {
|
|
72
|
+
type: 'thread-run-status',
|
|
73
|
+
runId: 'run-123',
|
|
74
|
+
from: 'AGENT',
|
|
75
|
+
payload: { status: 'success' },
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`status` is `success`, `failed`, `aborted`, or `suspended`. Live output arrives before its status. A suspension is resumable: the same run can later produce more output and a final status. A run outcome doesn't close the thread subscription, which continues listening for later runs.
|
|
80
|
+
|
|
81
|
+
With `withInitialHistory`, the first chunk's payload is `{ messages, hasMore, activeRunId }`. `activeRunId` identifies the run holding thread ownership during hydration, or is `null` when idle. Use `thread-run-status` to determine the outcome. An idle thread alone doesn't indicate success.
|
|
82
|
+
|
|
83
|
+
With `withRunStatus: true`, retained outcomes are delivered even when a run finished before you subscribed and its text is already in history. A late subscriber using both options receives one status for every still-retained finished run, including runs outside the initial history page. It doesn't receive only the newest run's status. Final outcomes are deduplicated within one subscription. Suspension notifications are deduplicated per execution segment. A reconnect creates a new subscription and may deliver the same outcome again. Group updates by `runId` rather than treating each delivery as a new answer.
|
|
55
84
|
|
|
56
85
|
### Approve tool calls
|
|
57
86
|
|
|
58
87
|
When a run pauses for tool approval, send your decision with [`client.getAgent().sendToolApproval()`](https://mastra.ai/reference/client-js/agents) or the [server approval route](https://mastra.ai/reference/server/routes). The existing subscription receives output when the run resumes.
|
|
59
88
|
|
|
60
|
-
A paused run keeps ownership of the thread. Signals that try to start a new run receive an `accepted` action of `blocked` until the paused run resumes or is aborted. Pending approvals and suspensions are replayed when you subscribe again. Completed
|
|
89
|
+
A paused run keeps ownership of the thread. Signals that try to start a new run receive an `accepted` action of `blocked` until the paused run resumes or is aborted. Pending approvals and suspensions are replayed when you subscribe again. Completed stored output isn't replayed. Retained run outcomes are delivered when `withRunStatus: true`. [When the agent sees your input](https://mastra.ai/docs/signals/sending-signals) covers the interrupt and wait rules for input that arrives during a run.
|
|
61
90
|
|
|
62
91
|
### Filter signals in a subscription
|
|
63
92
|
|
|
@@ -73,7 +102,9 @@ Use `reconnect: true` for long-lived subscriptions. `processDataStream()` then r
|
|
|
73
102
|
|
|
74
103
|
A reconnect can resume output that the shared [PubSub backend](https://mastra.ai/docs/server/pubsub) still retains. It can't recover events held only in another process's in-memory cache. Use `withInitialHistory` to reload the newest page of stored messages when you need conversation history.
|
|
75
104
|
|
|
76
|
-
Stored messages aren't a recording of every streamed text fragment. Reconnecting doesn't replay completed stored
|
|
105
|
+
Stored messages aren't a recording of every streamed text fragment. Reconnecting doesn't replay completed stored output or reconstruct fragments that weren't retained.
|
|
106
|
+
|
|
107
|
+
Outcome recovery is bounded by the PubSub backend's retention, not by the history page size. Redis Streams keeps compact terminal events and execution authority metadata when saved output is trimmed, but its configured stream length and idle TTL can still evict them. This isn't a permanent run audit log or a guaranteed time window. Upgrade both `@mastra/core` and `@mastra/redis-streams` for recovery after trimming. Older adapters may delete terminal events with the output.
|
|
77
108
|
|
|
78
109
|
### SSE heartbeats for custom endpoints
|
|
79
110
|
|
|
@@ -8,13 +8,13 @@ Mastra supports OpenTelemetry (OTEL) through an exporter for sending traces and
|
|
|
8
8
|
|
|
9
9
|
## Exporter
|
|
10
10
|
|
|
11
|
-
The OpenTelemetry exporter sends your traces and logs using standardized [OpenTelemetry Semantic Conventions for GenAI](https://opentelemetry.io/docs/specs/semconv/gen-ai/). This ensures broad compatibility with platforms like Datadog, New Relic, Sentry, SigNoz, MLflow, Latitude, Dash0, Traceloop, Laminar, telemetry.dev, and more.
|
|
11
|
+
The OpenTelemetry exporter sends your traces and logs using standardized [OpenTelemetry Semantic Conventions for GenAI](https://opentelemetry.io/docs/specs/semconv/gen-ai/). This ensures broad compatibility with platforms like Datadog, New Relic, Sentry, SigNoz, MLflow, Latitude, Dash0, Traceloop, Laminar, telemetry.dev, Sazabi, and more.
|
|
12
12
|
|
|
13
13
|
### Installation
|
|
14
14
|
|
|
15
15
|
Each provider requires specific protocol packages. Install the base exporter plus the protocol package for your provider:
|
|
16
16
|
|
|
17
|
-
#### For HTTP/Protobuf
|
|
17
|
+
#### For HTTP/Protobuf providers (SigNoz, New Relic, Sentry, Laminar, MLflow, Latitude, telemetry.dev)
|
|
18
18
|
|
|
19
19
|
**npm**:
|
|
20
20
|
|
|
@@ -40,7 +40,7 @@ yarn add @mastra/otel-exporter@latest @opentelemetry/exporter-trace-otlp-proto
|
|
|
40
40
|
bun add @mastra/otel-exporter@latest @opentelemetry/exporter-trace-otlp-proto
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
#### For `gRPC`
|
|
43
|
+
#### For `gRPC` providers (Dash0, Datadog)
|
|
44
44
|
|
|
45
45
|
**npm**:
|
|
46
46
|
|
|
@@ -66,7 +66,7 @@ yarn add @mastra/otel-exporter@latest @opentelemetry/exporter-trace-otlp-grpc @g
|
|
|
66
66
|
bun add @mastra/otel-exporter@latest @opentelemetry/exporter-trace-otlp-grpc @grpc/grpc-js
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
#### For HTTP/JSON
|
|
69
|
+
#### For HTTP/JSON providers (Traceloop, Sazabi)
|
|
70
70
|
|
|
71
71
|
**npm**:
|
|
72
72
|
|
|
@@ -199,6 +199,29 @@ new OtelExporter({
|
|
|
199
199
|
})
|
|
200
200
|
```
|
|
201
201
|
|
|
202
|
+
#### Sazabi
|
|
203
|
+
|
|
204
|
+
[Sazabi](https://sazabi.com) is an AI-native observability platform that ingests OTLP traces. In Sazabi, add a Mastra log source and copy its intake URL. The URL carries your project key, so no auth header is needed:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
SAZABI_INTAKE_URL=https://...
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Use the `custom` provider with HTTP/JSON:
|
|
211
|
+
|
|
212
|
+
```typescript
|
|
213
|
+
new OtelExporter({
|
|
214
|
+
provider: {
|
|
215
|
+
custom: {
|
|
216
|
+
endpoint: process.env.SAZABI_INTAKE_URL!,
|
|
217
|
+
protocol: 'http/json',
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
})
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
See [Sazabi's Mastra guide](https://docs.sazabi.com/catalogs/log-sources/send-to-an-endpoint/mastra) for the full setup.
|
|
224
|
+
|
|
202
225
|
#### Dash0
|
|
203
226
|
|
|
204
227
|
[Dash0](https://www.dash0.com/) provides real-time observability with automatic insights.
|
package/.docs/models/index.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Model Providers
|
|
6
6
|
|
|
7
|
-
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to
|
|
7
|
+
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 8254 models from 220 providers through a single API.
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
@@ -38,10 +38,10 @@ for await (const chunk of stream) {
|
|
|
38
38
|
|
|
39
39
|
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
40
40
|
| ---------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
41
|
-
| `inceptron/deepseek-ai/DeepSeek-V4-Flash-0731` | 1.0M | | | | | | $0.13 | $0.
|
|
41
|
+
| `inceptron/deepseek-ai/DeepSeek-V4-Flash-0731` | 1.0M | | | | | | $0.13 | $0.37 |
|
|
42
42
|
| `inceptron/moonshotai/Kimi-K2.6` | 262K | | | | | | $0.58 | $4 |
|
|
43
43
|
| `inceptron/moonshotai/Kimi-K2.7-Code` | 262K | | | | | | $0.56 | $3 |
|
|
44
|
-
| `inceptron/zai-org/GLM-5.2` | 1.0M | | | | | | $0.99 | $
|
|
44
|
+
| `inceptron/zai-org/GLM-5.2` | 1.0M | | | | | | $0.99 | $2 |
|
|
45
45
|
| `inceptron/zai-org/GLM-5.3` | 1.0M | | | | | | $1 | $4 |
|
|
46
46
|
| `inceptron/zai-org/GLM-5.3-Flash` | 1.0M | | | | | | $0.17 | $0.60 |
|
|
47
47
|
|
|
@@ -43,11 +43,11 @@ for await (const chunk of stream) {
|
|
|
43
43
|
| `kilo/~anthropic/claude-opus-latest` | 1.0M | | | | | | $4 | $20 |
|
|
44
44
|
| `kilo/~anthropic/claude-sonnet-latest` | 1.0M | | | | | | $2 | $10 |
|
|
45
45
|
| `kilo/~deepseek/deepseek-flash-latest` | 1.0M | | | | | | $0.02 | $1 |
|
|
46
|
-
| `kilo/~deepseek/deepseek-pro-latest` | 1.0M | | | | | | $0.
|
|
47
|
-
| `kilo/~deepseek/deepseek-v4-flash-latest` | 1.0M | | | | | | $0.
|
|
46
|
+
| `kilo/~deepseek/deepseek-pro-latest` | 1.0M | | | | | | $0.13 | $8 |
|
|
47
|
+
| `kilo/~deepseek/deepseek-v4-flash-latest` | 1.0M | | | | | | $0.04 | $0.17 |
|
|
48
48
|
| `kilo/~google/gemini-flash-latest` | 1.0M | | | | | | $0.75 | $4 |
|
|
49
49
|
| `kilo/~google/gemini-pro-latest` | 1.0M | | | | | | $2 | $10 |
|
|
50
|
-
| `kilo/~moonshotai/kimi-latest` | 1.0M | | | | | | $0.
|
|
50
|
+
| `kilo/~moonshotai/kimi-latest` | 1.0M | | | | | | $0.20 | $20 |
|
|
51
51
|
| `kilo/~openai/gpt-astra-latest` | 1.1M | | | | | | $10 | $50 |
|
|
52
52
|
| `kilo/~openai/gpt-luna-latest` | 1.1M | | | | | | $0.10 | $0.50 |
|
|
53
53
|
| `kilo/~openai/gpt-mini-latest` | 400K | | | | | | $0.75 | $5 |
|
|
@@ -55,7 +55,7 @@ for await (const chunk of stream) {
|
|
|
55
55
|
| `kilo/~openai/gpt-terra-latest` | 1.1M | | | | | | $1 | $5 |
|
|
56
56
|
| `kilo/~unbiased/pareto-latest` | 1.0M | | | | | | $0.80 | $3 |
|
|
57
57
|
| `kilo/~x-ai/grok-latest` | 500K | | | | | | $2 | $6 |
|
|
58
|
-
| `kilo/~z-ai/glm-flash-latest` | 1.0M | | | | | | $0.
|
|
58
|
+
| `kilo/~z-ai/glm-flash-latest` | 1.0M | | | | | | $0.04 | $0.07 |
|
|
59
59
|
| `kilo/~z-ai/glm-latest` | 1.0M | | | | | | $0.07 | $1 |
|
|
60
60
|
| `kilo/aion-labs/aion-2.0` | 131K | | | | | | $0.80 | $2 |
|
|
61
61
|
| `kilo/aion-labs/aion-3.0` | 131K | | | | | | $3 | $6 |
|
|
@@ -101,7 +101,7 @@ for await (const chunk of stream) {
|
|
|
101
101
|
| `kilo/deepseek/deepseek-v3.1-terminus` | 164K | | | | | | $0.27 | $1 |
|
|
102
102
|
| `kilo/deepseek/deepseek-v3.2` | 131K | | | | | | $0.28 | $0.42 |
|
|
103
103
|
| `kilo/deepseek/deepseek-v3.2-exp` | 164K | | | | | | $0.27 | $0.41 |
|
|
104
|
-
| `kilo/deepseek/deepseek-v4-flash` | 1.0M | | | | | | $0.05 | $0.
|
|
104
|
+
| `kilo/deepseek/deepseek-v4-flash` | 1.0M | | | | | | $0.05 | $0.09 |
|
|
105
105
|
| `kilo/deepseek/deepseek-v4-flash-0731` | 1.0M | | | | | | $0.44 | $1 |
|
|
106
106
|
| `kilo/deepseek/deepseek-v4-flash-vision-exp` | 1.0M | | | | | | $0.22 | $0.65 |
|
|
107
107
|
| `kilo/deepseek/deepseek-v4-pro` | 1.0M | | | | | | $2 | $3 |
|
|
@@ -378,9 +378,9 @@ for await (const chunk of stream) {
|
|
|
378
378
|
| `kilo/tencent/hy-mt2-1.8b` | 8K | | | | | | $0.04 | $0.18 |
|
|
379
379
|
| `kilo/tencent/hy-mt2-30b-a3b` | 8K | | | | | | $0.07 | $0.29 |
|
|
380
380
|
| `kilo/tencent/hy-mt2-7b` | 8K | | | | | | $0.07 | $0.29 |
|
|
381
|
-
| `kilo/tencent/hy3` | 262K | | | | | | $0.
|
|
381
|
+
| `kilo/tencent/hy3` | 262K | | | | | | $0.08 | $0.33 |
|
|
382
382
|
| `kilo/tencent/hy3-preview` | 262K | | | | | | $0.18 | $0.60 |
|
|
383
|
-
| `kilo/tencent/hy4-preview` | 1.0M | | | | | | $0.
|
|
383
|
+
| `kilo/tencent/hy4-preview` | 1.0M | | | | | | $0.75 | $2 |
|
|
384
384
|
| `kilo/thedrummer/cydonia-24b-v4.1` | 131K | | | | | | $0.30 | $0.50 |
|
|
385
385
|
| `kilo/thedrummer/skyfall-36b-v2` | 33K | | | | | | $0.55 | $0.80 |
|
|
386
386
|
| `kilo/thedrummer/unslopnemo-12b` | 1.0M | | | | | | $0.40 | $0.40 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# LLM Gateway
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 429 LLM Gateway models through Mastra's model router. Authentication is handled automatically using the `LLMGATEWAY_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [LLM Gateway documentation](https://llmgateway.io/docs).
|
|
10
10
|
|
|
@@ -173,7 +173,6 @@ for await (const chunk of stream) {
|
|
|
173
173
|
| `llmgateway-providers/cerebras/glm-4.7` | 200K | | | | | | $2 | $3 |
|
|
174
174
|
| `llmgateway-providers/cerebras/gpt-oss-120b` | 131K | | | | | | $0.35 | $0.75 |
|
|
175
175
|
| `llmgateway-providers/cerebras/llama-3.3-70b-instruct` | 128K | | | | | | $0.85 | $1 |
|
|
176
|
-
| `llmgateway-providers/cerebras/qwen3-235b-a22b-instruct-2507` | 262K | | | | | | $0.60 | $1 |
|
|
177
176
|
| `llmgateway-providers/consensusprotocol/deepseek-v4-flash` | 1.0M | | | | | | $0.10 | $0.20 |
|
|
178
177
|
| `llmgateway-providers/consensusprotocol/deepseek-v4.1-flash` | 1.0M | | | | | | $0.15 | $0.55 |
|
|
179
178
|
| `llmgateway-providers/consensusprotocol/gemma-4-31b-it` | 262K | | | | | | $0.10 | $0.25 |
|
|
@@ -317,7 +316,6 @@ for await (const chunk of stream) {
|
|
|
317
316
|
| `llmgateway-providers/novita/minimax-m2.7` | 205K | | | | | | $0.30 | $1 |
|
|
318
317
|
| `llmgateway-providers/novita/minimax-m3.1-flash` | 1.0M | | | | | | $0.15 | $0.60 |
|
|
319
318
|
| `llmgateway-providers/novita/qwen3-235b-a22b-fp8` | 41K | | | | | | $0.20 | $0.80 |
|
|
320
|
-
| `llmgateway-providers/novita/qwen3-235b-a22b-instruct-2507` | 131K | | | | | | $0.09 | $0.58 |
|
|
321
319
|
| `llmgateway-providers/novita/qwen3-235b-a22b-thinking-2507` | 131K | | | | | | $0.30 | $3 |
|
|
322
320
|
| `llmgateway-providers/novita/qwen3-coder-30b-a3b-instruct` | 160K | | | | | | $0.07 | $0.27 |
|
|
323
321
|
| `llmgateway-providers/novita/qwen3-coder-480b-a35b-instruct` | 262K | | | | | | $0.38 | $2 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# DevPass (LLM Gateway)
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 207 DevPass (LLM Gateway) models through Mastra's model router. Authentication is handled automatically using the `LLMGATEWAY_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [DevPass (LLM Gateway) documentation](https://llmgateway.io/docs).
|
|
10
10
|
|
|
@@ -204,7 +204,6 @@ for await (const chunk of stream) {
|
|
|
204
204
|
| `llmgateway/qwen-plus-latest` | 1.0M | | | | | | $0.40 | $1 |
|
|
205
205
|
| `llmgateway/qwen3-14b` | 33K | | | | | | $0.08 | $0.23 |
|
|
206
206
|
| `llmgateway/qwen3-235b-a22b-fp8` | 41K | | | | | | $0.20 | $0.80 |
|
|
207
|
-
| `llmgateway/qwen3-235b-a22b-instruct-2507` | 262K | | | | | | $0.09 | $0.58 |
|
|
208
207
|
| `llmgateway/qwen3-235b-a22b-thinking-2507` | 262K | | | | | | $0.30 | $3 |
|
|
209
208
|
| `llmgateway/qwen3-30b-a3b` | 33K | | | | | | $0.10 | $0.28 |
|
|
210
209
|
| `llmgateway/qwen3-32b` | 41K | | | | | | $0.36 | $0.87 |
|
|
@@ -122,28 +122,28 @@ for await (const chunk of stream) {
|
|
|
122
122
|
| `nano-gpt/deepseek-chat` | 128K | | | | | | $0.10 | $0.42 |
|
|
123
123
|
| `nano-gpt/deepseek-chat-cheaper` | 128K | | | | | | $0.10 | $0.42 |
|
|
124
124
|
| `nano-gpt/deepseek-v3-0324` | 128K | | | | | | $0.20 | $0.77 |
|
|
125
|
-
| `nano-gpt/deepseek/deepseek-latest` | 1.0M | | | | | | $0.
|
|
125
|
+
| `nano-gpt/deepseek/deepseek-latest` | 1.0M | | | | | | $0.14 | $0.42 |
|
|
126
126
|
| `nano-gpt/deepseek/deepseek-v3.2` | 163K | | | | | | $0.21 | $0.31 |
|
|
127
127
|
| `nano-gpt/deepseek/deepseek-v3.2:thinking` | 163K | | | | | | $0.21 | $0.31 |
|
|
128
128
|
| `nano-gpt/deepseek/deepseek-v4-flash` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
129
129
|
| `nano-gpt/deepseek/deepseek-v4-flash-0423` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
130
130
|
| `nano-gpt/deepseek/deepseek-v4-flash-0423:thinking` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
131
|
-
| `nano-gpt/deepseek/deepseek-v4-flash-0731` | 1.0M | | | | | | $0.
|
|
132
|
-
| `nano-gpt/deepseek/deepseek-v4-flash-0731:thinking` | 1.0M | | | | | | $0.
|
|
133
|
-
| `nano-gpt/deepseek/deepseek-v4-flash-latest` | 1.0M | | | | | | $0.
|
|
131
|
+
| `nano-gpt/deepseek/deepseek-v4-flash-0731` | 1.0M | | | | | | $0.04 | $0.13 |
|
|
132
|
+
| `nano-gpt/deepseek/deepseek-v4-flash-0731:thinking` | 1.0M | | | | | | $0.04 | $0.13 |
|
|
133
|
+
| `nano-gpt/deepseek/deepseek-v4-flash-latest` | 1.0M | | | | | | $0.10 | $0.60 |
|
|
134
134
|
| `nano-gpt/deepseek/deepseek-v4-flash-vision-exp` | 1.0M | | | | | | $0.22 | $0.65 |
|
|
135
135
|
| `nano-gpt/deepseek/deepseek-v4-flash:thinking` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
136
136
|
| `nano-gpt/deepseek/deepseek-v4-pro` | 1.0M | | | | | | $0.70 | $1 |
|
|
137
|
-
| `nano-gpt/deepseek/deepseek-v4-pro-0813` | 1.0M | | | | | | $0.
|
|
138
|
-
| `nano-gpt/deepseek/deepseek-v4-pro-0813:thinking` | 1.0M | | | | | | $0.
|
|
137
|
+
| `nano-gpt/deepseek/deepseek-v4-pro-0813` | 1.0M | | | | | | $0.14 | $0.42 |
|
|
138
|
+
| `nano-gpt/deepseek/deepseek-v4-pro-0813:thinking` | 1.0M | | | | | | $0.14 | $0.42 |
|
|
139
139
|
| `nano-gpt/deepseek/deepseek-v4-pro:thinking` | 1.0M | | | | | | $0.70 | $1 |
|
|
140
140
|
| `nano-gpt/deepseek/deepseek-v4.1-flash` | 1.0M | | | | | | $0.09 | $0.25 |
|
|
141
141
|
| `nano-gpt/deepseek/deepseek-v4.1-flash-0910-uncensored` | 524K | | | | | | $0.33 | $1 |
|
|
142
142
|
| `nano-gpt/deepseek/deepseek-v4.1-flash-0910-uncensored:thinking` | 524K | | | | | | $0.33 | $1 |
|
|
143
|
-
| `nano-gpt/deepseek/deepseek-v4.1-flash-1017` | 1.0M | | | | | | $0.
|
|
143
|
+
| `nano-gpt/deepseek/deepseek-v4.1-flash-1017` | 1.0M | | | | | | $0.10 | $0.60 |
|
|
144
144
|
| `nano-gpt/deepseek/deepseek-v4.1-flash-1017-uncensored` | 1.0M | | | | | | $0.33 | $1 |
|
|
145
145
|
| `nano-gpt/deepseek/deepseek-v4.1-flash-1017-uncensored:thinking` | 1.0M | | | | | | $0.33 | $1 |
|
|
146
|
-
| `nano-gpt/deepseek/deepseek-v4.1-flash-1017:thinking` | 1.0M | | | | | | $0.
|
|
146
|
+
| `nano-gpt/deepseek/deepseek-v4.1-flash-1017:thinking` | 1.0M | | | | | | $0.10 | $0.60 |
|
|
147
147
|
| `nano-gpt/deepseek/deepseek-v4.1-flash-uncensored` | 1.0M | | | | | | $0.33 | $1 |
|
|
148
148
|
| `nano-gpt/deepseek/deepseek-v4.1-flash-uncensored:thinking` | 1.0M | | | | | | $0.33 | $1 |
|
|
149
149
|
| `nano-gpt/deepseek/deepseek-v4.1-flash:thinking` | 1.0M | | | | | | $0.09 | $0.25 |
|
|
@@ -252,9 +252,9 @@ for await (const chunk of stream) {
|
|
|
252
252
|
| `nano-gpt/google/gemini-flash-latest` | 1.0M | | | | | | $0.75 | $4 |
|
|
253
253
|
| `nano-gpt/google/gemini-flash-lite-latest` | 1.0M | | | | | | $0.30 | $3 |
|
|
254
254
|
| `nano-gpt/google/gemini-pro-latest` | 1.0M | | | | | | $2 | $12 |
|
|
255
|
-
| `nano-gpt/google/gemma-4-26b-a4b-it` | 262K | | | | | | $0.
|
|
255
|
+
| `nano-gpt/google/gemma-4-26b-a4b-it` | 262K | | | | | | $0.07 | $0.24 |
|
|
256
256
|
| `nano-gpt/google/gemma-4-26b-a4b-it-cybersecurity` | 262K | | | | | | $0.11 | $0.33 |
|
|
257
|
-
| `nano-gpt/google/gemma-4-26b-a4b-it:thinking` | 262K | | | | | | $0.
|
|
257
|
+
| `nano-gpt/google/gemma-4-26b-a4b-it:thinking` | 262K | | | | | | $0.07 | $0.24 |
|
|
258
258
|
| `nano-gpt/google/gemma-4-31b-it` | 262K | | | | | | $0.14 | $0.40 |
|
|
259
259
|
| `nano-gpt/google/gemma-4-31b-it:thinking` | 262K | | | | | | $0.10 | $0.34 |
|
|
260
260
|
| `nano-gpt/google/gemma4-31b-splituntied` | 262K | | | | | | $0.10 | $0.30 |
|
|
@@ -591,7 +591,7 @@ for await (const chunk of stream) {
|
|
|
591
591
|
| `nano-gpt/TEE/qwen3.6-35b-a3b` | 262K | | | | | | $0.20 | $1 |
|
|
592
592
|
| `nano-gpt/TEE/qwen3.8-27b` | 262K | | | | | | $0.40 | $3 |
|
|
593
593
|
| `nano-gpt/tencent/hy3` | 262K | | | | | | $0.07 | $0.26 |
|
|
594
|
-
| `nano-gpt/tencent/hy4-preview` | 1.0M | | | | | | $0.
|
|
594
|
+
| `nano-gpt/tencent/hy4-preview` | 1.0M | | | | | | $0.75 | $2 |
|
|
595
595
|
| `nano-gpt/TheDrummer/Anubis-70B-v1` | 66K | | | | | | $0.31 | $0.31 |
|
|
596
596
|
| `nano-gpt/TheDrummer/Anubis-70B-v1.1` | 32K | | | | | | $0.31 | $0.31 |
|
|
597
597
|
| `nano-gpt/TheDrummer/Artemis-v1.1` | 262K | | | | | | $0.10 | $0.45 |
|
|
@@ -669,8 +669,8 @@ for await (const chunk of stream) {
|
|
|
669
669
|
| `nano-gpt/z-ai/glm-5:thinking` | 200K | | | | | | $0.60 | $2 |
|
|
670
670
|
| `nano-gpt/z-ai/glm-5.1` | 200K | | | | | | $0.70 | $3 |
|
|
671
671
|
| `nano-gpt/z-ai/glm-5.1:thinking` | 200K | | | | | | $0.70 | $3 |
|
|
672
|
-
| `nano-gpt/z-ai/glm-5.2` | 1.0M | | | | | | $0.
|
|
673
|
-
| `nano-gpt/z-ai/glm-5.2:thinking` | 1.0M | | | | | | $0.
|
|
672
|
+
| `nano-gpt/z-ai/glm-5.2` | 1.0M | | | | | | $0.19 | $0.59 |
|
|
673
|
+
| `nano-gpt/z-ai/glm-5.2:thinking` | 1.0M | | | | | | $0.19 | $0.59 |
|
|
674
674
|
| `nano-gpt/z-ai/glm-5.3` | 1.0M | | | | | | $0.60 | $1 |
|
|
675
675
|
| `nano-gpt/z-ai/glm-5.3-flash` | 1.0M | | | | | | $0.10 | $0.30 |
|
|
676
676
|
| `nano-gpt/z-ai/glm-5.3-flash-apex` | 1.0M | | | | | | $0.15 | $0.50 |
|
|
@@ -502,6 +502,8 @@ Subscribes to raw stream chunks for a memory thread. Use this before calling `se
|
|
|
502
502
|
|
|
503
503
|
**options.hideSignals** (`boolean | AgentSignalType[]`): Use true to hide all recognized signals, false to show all, or an array to hide selected types from this subscription, including live, idle-persisted, and replayed signals. Other subscribers and the initiating stream keep their own policies.
|
|
504
504
|
|
|
505
|
+
**options.withRunStatus** (`boolean`): Emit ordered thread-run-status chunks for live and retained outcomes without closing the subscription.
|
|
506
|
+
|
|
505
507
|
**options.withInitialHistory** (`boolean | { perPage?: number }`): Emit the stored thread messages as one thread-history chunk first, then only retained parts newer than that history, then live parts. Completed runs already in storage aren't replayed; pending tool approvals are still emitted. perPage limits how many recent messages are loaded (default 40). Without agent memory, or when the thread has no stored messages yet, the history chunk is emitted with an empty messages array.
|
|
506
508
|
|
|
507
509
|
By default, subscriptions include every signal type, including reactive reminders. To hide reminders for one subscriber without affecting another:
|
|
@@ -527,7 +529,7 @@ for await (const chunk of subscription.stream) {
|
|
|
527
529
|
}
|
|
528
530
|
```
|
|
529
531
|
|
|
530
|
-
The `thread-history` chunk carries the newest `perPage` messages
|
|
532
|
+
The `thread-history` chunk carries the newest `perPage` messages, a `hasMore` flag, and `activeRunId` (the owning run or `null` when idle). Set `withRunStatus: true` to receive [run outcomes](https://mastra.ai/reference/streaming/ChunkType), including one per still-retained finished run. Both options add their chunk types to the inferred subscription stream only when requested. See [Thread subscription chunks](https://mastra.ai/reference/streaming/ChunkType) for its shape.
|
|
531
533
|
|
|
532
534
|
`hideSignals: true` hides all recognized signal types. Set it to `false` to show all signals. An array accepts `user`, `state`, `reactive`, `notification`, `user-message`, and `system-reminder`. Matching normalizes `system-reminder` to `reactive` and `user-message` to `user`. An omitted option, `false`, or `[]` excludes nothing. Each subscriber filters its own live and replayed chunks, including remote pubsub events and idle-persisted signals. Filtering preserves non-signal chunks, unknown or malformed signal chunks, ordering, and completion/error events, even when every signal type is excluded.
|
|
533
535
|
|
|
@@ -201,6 +201,8 @@ A non-zero offset can skip earlier events. Aggregated values are built only from
|
|
|
201
201
|
|
|
202
202
|
When the PubSub transport supports numeric offsets, an offset beyond the highest retained index replays nothing and also skips live events with lower indexes. The observer receives events only when the published index reaches the requested offset. If the index counter restarts below that offset, the observer can wait indefinitely. On a transport without numeric offset support, providing an offset starts with new live events and doesn't replay cached events. Replay is limited to events still available in the configured cache. Events can't be replayed when caching is disabled, `shouldCache` excludes the run topic, a cache write fails, or retained events have been cleared.
|
|
203
203
|
|
|
204
|
+
An evented agent (`createEventedAgent()`) on a cross-process PubSub, such as Redis Streams, numbers its events only when every process shares the server cache. Configure a shared cache such as `RedisServerCache` on the `Mastra` instance. With the default in-memory server cache, events aren't numbered, so an offset can't skip them: the observer can receive events from before the offset again, and Mastra logs a warning.
|
|
205
|
+
|
|
204
206
|
By default `observe()` waits indefinitely for events. If the process running the run stops unexpectedly, the run stops producing events but never emits a completion event, so the observed stream would wait forever. Pass `idleTimeoutMs` to end the stream after a bounded period of silence. Before timing out, `observe()` can consult an optional `isAlive` check. Return `true` while work continues, such as during a long-running tool call or a pause for human input. A `false` result ends the stream with an error, as does omitting `isAlive`. A transient throw from `isAlive` is treated as "still alive", so a momentary check failure never ends a live stream.
|
|
205
207
|
|
|
206
208
|
```typescript
|
|
@@ -396,17 +398,23 @@ await output.text
|
|
|
396
398
|
cleanup()
|
|
397
399
|
```
|
|
398
400
|
|
|
399
|
-
`
|
|
401
|
+
Recovery restarts from the persisted `durable-agentic-loop` checkpoint. The nested execution row alone isn't sufficient. Before starting a run, enable `recovery: { durableAgents: 'auto' }` on `Mastra`, or provide a `shouldPersistSnapshot` policy that includes `'running'`. Recovery is unavailable until the first running checkpoint is saved, even with persistence enabled. Enabling persistence after a crash can't reconstruct a missing checkpoint.
|
|
402
|
+
|
|
403
|
+
Model and tool calls after the checkpoint may run again. Make tool side effects idempotent. Recovery doesn't guarantee exactly-once execution.
|
|
404
|
+
|
|
405
|
+
`recover()` throws for unavailable checkpoints and runs that aren't orphaned:
|
|
400
406
|
|
|
401
|
-
| Error ID
|
|
402
|
-
|
|
|
403
|
-
| `
|
|
404
|
-
| `
|
|
405
|
-
| `
|
|
406
|
-
| `
|
|
407
|
-
| `
|
|
407
|
+
| Error ID | Thrown when |
|
|
408
|
+
| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
409
|
+
| `DURABLE_AGENT_RECOVER_CHECKPOINT_NOT_AVAILABLE` | The loop row is still `pending` without a workflow input. No restartable checkpoint is available. No recovered execution starts, and any acquired recovery claim is released. |
|
|
410
|
+
| `DURABLE_AGENT_RUN_ACTIVE` | Another execution holds the run, and `force` isn't set. |
|
|
411
|
+
| `DURABLE_AGENT_RECOVER_RUN_ACTIVE_LOCALLY` | This process is executing the run. `force` doesn't override this. |
|
|
412
|
+
| `DURABLE_AGENT_RECOVER_ALREADY_IN_PROGRESS` | This process is already recovering the run. |
|
|
413
|
+
| `DURABLE_AGENT_RECOVER_RUN_SUSPENDED` | The run is suspended. Continue it with `resume()`. |
|
|
414
|
+
| `DURABLE_AGENT_RECOVER_RUN_NOT_ACTIVE` | The snapshot isn't restartable and isn't suspended. |
|
|
415
|
+
| `DURABLE_AGENT_EXECUTION_CONFLICT` | With `force`, another execution claimed the run during the takeover. |
|
|
408
416
|
|
|
409
|
-
The server's `POST /agents/:agentId/recover` route returns
|
|
417
|
+
The server's `POST /agents/:agentId/recover` route returns ownership, already-in-progress, suspended-run, and inactive-run conflicts as `409 Conflict`. An unavailable checkpoint returns `500 Internal Server Error`.
|
|
410
418
|
|
|
411
419
|
**options.force** (`boolean`): Take the run over even while another execution holds it. That execution loses the run and stops, and streams for the run drop the events it still publishes. Its writes are rejected when the storage adapter supports run fencing. (Default: `false`)
|
|
412
420
|
|
|
@@ -349,6 +349,8 @@ const { messages, initialHistoryPagination } = useChat({
|
|
|
349
349
|
|
|
350
350
|
**threadId** (`string`): Thread ID to subscribe to.
|
|
351
351
|
|
|
352
|
+
**withRunStatus** (`boolean`): Emit live and retained thread-run-status outcomes. Callback types include these chunks only when requested. useChat enables this for its thread subscription. (Default: `false`)
|
|
353
|
+
|
|
352
354
|
**processDataStream().reconnect** (`boolean | { maxRetries?: number; delayMs?: number }`): Reconnects the subscription stream after it closes or a reconnect request fails. true retries indefinitely with a one-second delay. A 4xx (other than 408 and 429) or 501 response stops reconnecting and rejects with that error.
|
|
353
355
|
|
|
354
356
|
The subscription also exposes `abort(options?)` and `unsubscribe()`. `await subscription.abort({ clearPendingSignals: true })` requests an abort and clears pending signals without closing the subscription. Omit the flag to preserve pending input. `unsubscribe()` closes the subscription without aborting the run.
|
|
@@ -54,19 +54,19 @@ Registering in `errorProcessors` alone, as the example above does, covers both h
|
|
|
54
54
|
|
|
55
55
|
`ProviderHistoryCompat` includes these built-in compatibility rules:
|
|
56
56
|
|
|
57
|
-
| Rule | Provider | Timing
|
|
58
|
-
| ------------------------------------------------ | ---------------------------------------------- |
|
|
59
|
-
| `strip-foreign-provider-executed-tools` | Anthropic, OpenAI, Azure OpenAI, Google/Vertex | Preemptive prompt rewrite
|
|
60
|
-
| `anthropic-tool-id-format` | Anthropic | Preemptive prompt rewrite
|
|
61
|
-
| `cerebras-strip-reasoning-content` | Cerebras | Preemptive prompt rewrite
|
|
62
|
-
| `anthropic-strip-empty-signed-reasoning-content` | Anthropic |
|
|
63
|
-
| `anthropic-strip-foreign-reasoning-content` | Anthropic | Preemptive prompt rewrite
|
|
64
|
-
| `anthropic-strip-foreign-signed-reasoning` | Anthropic-compatible | Preemptive prompt rewrite
|
|
65
|
-
| `azure-system-reminder-transform` | Azure OpenAI | Preemptive prompt rewrite
|
|
66
|
-
| `openai-orphan-item-id` | OpenAI, Azure OpenAI (Responses) | Reactive API error recovery
|
|
67
|
-
| `anthropic-orphaned-thinking-step` | Anthropic | Reactive API error recovery
|
|
68
|
-
| `tool-call-empty-input` | All providers | Preemptive prompt rewrite
|
|
69
|
-
| `ensure-user-first-turn` | Amazon Bedrock, Google/Vertex Gemini | Preemptive prompt rewrite
|
|
57
|
+
| Rule | Provider | Timing | Behavior |
|
|
58
|
+
| ------------------------------------------------ | ---------------------------------------------- | --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
59
|
+
| `strip-foreign-provider-executed-tools` | Anthropic, OpenAI, Azure OpenAI, Google/Vertex | Preemptive prompt rewrite | Removes provider-executed tool calls and their paired results from the outbound prompt when they came from a different provider family, since the receiving provider can't resolve another provider's tool IDs. Persisted history is left untouched. |
|
|
60
|
+
| `anthropic-tool-id-format` | Anthropic | Preemptive prompt rewrite | Rewrites tool call IDs that contain characters outside `[a-zA-Z0-9_-]` in the outbound prompt, on both the call and its result. A sanitized ID that would collide with one already in the prompt gets a `_2`, `_3`, … suffix. The provider's rejection never fires, and persisted history keeps the original IDs. A reactive fallback covers providers the preemptive check doesn't recognize, such as Vertex-hosted Claude. |
|
|
61
|
+
| `cerebras-strip-reasoning-content` | Cerebras | Preemptive prompt rewrite | Removes assistant `reasoning` parts from the outbound prompt so they're not serialized as unsupported `reasoning_content` fields. |
|
|
62
|
+
| `anthropic-strip-empty-signed-reasoning-content` | Anthropic | Reactive (matches Anthropic's 400 rejecting modified thinking blocks) | Removes assistant `reasoning` parts that carry an Anthropic signature but have empty text, which legacy records can contain, from earlier messages. Runs only after Anthropic rejects the history, because Claude 5.x returns empty-text signed blocks as normal output and they must be replayed unchanged to keep prompt caching. |
|
|
63
|
+
| `anthropic-strip-foreign-reasoning-content` | Anthropic | Preemptive prompt rewrite | Removes non-Anthropic assistant `reasoning` parts from the outbound prompt. Anthropic-native thinking history is preserved. |
|
|
64
|
+
| `anthropic-strip-foreign-signed-reasoning` | Anthropic-compatible | Preemptive prompt rewrite | Drops signed thinking from the outbound prompt when its origin turn was stamped with a different provider (for example Kimi For Coding ↔ `anthropic/claude-sonnet-5-5`), since the receiving provider can't verify another provider's signature. Turns emptied of all content by the drop are removed from the prompt. Unstamped history is left untouched. |
|
|
65
|
+
| `azure-system-reminder-transform` | Azure OpenAI | Preemptive prompt rewrite | Renames `<system-reminder>` wrappers in user text and system instructions to `<memory-context>` for the outbound request. Stored history remains unchanged. |
|
|
66
|
+
| `openai-orphan-item-id` | OpenAI, Azure OpenAI (Responses) | Reactive API error recovery | Recovers history that OpenAI rejects with `Item 'msg_…' of type 'message' was provided without its required 'reasoning' item`. Drops the Responses `itemId` from every item-bearing part of an assistant message that carries one but has no `reasoning` part, and retries. The message then replays by value instead of as an unsatisfiable `item_reference`. The repair is applied to the in-memory list for the current turn. |
|
|
67
|
+
| `anthropic-orphaned-thinking-step` | Anthropic | Reactive API error recovery | Recovers history that Anthropic rejects because `thinking` or `redacted_thinking` blocks in the latest assistant message can't be modified. Removes steps that contain only reasoning when more assistant content follows them, and retries. Covers history saved by older `@mastra/memory` releases ([#22798](https://github.com/mastra-ai/mastra/issues/22798)). |
|
|
68
|
+
| `tool-call-empty-input` | All providers | Preemptive prompt rewrite | Sends an assistant tool call whose stored input is missing (`undefined` or `null`) as `{}` in the outbound prompt, because providers reject a tool call without input (Anthropic: `tool_use.input: Field required`). A call whose arguments couldn't be parsed is stored this way. The call keeps its paired error result, and persisted history is left untouched. An empty-string input is a real stored value and is sent as is. |
|
|
69
|
+
| `ensure-user-first-turn` | Amazon Bedrock, Google/Vertex Gemini | Preemptive prompt rewrite | Inserts a minimal user turn (`.`) before a leading assistant turn, because these providers reject conversations whose first non-system turn is the assistant's. This happens when an agent greets first or `lastMessages` cuts into a thread. Runs last, so it sees the prompt after other rules have dropped emptied turns. |
|
|
70
70
|
|
|
71
71
|
Preemptive rules run through `processLLMRequest` after Mastra converts messages to the model prompt format and before the prompt is sent to the provider. These rewrites affect only the current provider call. Persisted history is never changed, so the IDs and content in memory and in the Studio stay exactly as written.
|
|
72
72
|
|
|
@@ -764,8 +764,26 @@ The stored history of a thread, emitted at the start of a thread subscription.
|
|
|
764
764
|
|
|
765
765
|
**payload.hasMore** (`boolean`): Whether older messages exist beyond this page.
|
|
766
766
|
|
|
767
|
+
**payload.activeRunId** (`string | null`): Run holding thread ownership during hydration, or null when idle. Use thread-run-status for the outcome.
|
|
768
|
+
|
|
767
769
|
For queue-count events on the same thread, see the [Thread events reference](https://mastra.ai/reference/signals/thread-events).
|
|
768
770
|
|
|
771
|
+
### thread-run-status
|
|
772
|
+
|
|
773
|
+
`ThreadRunStatusChunk` reports a run's outcome independently of stored-message replay. It's exported from `@mastra/core/stream` and emitted only when `subscribeToThread()` receives `withRunStatus: true`. The option defaults to `false`.
|
|
774
|
+
|
|
775
|
+
Live output precedes its status. `success`, `failed`, and `aborted` are final outcomes. `suspended` is resumable, so the same run can later emit more output and a final outcome. A status doesn't close the subscription.
|
|
776
|
+
|
|
777
|
+
**type** (`"thread-run-status"`): Chunk type identifier.
|
|
778
|
+
|
|
779
|
+
**runId** (`string`): ID of the run whose outcome is reported.
|
|
780
|
+
|
|
781
|
+
**from** (`ChunkFrom`): Always AGENT for thread run outcomes.
|
|
782
|
+
|
|
783
|
+
**payload** (`{ status: "success" | "failed" | "aborted" | "suspended" }`): Run outcome. Suspended runs can resume.
|
|
784
|
+
|
|
785
|
+
With `withInitialHistory`, `thread-history` arrives first. Opted-in late subscribers then receive one outcome per still-retained finished run, including runs outside that history page. Final outcomes are deduplicated within a subscription. Suspensions are deduplicated per execution segment. Reconnecting can redeliver outcomes. Recovery depends on PubSub retention and isn't a permanent audit log. See [Thread streams](https://mastra.ai/docs/signals/thread-streams).
|
|
786
|
+
|
|
769
787
|
## Usage example
|
|
770
788
|
|
|
771
789
|
```typescript
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.3.10-alpha.
|
|
3
|
+
"version": "1.3.10-alpha.9",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@mastra/mcp-legacy": "npm:@mastra/mcp@^1.18.0",
|
|
27
27
|
"local-pkg": "^1.2.1",
|
|
28
28
|
"zod": "^4.6.7",
|
|
29
|
-
"@mastra/core": "1.80.0-alpha.
|
|
29
|
+
"@mastra/core": "1.80.0-alpha.6",
|
|
30
30
|
"@mastra/mcp": "^2.6.0-alpha.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"vitest": "4.1.12",
|
|
45
45
|
"@internal/lint": "0.0.145",
|
|
46
46
|
"@internal/types-builder": "0.0.120",
|
|
47
|
-
"@mastra/core": "1.80.0-alpha.
|
|
47
|
+
"@mastra/core": "1.80.0-alpha.6"
|
|
48
48
|
},
|
|
49
49
|
"homepage": "https://mastra.ai",
|
|
50
50
|
"repository": {
|