@mastra/mcp-docs-server 1.2.17-alpha.16 → 1.2.17-alpha.17
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.
|
@@ -164,6 +164,8 @@ const result = await agent.generate('message for agent')
|
|
|
164
164
|
|
|
165
165
|
**options.modelSettings.frequencyPenalty** (`number`): Penalty for token frequency (-2 to 2). Reduces repetition of frequent tokens.
|
|
166
166
|
|
|
167
|
+
**options.modelSettings.timeout** (`object`): Time-based execution budget for the run. Accepts totalMs, the maximum duration of the entire agent run across every loop iteration, tool call and retry, and stepMs, the maximum duration of a single model call including the time spent consuming its stream. Exceeding either budget fails with a MastraTimeoutError. A totalMs timeout ends the run and does not try fallback models, because it is a hard deadline for the whole run. A stepMs timeout is not retried against the same model but does advance to the next entry in models when fallback models are configured.
|
|
168
|
+
|
|
167
169
|
**options.modelSettings.stopSequences** (`string[]`): Stop sequences. If set, the model will stop generating text when one of the stop sequences is generated.
|
|
168
170
|
|
|
169
171
|
**options.toolChoice** (`'auto' | 'none' | 'required' | { type: 'tool'; toolName: string }`): Controls how tools are selected during generation.
|
|
@@ -100,6 +100,8 @@ await agent.network(`
|
|
|
100
100
|
|
|
101
101
|
**options.modelSettings.frequencyPenalty** (`number`): Penalty for token frequency (-2 to 2). Reduces repetition of frequent tokens.
|
|
102
102
|
|
|
103
|
+
**options.modelSettings.timeout** (`object`): Time-based execution budget for the run. Accepts totalMs, the maximum duration of the entire agent run across every loop iteration, tool call and retry, and stepMs, the maximum duration of a single model call including the time spent consuming its stream. Exceeding either budget fails with a MastraTimeoutError. A totalMs timeout ends the run and does not try fallback models, because it is a hard deadline for the whole run. A stepMs timeout is not retried against the same model but does advance to the next entry in models when fallback models are configured.
|
|
104
|
+
|
|
103
105
|
**options.modelSettings.stopSequences** (`string[]`): Stop sequences. If set, the model will stop generating text when one of the stop sequences is generated.
|
|
104
106
|
|
|
105
107
|
**options.structuredOutput** (`StructuredOutputOptions`): Configuration for generating a typed structured output from the network result.
|
|
@@ -158,6 +158,8 @@ const stream = await agent.stream('message for agent')
|
|
|
158
158
|
|
|
159
159
|
**options.modelSettings.frequencyPenalty** (`number`): Penalty for token frequency (-2 to 2). Reduces repetition of frequent tokens.
|
|
160
160
|
|
|
161
|
+
**options.modelSettings.timeout** (`object`): Time-based execution budget for the run. Accepts totalMs, the maximum duration of the entire agent run across every loop iteration, tool call and retry, and stepMs, the maximum duration of a single model call including the time spent consuming its stream. Exceeding either budget fails with a MastraTimeoutError. A totalMs timeout ends the run and does not try fallback models, because it is a hard deadline for the whole run. A stepMs timeout is not retried against the same model but does advance to the next entry in models when fallback models are configured.
|
|
162
|
+
|
|
161
163
|
**options.modelSettings.stopSequences** (`string[]`): Stop sequences. If set, the model will stop generating text when one of the stop sequences is generated.
|
|
162
164
|
|
|
163
165
|
**options.toolChoice** (`'auto' | 'none' | 'required' | { type: 'tool'; toolName: string }`): Controls how the agent uses tools during streaming.
|
|
@@ -264,6 +266,26 @@ for await (const chunk of stream.fullStream) {
|
|
|
264
266
|
const fullText = await stream.text
|
|
265
267
|
```
|
|
266
268
|
|
|
269
|
+
### Limiting execution time
|
|
270
|
+
|
|
271
|
+
Use `modelSettings.timeout` to bound how long a run may take. `totalMs` limits the entire run, including every loop iteration, tool call and retry. `stepMs` limits a single model call, covering both establishing the stream and consuming it.
|
|
272
|
+
|
|
273
|
+
```ts
|
|
274
|
+
const stream = await agent.stream('Tell me a story', {
|
|
275
|
+
modelSettings: {
|
|
276
|
+
timeout: {
|
|
277
|
+
totalMs: 30000, // fail the run if it takes longer than 30s
|
|
278
|
+
stepMs: 10000, // fail an individual model call after 10s
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
})
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Exceeding either budget fails with a `MastraTimeoutError`, which carries a `timeoutType` of `'total'` or `'step'`. Each budget behaves differently when the agent is configured with fallback [`models`](https://mastra.ai/reference/agents/agent):
|
|
285
|
+
|
|
286
|
+
- A `totalMs` timeout ends the run immediately and doesn't try the next model, because it's a hard deadline for the run as a whole.
|
|
287
|
+
- A `stepMs` timeout isn't retried against the same model, but does advance to the next model, which makes it a way to fail over from a slow provider.
|
|
288
|
+
|
|
267
289
|
### AI SDK v5+ Format
|
|
268
290
|
|
|
269
291
|
To use the stream with AI SDK v5 (and later), you can convert it using our utility function `toAISdkStream`.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @mastra/mcp-docs-server
|
|
2
2
|
|
|
3
|
+
## 1.2.17-alpha.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`b860493`](https://github.com/mastra-ai/mastra/commit/b86049391100e665d579f700c8a2034c036defc3)]:
|
|
8
|
+
- @mastra/core@1.60.0-alpha.10
|
|
9
|
+
|
|
3
10
|
## 1.2.17-alpha.15
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.2.17-alpha.
|
|
3
|
+
"version": "1.2.17-alpha.17",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"jsdom": "^26.1.0",
|
|
29
29
|
"local-pkg": "^1.1.2",
|
|
30
30
|
"zod": "^4.4.3",
|
|
31
|
-
"@mastra/core": "1.60.0-alpha.
|
|
31
|
+
"@mastra/core": "1.60.0-alpha.10",
|
|
32
32
|
"@mastra/mcp": "^1.17.0-alpha.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"tsx": "^4.23.1",
|
|
46
46
|
"typescript": "^6.0.3",
|
|
47
47
|
"vitest": "4.1.10",
|
|
48
|
-
"@internal/lint": "0.0.123",
|
|
49
48
|
"@internal/types-builder": "0.0.98",
|
|
50
|
-
"@mastra/core": "1.60.0-alpha.
|
|
49
|
+
"@mastra/core": "1.60.0-alpha.10",
|
|
50
|
+
"@internal/lint": "0.0.123"
|
|
51
51
|
},
|
|
52
52
|
"homepage": "https://mastra.ai",
|
|
53
53
|
"repository": {
|