@mastra/core 1.0.0-beta.3 → 1.0.0-beta.4
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 +44 -0
- package/dist/agent/index.cjs +9 -9
- package/dist/agent/index.js +2 -2
- package/dist/agent/message-list/index.cjs +3 -3
- package/dist/agent/message-list/index.d.ts +5 -0
- package/dist/agent/message-list/index.d.ts.map +1 -1
- package/dist/agent/message-list/index.js +1 -1
- package/dist/{chunk-OWX2PUFH.cjs → chunk-2NVBZKZI.cjs} +161 -129
- package/dist/chunk-2NVBZKZI.cjs.map +1 -0
- package/dist/{chunk-OQF4H5Y2.js → chunk-2OTDXX73.js} +4 -4
- package/dist/{chunk-OQF4H5Y2.js.map → chunk-2OTDXX73.js.map} +1 -1
- package/dist/{chunk-4DWZ4Z6H.js → chunk-3RW5EMSB.js} +3 -4
- package/dist/chunk-3RW5EMSB.js.map +1 -0
- package/dist/{chunk-N4SJ4YX7.cjs → chunk-3W5RQCCY.cjs} +40 -24
- package/dist/chunk-3W5RQCCY.cjs.map +1 -0
- package/dist/{chunk-XRIVPHXV.cjs → chunk-4RXG622P.cjs} +5 -5
- package/dist/{chunk-XRIVPHXV.cjs.map → chunk-4RXG622P.cjs.map} +1 -1
- package/dist/{chunk-VZGBVYXA.cjs → chunk-5WXEYDFI.cjs} +22 -23
- package/dist/chunk-5WXEYDFI.cjs.map +1 -0
- package/dist/{chunk-EZVRSZMK.cjs → chunk-CYVNOIXS.cjs} +11 -11
- package/dist/{chunk-EZVRSZMK.cjs.map → chunk-CYVNOIXS.cjs.map} +1 -1
- package/dist/{chunk-MCUX2D5Q.js → chunk-FVNT7VTO.js} +29 -13
- package/dist/chunk-FVNT7VTO.js.map +1 -0
- package/dist/{chunk-T3WZCEC4.js → chunk-IHJDOC3A.js} +34 -587
- package/dist/chunk-IHJDOC3A.js.map +1 -0
- package/dist/{chunk-QUKUN6NR.cjs → chunk-ISMGVGUM.cjs} +105 -5
- package/dist/chunk-ISMGVGUM.cjs.map +1 -0
- package/dist/{chunk-4RSHBKDJ.cjs → chunk-IWB65P37.cjs} +5 -5
- package/dist/{chunk-4RSHBKDJ.cjs.map → chunk-IWB65P37.cjs.map} +1 -1
- package/dist/{chunk-5CWWU22H.js → chunk-IWQDBVJK.js} +3 -3
- package/dist/{chunk-5CWWU22H.js.map → chunk-IWQDBVJK.js.map} +1 -1
- package/dist/{chunk-KOSW5PP5.js → chunk-MDKPL2R2.js} +464 -124
- package/dist/chunk-MDKPL2R2.js.map +1 -0
- package/dist/{chunk-UIZSWUKP.js → chunk-NZAXAFI3.js} +104 -6
- package/dist/chunk-NZAXAFI3.js.map +1 -0
- package/dist/{chunk-GRGPQ32U.js → chunk-RXDJL5QT.js} +3 -3
- package/dist/{chunk-GRGPQ32U.js.map → chunk-RXDJL5QT.js.map} +1 -1
- package/dist/{chunk-YQ7NLZZ3.cjs → chunk-S6OEQHEI.cjs} +61 -614
- package/dist/chunk-S6OEQHEI.cjs.map +1 -0
- package/dist/{chunk-G3OOCXAI.js → chunk-U7VECK2G.js} +4 -4
- package/dist/{chunk-G3OOCXAI.js.map → chunk-U7VECK2G.js.map} +1 -1
- package/dist/{chunk-G36A2JRR.cjs → chunk-VSM3NLUX.cjs} +296 -199
- package/dist/chunk-VSM3NLUX.cjs.map +1 -0
- package/dist/{chunk-3VOUB4ZU.cjs → chunk-VZC4BWWH.cjs} +8 -8
- package/dist/{chunk-3VOUB4ZU.cjs.map → chunk-VZC4BWWH.cjs.map} +1 -1
- package/dist/{chunk-BAMR7HKO.js → chunk-W3DD3XP5.js} +296 -199
- package/dist/chunk-W3DD3XP5.js.map +1 -0
- package/dist/{chunk-JTXVR2RA.cjs → chunk-WQSGX6XA.cjs} +5 -5
- package/dist/{chunk-JTXVR2RA.cjs.map → chunk-WQSGX6XA.cjs.map} +1 -1
- package/dist/{chunk-VU6DVS7J.js → chunk-WTYNK7Q4.js} +4 -4
- package/dist/{chunk-VU6DVS7J.js.map → chunk-WTYNK7Q4.js.map} +1 -1
- package/dist/{chunk-CKGIPST2.js → chunk-XXBWX7DT.js} +138 -106
- package/dist/chunk-XXBWX7DT.js.map +1 -0
- package/dist/{chunk-ZPMFINU2.cjs → chunk-ZCVTH3CH.cjs} +464 -130
- package/dist/chunk-ZCVTH3CH.cjs.map +1 -0
- package/dist/evals/index.cjs +4 -4
- package/dist/evals/index.js +1 -1
- package/dist/evals/scoreTraces/index.cjs +3 -3
- package/dist/evals/scoreTraces/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/llm/index.cjs +14 -14
- package/dist/llm/index.js +5 -5
- package/dist/llm/model/aisdk/v5/model.d.ts.map +1 -1
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +1 -1
- package/dist/loop/test-utils/generateText.d.ts.map +1 -1
- package/dist/loop/test-utils/resultObject.d.ts.map +1 -1
- package/dist/loop/test-utils/toUIMessageStream.d.ts.map +1 -1
- package/dist/loop/test-utils/utils.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts.map +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +6 -6
- package/dist/memory/index.js +3 -3
- package/dist/models-dev-6PRLJKVZ.js +3 -0
- package/dist/{models-dev-GCVENVWA.js.map → models-dev-6PRLJKVZ.js.map} +1 -1
- package/dist/models-dev-WHMI5G6Y.cjs +12 -0
- package/dist/{models-dev-TIBJR6IG.cjs.map → models-dev-WHMI5G6Y.cjs.map} +1 -1
- package/dist/netlify-46I3SNNV.cjs +12 -0
- package/dist/{netlify-NTSNNT6F.cjs.map → netlify-46I3SNNV.cjs.map} +1 -1
- package/dist/netlify-EBQ6YUC6.js +3 -0
- package/dist/{netlify-O5NJW7CF.js.map → netlify-EBQ6YUC6.js.map} +1 -1
- package/dist/processors/index.cjs +11 -11
- package/dist/processors/index.js +1 -1
- package/dist/provider-registry-HDG6UMUC.js +3 -0
- package/dist/{provider-registry-74GMFZKT.js.map → provider-registry-HDG6UMUC.js.map} +1 -1
- package/dist/provider-registry-RP2W4B24.cjs +40 -0
- package/dist/{provider-registry-BZP3DIIV.cjs.map → provider-registry-RP2W4B24.cjs.map} +1 -1
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +1 -1
- package/dist/server/auth.d.ts +11 -0
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/index.cjs +10 -0
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +10 -0
- package/dist/server/index.js.map +1 -1
- package/dist/storage/index.cjs +29 -29
- package/dist/storage/index.js +1 -1
- package/dist/stream/aisdk/v5/compat/prepare-tools.d.ts.map +1 -1
- package/dist/stream/index.cjs +11 -11
- package/dist/stream/index.js +2 -2
- package/dist/test-utils/llm-mock.cjs +66 -29
- package/dist/test-utils/llm-mock.cjs.map +1 -1
- package/dist/test-utils/llm-mock.d.ts +4 -2
- package/dist/test-utils/llm-mock.d.ts.map +1 -1
- package/dist/test-utils/llm-mock.js +66 -29
- package/dist/test-utils/llm-mock.js.map +1 -1
- package/dist/voice/aisdk/index.d.ts +3 -0
- package/dist/voice/aisdk/index.d.ts.map +1 -0
- package/dist/voice/aisdk/speech.d.ts +23 -0
- package/dist/voice/aisdk/speech.d.ts.map +1 -0
- package/dist/voice/aisdk/transcription.d.ts +22 -0
- package/dist/voice/aisdk/transcription.d.ts.map +1 -0
- package/dist/voice/composite-voice.d.ts +4 -3
- package/dist/voice/composite-voice.d.ts.map +1 -1
- package/dist/voice/index.cjs +12 -4
- package/dist/voice/index.d.ts +1 -0
- package/dist/voice/index.d.ts.map +1 -1
- package/dist/voice/index.js +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/index.cjs +19 -19
- package/dist/workflows/index.js +1 -1
- package/package.json +10 -10
- package/dist/chunk-4DWZ4Z6H.js.map +0 -1
- package/dist/chunk-BAMR7HKO.js.map +0 -1
- package/dist/chunk-CKGIPST2.js.map +0 -1
- package/dist/chunk-G36A2JRR.cjs.map +0 -1
- package/dist/chunk-KOSW5PP5.js.map +0 -1
- package/dist/chunk-MCUX2D5Q.js.map +0 -1
- package/dist/chunk-N4SJ4YX7.cjs.map +0 -1
- package/dist/chunk-OWX2PUFH.cjs.map +0 -1
- package/dist/chunk-QUKUN6NR.cjs.map +0 -1
- package/dist/chunk-T3WZCEC4.js.map +0 -1
- package/dist/chunk-UIZSWUKP.js.map +0 -1
- package/dist/chunk-VZGBVYXA.cjs.map +0 -1
- package/dist/chunk-YQ7NLZZ3.cjs.map +0 -1
- package/dist/chunk-ZPMFINU2.cjs.map +0 -1
- package/dist/models-dev-GCVENVWA.js +0 -3
- package/dist/models-dev-TIBJR6IG.cjs +0 -12
- package/dist/netlify-NTSNNT6F.cjs +0 -12
- package/dist/netlify-O5NJW7CF.js +0 -3
- package/dist/provider-registry-74GMFZKT.js +0 -3
- package/dist/provider-registry-BZP3DIIV.cjs +0 -40
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DefaultVoice } from './chunk-
|
|
1
|
+
import { DefaultVoice } from './chunk-NZAXAFI3.js';
|
|
2
2
|
import { STREAM_FORMAT_SYMBOL, EMITTER_SYMBOL } from './chunk-NLNKQD2T.js';
|
|
3
|
-
import { MessageList, DefaultGeneratedFile, DefaultGeneratedFileWithType } from './chunk-
|
|
4
|
-
import { resolveModelConfig } from './chunk-
|
|
3
|
+
import { MessageList, DefaultGeneratedFile, DefaultGeneratedFileWithType } from './chunk-W3DD3XP5.js';
|
|
4
|
+
import { resolveModelConfig } from './chunk-FVNT7VTO.js';
|
|
5
5
|
import { MastraLLMV1 } from './chunk-JXESKY4A.js';
|
|
6
6
|
import { executeHook } from './chunk-L54GIUCB.js';
|
|
7
7
|
import { removeUndefinedValues, selectFields, ensureToolProperties, makeCoreTool, createMastraProxy, delay } from './chunk-D6EDHNGV.js';
|
|
@@ -422,14 +422,22 @@ function prepareToolsAndToolChoice({
|
|
|
422
422
|
inputSchema: asSchema(sdkTool.inputSchema).jsonSchema,
|
|
423
423
|
providerOptions: sdkTool.providerOptions
|
|
424
424
|
};
|
|
425
|
-
case "provider-defined":
|
|
425
|
+
case "provider-defined": {
|
|
426
|
+
const providerId = sdkTool.id;
|
|
427
|
+
let providerToolName = name;
|
|
428
|
+
if (providerId && providerId.includes(".")) {
|
|
429
|
+
providerToolName = providerId.split(".").slice(1).join(".");
|
|
430
|
+
} else if (providerId) {
|
|
431
|
+
providerToolName = providerId;
|
|
432
|
+
}
|
|
426
433
|
return {
|
|
427
434
|
type: "provider-defined",
|
|
428
|
-
name,
|
|
435
|
+
name: providerToolName,
|
|
429
436
|
// TODO: as any seems wrong here. are there cases where we don't have an id?
|
|
430
|
-
id:
|
|
437
|
+
id: providerId,
|
|
431
438
|
args: sdkTool.args
|
|
432
439
|
};
|
|
440
|
+
}
|
|
433
441
|
default: {
|
|
434
442
|
const exhaustiveCheck = toolType;
|
|
435
443
|
throw new Error(`Unsupported tool type: ${exhaustiveCheck}`);
|
|
@@ -5721,23 +5729,22 @@ async function processOutputStream({
|
|
|
5721
5729
|
if (runState.state.textDeltas.length) {
|
|
5722
5730
|
const textStartPayload = chunk.payload;
|
|
5723
5731
|
const providerMetadata = textStartPayload.providerMetadata ?? runState.state.providerOptions;
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5732
|
+
const message = {
|
|
5733
|
+
id: messageId,
|
|
5734
|
+
role: "assistant",
|
|
5735
|
+
content: {
|
|
5736
|
+
format: 2,
|
|
5737
|
+
parts: [
|
|
5738
|
+
{
|
|
5730
5739
|
type: "text",
|
|
5731
5740
|
text: runState.state.textDeltas.join(""),
|
|
5732
|
-
|
|
5733
|
-
} : {
|
|
5734
|
-
type: "text",
|
|
5735
|
-
text: runState.state.textDeltas.join("")
|
|
5741
|
+
...providerMetadata ? { providerMetadata } : {}
|
|
5736
5742
|
}
|
|
5737
5743
|
]
|
|
5738
5744
|
},
|
|
5739
|
-
|
|
5740
|
-
|
|
5745
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
5746
|
+
};
|
|
5747
|
+
messageList.add(message, "response");
|
|
5741
5748
|
}
|
|
5742
5749
|
runState.setState({
|
|
5743
5750
|
isStreaming: false,
|
|
@@ -5817,20 +5824,23 @@ async function processOutputStream({
|
|
|
5817
5824
|
providerOptions: chunk.payload.providerMetadata ?? runState.state.providerOptions
|
|
5818
5825
|
});
|
|
5819
5826
|
if (Object.values(chunk.payload.providerMetadata || {}).find((v) => v?.redactedData)) {
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5827
|
+
const message = {
|
|
5828
|
+
id: messageId,
|
|
5829
|
+
role: "assistant",
|
|
5830
|
+
content: {
|
|
5831
|
+
format: 2,
|
|
5832
|
+
parts: [
|
|
5825
5833
|
{
|
|
5826
5834
|
type: "reasoning",
|
|
5827
|
-
|
|
5828
|
-
|
|
5835
|
+
reasoning: "",
|
|
5836
|
+
details: [{ type: "redacted", data: "" }],
|
|
5837
|
+
providerMetadata: chunk.payload.providerMetadata ?? runState.state.providerOptions
|
|
5829
5838
|
}
|
|
5830
5839
|
]
|
|
5831
5840
|
},
|
|
5832
|
-
|
|
5833
|
-
|
|
5841
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
5842
|
+
};
|
|
5843
|
+
messageList.add(message, "response");
|
|
5834
5844
|
if (isControllerOpen(controller)) {
|
|
5835
5845
|
controller.enqueue(chunk);
|
|
5836
5846
|
}
|
|
@@ -5856,20 +5866,23 @@ async function processOutputStream({
|
|
|
5856
5866
|
}
|
|
5857
5867
|
case "reasoning-end": {
|
|
5858
5868
|
if (runState.state.reasoningDeltas.length > 0) {
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5869
|
+
const message = {
|
|
5870
|
+
id: messageId,
|
|
5871
|
+
role: "assistant",
|
|
5872
|
+
content: {
|
|
5873
|
+
format: 2,
|
|
5874
|
+
parts: [
|
|
5864
5875
|
{
|
|
5865
5876
|
type: "reasoning",
|
|
5866
|
-
|
|
5867
|
-
|
|
5877
|
+
reasoning: "",
|
|
5878
|
+
details: [{ type: "text", text: runState.state.reasoningDeltas.join("") }],
|
|
5879
|
+
providerMetadata: chunk.payload.providerMetadata ?? runState.state.providerOptions
|
|
5868
5880
|
}
|
|
5869
5881
|
]
|
|
5870
5882
|
},
|
|
5871
|
-
|
|
5872
|
-
|
|
5883
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
5884
|
+
};
|
|
5885
|
+
messageList.add(message, "response");
|
|
5873
5886
|
}
|
|
5874
5887
|
runState.setState({
|
|
5875
5888
|
isReasoning: false,
|
|
@@ -5881,25 +5894,31 @@ async function processOutputStream({
|
|
|
5881
5894
|
break;
|
|
5882
5895
|
}
|
|
5883
5896
|
case "file":
|
|
5884
|
-
|
|
5885
|
-
{
|
|
5897
|
+
{
|
|
5898
|
+
const message = {
|
|
5886
5899
|
id: messageId,
|
|
5887
5900
|
role: "assistant",
|
|
5888
|
-
content:
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5901
|
+
content: {
|
|
5902
|
+
format: 2,
|
|
5903
|
+
parts: [
|
|
5904
|
+
{
|
|
5905
|
+
type: "file",
|
|
5906
|
+
// @ts-expect-error
|
|
5907
|
+
data: chunk.payload.data,
|
|
5908
|
+
// TODO: incorrect string type
|
|
5909
|
+
mimeType: chunk.payload.mimeType
|
|
5910
|
+
}
|
|
5911
|
+
]
|
|
5912
|
+
},
|
|
5913
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
5914
|
+
};
|
|
5915
|
+
messageList.add(message, "response");
|
|
5916
|
+
controller.enqueue(chunk);
|
|
5917
|
+
}
|
|
5899
5918
|
break;
|
|
5900
5919
|
case "source":
|
|
5901
|
-
|
|
5902
|
-
{
|
|
5920
|
+
{
|
|
5921
|
+
const message = {
|
|
5903
5922
|
id: messageId,
|
|
5904
5923
|
role: "assistant",
|
|
5905
5924
|
content: {
|
|
@@ -5918,10 +5937,10 @@ async function processOutputStream({
|
|
|
5918
5937
|
]
|
|
5919
5938
|
},
|
|
5920
5939
|
createdAt: /* @__PURE__ */ new Date()
|
|
5921
|
-
}
|
|
5922
|
-
"response"
|
|
5923
|
-
|
|
5924
|
-
|
|
5940
|
+
};
|
|
5941
|
+
messageList.add(message, "response");
|
|
5942
|
+
controller.enqueue(chunk);
|
|
5943
|
+
}
|
|
5925
5944
|
break;
|
|
5926
5945
|
case "finish":
|
|
5927
5946
|
runState.setState({
|
|
@@ -6260,24 +6279,27 @@ function createLLMExecutionStep({
|
|
|
6260
6279
|
return chunk.payload;
|
|
6261
6280
|
});
|
|
6262
6281
|
if (toolCalls.length > 0) {
|
|
6263
|
-
const
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6282
|
+
const message = {
|
|
6283
|
+
id: messageId,
|
|
6284
|
+
role: "assistant",
|
|
6285
|
+
content: {
|
|
6286
|
+
format: 2,
|
|
6287
|
+
parts: toolCalls.map((toolCall) => {
|
|
6288
|
+
return {
|
|
6289
|
+
type: "tool-invocation",
|
|
6290
|
+
toolInvocation: {
|
|
6291
|
+
state: "call",
|
|
6292
|
+
toolCallId: toolCall.toolCallId,
|
|
6293
|
+
toolName: toolCall.toolName,
|
|
6294
|
+
args: toolCall.args
|
|
6295
|
+
},
|
|
6296
|
+
...toolCall.providerMetadata ? { providerMetadata: toolCall.providerMetadata } : {}
|
|
6297
|
+
};
|
|
6298
|
+
})
|
|
6278
6299
|
},
|
|
6279
|
-
|
|
6280
|
-
|
|
6300
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
6301
|
+
};
|
|
6302
|
+
messageList.add(message, "response");
|
|
6281
6303
|
}
|
|
6282
6304
|
const finishReason = runState?.state?.stepResult?.reason ?? outputStream._getImmediateFinishReason();
|
|
6283
6305
|
const hasErrored = runState.state.hasErrored;
|
|
@@ -6359,24 +6381,28 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
6359
6381
|
};
|
|
6360
6382
|
rest.controller.enqueue(chunk);
|
|
6361
6383
|
});
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6384
|
+
const msg = {
|
|
6385
|
+
id: toolResultMessageId || "",
|
|
6386
|
+
role: "assistant",
|
|
6387
|
+
content: {
|
|
6388
|
+
format: 2,
|
|
6389
|
+
parts: errorResults.map((toolCallErrorResult) => {
|
|
6367
6390
|
return {
|
|
6368
|
-
type: "tool-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6391
|
+
type: "tool-invocation",
|
|
6392
|
+
toolInvocation: {
|
|
6393
|
+
state: "result",
|
|
6394
|
+
toolCallId: toolCallErrorResult.toolCallId,
|
|
6395
|
+
toolName: toolCallErrorResult.toolName,
|
|
6396
|
+
args: toolCallErrorResult.args,
|
|
6397
|
+
result: toolCallErrorResult.error?.message ?? toolCallErrorResult.error
|
|
6398
|
+
},
|
|
6399
|
+
...toolCallErrorResult.providerMetadata ? { providerMetadata: toolCallErrorResult.providerMetadata } : {}
|
|
6375
6400
|
};
|
|
6376
6401
|
})
|
|
6377
6402
|
},
|
|
6378
|
-
|
|
6379
|
-
|
|
6403
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
6404
|
+
};
|
|
6405
|
+
rest.messageList.add(msg, "response");
|
|
6380
6406
|
}
|
|
6381
6407
|
initialResult.stepResult.isContinued = false;
|
|
6382
6408
|
return bail(initialResult);
|
|
@@ -6404,24 +6430,30 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
6404
6430
|
})
|
|
6405
6431
|
});
|
|
6406
6432
|
}
|
|
6407
|
-
const toolResultMessageId = rest.experimental_generateMessageId?.() || _internal?.generateId?.();
|
|
6408
|
-
rest.messageList.add(
|
|
6409
|
-
{
|
|
6410
|
-
id: toolResultMessageId,
|
|
6411
|
-
role: "tool",
|
|
6412
|
-
content: inputData.map((toolCall2) => {
|
|
6413
|
-
return {
|
|
6414
|
-
type: "tool-result",
|
|
6415
|
-
args: toolCall2.args,
|
|
6416
|
-
toolCallId: toolCall2.toolCallId,
|
|
6417
|
-
toolName: toolCall2.toolName,
|
|
6418
|
-
result: toolCall2.result
|
|
6419
|
-
};
|
|
6420
|
-
})
|
|
6421
|
-
},
|
|
6422
|
-
"response"
|
|
6423
|
-
);
|
|
6424
6433
|
}
|
|
6434
|
+
const toolResultMessageId = rest.experimental_generateMessageId?.() || _internal?.generateId?.();
|
|
6435
|
+
const toolResultMessage = {
|
|
6436
|
+
id: toolResultMessageId || "",
|
|
6437
|
+
role: "assistant",
|
|
6438
|
+
content: {
|
|
6439
|
+
format: 2,
|
|
6440
|
+
parts: inputData.map((toolCall) => {
|
|
6441
|
+
return {
|
|
6442
|
+
type: "tool-invocation",
|
|
6443
|
+
toolInvocation: {
|
|
6444
|
+
state: "result",
|
|
6445
|
+
toolCallId: toolCall.toolCallId,
|
|
6446
|
+
toolName: toolCall.toolName,
|
|
6447
|
+
args: toolCall.args,
|
|
6448
|
+
result: toolCall.result
|
|
6449
|
+
},
|
|
6450
|
+
...toolCall.providerMetadata ? { providerMetadata: toolCall.providerMetadata } : {}
|
|
6451
|
+
};
|
|
6452
|
+
})
|
|
6453
|
+
},
|
|
6454
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
6455
|
+
};
|
|
6456
|
+
rest.messageList.add(toolResultMessage, "response");
|
|
6425
6457
|
return {
|
|
6426
6458
|
...initialResult,
|
|
6427
6459
|
messages: {
|
|
@@ -7927,7 +7959,7 @@ ${completionResult?.object?.finalResult}` : ""}
|
|
|
7927
7959
|
requestContext
|
|
7928
7960
|
});
|
|
7929
7961
|
let chunks = [];
|
|
7930
|
-
for await (const chunk of stream) {
|
|
7962
|
+
for await (const chunk of stream.fullStream) {
|
|
7931
7963
|
chunks.push(chunk);
|
|
7932
7964
|
await writer?.write({
|
|
7933
7965
|
type: `workflow-execution-event-${chunk.type}`,
|
|
@@ -16494,5 +16526,5 @@ var MastraModelOutput = class extends MastraBase {
|
|
|
16494
16526
|
};
|
|
16495
16527
|
|
|
16496
16528
|
export { AISDKV5OutputStream, Agent, BatchPartsProcessor, ChunkFrom, DefaultExecutionEngine, ExecutionEngine, LanguageDetector, MastraAgentNetworkStream, MastraModelOutput, ModerationProcessor, PIIDetector, ProcessorState, PromptInjectionDetector, Run, StructuredOutputProcessor, SystemPromptScrubber, TokenLimiterProcessor, TripWire, UnicodeNormalizer, Workflow, WorkflowRunOutput, cloneStep, cloneWorkflow, convertFullStreamChunkToUIMessageStream, convertMastraChunkToAISDKv5, createDeprecationProxy, createStep, createTimeTravelExecutionParams, createWorkflow, getResumeLabelsByStepId, getStepIds, getStepResult, getZodErrors, loop, mapVariable, resolveThreadIdFromArgs, runCountDeprecationMessage, tryGenerateWithJsonFallback, tryStreamWithJsonFallback, validateStepInput, validateStepResumeData };
|
|
16497
|
-
//# sourceMappingURL=chunk-
|
|
16498
|
-
//# sourceMappingURL=chunk-
|
|
16529
|
+
//# sourceMappingURL=chunk-XXBWX7DT.js.map
|
|
16530
|
+
//# sourceMappingURL=chunk-XXBWX7DT.js.map
|