@mastra/ai-sdk 1.4.1-alpha.1 → 1.4.1
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 +26 -0
- package/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +51 -5
- package/dist/_types/@internal_ai-v6/dist/index.d.ts +51 -5
- package/dist/chat-route.d.ts.map +1 -1
- package/dist/index.cjs +2 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -9
- package/dist/index.js.map +1 -1
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -13277,15 +13277,8 @@ function toAISdkStream(stream, options = {
|
|
|
13277
13277
|
|
|
13278
13278
|
// src/chat-route.ts
|
|
13279
13279
|
function extractV6NativeApproval(messages) {
|
|
13280
|
-
|
|
13281
|
-
|
|
13282
|
-
const message = messages[i];
|
|
13283
|
-
if (message.role === "assistant") {
|
|
13284
|
-
lastAssistantMsg = message;
|
|
13285
|
-
break;
|
|
13286
|
-
}
|
|
13287
|
-
}
|
|
13288
|
-
if (!lastAssistantMsg) return null;
|
|
13280
|
+
const lastAssistantMsg = messages.at(-1);
|
|
13281
|
+
if (!lastAssistantMsg || lastAssistantMsg.role !== "assistant") return null;
|
|
13289
13282
|
for (const part of lastAssistantMsg.parts ?? []) {
|
|
13290
13283
|
if (!isToolUIPart2(part) || part.state !== "approval-responded") continue;
|
|
13291
13284
|
const lastSep = part.approval.id.lastIndexOf(APPROVAL_ID_SEPARATOR);
|