@mastra/ai-sdk 1.3.4-alpha.0 → 1.4.0-alpha.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @mastra/ai-sdk
2
2
 
3
+ ## 1.4.0-alpha.2
4
+
5
+ ### Minor Changes
6
+
7
+ - Added structured output streaming to the AI SDK UI stream. When an agent produces structured output, the final object is now emitted as a `data-structured-output` data part in the UI message stream, making it available to frontends via AI SDK UI's custom data handling. ([#15237](https://github.com/mastra-ai/mastra/pull/15237))
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`cbdf3e1`](https://github.com/mastra-ai/mastra/commit/cbdf3e12b3d0c30a6e5347be658e2009648c130a), [`8fe46d3`](https://github.com/mastra-ai/mastra/commit/8fe46d354027f3f0f0846e64219772348de106dd), [`18c67db`](https://github.com/mastra-ai/mastra/commit/18c67dbb9c9ebc26f26f65f7d3ff836e5691ef46), [`8dcc77e`](https://github.com/mastra-ai/mastra/commit/8dcc77e78a5340f5848f74b9e9f1b3da3513c1f5), [`aa67fc5`](https://github.com/mastra-ai/mastra/commit/aa67fc59ee8a5eeff1f23eb05970b8d7a536c8ff), [`fa8140b`](https://github.com/mastra-ai/mastra/commit/fa8140bcd4251d2e3ac85fdc5547dfc4f372b5be), [`190f452`](https://github.com/mastra-ai/mastra/commit/190f45258b0640e2adfc8219fa3258cdc5b8f071), [`7e7bf60`](https://github.com/mastra-ai/mastra/commit/7e7bf606886bf374a6f9d4ca9b09dd83d0533372), [`184907d`](https://github.com/mastra-ai/mastra/commit/184907d775d8609c03c26e78ccaf37315f3aa287), [`0c4cd13`](https://github.com/mastra-ai/mastra/commit/0c4cd131931c04ac5405373c932a242dbe88edd6), [`b16a753`](https://github.com/mastra-ai/mastra/commit/b16a753d5748440248d7df82e29bb987a9c8386c)]:
12
+ - @mastra/core@1.25.0-alpha.3
13
+
14
+ ## 1.4.0-alpha.1
15
+
16
+ ### Minor Changes
17
+
18
+ - Added agent versioning support to chat and network route handlers. You can now pass `agentVersion` to `chatRoute()`, `handleChatStream()`, `networkRoute()`, and `handleNetworkStream()` to target a specific agent version by ID or status (draft/published). Route handlers also accept `?versionId=<id>` or `?status=draft|published` query parameters at request time, which take precedence over static configuration. Requires the Editor to be configured. ([#15296](https://github.com/mastra-ai/mastra/pull/15296))
19
+
20
+ ```typescript
21
+ // Static version on route config
22
+ chatRoute({
23
+ path: '/chat',
24
+ agent: 'weatherAgent',
25
+ agentVersion: { status: 'published' },
26
+ });
27
+
28
+ // Programmatic version on handler
29
+ const stream = await handleChatStream({
30
+ mastra,
31
+ agentId: 'weatherAgent',
32
+ agentVersion: { versionId: 'ver_abc123' },
33
+ params,
34
+ });
35
+ ```
36
+
3
37
  ## 1.3.4-alpha.0
4
38
 
5
39
  ### Patch Changes
package/README.md CHANGED
@@ -158,6 +158,33 @@ export async function POST(req: Request) {
158
158
  }
159
159
  ```
160
160
 
161
+ ## Agent versioning
162
+
163
+ All route handlers and standalone stream functions accept an optional `agentVersion` parameter to target a specific agent version. This requires the [Editor](https://mastra.ai/docs/editor/overview) to be configured.
164
+
165
+ Pass a version ID or resolve by status:
166
+
167
+ ```typescript
168
+ chatRoute({
169
+ path: '/chat',
170
+ agent: 'weatherAgent',
171
+ agentVersion: { status: 'published' },
172
+ });
173
+ ```
174
+
175
+ For route handlers (`chatRoute`, `networkRoute`), callers can also override the version at request time with query parameters: `?versionId=<id>` or `?status=draft|published`. Query parameters take precedence over the static `agentVersion` option.
176
+
177
+ The standalone handlers (`handleChatStream`, `handleNetworkStream`) accept `agentVersion` directly:
178
+
179
+ ```typescript
180
+ const stream = await handleChatStream({
181
+ mastra,
182
+ agentId: 'weatherAgent',
183
+ agentVersion: { versionId: 'ver_abc123' },
184
+ params,
185
+ });
186
+ ```
187
+
161
188
  ## Manual transformation
162
189
 
163
190
  If you have a raw Mastra `stream`, you can manually transform it to AI SDK UI message parts: