@mastra/ai-sdk 1.10.7-alpha.0 → 1.10.7
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/dist/chat-route.d.ts.map +1 -1
- package/dist/index.cjs +15 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { MASTRA_RESOURCE_ID_KEY } from "@mastra/core/request-context";
|
|
|
10
10
|
import { MessageList, TripWire, aiV5ModelMessageToV2PromptMessage } from "@mastra/core/agent";
|
|
11
11
|
import { RequestContext } from "@mastra/core/di";
|
|
12
12
|
import { MessageHistory, SemanticRecall, WorkingMemory } from "@mastra/core/processors";
|
|
13
|
-
//#region ../../packages/_vendored/ai_v5/dist/dist-
|
|
13
|
+
//#region ../../packages/_vendored/ai_v5/dist/dist-CwCWl16R.js
|
|
14
14
|
var marker$2$5 = "vercel.ai.error";
|
|
15
15
|
var symbol$2$3 = Symbol.for(marker$2$5);
|
|
16
16
|
var _a$2$2;
|
|
@@ -5426,7 +5426,7 @@ function createUIMessageStream$2({ execute, onError = () => "An error occurred."
|
|
|
5426
5426
|
});
|
|
5427
5427
|
}
|
|
5428
5428
|
//#endregion
|
|
5429
|
-
//#region ../../packages/_vendored/ai_v6/dist/dist-
|
|
5429
|
+
//#region ../../packages/_vendored/ai_v6/dist/dist-B5Rt0qDx.js
|
|
5430
5430
|
var marker$2$2 = "vercel.ai.error";
|
|
5431
5431
|
var symbol$2$2 = Symbol.for(marker$2$2);
|
|
5432
5432
|
var _a$2$1;
|
|
@@ -9522,7 +9522,7 @@ var doWrap = ({ model, middleware: { transformParams, wrapGenerate, wrapStream,
|
|
|
9522
9522
|
};
|
|
9523
9523
|
};
|
|
9524
9524
|
//#endregion
|
|
9525
|
-
//#region ../../packages/_vendored/ai_v7/dist/dist-
|
|
9525
|
+
//#region ../../packages/_vendored/ai_v7/dist/dist-CqZ0ukbf.js
|
|
9526
9526
|
/**
|
|
9527
9527
|
* Symbol used for identifying AI SDK Error instances.
|
|
9528
9528
|
* Enables checking if an error is an instance of AISDKError across package versions.
|
|
@@ -15485,6 +15485,14 @@ function streamV6ApprovalResumes(args) {
|
|
|
15485
15485
|
}
|
|
15486
15486
|
});
|
|
15487
15487
|
}
|
|
15488
|
+
const CREDENTIAL_HEADER_NAMES = /* @__PURE__ */ new Set([
|
|
15489
|
+
"authorization",
|
|
15490
|
+
"proxy-authorization",
|
|
15491
|
+
"x-api-key",
|
|
15492
|
+
"api-key",
|
|
15493
|
+
"x-goog-api-key",
|
|
15494
|
+
"cookie"
|
|
15495
|
+
]);
|
|
15488
15496
|
async function handleChatStream({ mastra, agentId, agentVersion, params, defaultOptions, experimentalTransform, version = "v5", sendStart = true, sendFinish = true, sendReasoning = false, sendSources = false, onError, messageMetadata }) {
|
|
15489
15497
|
const { messages, resumeData, runId, requestContext, trigger, ...rest } = params;
|
|
15490
15498
|
if (resumeData && !runId) throw new Error("runId is required when resumeData is provided");
|
|
@@ -15505,6 +15513,10 @@ async function handleChatStream({ mastra, agentId, agentVersion, params, default
|
|
|
15505
15513
|
}
|
|
15506
15514
|
}
|
|
15507
15515
|
const { structuredOutput: restStructuredOutput, ...restOptions } = rest;
|
|
15516
|
+
if (restOptions.modelSettings?.headers) restOptions.modelSettings = {
|
|
15517
|
+
...restOptions.modelSettings,
|
|
15518
|
+
headers: Object.fromEntries(Object.entries(restOptions.modelSettings.headers).filter(([name]) => !CREDENTIAL_HEADER_NAMES.has(name.toLowerCase())))
|
|
15519
|
+
};
|
|
15508
15520
|
const { structuredOutput: defaultStructuredOutput, experimentalTransform: defaultExperimentalTransform, ...defaultOptionsRest } = defaultOptions ?? {};
|
|
15509
15521
|
const structuredOutput = restStructuredOutput ?? defaultStructuredOutput;
|
|
15510
15522
|
const effectiveExperimentalTransform = experimentalTransform ?? defaultExperimentalTransform;
|