@mastra/ai-sdk 1.8.0-alpha.0 → 1.8.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.
- package/CHANGELOG.md +60 -0
- package/dist/helpers.d.ts +9 -2
- package/dist/helpers.d.ts.map +1 -1
- package/dist/index.cjs +11 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -8840,6 +8840,7 @@ const isMastraTextStreamChunk = (chunk) => {
|
|
|
8840
8840
|
"tool-call",
|
|
8841
8841
|
"tool-result",
|
|
8842
8842
|
"tool-error",
|
|
8843
|
+
"tool-output-denied",
|
|
8843
8844
|
"error",
|
|
8844
8845
|
"start-step",
|
|
8845
8846
|
"finish-step",
|
|
@@ -9192,6 +9193,11 @@ function normalizeV6Usage(usage) {
|
|
|
9192
9193
|
};
|
|
9193
9194
|
}
|
|
9194
9195
|
function convertMastraChunkToAISDKv6({ chunk, mode = "stream" }) {
|
|
9196
|
+
if (chunk.type === "tool-output-denied") return {
|
|
9197
|
+
type: "tool-output-denied",
|
|
9198
|
+
toolCallId: chunk.payload.toolCallId,
|
|
9199
|
+
toolName: chunk.payload.toolName
|
|
9200
|
+
};
|
|
9195
9201
|
if (chunk.type === "tool-call-approval") {
|
|
9196
9202
|
const displayTransform = getTransformedToolPayload(chunk.metadata, "display", "approval");
|
|
9197
9203
|
return [{
|
|
@@ -9320,6 +9326,10 @@ function convertFullStreamChunkToUIMessageStream({ part, messageMetadataValue, s
|
|
|
9320
9326
|
...part.providerExecuted != null ? { providerExecuted: part.providerExecuted } : {},
|
|
9321
9327
|
...part.dynamic != null ? { dynamic: part.dynamic } : {}
|
|
9322
9328
|
};
|
|
9329
|
+
case "tool-output-denied": return {
|
|
9330
|
+
type: "tool-output-denied",
|
|
9331
|
+
toolCallId: part.toolCallId
|
|
9332
|
+
};
|
|
9323
9333
|
case "tool-output":
|
|
9324
9334
|
if (part.output.from === "AGENT") return {
|
|
9325
9335
|
type: "tool-agent",
|
|
@@ -9372,6 +9382,7 @@ function convertFullStreamChunkToUIMessageStream({ part, messageMetadataValue, s
|
|
|
9372
9382
|
case "finish":
|
|
9373
9383
|
if (sendFinish) return {
|
|
9374
9384
|
type: "finish",
|
|
9385
|
+
...part.finishReason != null ? { finishReason: part.finishReason } : {},
|
|
9375
9386
|
...messageMetadataValue != null ? { messageMetadata: messageMetadataValue } : {}
|
|
9376
9387
|
};
|
|
9377
9388
|
return;
|