@mastra/mcp-docs-server 1.3.6-alpha.1 → 1.3.6-alpha.3

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.
Files changed (53) hide show
  1. package/.docs/docs/agents/human-in-the-loop.md +5 -3
  2. package/.docs/docs/agents/processors.md +7 -3
  3. package/.docs/docs/agents/tools.md +24 -0
  4. package/.docs/docs/memory/memory-processors.md +2 -5
  5. package/.docs/docs/memory/semantic-recall.md +2 -2
  6. package/.docs/docs/memory/working-memory.md +16 -0
  7. package/.docs/docs/subagents.md +10 -8
  8. package/.docs/docs/workflows/control-flow.md +1 -1
  9. package/.docs/integrations/agentic-ui/ai-sdk-ui.md +60 -0
  10. package/.docs/models/gateways/merge-gateway.md +2 -1
  11. package/.docs/models/gateways/netlify.md +2 -1
  12. package/.docs/models/gateways/openrouter.md +2 -1
  13. package/.docs/models/gateways/vercel.md +3 -4
  14. package/.docs/models/index.md +1 -1
  15. package/.docs/models/providers/alibaba.md +1 -1
  16. package/.docs/models/providers/anthropic.md +4 -3
  17. package/.docs/models/providers/berget.md +1 -1
  18. package/.docs/models/providers/coralbricks.md +1 -2
  19. package/.docs/models/providers/cortecs.md +3 -1
  20. package/.docs/models/providers/edenai.md +5 -3
  21. package/.docs/models/providers/kilo.md +12 -11
  22. package/.docs/models/providers/llmgateway-providers.md +4 -1
  23. package/.docs/models/providers/llmgateway.md +2 -1
  24. package/.docs/models/providers/mistral.md +9 -16
  25. package/.docs/models/providers/nano-gpt.md +3 -3
  26. package/.docs/models/providers/ollama-cloud.md +2 -1
  27. package/.docs/models/providers/opencode-go.md +5 -4
  28. package/.docs/models/providers/opencode.md +2 -1
  29. package/.docs/models/providers/requesty.md +2 -2
  30. package/.docs/reference/agents/generate.md +1 -1
  31. package/.docs/reference/classifier/classifier.md +35 -35
  32. package/.docs/reference/client-js/memory.md +12 -0
  33. package/.docs/reference/configuration.md +2 -2
  34. package/.docs/reference/connect/providers.md +118 -112
  35. package/.docs/reference/core/getClassifier.md +1 -1
  36. package/.docs/reference/editor/processor-provider.md +2 -2
  37. package/.docs/reference/evals/create-classifier-scorer.md +5 -5
  38. package/.docs/reference/logging/pino-logger.md +1 -1
  39. package/.docs/reference/memory/deleteMessages.md +1 -1
  40. package/.docs/reference/memory/memory-class.md +2 -2
  41. package/.docs/reference/migrations/upgrade-to-v1/memory.md +1 -1
  42. package/.docs/reference/processors/classifier-processor.md +6 -6
  43. package/.docs/reference/processors/message-history-processor.md +3 -2
  44. package/.docs/reference/processors/model-selection-processor.md +11 -11
  45. package/.docs/reference/processors/response-cache.md +1 -1
  46. package/.docs/reference/processors/semantic-recall-processor.md +2 -3
  47. package/.docs/reference/processors/working-memory-processor.md +3 -2
  48. package/.docs/reference/pubsub/unix-socket-pubsub.md +6 -2
  49. package/.docs/reference/rag/metadata-filters.md +1 -1
  50. package/.docs/reference/rag/vector-databases.md +1 -1
  51. package/.docs/reference/streaming/agents/stream.md +1 -1
  52. package/.docs/reference/workflows/step.md +1 -1
  53. package/package.json +6 -6
@@ -4,11 +4,11 @@
4
4
 
5
5
  # ModelSelectionProcessor
6
6
 
7
- `ModelSelectionProcessor` classifies the incoming request once, then overrides which model serves the run. It's intended for cost routing: keep a capable model as the agent's configured default and let the processor downgrade to a cheaper model when an evaluation model is confident the cheaper model can handle the request.
7
+ `ModelSelectionProcessor` classifies the incoming request once, then overrides which model serves the run. It's intended for cost routing: keep a capable model as the agent's configured default and let the processor downgrade to a cheaper model when a decision model is confident the cheaper model can handle the request.
8
8
 
9
9
  > **Warning:** Routing can cost more than it saves. Provider prompt caches aren't shared between models. Each switch pays full price for the conversation again, and a cheaper model can take more steps to finish a task. Measure cost and quality on your own traffic before enabling it. See [Cost tradeoffs](#cost-tradeoffs).
10
10
 
11
- Describe each model alongside the kind of request it should handle. The processor builds the [Classifier](https://mastra.ai/reference/classifier/classifier) for you. The processor's own `model` option takes an evaluation model (`EvaluationModelV4 | MastraEvaluationModel`), the same type `Classifier` accepts. A `'provider/model'` string isn't supported for this option. See [Evaluation models](https://mastra.ai/reference/classifier/classifier) for provider setup:
11
+ Describe each model alongside the kind of request it should handle. The processor builds the [Classifier](https://mastra.ai/reference/classifier/classifier) for you. The processor's own `model` option takes a decision model (`DecisionModelV4 | EvaluationModelV4 | MastraDecisionModel`), the same type `Classifier` accepts. A `'provider/model'` string isn't supported for this option. See [Decision models](https://mastra.ai/reference/classifier/classifier) for provider setup:
12
12
 
13
13
  ```typescript
14
14
  import { Agent } from '@mastra/core/agent'
@@ -21,7 +21,7 @@ export const agent = new Agent({
21
21
  model: 'openai/gpt-5.6-sol',
22
22
  inputProcessors: [
23
23
  new ModelSelectionProcessor({
24
- model: typeSafeAi.evaluationModel('jev-latest'),
24
+ model: typeSafeAi.decisionModel('jev-latest'),
25
25
  choices: [
26
26
  {
27
27
  model: 'openai/gpt-5-mini',
@@ -55,7 +55,7 @@ By default the decision applies to every step of the run. Set `scope: 'first-ste
55
55
 
56
56
  **choices.name** (`string`): Name reported in onDecision. Defaults to the model ID. Set it when the same model appears in two choices.
57
57
 
58
- **model** (`EvaluationModelV4 | MastraEvaluationModel`): The evaluation model used to make the routing decision, the same type as the Classifier model option. A provider/model string is not supported. Required with choices, and unrelated to the models being routed to.
58
+ **model** (`DecisionModelV4 | EvaluationModelV4 | MastraDecisionModel`): The decision model used to make the routing decision, the same type as the Classifier model option. A provider/model string is not supported. Required with choices, and unrelated to the models being routed to.
59
59
 
60
60
  **instructions** (`string`): The objective the processor optimizes for, used with choices. Defaults to choosing the least capable model that can handle the request correctly. Set it to state a different objective, such as favoring accuracy over cost.
61
61
 
@@ -71,7 +71,7 @@ By default the decision applies to every step of the run. Set `scope: 'first-ste
71
71
 
72
72
  **scope** (`'run' | 'first-step'`): Which model calls the decision applies to. 'run' routes every step. 'first-step' routes only the opening call, which captures far less saving because context accumulates across a run. (Default: `'run'`)
73
73
 
74
- **providerOptions** (`SharedV4ProviderOptions`): Provider-specific options forwarded to Classifier.evaluate().
74
+ **providerOptions** (`SharedV4ProviderOptions`): Provider-specific options forwarded to Classifier.decide().
75
75
 
76
76
  ## Decision callback
77
77
 
@@ -85,7 +85,7 @@ import { PinoLogger } from '@mastra/loggers'
85
85
  const logger = new PinoLogger({ name: 'model-selection' })
86
86
 
87
87
  new ModelSelectionProcessor({
88
- model: typeSafeAi.evaluationModel('jev-latest'),
88
+ model: typeSafeAi.decisionModel('jev-latest'),
89
89
  choices: [
90
90
  { model: 'openai/gpt-5-mini', criteria: 'Simple lookups' },
91
91
  { model: 'openai/gpt-5.6-sol', criteria: 'Multi-step reasoning' },
@@ -102,7 +102,7 @@ The decision carries the model that was applied, the criterion that was chosen,
102
102
 
103
103
  **choice** (`string`): The choice the classifier selected. Absent when the processor abstained and with select.
104
104
 
105
- **probability** (`number`): Confidence in the selected choice, taken from the answer distribution. Absent when the evaluation model returns no distribution.
105
+ **probability** (`number`): Confidence in the selected choice, taken from the answer distribution. Absent when the decision model returns no distribution.
106
106
 
107
107
  **abstained** (`'below-threshold' | 'no-model-for-choice' | 'no-text' | 'error'`): Why no model was applied. Absent on a successful routing decision and when select returns undefined.
108
108
 
@@ -116,7 +116,7 @@ import { typeSafeAi } from '@ai-sdk/typesafe-ai'
116
116
 
117
117
  const triage = new Classifier({
118
118
  id: 'triage',
119
- model: typeSafeAi.evaluationModel('jev-latest'),
119
+ model: typeSafeAi.decisionModel('jev-latest'),
120
120
  questions: {
121
121
  complexity: {
122
122
  type: 'choice',
@@ -158,7 +158,7 @@ import { ModelSelectionProcessor } from '@mastra/core/processors'
158
158
 
159
159
  const triage = new Classifier({
160
160
  id: 'triage',
161
- model: typeSafeAi.evaluationModel('jev-latest'),
161
+ model: typeSafeAi.decisionModel('jev-latest'),
162
162
  questions: {
163
163
  complexity: {
164
164
  type: 'choice',
@@ -189,14 +189,14 @@ new ModelSelectionProcessor({
189
189
 
190
190
  ## Probabilities and `minProbability`
191
191
 
192
- A choice answer carries a distribution over the criteria, and the confidence in a routing decision is the mass on the criterion that was actually selected. Not every evaluation model reports that distribution.
192
+ A choice answer carries a distribution over the criteria, and the confidence in a routing decision is the mass on the criterion that was actually selected. Not every decision model reports that distribution.
193
193
 
194
194
  This is why `minProbability` has no default. Each setting behaves explicitly:
195
195
 
196
196
  - **Omitted**: route on the selected choice. The classifier's answer is the decision.
197
197
  - **Set**: require a probability at or above the threshold. If the model returns no distribution at all, the processor **abstains**, because a threshold that can't be evaluated must not pass.
198
198
 
199
- If your evaluation model doesn't report choice distributions, the processor abstains on every request once `minProbability` is set. Log `onDecision` to check: an `abstained` value of `below-threshold` with no `probability` means the distribution is missing rather than the confidence being low.
199
+ If your decision model doesn't report choice distributions, the processor abstains on every request once `minProbability` is set. Log `onDecision` to check: an `abstained` value of `below-threshold` with no `probability` means the distribution is missing rather than the confidence being low.
200
200
 
201
201
  ## Failure behavior
202
202
 
@@ -45,7 +45,7 @@ See [Response caching](https://mastra.ai/docs/agents/processors) for the concept
45
45
 
46
46
  ## Constructor parameters
47
47
 
48
- **cache** (`MastraServerCache`): The cache backend. Required. Pass any MastraServerCache implementation — InMemoryServerCache for local development, RedisCache from @mastra/redis for production, or your own subclass for a custom backend.
48
+ **cache** (`MastraServerCache`): The cache backend. Required. Pass any MastraServerCache implementation — InMemoryServerCache for local development, RedisServerCache from @mastra/redis for production, or your own subclass for a custom backend.
49
49
 
50
50
  **ttl** (`number`): Time-to-live (seconds) for entries written by this processor. Defaults to 300 seconds (5 minutes), matching OpenRouter's reference implementation. (Default: `300`)
51
51
 
@@ -59,11 +59,10 @@ const processor = new SemanticRecall({
59
59
  ```typescript
60
60
  import { Agent } from '@mastra/core/agent'
61
61
  import { SemanticRecall, MessageHistory } from '@mastra/core/processors'
62
- import { PostgresStorage } from '@mastra/pg'
63
- import { PgVector } from '@mastra/pg'
62
+ import { PostgresStore, PgVector } from '@mastra/pg'
64
63
  import { openai } from '@ai-sdk/openai'
65
64
 
66
- const storage = new PostgresStorage({
65
+ const storage = new PostgresStore({
67
66
  id: 'pg-storage',
68
67
  connectionString: process.env.DATABASE_URL,
69
68
  })
@@ -62,9 +62,10 @@ const processor = new WorkingMemory({
62
62
  ```typescript
63
63
  import { Agent } from '@mastra/core/agent'
64
64
  import { WorkingMemory, MessageHistory } from '@mastra/core/processors'
65
- import { PostgresStorage } from '@mastra/pg'
65
+ import { PostgresStore } from '@mastra/pg'
66
66
 
67
- const storage = new PostgresStorage({
67
+ const storage = new PostgresStore({
68
+ id: 'pg-storage',
68
69
  connectionString: process.env.DATABASE_URL,
69
70
  })
70
71
 
@@ -45,7 +45,7 @@ export const mastra = new Mastra({
45
45
 
46
46
  ### `close()`
47
47
 
48
- Closes the socket connection and, when this instance is the broker, releases the broker role. Call this during graceful shutdown.
48
+ Closes the socket connection and, when this instance is the broker, releases the broker role. Call this during graceful shutdown. `close()` waits up to one second for lease releases that started before it. A release still blocked on another process's lock after that rejects with `UnixSocketPubSub is closed`. Lease operations started after `close()` throw.
49
49
 
50
50
  ```typescript
51
51
  await pubsub.close()
@@ -53,4 +53,8 @@ await pubsub.close()
53
53
 
54
54
  ## Broker election
55
55
 
56
- The first process to bind the socket becomes the broker and routes events between all connected clients. Other processes connect as clients. When the broker exits, an exclusive lock file serializes the next election. Exactly one client becomes the new broker. The remaining clients resubscribe to it. This avoids a split-brain state where two processes both act as broker.
56
+ The broker is the first process to link its socket into place at the shared path. It routes events between all connected clients, and other processes connect to it as clients. Each candidate binds a socket at a private name and hard-links it to the shared path. The link fails if a socket is already there, so a candidate never replaces a live broker by accident.
57
+
58
+ When the broker exits cleanly, it removes the shared path. Clients then reconnect, and the first to link its socket into place becomes the new broker. The remaining clients resubscribe to it.
59
+
60
+ A refused connection doesn't trigger a takeover on its own. Clients retry with backoff first. Only if the socket keeps refusing connections does a client take an exclusive lock file and replace it. A broker removes the shared path only while it still points at its own socket. If a broker finds its path deleted or replaced, it steps down and rejoins as a client. Processes that end up on different sockets therefore converge on one broker again instead of staying split.
@@ -231,7 +231,7 @@ await store.createIndex({
231
231
  - [libSQL](https://mastra.ai/reference/vectors/libsql)
232
232
  - [MongoDB](https://mastra.ai/reference/vectors/mongodb)
233
233
  - [OracleDB](https://mastra.ai/reference/vectors/oracledb)
234
- - [PgStore](https://mastra.ai/reference/vectors/pg)
234
+ - [PgVector](https://mastra.ai/reference/vectors/pg)
235
235
  - [Pinecone](https://mastra.ai/reference/vectors/pinecone)
236
236
  - [Qdrant](https://mastra.ai/reference/vectors/qdrant)
237
237
  - [Upstash](https://mastra.ai/reference/vectors/upstash)
@@ -230,7 +230,7 @@ await store.upsert({
230
230
  **libSQL**:
231
231
 
232
232
  ```ts
233
- import { LibSQLVector } from '@mastra/core/vector/libsql'
233
+ import { LibSQLVector } from '@mastra/libsql'
234
234
 
235
235
  const store = new LibSQLVector({
236
236
  id: 'libsql-vector',
@@ -74,7 +74,7 @@ const stream = await agent.stream('message for agent')
74
74
 
75
75
  **options.delegation.onDelegationComplete** (`(context: DelegationCompleteContext) => { feedback?: string } | void | Promise<{ feedback?: string } | void>`): Called after a subagent delegation completes. The context includes a bail() method to stop further execution, and you can return { feedback } to guide the supervisor's next action. Feedback is saved to supervisor memory as an assistant message.
76
76
 
77
- **options.delegation.messageFilter** (`(context: MessageFilterContext) => MastraDBMessage[] | Promise<MastraDBMessage[]>`): Callback function called before delegating to a subagent. Use this to filter the messages that are passed to the subagent.
77
+ **options.delegation.messageFilter** (`(context: MessageFilterContext) => ModelMessage[] | Promise<ModelMessage[]>`): Callback function called before delegating to a subagent. Use this to filter the messages that are passed to the subagent.
78
78
 
79
79
  **options.tracingContext** (`TracingContext`): Tracing context for span hierarchy and metadata.
80
80
 
@@ -160,7 +160,7 @@ import { createStep } from '@mastra/core/workflows'
160
160
 
161
161
  const router = new Classifier({
162
162
  id: 'ticket-router',
163
- model: typeSafeAi.evaluationModel('jev-latest'),
163
+ model: typeSafeAi.decisionModel('jev-latest'),
164
164
  questions: {
165
165
  route: {
166
166
  type: 'choice',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "1.3.6-alpha.1",
3
+ "version": "1.3.6-alpha.3",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -26,12 +26,12 @@
26
26
  "@mastra/mcp-legacy": "npm:@mastra/mcp@^1.18.0",
27
27
  "local-pkg": "^1.1.2",
28
28
  "zod": "^4.6.4",
29
- "@mastra/mcp": "^2.2.0",
30
- "@mastra/core": "1.76.0-alpha.0"
29
+ "@mastra/core": "1.76.0-alpha.1",
30
+ "@mastra/mcp": "^2.2.1-alpha.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@hono/node-server": "^2.0.0",
34
- "@modelcontextprotocol/client": "2.0.0",
34
+ "@modelcontextprotocol/client": "2.2.0",
35
35
  "@types/node": "22.20.1",
36
36
  "@vitest/coverage-v8": "4.1.11",
37
37
  "@vitest/ui": "4.1.11",
@@ -43,9 +43,9 @@
43
43
  "tsx": "^4.23.1",
44
44
  "typescript": "^7.0.2",
45
45
  "vitest": "4.1.11",
46
- "@internal/types-builder": "0.0.116",
47
46
  "@internal/lint": "0.0.141",
48
- "@mastra/core": "1.76.0-alpha.0"
47
+ "@internal/types-builder": "0.0.116",
48
+ "@mastra/core": "1.76.0-alpha.1"
49
49
  },
50
50
  "homepage": "https://mastra.ai",
51
51
  "repository": {