@mastra/ai-sdk 1.6.0 → 1.6.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 +18 -0
- package/dist/chat-route.d.ts.map +1 -1
- package/dist/index.cjs +13 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -13900,10 +13900,21 @@ async function handleChatStream({
|
|
|
13900
13900
|
if (resumeData && !runId) {
|
|
13901
13901
|
throw new Error("runId is required when resumeData is provided");
|
|
13902
13902
|
}
|
|
13903
|
-
const
|
|
13904
|
-
if (!
|
|
13903
|
+
const baseAgent = mastra.getAgentById(agentId);
|
|
13904
|
+
if (!baseAgent) {
|
|
13905
13905
|
throw new Error(`Agent ${agentId} not found`);
|
|
13906
13906
|
}
|
|
13907
|
+
let agentObj = baseAgent;
|
|
13908
|
+
const editorAgent = mastra.getEditor?.()?.agent;
|
|
13909
|
+
if (editorAgent) {
|
|
13910
|
+
agentObj = await editorAgent.applyStoredOverrides(
|
|
13911
|
+
baseAgent,
|
|
13912
|
+
agentVersion ?? { status: "published" },
|
|
13913
|
+
requestContext
|
|
13914
|
+
);
|
|
13915
|
+
} else if (agentVersion) {
|
|
13916
|
+
agentObj = await mastra.getAgentById(agentId, agentVersion);
|
|
13917
|
+
}
|
|
13907
13918
|
if (!Array.isArray(messages)) {
|
|
13908
13919
|
throw new Error("Messages must be an array of UIMessage objects");
|
|
13909
13920
|
}
|