@mastra/ai-sdk 0.3.2 → 0.3.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.
- package/CHANGELOG.md +30 -0
- package/dist/index.cjs +42 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +42 -20
- package/dist/index.js.map +1 -1
- package/dist/transformers.d.ts +1 -0
- package/dist/transformers.d.ts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @mastra/ai-sdk
|
|
2
2
|
|
|
3
|
+
## 0.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Return NetworkDataPart on each agent-execution-event and workflow-execution-event in network streams ([#10979](https://github.com/mastra-ai/mastra/pull/10979))
|
|
8
|
+
|
|
9
|
+
- Fixed tool-call-suspended chunks being dropped in workflow-step-output when using AI SDK. Previously, when an agent inside a workflow step called a tool that got suspended, the tool-call-suspended chunk was not received on the frontend even though tool-input-available chunks were correctly received. ([#10988](https://github.com/mastra-ai/mastra/pull/10988))
|
|
10
|
+
|
|
11
|
+
The issue occurred because tool-call-suspended was not included in the isMastraTextStreamChunk list, causing it to be filtered out in transformWorkflow. Now tool-call-suspended, tool-call-approval, object, and tripwire chunks are properly included in the text stream chunk list and will be transformed and passed through correctly.
|
|
12
|
+
|
|
13
|
+
Fixes #10978
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`5cc85aa`](https://github.com/mastra-ai/mastra/commit/5cc85aa4329773cac8314f3aa0146227b6b158e4), [`c53f8e6`](https://github.com/mastra-ai/mastra/commit/c53f8e68df42464935f9a63eb0fc765a65aacb83), [`386ab43`](https://github.com/mastra-ai/mastra/commit/386ab4350cf2a814fb4ac0a5fc6983ca93158ffe), [`2b62302`](https://github.com/mastra-ai/mastra/commit/2b623027a9d65c1dbc963bf651e9e6a9d09da1fa), [`7d85da4`](https://github.com/mastra-ai/mastra/commit/7d85da42a5fab56009a959a9c20328558d14f4b5), [`3d7c5bd`](https://github.com/mastra-ai/mastra/commit/3d7c5bdbee1b2693cd45bf207b960dd9b7277680), [`31b381e`](https://github.com/mastra-ai/mastra/commit/31b381efb48e031c0ecc46bc6e410ae6e67b88e5), [`54cc99c`](https://github.com/mastra-ai/mastra/commit/54cc99cb99483b9e08ec41fa1502f43b71b4c351), [`e77a5f9`](https://github.com/mastra-ai/mastra/commit/e77a5f9718dc418e29e3c8a389299ed6dc0a6401), [`b685c9c`](https://github.com/mastra-ai/mastra/commit/b685c9c0b89f49e0d4542c4ac72569682db69794), [`b069af5`](https://github.com/mastra-ai/mastra/commit/b069af514c4dcfc4fdcb164303569bfff1c26e3d), [`7dc8304`](https://github.com/mastra-ai/mastra/commit/7dc830420296db516b86dcec663e54d0309b8fb8), [`6942109`](https://github.com/mastra-ai/mastra/commit/694210903c70e3c26b5ce8ca4f4637ca2d9eb369), [`62d13f4`](https://github.com/mastra-ai/mastra/commit/62d13f4d1db1c16742831f210fe4c2caf8a26d57), [`358ab98`](https://github.com/mastra-ai/mastra/commit/358ab98024c388e383aca15616e8988bf4a5b66e)]:
|
|
16
|
+
- @mastra/core@0.24.7
|
|
17
|
+
|
|
18
|
+
## 0.3.3-alpha.0
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Return NetworkDataPart on each agent-execution-event and workflow-execution-event in network streams ([#10979](https://github.com/mastra-ai/mastra/pull/10979))
|
|
23
|
+
|
|
24
|
+
- Fixed tool-call-suspended chunks being dropped in workflow-step-output when using AI SDK. Previously, when an agent inside a workflow step called a tool that got suspended, the tool-call-suspended chunk was not received on the frontend even though tool-input-available chunks were correctly received. ([#10988](https://github.com/mastra-ai/mastra/pull/10988))
|
|
25
|
+
|
|
26
|
+
The issue occurred because tool-call-suspended was not included in the isMastraTextStreamChunk list, causing it to be filtered out in transformWorkflow. Now tool-call-suspended, tool-call-approval, object, and tripwire chunks are properly included in the text stream chunk list and will be transformed and passed through correctly.
|
|
27
|
+
|
|
28
|
+
Fixes #10978
|
|
29
|
+
|
|
30
|
+
- Updated dependencies []:
|
|
31
|
+
- @mastra/core@0.24.7-alpha.3
|
|
32
|
+
|
|
3
33
|
## 0.3.2
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -22,6 +22,8 @@ var isMastraTextStreamChunk = (chunk) => {
|
|
|
22
22
|
"source",
|
|
23
23
|
"tool-input-start",
|
|
24
24
|
"tool-input-delta",
|
|
25
|
+
"tool-call-approval",
|
|
26
|
+
"tool-call-suspended",
|
|
25
27
|
"tool-call",
|
|
26
28
|
"tool-result",
|
|
27
29
|
"tool-error",
|
|
@@ -32,6 +34,8 @@ var isMastraTextStreamChunk = (chunk) => {
|
|
|
32
34
|
"finish",
|
|
33
35
|
"abort",
|
|
34
36
|
"tool-input-end",
|
|
37
|
+
"object",
|
|
38
|
+
"tripwire",
|
|
35
39
|
"raw"
|
|
36
40
|
].includes(chunk.type);
|
|
37
41
|
};
|
|
@@ -1134,6 +1138,26 @@ function transformNetwork(payload, bufferedNetworks, isNested) {
|
|
|
1134
1138
|
};
|
|
1135
1139
|
}
|
|
1136
1140
|
default: {
|
|
1141
|
+
if (isAgentExecutionDataChunkType(payload)) {
|
|
1142
|
+
if (!("data" in payload.payload)) {
|
|
1143
|
+
throw new Error(
|
|
1144
|
+
`UI Messages require a data property when using data- prefixed chunks
|
|
1145
|
+
${JSON.stringify(payload)}`
|
|
1146
|
+
);
|
|
1147
|
+
}
|
|
1148
|
+
const { type, data } = payload.payload;
|
|
1149
|
+
return { type, data };
|
|
1150
|
+
}
|
|
1151
|
+
if (isWorkflowExecutionDataChunkType(payload)) {
|
|
1152
|
+
if (!("data" in payload.payload)) {
|
|
1153
|
+
throw new Error(
|
|
1154
|
+
`UI Messages require a data property when using data- prefixed chunks
|
|
1155
|
+
${JSON.stringify(payload)}`
|
|
1156
|
+
);
|
|
1157
|
+
}
|
|
1158
|
+
const { type, data } = payload.payload;
|
|
1159
|
+
return { type, data };
|
|
1160
|
+
}
|
|
1137
1161
|
if (payload.type.startsWith("agent-execution-event-")) {
|
|
1138
1162
|
const stepId = payload.payload.runId;
|
|
1139
1163
|
const current = bufferedNetworks.get(payload.runId);
|
|
@@ -1148,6 +1172,15 @@ function transformNetwork(payload, bufferedNetworks, isNested) {
|
|
|
1148
1172
|
const { request, response, ...data } = result.data;
|
|
1149
1173
|
step.task = data;
|
|
1150
1174
|
}
|
|
1175
|
+
bufferedNetworks.set(payload.runId, current);
|
|
1176
|
+
return {
|
|
1177
|
+
type: isNested ? "data-tool-network" : "data-network",
|
|
1178
|
+
id: payload.runId,
|
|
1179
|
+
data: {
|
|
1180
|
+
...current,
|
|
1181
|
+
status: "running"
|
|
1182
|
+
}
|
|
1183
|
+
};
|
|
1151
1184
|
}
|
|
1152
1185
|
if (payload.type.startsWith("workflow-execution-event-")) {
|
|
1153
1186
|
const stepId = payload.payload.runId;
|
|
@@ -1166,6 +1199,15 @@ function transformNetwork(payload, bufferedNetworks, isNested) {
|
|
|
1166
1199
|
step.task.id = data.name;
|
|
1167
1200
|
}
|
|
1168
1201
|
}
|
|
1202
|
+
bufferedNetworks.set(payload.runId, current);
|
|
1203
|
+
return {
|
|
1204
|
+
type: isNested ? "data-tool-network" : "data-network",
|
|
1205
|
+
id: payload.runId,
|
|
1206
|
+
data: {
|
|
1207
|
+
...current,
|
|
1208
|
+
status: "running"
|
|
1209
|
+
}
|
|
1210
|
+
};
|
|
1169
1211
|
}
|
|
1170
1212
|
if (isDataChunkType(payload)) {
|
|
1171
1213
|
if (!("data" in payload)) {
|
|
@@ -1177,26 +1219,6 @@ function transformNetwork(payload, bufferedNetworks, isNested) {
|
|
|
1177
1219
|
const { type, data } = payload;
|
|
1178
1220
|
return { type, data };
|
|
1179
1221
|
}
|
|
1180
|
-
if (isAgentExecutionDataChunkType(payload)) {
|
|
1181
|
-
if (!("data" in payload.payload)) {
|
|
1182
|
-
throw new Error(
|
|
1183
|
-
`UI Messages require a data property when using data- prefixed chunks
|
|
1184
|
-
${JSON.stringify(payload)}`
|
|
1185
|
-
);
|
|
1186
|
-
}
|
|
1187
|
-
const { type, data } = payload.payload;
|
|
1188
|
-
return { type, data };
|
|
1189
|
-
}
|
|
1190
|
-
if (isWorkflowExecutionDataChunkType(payload)) {
|
|
1191
|
-
if (!("data" in payload.payload)) {
|
|
1192
|
-
throw new Error(
|
|
1193
|
-
`UI Messages require a data property when using data- prefixed chunks
|
|
1194
|
-
${JSON.stringify(payload)}`
|
|
1195
|
-
);
|
|
1196
|
-
}
|
|
1197
|
-
const { type, data } = payload.payload;
|
|
1198
|
-
return { type, data };
|
|
1199
|
-
}
|
|
1200
1222
|
return null;
|
|
1201
1223
|
}
|
|
1202
1224
|
}
|