@mastra/mcp-docs-server 1.1.42-alpha.8 → 1.1.43-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/.docs/docs/agent-builder/memory.md +1 -1
  2. package/.docs/docs/agents/a2a.md +1 -1
  3. package/.docs/docs/agents/acp.md +23 -160
  4. package/.docs/docs/agents/adding-voice.md +7 -7
  5. package/.docs/docs/agents/agent-approval.md +1 -1
  6. package/.docs/docs/agents/background-tasks.md +2 -2
  7. package/.docs/docs/agents/channels.md +1 -1
  8. package/.docs/docs/agents/code-mode.md +3 -3
  9. package/.docs/docs/agents/guardrails.md +2 -2
  10. package/.docs/docs/agents/networks.md +1 -1
  11. package/.docs/docs/agents/overview.md +1 -1
  12. package/.docs/docs/agents/processors.md +146 -3
  13. package/.docs/docs/agents/sdk-agents.md +261 -0
  14. package/.docs/docs/agents/signals.md +230 -10
  15. package/.docs/docs/agents/structured-output.md +5 -5
  16. package/.docs/docs/agents/supervisor-agents.md +2 -2
  17. package/.docs/docs/agents/using-tools.md +5 -5
  18. package/.docs/docs/browser/agent-browser.md +1 -1
  19. package/.docs/docs/browser/browser-viewer.md +1 -1
  20. package/.docs/docs/browser/overview.md +1 -1
  21. package/.docs/docs/browser/stagehand.md +5 -5
  22. package/.docs/docs/build-with-ai/skills.md +3 -3
  23. package/.docs/docs/editor/overview.md +12 -11
  24. package/.docs/docs/evals/custom-scorers.md +1 -1
  25. package/.docs/docs/evals/datasets/running-experiments.md +1 -1
  26. package/.docs/docs/evals/overview.md +2 -2
  27. package/.docs/docs/getting-started/build-with-ai.md +37 -0
  28. package/.docs/docs/mastra-platform/observability.md +4 -4
  29. package/.docs/docs/mcp/mcp-apps.md +3 -3
  30. package/.docs/docs/mcp/overview.md +1 -1
  31. package/.docs/docs/memory/memory-processors.md +6 -6
  32. package/.docs/docs/memory/multi-user-threads.md +2 -2
  33. package/.docs/docs/memory/semantic-recall.md +1 -1
  34. package/.docs/docs/memory/storage.md +2 -1
  35. package/.docs/docs/memory/working-memory.md +28 -1
  36. package/.docs/docs/observability/metrics/querying.md +1 -1
  37. package/.docs/docs/observability/tracing/exporters/langfuse.md +1 -1
  38. package/.docs/docs/observability/tracing/exporters/langsmith.md +2 -2
  39. package/.docs/docs/rag/graph-rag.md +2 -2
  40. package/.docs/docs/rag/retrieval.md +12 -12
  41. package/.docs/docs/server/auth/fga.md +2 -0
  42. package/.docs/docs/server/mastra-client.md +1 -1
  43. package/.docs/docs/server/pubsub.md +124 -0
  44. package/.docs/docs/server/request-context.md +3 -3
  45. package/.docs/docs/streaming/overview.md +1 -1
  46. package/.docs/docs/streaming/tool-streaming.md +1 -1
  47. package/.docs/docs/studio/auth.md +20 -0
  48. package/.docs/docs/voice/overview.md +25 -25
  49. package/.docs/docs/voice/speech-to-speech.md +4 -4
  50. package/.docs/docs/voice/speech-to-text.md +1 -1
  51. package/.docs/docs/voice/text-to-speech.md +1 -1
  52. package/.docs/docs/workspace/filesystem.md +2 -2
  53. package/.docs/docs/workspace/overview.md +1 -1
  54. package/.docs/docs/workspace/sandbox.md +1 -1
  55. package/.docs/guides/build-your-ui/ai-sdk-ui.md +1 -1
  56. package/.docs/guides/guide/ai-recruiter.md +1 -1
  57. package/.docs/guides/guide/chef-michel.md +1 -1
  58. package/.docs/guides/guide/code-review-bot.md +1 -1
  59. package/.docs/guides/guide/dev-assistant.md +1 -1
  60. package/.docs/guides/guide/docs-manager.md +1 -1
  61. package/.docs/guides/guide/firecrawl.md +1 -1
  62. package/.docs/guides/guide/github-actions-pr-description.md +1 -1
  63. package/.docs/guides/guide/research-assistant.md +1 -1
  64. package/.docs/guides/guide/research-coordinator.md +2 -2
  65. package/.docs/guides/guide/slack-assistant.md +1 -1
  66. package/.docs/guides/guide/stock-agent.md +2 -2
  67. package/.docs/guides/guide/whatsapp-chat-bot.md +2 -2
  68. package/.docs/guides/migrations/agentnetwork.md +4 -4
  69. package/.docs/guides/migrations/upgrade-to-v1/agent.md +1 -1
  70. package/.docs/guides/migrations/vnext-to-standard-apis.md +2 -2
  71. package/.docs/reference/acp/acp-agent.md +228 -0
  72. package/.docs/reference/acp/create-acp-tool.md +131 -0
  73. package/.docs/reference/agents/agent.md +55 -5
  74. package/.docs/reference/agents/channels.md +47 -5
  75. package/.docs/reference/agents/durable-agent.md +239 -0
  76. package/.docs/reference/agents/generateLegacy.md +1 -1
  77. package/.docs/reference/agents/getLLM.md +2 -2
  78. package/.docs/reference/agents/getMetadata.md +2 -2
  79. package/.docs/reference/agents/network.md +1 -1
  80. package/.docs/reference/browser/agent-browser.md +1 -1
  81. package/.docs/reference/browser/browser-viewer.md +1 -1
  82. package/.docs/reference/browser/mastra-browser.md +1 -1
  83. package/.docs/reference/browser/stagehand-browser.md +5 -5
  84. package/.docs/reference/cli/mastra.md +5 -5
  85. package/.docs/reference/client-js/agents.md +41 -7
  86. package/.docs/reference/configuration.md +1 -1
  87. package/.docs/reference/evals/answer-relevancy.md +1 -1
  88. package/.docs/reference/evals/answer-similarity.md +1 -1
  89. package/.docs/reference/evals/bias.md +1 -1
  90. package/.docs/reference/evals/context-precision.md +3 -3
  91. package/.docs/reference/evals/context-relevance.md +11 -11
  92. package/.docs/reference/evals/faithfulness.md +1 -1
  93. package/.docs/reference/evals/hallucination.md +5 -5
  94. package/.docs/reference/evals/noise-sensitivity.md +11 -11
  95. package/.docs/reference/evals/prompt-alignment.md +15 -15
  96. package/.docs/reference/evals/tool-call-accuracy.md +3 -3
  97. package/.docs/reference/evals/toxicity.md +1 -1
  98. package/.docs/reference/index.md +9 -0
  99. package/.docs/reference/memory/memory-class.md +3 -3
  100. package/.docs/reference/memory/observational-memory.md +4 -4
  101. package/.docs/reference/observability/tracing/exporters/langfuse.md +1 -1
  102. package/.docs/reference/processors/batch-parts-processor.md +1 -1
  103. package/.docs/reference/processors/cost-guard-processor.md +1 -1
  104. package/.docs/reference/processors/language-detector.md +1 -1
  105. package/.docs/reference/processors/message-history-processor.md +1 -1
  106. package/.docs/reference/processors/moderation-processor.md +2 -2
  107. package/.docs/reference/processors/pii-detector.md +2 -2
  108. package/.docs/reference/processors/prefill-error-handler.md +2 -2
  109. package/.docs/reference/processors/processor-interface.md +2 -2
  110. package/.docs/reference/processors/prompt-injection-detector.md +1 -1
  111. package/.docs/reference/processors/regex-filter-processor.md +1 -1
  112. package/.docs/reference/processors/response-cache.md +2 -2
  113. package/.docs/reference/processors/semantic-recall-processor.md +1 -1
  114. package/.docs/reference/processors/skill-search-processor.md +1 -1
  115. package/.docs/reference/processors/system-prompt-scrubber.md +1 -1
  116. package/.docs/reference/processors/token-limiter-processor.md +3 -3
  117. package/.docs/reference/processors/tool-call-filter.md +2 -2
  118. package/.docs/reference/processors/tool-search-processor.md +2 -2
  119. package/.docs/reference/processors/unicode-normalizer.md +1 -1
  120. package/.docs/reference/processors/working-memory-processor.md +1 -1
  121. package/.docs/reference/pubsub/base.md +168 -0
  122. package/.docs/reference/pubsub/caching-pubsub.md +102 -0
  123. package/.docs/reference/pubsub/event-emitter.md +72 -0
  124. package/.docs/reference/pubsub/google-cloud-pubsub.md +94 -0
  125. package/.docs/reference/pubsub/redis-streams.md +108 -0
  126. package/.docs/reference/pubsub/unix-socket-pubsub.md +52 -0
  127. package/.docs/reference/rag/rerank.md +1 -1
  128. package/.docs/reference/server/nestjs-adapter.md +1 -1
  129. package/.docs/reference/storage/dsql.md +1 -1
  130. package/.docs/reference/storage/libsql.md +6 -0
  131. package/.docs/reference/storage/mongodb.md +4 -1
  132. package/.docs/reference/storage/postgresql.md +4 -1
  133. package/.docs/reference/storage/redis.md +1 -1
  134. package/.docs/reference/storage/spanner.md +5 -0
  135. package/.docs/reference/storage/upstash.md +1 -1
  136. package/.docs/reference/streaming/agents/stream.md +1 -1
  137. package/.docs/reference/templates/overview.md +1 -1
  138. package/.docs/reference/tools/mcp-client.md +2 -2
  139. package/.docs/reference/tools/mcp-server.md +33 -1
  140. package/.docs/reference/tools/vector-query-tool.md +1 -1
  141. package/.docs/reference/vectors/libsql.md +1 -1
  142. package/.docs/reference/vectors/mongodb.md +1 -1
  143. package/.docs/reference/vectors/pg.md +1 -1
  144. package/.docs/reference/vectors/upstash.md +1 -1
  145. package/.docs/reference/voice/voice.addInstructions.md +1 -1
  146. package/.docs/reference/workspace/agentfs-filesystem.md +1 -1
  147. package/.docs/reference/workspace/azure-blob-filesystem.md +1 -1
  148. package/.docs/reference/workspace/docker-sandbox.md +1 -1
  149. package/.docs/reference/workspace/e2b-sandbox.md +9 -5
  150. package/.docs/reference/workspace/files-sdk-filesystem.md +1 -1
  151. package/.docs/reference/workspace/gcs-filesystem.md +1 -1
  152. package/.docs/reference/workspace/google-drive-filesystem.md +1 -1
  153. package/.docs/reference/workspace/local-filesystem.md +1 -1
  154. package/.docs/reference/workspace/local-sandbox.md +1 -1
  155. package/.docs/reference/workspace/modal-sandbox.md +1 -1
  156. package/.docs/reference/workspace/s3-filesystem.md +1 -1
  157. package/CHANGELOG.md +38 -0
  158. package/package.json +6 -6
  159. package/.docs/docs/agents/response-caching.md +0 -150
@@ -0,0 +1,239 @@
1
+ # DurableAgent
2
+
3
+ `DurableAgent` wraps an existing [`Agent`](https://mastra.ai/reference/agents/agent) with durable execution and resumable streams. It runs the agentic loop so that a client can disconnect and reconnect without missing events, and it streams those events over [PubSub](https://mastra.ai/docs/server/pubsub). Use it when a run must outlive a single request or survive a dropped connection.
4
+
5
+ Create one with the [`createDurableAgent`](#createdurableagentoptions) factory, or use [`createEventedAgent`](#createeventedagentoptions) for fire-and-forget execution on the built-in workflow engine. For Inngest-powered execution, use `createInngestAgent` from `@mastra/inngest`.
6
+
7
+ ## Usage example
8
+
9
+ ```typescript
10
+ import { Mastra } from '@mastra/core'
11
+ import { Agent } from '@mastra/core/agent'
12
+ import { createDurableAgent } from '@mastra/core/agent/durable'
13
+
14
+ const agent = new Agent({
15
+ id: 'my-agent',
16
+ name: 'My Agent',
17
+ instructions: 'You are a helpful assistant',
18
+ model: 'openai/gpt-5.5',
19
+ })
20
+
21
+ const durableAgent = createDurableAgent({ agent })
22
+
23
+ export const mastra = new Mastra({
24
+ agents: { myAgent: durableAgent },
25
+ })
26
+ ```
27
+
28
+ Stream a response and read the result. The `cleanup` function unsubscribes from PubSub when you are done with the run:
29
+
30
+ ```typescript
31
+ const { output, runId, cleanup } = await durableAgent.stream('Hello!')
32
+
33
+ const text = await output.text
34
+
35
+ cleanup()
36
+ ```
37
+
38
+ ## `createDurableAgent(options)`
39
+
40
+ Wraps an `Agent` with durable execution and resumable streams. This is the recommended way to create a `DurableAgent`.
41
+
42
+ ```typescript
43
+ import { createDurableAgent } from '@mastra/core/agent/durable'
44
+
45
+ const durableAgent = createDurableAgent({ agent })
46
+ ```
47
+
48
+ Returns: `DurableAgent`
49
+
50
+ ### Parameters
51
+
52
+ **agent** (`Agent`): The Agent to wrap with durable execution capabilities. Agent methods delegate to this agent.
53
+
54
+ **id** (`string`): ID override. (Default: `agent.id`)
55
+
56
+ **name** (`string`): Name override. (Default: `agent.name`)
57
+
58
+ **cache** (`MastraServerCache | false`): Cache for stored stream events, which enables resumable streams. If omitted, the agent inherits the cache from the Mastra instance, or uses an InMemoryServerCache. Set to \`false\` to disable caching, which makes streams non-resumable.
59
+
60
+ **pubsub** (`PubSub`): PubSub instance for streaming events. (Default: `EventEmitterPubSub`)
61
+
62
+ **maxSteps** (`number`): Maximum number of steps for the agentic loop.
63
+
64
+ ## `createEventedAgent(options)`
65
+
66
+ Wraps an `Agent` with fire-and-forget durable execution on the built-in workflow engine. Like `createDurableAgent`, it returns a result you stream from, but the underlying workflow runs non-blocking (via `startAsync`) instead of running to completion before the stream is wired up. Use it when you want the run to progress independently of the caller. It does not accept `id` or `name` overrides.
67
+
68
+ ```typescript
69
+ import { createEventedAgent } from '@mastra/core/agent/durable'
70
+
71
+ const eventedAgent = createEventedAgent({ agent })
72
+ ```
73
+
74
+ Returns: `EventedAgent` (a subclass of `DurableAgent`)
75
+
76
+ ### Parameters
77
+
78
+ **agent** (`Agent`): The Agent to wrap with evented durable execution capabilities.
79
+
80
+ **cache** (`MastraServerCache | false`): Cache for stored stream events, which enables resumable streams. If omitted, the agent inherits the cache from the Mastra instance, or uses an InMemoryServerCache. Set to \`false\` to disable caching.
81
+
82
+ **pubsub** (`PubSub`): PubSub instance for streaming events. (Default: `EventEmitterPubSub`)
83
+
84
+ **maxSteps** (`number`): Maximum number of steps for the agentic loop.
85
+
86
+ ## Constructor parameters
87
+
88
+ The `DurableAgent` class accepts the same options as `createDurableAgent`, plus `cleanupTimeoutMs`. Prefer the factory unless you need to subclass.
89
+
90
+ **agent** (`Agent`): The Agent to wrap with durable execution capabilities.
91
+
92
+ **id** (`string`): ID override. (Default: `agent.id`)
93
+
94
+ **name** (`string`): Name override. (Default: `agent.name`)
95
+
96
+ **cache** (`MastraServerCache | false`): Cache for stored stream events. If omitted, inherits from the Mastra instance or uses an InMemoryServerCache. Set to \`false\` to disable caching.
97
+
98
+ **pubsub** (`PubSub`): PubSub instance for streaming events. (Default: `EventEmitterPubSub`)
99
+
100
+ **maxSteps** (`number`): Maximum number of steps for the agentic loop.
101
+
102
+ **cleanupTimeoutMs** (`number`): Grace period in milliseconds before registry entries are cleaned up automatically after a stream finishes or errors. Set to 0 to disable auto-cleanup and require a manual \`cleanup()\` call. Auto-cleanup does not fire on suspended events. (Default: `30000`)
103
+
104
+ ## Methods
105
+
106
+ ### Execution
107
+
108
+ #### `stream(messages, options?)`
109
+
110
+ Streams a response using durable execution. Returns immediately with a result whose `output` produces events as the run progresses.
111
+
112
+ ```typescript
113
+ const { output, runId, cleanup } = await durableAgent.stream('Hello!', {
114
+ onChunk: chunk => console.log(chunk),
115
+ onFinish: result => console.log('done', result),
116
+ })
117
+
118
+ const text = await output.text
119
+ cleanup()
120
+ ```
121
+
122
+ Returns: [`Promise<DurableAgentStreamResult>`](#durableagentstreamresult)
123
+
124
+ #### `resume(runId, resumeData, options?)`
125
+
126
+ Resumes a suspended run, for example after a tool approval. Pass the `runId` from the original stream and the data the run was waiting on. Throws if no registry entry exists for the run.
127
+
128
+ ```typescript
129
+ const { output, cleanup } = await durableAgent.resume(runId, {
130
+ approved: true,
131
+ })
132
+
133
+ await output.text
134
+ cleanup()
135
+ ```
136
+
137
+ Returns: [`Promise<DurableAgentStreamResult>`](#durableagentstreamresult)
138
+
139
+ #### `observe(runId, options?)`
140
+
141
+ Reconnects to an existing run, replaying cached events before delivering live ones. Use this after a network disconnection. Pass `offset` to start replay from a known position.
142
+
143
+ ```typescript
144
+ const { output, cleanup } = await durableAgent.observe(runId, {
145
+ offset: 0,
146
+ onChunk: chunk => console.log(chunk),
147
+ })
148
+
149
+ await output.text
150
+ ```
151
+
152
+ Returns: `Promise<DurableAgentStreamResult>`
153
+
154
+ > **Warning:** The `cleanup()` returned by `observe()` destroys the run's registry entries and cached events. Only call it when you are done with the run. If the run is suspended and you intend to resume later, do not call `cleanup()` — let the auto-cleanup timer handle it after the run finishes or errors. Auto-cleanup does not fire on suspended events.
155
+
156
+ ## Stream options
157
+
158
+ `stream()` accepts a `DurableAgentStreamOptions` object. It supports the agent execution options below, plus lifecycle callbacks.
159
+
160
+ **runId** (`string`): Unique identifier for this run. Use it later with \`resume()\` or \`observe()\`.
161
+
162
+ **instructions** (`AgentExecutionOptions['instructions']`): Overrides the agent's default instructions for this run. Accepts a static string or the same dynamic instructions value the agent supports.
163
+
164
+ **context** (`ModelMessage[]`): Additional context messages to provide to the agent.
165
+
166
+ **memory** (`object`): Memory configuration for conversation persistence and retrieval.
167
+
168
+ **requestContext** (`RequestContext`): Request context carrying dynamic configuration and state for this run.
169
+
170
+ **maxSteps** (`number`): Maximum number of steps to run for this stream.
171
+
172
+ **toolsets** (`object`): Additional tool sets available for this run.
173
+
174
+ **clientTools** (`object`): Client-side tools available during execution.
175
+
176
+ **toolChoice** (`'auto' | 'none' | 'required' | { type: 'tool'; toolName: string }`): Tool selection strategy.
177
+
178
+ **activeTools** (`string[]`): Restricts execution to the named subset of the agent's tools.
179
+
180
+ **modelSettings** (`object`): Model-specific settings such as temperature.
181
+
182
+ **requireToolApproval** (`boolean`): Require approval for all tool calls, which suspends the run until resumed.
183
+
184
+ **autoResumeSuspendedTools** (`boolean`): Automatically resume tools that suspended, instead of waiting for an external \`resume()\` call.
185
+
186
+ **toolCallConcurrency** (`number`): Maximum number of tool calls to execute concurrently.
187
+
188
+ **includeRawChunks** (`boolean`): Include raw provider chunks in the stream output.
189
+
190
+ **maxProcessorRetries** (`number`): Maximum number of processor retries per generation.
191
+
192
+ **structuredOutput** (`object`): Structured output configuration.
193
+
194
+ **versions** (`object`): Version overrides for sub-agent delegation.
195
+
196
+ **onChunk** (`(chunk: ChunkType) => void | Promise<void>`): Called for each streamed chunk.
197
+
198
+ **onStepFinish** (`(result: AgentStepFinishEventData) => void | Promise<void>`): Called when a step in the agentic loop finishes.
199
+
200
+ **onFinish** (`(result: AgentFinishEventData) => void | Promise<void>`): Called when the run finishes.
201
+
202
+ **onError** (`(error: Error) => void | Promise<void>`): Called when the run errors.
203
+
204
+ **onSuspended** (`(data: AgentSuspendedEventData) => void | Promise<void>`): Called when the run suspends, for example for tool approval.
205
+
206
+ `resume()` and `observe()` accept the same lifecycle callbacks (`onChunk`, `onStepFinish`, `onFinish`, `onError`, `onSuspended`). `observe()` also accepts an `offset` to control where replay starts.
207
+
208
+ ## DurableAgentStreamResult
209
+
210
+ The object returned by `stream()`, `resume()`, and `observe()`.
211
+
212
+ ```typescript
213
+ interface DurableAgentStreamResult<OUTPUT = undefined> {
214
+ output: MastraModelOutput<OUTPUT>
215
+ readonly fullStream: ReadableStream<any>
216
+ runId: string
217
+ threadId?: string
218
+ resourceId?: string
219
+ cleanup: () => void
220
+ }
221
+ ```
222
+
223
+ **output** (`MastraModelOutput`): The streaming output. Await \`output.text\` for the full text, or consume \`output.fullStream\`.
224
+
225
+ **fullStream** (`ReadableStream`): The full event stream, delegating to \`output.fullStream\`.
226
+
227
+ **runId** (`string`): The unique run ID. Pass it to \`resume()\` or \`observe()\` to reconnect.
228
+
229
+ **threadId** (`string`): Thread ID when using memory.
230
+
231
+ **resourceId** (`string`): Resource ID when using memory.
232
+
233
+ **cleanup** (`() => void`): Unsubscribes from PubSub and clears registry entries for the run. Call it when done with the run.
234
+
235
+ ## Related
236
+
237
+ - [Agent class](https://mastra.ai/reference/agents/agent)
238
+ - [PubSub](https://mastra.ai/docs/server/pubsub)
239
+ - [`.getMemory()`](https://mastra.ai/reference/agents/getMemory)
@@ -195,7 +195,7 @@ await agent.generateLegacy(
195
195
  sentiment: z.enum(['positive', 'negative', 'neutral']),
196
196
  confidence: z.number(),
197
197
  }),
198
- model: 'openai/gpt-5.4',
198
+ model: 'openai/gpt-5.5',
199
199
  errorStrategy: 'warn',
200
200
  },
201
201
  // Output processors for response validation
@@ -10,7 +10,7 @@ await agent.getLLM()
10
10
 
11
11
  ```typescript
12
12
  await agent.getLLM({
13
- model: 'openai/gpt-5.4',
13
+ model: 'openai/gpt-5.5',
14
14
  })
15
15
  ```
16
16
 
@@ -31,7 +31,7 @@ await agent.getLLM({
31
31
  ```typescript
32
32
  await agent.getLLM({
33
33
  requestContext: new RequestContext(),
34
- model: 'openai/gpt-5.4',
34
+ model: 'openai/gpt-5.5',
35
35
  })
36
36
  ```
37
37
 
@@ -29,7 +29,7 @@ export const supportAgent = new Agent({
29
29
  id: 'support-agent',
30
30
  name: 'Support Agent',
31
31
  instructions: 'You help customers with support requests.',
32
- model: 'openai/gpt-5.4',
32
+ model: 'openai/gpt-5.5',
33
33
  metadata: { type: 'support' },
34
34
  })
35
35
 
@@ -45,7 +45,7 @@ export const supportAgent = new Agent({
45
45
  id: 'support-agent',
46
46
  name: 'Support Agent',
47
47
  instructions: 'You help customers with support requests.',
48
- model: 'openai/gpt-5.4',
48
+ model: 'openai/gpt-5.5',
49
49
  metadata: ({ requestContext }) => ({
50
50
  type: 'support',
51
51
  tenant: requestContext.get('tenant'),
@@ -16,7 +16,7 @@ const agent = new Agent({
16
16
  id: 'network-agent',
17
17
  name: 'Network Agent',
18
18
  instructions: 'You are a network agent that can help users with a variety of tasks.',
19
- model: 'openai/gpt-5.4',
19
+ model: 'openai/gpt-5.5',
20
20
  agents: {
21
21
  agent1,
22
22
  agent2,
@@ -21,7 +21,7 @@ export const browserAgent = new Agent({
21
21
  name: 'Browser Agent',
22
22
  instructions: `You can browse the web. Use browser_snapshot to see the page structure,
23
23
  then interact with elements using their refs (e.g., @e5).`,
24
- model: 'openai/gpt-5.4',
24
+ model: 'openai/gpt-5.5',
25
25
  browser,
26
26
  })
27
27
  ```
@@ -23,7 +23,7 @@ const workspace = new Workspace({
23
23
 
24
24
  const browserAgent = new Agent({
25
25
  id: 'browser-agent',
26
- model: 'openai/gpt-5.4',
26
+ model: 'openai/gpt-5.5',
27
27
  workspace,
28
28
  instructions: 'You are a web automation assistant.',
29
29
  })
@@ -24,7 +24,7 @@ export const browserAgent = new Agent({
24
24
  id: 'browser-agent',
25
25
  name: 'Browser Agent',
26
26
  instructions: 'You can browse the web to find information.',
27
- model: 'openai/gpt-5.4',
27
+ model: 'openai/gpt-5.5',
28
28
  browser,
29
29
  })
30
30
  ```
@@ -12,7 +12,7 @@ import { StagehandBrowser } from '@mastra/stagehand'
12
12
 
13
13
  const browser = new StagehandBrowser({
14
14
  headless: true,
15
- model: 'openai/gpt-5.4',
15
+ model: 'openai/gpt-5.5',
16
16
  selfHeal: true,
17
17
  })
18
18
 
@@ -22,7 +22,7 @@ export const browserAgent = new Agent({
22
22
  instructions: `You can browse the web using natural language.
23
23
  Use stagehand_act to perform actions like "click the login button".
24
24
  Use stagehand_extract to get data from pages.`,
25
- model: 'openai/gpt-5.4',
25
+ model: 'openai/gpt-5.5',
26
26
  browser,
27
27
  })
28
28
  ```
@@ -39,7 +39,7 @@ Use stagehand_extract to get data from pages.`,
39
39
 
40
40
  **projectId** (`string`): Browserbase project ID. Required when env is 'BROWSERBASE'.
41
41
 
42
- **model** (`string | ModelConfiguration`): Model configuration for AI operations. Can be a string like '\_\_GATEWAY\_OPENAI\_MODEL\_\_' or an object with modelName, apiKey, and baseURL. (Default: `'openai/gpt-5.4'`)
42
+ **model** (`string | ModelConfiguration`): Model configuration for AI operations. Can be a string like 'openai/gpt-5.5' or an object with modelName, apiKey, and baseURL. (Default: `'openai/gpt-5.5'`)
43
43
 
44
44
  **selfHeal** (`boolean`): Enable self-healing selectors. When enabled, Stagehand uses AI to find elements even when initial selectors fail. (Default: `true`)
45
45
 
@@ -268,7 +268,7 @@ const browser = new StagehandBrowser({
268
268
  env: 'BROWSERBASE',
269
269
  apiKey: process.env.BROWSERBASE_API_KEY,
270
270
  projectId: process.env.BROWSERBASE_PROJECT_ID,
271
- model: 'openai/gpt-5.4',
271
+ model: 'openai/gpt-5.5',
272
272
  })
273
273
  ```
274
274
 
@@ -279,7 +279,7 @@ Configure the AI model for Stagehand operations:
279
279
  ```typescript
280
280
  // String format: "provider/model"
281
281
  const browser = new StagehandBrowser({
282
- model: 'openai/gpt-5.4',
282
+ model: 'openai/gpt-5.5',
283
283
  })
284
284
 
285
285
  // Object format for custom configuration
@@ -603,10 +603,10 @@ It accepts [common flags](#common-flags).
603
603
  Calls a Mastra runtime server with JSON input and JSON output. Use it for local development servers, deployed Mastra platform projects, self-hosted Mastra servers, or hosted Mastra Platform Observability APIs.
604
604
 
605
605
  ```bash
606
- mastra api agent list --pretty
606
+ mastra api agent list
607
607
  mastra api agent run weather-agent '{"messages":"What is the weather in London?"}'
608
608
  mastra api tool execute get-weather '{"location":"San Francisco"}'
609
- mastra api trace list '{"page":0,"perPage":20}' --pretty
609
+ mastra api trace list '{"page":0,"perPage":20}'
610
610
  ```
611
611
 
612
612
  Use `mastra api <resource> <action> --help` to see examples for a command.
@@ -717,7 +717,7 @@ mastra api trace list '{"page":0,"perPage":20}'
717
717
  Routes that support filters accept them in the same JSON input. For example, observability trace listing supports pagination and route-supported filters:
718
718
 
719
719
  ```bash
720
- mastra api trace list '{"page":0,"perPage":20,"filters":{"spanType":"agent"}}' --pretty
720
+ mastra api trace list '{"page":0,"perPage":20,"filters":{"spanType":"agent"}}'
721
721
  ```
722
722
 
723
723
  ### Get command-specific help
@@ -973,8 +973,8 @@ Lists observability traces. Pass optional JSON input for route-supported filters
973
973
 
974
974
  ```bash
975
975
  mastra api trace list [input]
976
- mastra api trace list '{"page":0,"perPage":20}' --pretty
977
- mastra api trace list '{"page":0,"perPage":20}' --verbose --pretty
976
+ mastra api trace list '{"page":0,"perPage":20}'
977
+ mastra api trace list '{"page":0,"perPage":20}' --verbose
978
978
  ```
979
979
 
980
980
  `trace list` returns lightweight root span records by default so you can page through traces without fetching large input, output, attributes, or metadata payloads. Pass `--verbose` to fetch the full root span records.
@@ -151,17 +151,51 @@ for await (const part of uiMessageStream) {
151
151
  }
152
152
  ```
153
153
 
154
+ ### `sendMessage()`
155
+
156
+ Send user-authored input to an active agent run or idle memory thread. Use this with `subscribeToThread()` so the client can render the stream that wakes from, or receives, the message.
157
+
158
+ ```typescript
159
+ const agent = mastraClient.getAgent('support-agent')
160
+
161
+ const result = await agent.sendMessage({
162
+ message: {
163
+ contents: 'Also consider the customer note I just added.',
164
+ attributes: { sentFrom: 'web' },
165
+ },
166
+ resourceId: 'user-123',
167
+ threadId: 'thread-abc',
168
+ })
169
+
170
+ console.log(result.runId)
171
+ ```
172
+
173
+ `message` accepts a string, an array of text/file parts, or an object with `contents`, `attributes`, `metadata`, and `providerOptions`.
174
+
175
+ ### `queueMessage()`
176
+
177
+ Queue user-authored input for the next thread turn. If the thread is active, Mastra starts a new run after the current run completes. If the thread is idle, Mastra starts a run immediately.
178
+
179
+ ```typescript
180
+ await agent.queueMessage({
181
+ message: 'Also check whether the tests need updates.',
182
+ resourceId: 'user-123',
183
+ threadId: 'thread-abc',
184
+ })
185
+ ```
186
+
154
187
  ### `sendSignal()`
155
188
 
156
- Send a signal to an active agent run or memory thread. Use this with `subscribeToThread()` so the client can render the stream that wakes from, or receives, the signal.
189
+ Send a lower-level signal to an active agent run or memory thread. Use this for system-generated context such as reactive reminders or notification-shaped context that doesn't need inbox storage. For durable notification records, use the server-side [`Agent.sendNotificationSignal()`](https://mastra.ai/reference/agents/agent) API. For user-authored input, prefer `sendMessage()` or `queueMessage()`.
157
190
 
158
191
  ```typescript
159
192
  const agent = mastraClient.getAgent('support-agent')
160
193
 
161
194
  const result = await agent.sendSignal({
162
195
  signal: {
163
- type: 'user-message',
164
- contents: 'Also consider the customer note I just added.',
196
+ type: 'reactive',
197
+ tagName: 'system-reminder',
198
+ contents: 'Also consider the latest customer note.',
165
199
  },
166
200
  resourceId: 'user-123',
167
201
  threadId: 'thread-abc',
@@ -174,7 +208,7 @@ Use `ifActive.behavior` and `ifIdle.behavior` to control whether Mastra delivers
174
208
 
175
209
  ```typescript
176
210
  await agent.sendSignal({
177
- signal: { type: 'user-message', contents: 'Store this for later.' },
211
+ signal: { type: 'reactive', tagName: 'system-reminder', contents: 'Store this for later.' },
178
212
  resourceId: 'user-123',
179
213
  threadId: 'thread-abc',
180
214
  ifIdle: {
@@ -187,7 +221,7 @@ Pass `ifIdle.streamOptions` when the idle wake-up stream needs options such as m
187
221
 
188
222
  ```typescript
189
223
  await agent.sendSignal({
190
- signal: { type: 'user-message', contents: 'Start from this signal.' },
224
+ signal: { type: 'reactive', tagName: 'system-reminder', contents: 'Start from this signal.' },
191
225
  resourceId: 'user-123',
192
226
  threadId: 'thread-abc',
193
227
  ifIdle: {
@@ -201,7 +235,7 @@ await agent.sendSignal({
201
235
 
202
236
  Returns `{ accepted: true, runId: string }`.
203
237
 
204
- **signal** (`{ type: 'user-message' | 'system-reminder' | string; contents: string | Array<TextPart | FilePart>; attributes?: Record<string, JSONValue>; metadata?: Record<string, unknown>; providerOptions?: ProviderMetadata }`): \`user-message\` signals without attributes are treated as plain user input. All other signals — including \`user-message\` with \`attributes\`, \`system-reminder\`, and custom types — are wrapped in an XML element named after the signal type with \`attributes\` rendered as XML attributes (e.g. \`\<user name="Devin" from="slack">message\</user>\`). The model sees the XML; the UI sees the raw contents and can read \`attributes\` for custom rendering. \`providerOptions\` is attached to the resulting prompt turn and persisted on the stored signal message.
238
+ **signal** (`{ type: 'user' | 'reactive' | 'notification' | string; tagName?: string; contents: string | Array<TextPart | FilePart>; attributes?: Record<string, JSONValue>; metadata?: Record<string, unknown>; providerOptions?: ProviderMetadata }`): Lower-level signal payload. Use \`type\` for the semantic signal category and \`tagName\` for the XML tag shown to the model. \`providerOptions\` is attached to the resulting prompt turn and persisted on the stored signal message.
205
239
 
206
240
  **runId** (`string`): Run ID to target directly.
207
241
 
@@ -217,7 +251,7 @@ Returns `{ accepted: true, runId: string }`.
217
251
 
218
252
  ### `subscribeToThread()`
219
253
 
220
- Subscribe to raw stream chunks for a memory thread. Use this to render output from a thread that may be started or continued by `sendSignal()`.
254
+ Subscribe to raw stream chunks for a memory thread. Use this to render output from a thread that may be started or continued by `sendMessage()`, `queueMessage()`, `sendSignal()`, or server-side notification dispatch.
221
255
 
222
256
  ```typescript
223
257
  const agent = mastraClient.getAgent('support-agent')
@@ -30,7 +30,7 @@ export const mastra = new Mastra({
30
30
  id: 'weather-agent',
31
31
  name: 'Weather Agent',
32
32
  instructions: 'You help with weather information',
33
- model: 'openai/gpt-5.4',
33
+ model: 'openai/gpt-5.5',
34
34
  }),
35
35
  },
36
36
  })
@@ -69,7 +69,7 @@ import { runEvals } from '@mastra/core/evals'
69
69
  import { createAnswerRelevancyScorer } from '@mastra/evals/scorers/prebuilt'
70
70
  import { myAgent } from './agent'
71
71
 
72
- const scorer = createAnswerRelevancyScorer({ model: 'openai/gpt-5.4' })
72
+ const scorer = createAnswerRelevancyScorer({ model: 'openai/gpt-5.5' })
73
73
 
74
74
  const result = await runEvals({
75
75
  data: [
@@ -62,7 +62,7 @@ import { runEvals } from '@mastra/core/evals'
62
62
  import { createAnswerSimilarityScorer } from '@mastra/evals/scorers/prebuilt'
63
63
  import { myAgent } from './agent'
64
64
 
65
- const scorer = createAnswerSimilarityScorer({ model: 'openai/gpt-5.4' })
65
+ const scorer = createAnswerSimilarityScorer({ model: 'openai/gpt-5.5' })
66
66
 
67
67
  const result = await runEvals({
68
68
  data: [
@@ -82,7 +82,7 @@ import { runEvals } from '@mastra/core/evals'
82
82
  import { createBiasScorer } from '@mastra/evals/scorers/prebuilt'
83
83
  import { myAgent } from './agent'
84
84
 
85
- const scorer = createBiasScorer({ model: 'openai/gpt-5.4' })
85
+ const scorer = createBiasScorer({ model: 'openai/gpt-5.5' })
86
86
 
87
87
  const result = await runEvals({
88
88
  data: [
@@ -98,7 +98,7 @@ MAP = (1.0 + 0.67) / 2 = 0.835 ≈ **0.83**
98
98
 
99
99
  ```typescript
100
100
  const scorer = createContextPrecisionScorer({
101
- model: 'openai/gpt-5.4',
101
+ model: 'openai/gpt-5.5',
102
102
  options: {
103
103
  contextExtractor: (input, output) => {
104
104
  // Extract context dynamically based on the query
@@ -117,7 +117,7 @@ const scorer = createContextPrecisionScorer({
117
117
 
118
118
  ```typescript
119
119
  const scorer = createContextPrecisionScorer({
120
- model: 'openai/gpt-5.4',
120
+ model: 'openai/gpt-5.5',
121
121
  options: {
122
122
  context: [
123
123
  // Simulate retrieved documents from vector database
@@ -142,7 +142,7 @@ import { createContextPrecisionScorer } from '@mastra/evals/scorers/prebuilt'
142
142
  import { myAgent } from './agent'
143
143
 
144
144
  const scorer = createContextPrecisionScorer({
145
- model: 'openai/gpt-5.4',
145
+ model: 'openai/gpt-5.5',
146
146
  options: {
147
147
  contextExtractor: (input, output) => {
148
148
  // Extract context from agent's retrieved documents
@@ -119,7 +119,7 @@ import { createContextRelevanceScorerLLM } from '@mastra/evals'
119
119
 
120
120
  // Stricter penalty configuration
121
121
  const strictScorer = createContextRelevanceScorerLLM({
122
- model: 'openai/gpt-5.4',
122
+ model: 'openai/gpt-5.5',
123
123
  options: {
124
124
  context: [
125
125
  'Einstein won the Nobel Prize for photoelectric effect',
@@ -137,7 +137,7 @@ const strictScorer = createContextRelevanceScorerLLM({
137
137
 
138
138
  // Lenient penalty configuration
139
139
  const lenientScorer = createContextRelevanceScorerLLM({
140
- model: 'openai/gpt-5.4',
140
+ model: 'openai/gpt-5.5',
141
141
  options: {
142
142
  context: [
143
143
  'Einstein won the Nobel Prize for photoelectric effect',
@@ -183,7 +183,7 @@ console.log('Lenient penalties:', lenientResult.score) // Higher score, less pen
183
183
 
184
184
  ```typescript
185
185
  const scorer = createContextRelevanceScorerLLM({
186
- model: 'openai/gpt-5.4',
186
+ model: 'openai/gpt-5.5',
187
187
  options: {
188
188
  contextExtractor: (input, output) => {
189
189
  // Extract context based on the query
@@ -207,7 +207,7 @@ const scorer = createContextRelevanceScorerLLM({
207
207
 
208
208
  ```typescript
209
209
  const scorer = createContextRelevanceScorerLLM({
210
- model: 'openai/gpt-5.4',
210
+ model: 'openai/gpt-5.5',
211
211
  options: {
212
212
  context: ['Relevant information...', 'Supporting details...'],
213
213
  scale: 100, // Scale scores from 0-100 instead of 0-1
@@ -221,7 +221,7 @@ const scorer = createContextRelevanceScorerLLM({
221
221
 
222
222
  ```typescript
223
223
  const scorer = createContextRelevanceScorerLLM({
224
- model: 'openai/gpt-5.4',
224
+ model: 'openai/gpt-5.5',
225
225
  options: {
226
226
  contextExtractor: (input, output) => {
227
227
  const query = input?.inputMessages?.[0]?.content || ''
@@ -248,7 +248,7 @@ This example shows excellent context relevance where all context directly suppor
248
248
  import { createContextRelevanceScorerLLM } from '@mastra/evals'
249
249
 
250
250
  const scorer = createContextRelevanceScorerLLM({
251
- model: 'openai/gpt-5.4',
251
+ model: 'openai/gpt-5.5',
252
252
  options: {
253
253
  context: [
254
254
  'Einstein won the Nobel Prize for his discovery of the photoelectric effect in 1921.',
@@ -295,7 +295,7 @@ This example shows moderate relevance with some context being irrelevant or unus
295
295
  import { createContextRelevanceScorerLLM } from '@mastra/evals'
296
296
 
297
297
  const scorer = createContextRelevanceScorerLLM({
298
- model: 'openai/gpt-5.4',
298
+ model: 'openai/gpt-5.5',
299
299
  options: {
300
300
  context: [
301
301
  'Solar eclipses occur when the Moon blocks the Sun.',
@@ -337,7 +337,7 @@ console.log(result)
337
337
 
338
338
  // With custom penalty configuration
339
339
  const customScorer = createContextRelevanceScorerLLM({
340
- model: 'openai/gpt-5.4',
340
+ model: 'openai/gpt-5.5',
341
341
  options: {
342
342
  context: [
343
343
  'Solar eclipses occur when the Moon blocks the Sun.',
@@ -384,7 +384,7 @@ This example shows poor context relevance with mostly irrelevant information:
384
384
  import { createContextRelevanceScorerLLM } from '@mastra/evals'
385
385
 
386
386
  const scorer = createContextRelevanceScorerLLM({
387
- model: 'openai/gpt-5.4',
387
+ model: 'openai/gpt-5.5',
388
388
  options: {
389
389
  context: [
390
390
  'The Great Barrier Reef is located in Australia.',
@@ -432,7 +432,7 @@ Extract context dynamically based on the run input:
432
432
  import { createContextRelevanceScorerLLM } from '@mastra/evals'
433
433
 
434
434
  const scorer = createContextRelevanceScorerLLM({
435
- model: 'openai/gpt-5.4',
435
+ model: 'openai/gpt-5.5',
436
436
  options: {
437
437
  contextExtractor: (input, output) => {
438
438
  // Extract query from input
@@ -475,7 +475,7 @@ Integrate with RAG pipelines to evaluate retrieved context:
475
475
  import { createContextRelevanceScorerLLM } from '@mastra/evals'
476
476
 
477
477
  const scorer = createContextRelevanceScorerLLM({
478
- model: 'openai/gpt-5.4',
478
+ model: 'openai/gpt-5.5',
479
479
  options: {
480
480
  contextExtractor: (input, output) => {
481
481
  // Extract from RAG retrieval results