@mastra/core 1.16.0-alpha.3 → 1.16.0-alpha.5
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 +13 -13
- package/dist/agent/index.js +2 -2
- package/dist/agent/message-list/conversion/output-converter.d.ts.map +1 -1
- package/dist/agent/message-list/index.cjs +18 -18
- package/dist/agent/message-list/index.js +1 -1
- package/dist/agent/message-list/message-list.d.ts +13 -0
- package/dist/agent/message-list/message-list.d.ts.map +1 -1
- package/dist/{chunk-4EZX3JLF.cjs → chunk-43LAX4OC.cjs} +9 -9
- package/dist/{chunk-4EZX3JLF.cjs.map → chunk-43LAX4OC.cjs.map} +1 -1
- package/dist/{chunk-WZQ2AJZV.js → chunk-7BMRL7A7.js} +8 -8
- package/dist/{chunk-WZQ2AJZV.js.map → chunk-7BMRL7A7.js.map} +1 -1
- package/dist/{chunk-26OOSNWN.js → chunk-7BZCZH6B.js} +3 -3
- package/dist/{chunk-26OOSNWN.js.map → chunk-7BZCZH6B.js.map} +1 -1
- package/dist/{chunk-WZ2EJZ7R.cjs → chunk-7L2ICIDI.cjs} +6 -6
- package/dist/{chunk-WZ2EJZ7R.cjs.map → chunk-7L2ICIDI.cjs.map} +1 -1
- package/dist/{chunk-VQMIFPSC.cjs → chunk-ALCZ3AX7.cjs} +87 -84
- package/dist/chunk-ALCZ3AX7.cjs.map +1 -0
- package/dist/{chunk-O6O5MD7Q.cjs → chunk-ANLO4VM2.cjs} +36 -2
- package/dist/chunk-ANLO4VM2.cjs.map +1 -0
- package/dist/{chunk-76GUV7TZ.js → chunk-BLBX5SP3.js} +4 -4
- package/dist/{chunk-76GUV7TZ.js.map → chunk-BLBX5SP3.js.map} +1 -1
- package/dist/{chunk-V7KMU6NL.cjs → chunk-EEOZARYV.cjs} +7 -7
- package/dist/{chunk-V7KMU6NL.cjs.map → chunk-EEOZARYV.cjs.map} +1 -1
- package/dist/{chunk-GZWOMZ7C.js → chunk-GC3I45ZY.js} +3 -3
- package/dist/{chunk-GZWOMZ7C.js.map → chunk-GC3I45ZY.js.map} +1 -1
- package/dist/{chunk-MLCFE6MR.js → chunk-GRMC2OYN.js} +19 -3
- package/dist/chunk-GRMC2OYN.js.map +1 -0
- package/dist/{chunk-IS7VFXXN.js → chunk-HA53QKBU.js} +8 -8
- package/dist/{chunk-IS7VFXXN.js.map → chunk-HA53QKBU.js.map} +1 -1
- package/dist/{chunk-AVOGYFGK.cjs → chunk-HXFCAKO3.cjs} +83 -83
- package/dist/{chunk-AVOGYFGK.cjs.map → chunk-HXFCAKO3.cjs.map} +1 -1
- package/dist/{chunk-2NDTZII6.cjs → chunk-IK6ZBEOH.cjs} +15 -15
- package/dist/{chunk-2NDTZII6.cjs.map → chunk-IK6ZBEOH.cjs.map} +1 -1
- package/dist/{chunk-WEKILIGZ.js → chunk-J3NJXIJ4.js} +3 -3
- package/dist/{chunk-WEKILIGZ.js.map → chunk-J3NJXIJ4.js.map} +1 -1
- package/dist/{chunk-XME4PQE7.cjs → chunk-K4NN2KQQ.cjs} +19 -3
- package/dist/chunk-K4NN2KQQ.cjs.map +1 -0
- package/dist/{chunk-TKGXEXRR.js → chunk-KXRAP65E.js} +13 -10
- package/dist/chunk-KXRAP65E.js.map +1 -0
- package/dist/{chunk-A25ZFPG7.js → chunk-OMQ7OGTD.js} +7 -7
- package/dist/{chunk-A25ZFPG7.js.map → chunk-OMQ7OGTD.js.map} +1 -1
- package/dist/{chunk-Q7B3NPO3.cjs → chunk-OUMEFQRG.cjs} +3 -3
- package/dist/{chunk-Q7B3NPO3.cjs.map → chunk-OUMEFQRG.cjs.map} +1 -1
- package/dist/{chunk-TQO7BSJX.js → chunk-OUYKDP7F.js} +3 -3
- package/dist/{chunk-TQO7BSJX.js.map → chunk-OUYKDP7F.js.map} +1 -1
- package/dist/{chunk-RKGUSDHX.cjs → chunk-P5L3FDO5.cjs} +58 -58
- package/dist/{chunk-RKGUSDHX.cjs.map → chunk-P5L3FDO5.cjs.map} +1 -1
- package/dist/{chunk-MQ2YFSTS.cjs → chunk-PPDMILXE.cjs} +185 -185
- package/dist/{chunk-MQ2YFSTS.cjs.map → chunk-PPDMILXE.cjs.map} +1 -1
- package/dist/{chunk-BF2JWKWL.cjs → chunk-QR67PGEX.cjs} +5 -5
- package/dist/{chunk-BF2JWKWL.cjs.map → chunk-QR67PGEX.cjs.map} +1 -1
- package/dist/{chunk-XYT5D2T7.cjs → chunk-R67VVUDR.cjs} +13 -13
- package/dist/{chunk-XYT5D2T7.cjs.map → chunk-R67VVUDR.cjs.map} +1 -1
- package/dist/{chunk-YVFTL5BS.cjs → chunk-RQBBPR64.cjs} +16 -16
- package/dist/{chunk-YVFTL5BS.cjs.map → chunk-RQBBPR64.cjs.map} +1 -1
- package/dist/{chunk-2CEWKM43.js → chunk-RTRZMBMW.js} +3 -3
- package/dist/{chunk-2CEWKM43.js.map → chunk-RTRZMBMW.js.map} +1 -1
- package/dist/{chunk-YPJ5V2S5.js → chunk-SLZ3WO42.js} +36 -2
- package/dist/chunk-SLZ3WO42.js.map +1 -0
- package/dist/{chunk-STU7CG7E.js → chunk-V4WRIZUB.js} +5 -5
- package/dist/{chunk-STU7CG7E.js.map → chunk-V4WRIZUB.js.map} +1 -1
- package/dist/{chunk-JBAMLTYP.js → chunk-VDL5NSEM.js} +4 -4
- package/dist/{chunk-JBAMLTYP.js.map → chunk-VDL5NSEM.js.map} +1 -1
- package/dist/{chunk-JO36CQSY.js → chunk-WT6PBYLT.js} +12 -12
- package/dist/chunk-WT6PBYLT.js.map +1 -0
- package/dist/{chunk-7LMIK23W.js → chunk-XKOCRXCP.js} +3 -3
- package/dist/{chunk-7LMIK23W.js.map → chunk-XKOCRXCP.js.map} +1 -1
- package/dist/{chunk-YSPKTAYB.cjs → chunk-XW4B2RAG.cjs} +24 -24
- package/dist/{chunk-YSPKTAYB.cjs.map → chunk-XW4B2RAG.cjs.map} +1 -1
- package/dist/{chunk-4LDSJHWQ.cjs → chunk-YW7C25S4.cjs} +7 -7
- package/dist/{chunk-4LDSJHWQ.cjs.map → chunk-YW7C25S4.cjs.map} +1 -1
- package/dist/{chunk-BXDWBXQW.cjs → chunk-Z2ZO3S34.cjs} +13 -13
- package/dist/chunk-Z2ZO3S34.cjs.map +1 -0
- package/dist/{chunk-TUSCHVH3.js → chunk-ZJMETLCP.js} +4 -4
- package/dist/{chunk-TUSCHVH3.js.map → chunk-ZJMETLCP.js.map} +1 -1
- package/dist/datasets/index.cjs +17 -17
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +239 -239
- package/dist/docs/references/docs-memory-observational-memory.md +36 -0
- package/dist/docs/references/reference-memory-observational-memory.md +42 -3
- package/dist/evals/index.cjs +5 -5
- package/dist/evals/index.js +2 -2
- package/dist/evals/scoreTraces/index.cjs +3 -3
- package/dist/evals/scoreTraces/index.js +1 -1
- package/dist/harness/index.cjs +17 -17
- package/dist/harness/index.js +7 -7
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/integration/index.cjs +2 -2
- package/dist/integration/index.js +1 -1
- package/dist/llm/index.cjs +16 -16
- package/dist/llm/index.js +5 -5
- package/dist/llm/model/provider-types.generated.d.ts +3 -3
- package/dist/loop/index.cjs +14 -14
- package/dist/loop/index.js +1 -1
- package/dist/loop/workflows/agentic-execution/llm-execution-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 +14 -14
- package/dist/memory/index.js +1 -1
- package/dist/models-dev-FQZJVFA3.cjs +12 -0
- package/dist/{models-dev-2FOUJALF.cjs.map → models-dev-FQZJVFA3.cjs.map} +1 -1
- package/dist/models-dev-IXIFPHTL.js +3 -0
- package/dist/{models-dev-A55UVGDD.js.map → models-dev-IXIFPHTL.js.map} +1 -1
- package/dist/netlify-ZDPSLMHL.js +3 -0
- package/dist/{netlify-MF3L2BRE.js.map → netlify-ZDPSLMHL.js.map} +1 -1
- package/dist/netlify-ZP6W4FNX.cjs +12 -0
- package/dist/{netlify-I3P5QPXG.cjs.map → netlify-ZP6W4FNX.cjs.map} +1 -1
- package/dist/processor-provider/index.cjs +10 -10
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +42 -42
- package/dist/processors/index.js +1 -1
- package/dist/provider-registry-GQASCCYW.cjs +40 -0
- package/dist/{provider-registry-QB6DEJ7U.cjs.map → provider-registry-GQASCCYW.cjs.map} +1 -1
- package/dist/provider-registry-JPXSL43R.js +3 -0
- package/dist/{provider-registry-J76YNM72.js.map → provider-registry-JPXSL43R.js.map} +1 -1
- package/dist/provider-registry.json +8 -8
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/storage/index.cjs +74 -74
- package/dist/storage/index.js +1 -1
- package/dist/stream/index.cjs +11 -11
- package/dist/stream/index.js +2 -2
- package/dist/test-utils/llm-mock.cjs +4 -4
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/tool-loop-agent/index.cjs +4 -4
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/tools/index.cjs +7 -7
- package/dist/tools/index.js +1 -1
- package/dist/tools/is-vercel-tool.cjs +2 -2
- package/dist/tools/is-vercel-tool.js +1 -1
- package/dist/tools/validation.d.ts.map +1 -1
- package/dist/utils.cjs +23 -23
- package/dist/utils.js +1 -1
- package/dist/vector/index.cjs +7 -7
- package/dist/vector/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 +24 -24
- package/dist/workflows/index.js +1 -1
- package/dist/workspace/index.cjs +68 -68
- package/dist/workspace/index.js +1 -1
- package/package.json +5 -5
- package/src/llm/model/provider-types.generated.d.ts +3 -3
- package/dist/chunk-BXDWBXQW.cjs.map +0 -1
- package/dist/chunk-JO36CQSY.js.map +0 -1
- package/dist/chunk-MLCFE6MR.js.map +0 -1
- package/dist/chunk-O6O5MD7Q.cjs.map +0 -1
- package/dist/chunk-TKGXEXRR.js.map +0 -1
- package/dist/chunk-VQMIFPSC.cjs.map +0 -1
- package/dist/chunk-XME4PQE7.cjs.map +0 -1
- package/dist/chunk-YPJ5V2S5.js.map +0 -1
- package/dist/models-dev-2FOUJALF.cjs +0 -12
- package/dist/models-dev-A55UVGDD.js +0 -3
- package/dist/netlify-I3P5QPXG.cjs +0 -12
- package/dist/netlify-MF3L2BRE.js +0 -3
- package/dist/provider-registry-J76YNM72.js +0 -3
- package/dist/provider-registry-QB6DEJ7U.cjs +0 -40
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkZC4FJVJZ_cjs = require('./chunk-ZC4FJVJZ.cjs');
|
|
4
4
|
var chunkZCBG4ZQT_cjs = require('./chunk-ZCBG4ZQT.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var chunkXW4B2RAG_cjs = require('./chunk-XW4B2RAG.cjs');
|
|
6
|
+
var chunkR67VVUDR_cjs = require('./chunk-R67VVUDR.cjs');
|
|
7
|
+
var chunkANLO4VM2_cjs = require('./chunk-ANLO4VM2.cjs');
|
|
8
8
|
var chunkY3APFUXZ_cjs = require('./chunk-Y3APFUXZ.cjs');
|
|
9
9
|
var chunkCFMZZDO2_cjs = require('./chunk-CFMZZDO2.cjs');
|
|
10
10
|
var chunkMR7ZWBL6_cjs = require('./chunk-MR7ZWBL6.cjs');
|
|
11
|
-
var
|
|
12
|
-
var
|
|
11
|
+
var chunkHXFCAKO3_cjs = require('./chunk-HXFCAKO3.cjs');
|
|
12
|
+
var chunk7L2ICIDI_cjs = require('./chunk-7L2ICIDI.cjs');
|
|
13
13
|
var chunk6BJ7XHRH_cjs = require('./chunk-6BJ7XHRH.cjs');
|
|
14
14
|
var chunkOQDRPRKM_cjs = require('./chunk-OQDRPRKM.cjs');
|
|
15
|
-
var
|
|
15
|
+
var chunkRQBBPR64_cjs = require('./chunk-RQBBPR64.cjs');
|
|
16
16
|
var chunkG5HKDGNT_cjs = require('./chunk-G5HKDGNT.cjs');
|
|
17
17
|
var chunkKJBMTK5B_cjs = require('./chunk-KJBMTK5B.cjs');
|
|
18
|
-
var
|
|
18
|
+
var chunkK4NN2KQQ_cjs = require('./chunk-K4NN2KQQ.cjs');
|
|
19
19
|
var chunkXB4FLS7A_cjs = require('./chunk-XB4FLS7A.cjs');
|
|
20
|
-
var chunk4U7ZLI36_cjs = require('./chunk-4U7ZLI36.cjs');
|
|
21
20
|
var chunk5WBEMKE2_cjs = require('./chunk-5WBEMKE2.cjs');
|
|
21
|
+
var chunk4U7ZLI36_cjs = require('./chunk-4U7ZLI36.cjs');
|
|
22
22
|
var chunkRO47SMI7_cjs = require('./chunk-RO47SMI7.cjs');
|
|
23
23
|
var chunk7XAECHYL_cjs = require('./chunk-7XAECHYL.cjs');
|
|
24
24
|
var chunkBVWXTWXP_cjs = require('./chunk-BVWXTWXP.cjs');
|
|
@@ -651,10 +651,10 @@ function prepareToolsAndToolChoice({
|
|
|
651
651
|
return {
|
|
652
652
|
tools: filteredTools.map(([name, tool2]) => {
|
|
653
653
|
try {
|
|
654
|
-
if (
|
|
654
|
+
if (chunkK4NN2KQQ_cjs.isProviderDefinedTool(tool2)) {
|
|
655
655
|
return {
|
|
656
656
|
type: providerToolType,
|
|
657
|
-
name:
|
|
657
|
+
name: chunkK4NN2KQQ_cjs.getProviderToolName(tool2.id),
|
|
658
658
|
id: tool2.id,
|
|
659
659
|
args: tool2.args ?? {}
|
|
660
660
|
};
|
|
@@ -708,7 +708,7 @@ function prepareToolsAndToolChoice({
|
|
|
708
708
|
const providerId = sdkTool.id;
|
|
709
709
|
return {
|
|
710
710
|
type: providerToolType,
|
|
711
|
-
name: providerId ?
|
|
711
|
+
name: providerId ? chunkK4NN2KQQ_cjs.getProviderToolName(providerId) : name,
|
|
712
712
|
id: providerId,
|
|
713
713
|
args: sdkTool.args
|
|
714
714
|
};
|
|
@@ -1296,7 +1296,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1296
1296
|
writer
|
|
1297
1297
|
});
|
|
1298
1298
|
const mutations = messageList.stopRecording();
|
|
1299
|
-
if (processResult instanceof
|
|
1299
|
+
if (processResult instanceof chunkANLO4VM2_cjs.MessageList) {
|
|
1300
1300
|
if (processResult !== messageList) {
|
|
1301
1301
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
1302
1302
|
category: "USER",
|
|
@@ -1590,7 +1590,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1590
1590
|
retryCount
|
|
1591
1591
|
});
|
|
1592
1592
|
let mutations;
|
|
1593
|
-
if (result instanceof
|
|
1593
|
+
if (result instanceof chunkANLO4VM2_cjs.MessageList) {
|
|
1594
1594
|
if (result !== messageList) {
|
|
1595
1595
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
1596
1596
|
category: "USER",
|
|
@@ -1961,7 +1961,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1961
1961
|
writer
|
|
1962
1962
|
});
|
|
1963
1963
|
const mutations = messageList.stopRecording();
|
|
1964
|
-
if (result instanceof
|
|
1964
|
+
if (result instanceof chunkANLO4VM2_cjs.MessageList) {
|
|
1965
1965
|
if (result !== messageList) {
|
|
1966
1966
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
1967
1967
|
category: "USER",
|
|
@@ -2034,7 +2034,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
2034
2034
|
processor,
|
|
2035
2035
|
stepNumber
|
|
2036
2036
|
}) {
|
|
2037
|
-
if (result instanceof
|
|
2037
|
+
if (result instanceof chunkANLO4VM2_cjs.MessageList) {
|
|
2038
2038
|
if (result !== messageList) {
|
|
2039
2039
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
2040
2040
|
category: "USER",
|
|
@@ -2069,7 +2069,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
2069
2069
|
}
|
|
2070
2070
|
const { model: _model, ...rest } = result;
|
|
2071
2071
|
if (result.model) {
|
|
2072
|
-
const resolvedModel = await
|
|
2072
|
+
const resolvedModel = await chunkHXFCAKO3_cjs.resolveModelConfig(result.model);
|
|
2073
2073
|
const isSupported = isSupportedLanguageModel(resolvedModel);
|
|
2074
2074
|
if (!isSupported) {
|
|
2075
2075
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
@@ -3276,7 +3276,7 @@ var MastraModelOutput = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
3276
3276
|
);
|
|
3277
3277
|
const responseMessages = self.messageList.get.response.aiV4.core();
|
|
3278
3278
|
const lastResponseMessage = responseMessages[responseMessages.length - 1];
|
|
3279
|
-
const outputText = lastResponseMessage ?
|
|
3279
|
+
const outputText = lastResponseMessage ? chunkANLO4VM2_cjs.coreContentToString(lastResponseMessage.content) : "";
|
|
3280
3280
|
if (lastStep && outputText && outputText !== originalText) {
|
|
3281
3281
|
lastStep.text = outputText;
|
|
3282
3282
|
}
|
|
@@ -4648,7 +4648,7 @@ function convertMastraChunkToAISDKv5({
|
|
|
4648
4648
|
if (mode === "generate") {
|
|
4649
4649
|
return {
|
|
4650
4650
|
type: "file",
|
|
4651
|
-
file: new
|
|
4651
|
+
file: new chunkANLO4VM2_cjs.DefaultGeneratedFile({
|
|
4652
4652
|
data: chunk.payload.data,
|
|
4653
4653
|
mediaType: chunk.payload.mimeType
|
|
4654
4654
|
})
|
|
@@ -4656,7 +4656,7 @@ function convertMastraChunkToAISDKv5({
|
|
|
4656
4656
|
}
|
|
4657
4657
|
return {
|
|
4658
4658
|
type: "file",
|
|
4659
|
-
file: new
|
|
4659
|
+
file: new chunkANLO4VM2_cjs.DefaultGeneratedFileWithType({
|
|
4660
4660
|
data: chunk.payload.data,
|
|
4661
4661
|
mediaType: chunk.payload.mimeType
|
|
4662
4662
|
})
|
|
@@ -5495,7 +5495,7 @@ var createTimeTravelExecutionParams = (params) => {
|
|
|
5495
5495
|
result = void 0;
|
|
5496
5496
|
}
|
|
5497
5497
|
if (result) {
|
|
5498
|
-
const formattedResult =
|
|
5498
|
+
const formattedResult = chunkRQBBPR64_cjs.removeUndefinedValues(result);
|
|
5499
5499
|
stepResults[stepId] = formattedResult;
|
|
5500
5500
|
}
|
|
5501
5501
|
});
|
|
@@ -6053,7 +6053,7 @@ async function executeLoop(engine, params) {
|
|
|
6053
6053
|
options: {
|
|
6054
6054
|
type: "workflow_conditional_eval" /* WORKFLOW_CONDITIONAL_EVAL */,
|
|
6055
6055
|
name: `condition: '${entry.loopType}'`,
|
|
6056
|
-
input:
|
|
6056
|
+
input: chunkRQBBPR64_cjs.selectFields(result.output, ["stepResult", "output.text", "output.object", "messages"]),
|
|
6057
6057
|
attributes: {
|
|
6058
6058
|
conditionIndex: iteration
|
|
6059
6059
|
},
|
|
@@ -8323,10 +8323,10 @@ function isAgent(input) {
|
|
|
8323
8323
|
return input instanceof Agent;
|
|
8324
8324
|
}
|
|
8325
8325
|
function isToolStep(input) {
|
|
8326
|
-
return input instanceof
|
|
8326
|
+
return input instanceof chunkK4NN2KQQ_cjs.Tool;
|
|
8327
8327
|
}
|
|
8328
8328
|
function isStepParams(input) {
|
|
8329
|
-
return input !== null && typeof input === "object" && "id" in input && "execute" in input && !(input instanceof Agent) && !(input instanceof
|
|
8329
|
+
return input !== null && typeof input === "object" && "id" in input && "execute" in input && !(input instanceof Agent) && !(input instanceof chunkK4NN2KQQ_cjs.Tool);
|
|
8330
8330
|
}
|
|
8331
8331
|
function createStep(params, agentOrToolOptions) {
|
|
8332
8332
|
if (isAgent(params)) {
|
|
@@ -8681,7 +8681,7 @@ function createStepFromProcessor(processor) {
|
|
|
8681
8681
|
phase,
|
|
8682
8682
|
// Auto-create MessageList from messages if not provided
|
|
8683
8683
|
// This enables running processor workflows from the UI where messageList can't be serialized
|
|
8684
|
-
messageList: messageList ?? (Array.isArray(messages) ? new
|
|
8684
|
+
messageList: messageList ?? (Array.isArray(messages) ? new chunkANLO4VM2_cjs.MessageList().add(messages, "input").addSystem(systemMessages ?? []) : void 0),
|
|
8685
8685
|
stepNumber,
|
|
8686
8686
|
systemMessages,
|
|
8687
8687
|
streamParts,
|
|
@@ -8738,7 +8738,7 @@ function createStepFromProcessor(processor) {
|
|
|
8738
8738
|
messageList: checkedMessageList,
|
|
8739
8739
|
systemMessages: systemMessages ?? []
|
|
8740
8740
|
});
|
|
8741
|
-
if (result instanceof
|
|
8741
|
+
if (result instanceof chunkANLO4VM2_cjs.MessageList) {
|
|
8742
8742
|
if (result !== checkedMessageList) {
|
|
8743
8743
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
8744
8744
|
category: "USER" /* USER */,
|
|
@@ -8921,7 +8921,7 @@ function createStepFromProcessor(processor) {
|
|
|
8921
8921
|
messageList: passThrough.messageList,
|
|
8922
8922
|
result: passThrough.result ?? defaultResult
|
|
8923
8923
|
});
|
|
8924
|
-
if (result instanceof
|
|
8924
|
+
if (result instanceof chunkANLO4VM2_cjs.MessageList) {
|
|
8925
8925
|
if (result !== passThrough.messageList) {
|
|
8926
8926
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
8927
8927
|
category: "USER" /* USER */,
|
|
@@ -8988,7 +8988,7 @@ function createStepFromProcessor(processor) {
|
|
|
8988
8988
|
systemMessages: systemMessages ?? [],
|
|
8989
8989
|
steps: steps ?? []
|
|
8990
8990
|
});
|
|
8991
|
-
if (result instanceof
|
|
8991
|
+
if (result instanceof chunkANLO4VM2_cjs.MessageList) {
|
|
8992
8992
|
if (result !== checkedMessageList) {
|
|
8993
8993
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
8994
8994
|
category: "USER" /* USER */,
|
|
@@ -9056,7 +9056,7 @@ function cloneStep(step, opts) {
|
|
|
9056
9056
|
};
|
|
9057
9057
|
}
|
|
9058
9058
|
function isProcessor(obj) {
|
|
9059
|
-
return obj !== null && typeof obj === "object" && "id" in obj && typeof obj.id === "string" && !(obj instanceof Agent) && !(obj instanceof
|
|
9059
|
+
return obj !== null && typeof obj === "object" && "id" in obj && typeof obj.id === "string" && !(obj instanceof Agent) && !(obj instanceof chunkK4NN2KQQ_cjs.Tool) && (typeof obj.processInput === "function" || typeof obj.processInputStep === "function" || typeof obj.processOutputStream === "function" || typeof obj.processOutputResult === "function" || typeof obj.processOutputStep === "function");
|
|
9060
9060
|
}
|
|
9061
9061
|
function createWorkflow(params) {
|
|
9062
9062
|
return new Workflow(params);
|
|
@@ -11354,7 +11354,7 @@ var MastraScorer = class _MastraScorer {
|
|
|
11354
11354
|
}
|
|
11355
11355
|
});
|
|
11356
11356
|
}
|
|
11357
|
-
const resolvedModel = await
|
|
11357
|
+
const resolvedModel = await chunkHXFCAKO3_cjs.resolveModelConfig(modelConfig, void 0, this.#mastra);
|
|
11358
11358
|
const judge = new Agent({
|
|
11359
11359
|
id: "judge",
|
|
11360
11360
|
name: "judge",
|
|
@@ -12209,11 +12209,11 @@ var DefaultStepResult = class {
|
|
|
12209
12209
|
// src/tools/provider-tool-utils.ts
|
|
12210
12210
|
function findProviderToolByName(tools, toolName) {
|
|
12211
12211
|
if (!tools) return void 0;
|
|
12212
|
-
return Object.values(tools).find((t) =>
|
|
12212
|
+
return Object.values(tools).find((t) => chunkK4NN2KQQ_cjs.isProviderTool(t) && chunkK4NN2KQQ_cjs.getProviderToolName(t.id) === toolName);
|
|
12213
12213
|
}
|
|
12214
12214
|
function inferProviderExecuted(providerExecuted, tool2) {
|
|
12215
12215
|
if (providerExecuted !== void 0) return providerExecuted;
|
|
12216
|
-
return
|
|
12216
|
+
return chunkK4NN2KQQ_cjs.isProviderTool(tool2) ? true : void 0;
|
|
12217
12217
|
}
|
|
12218
12218
|
|
|
12219
12219
|
// src/loop/workflows/run-state.ts
|
|
@@ -12732,6 +12732,9 @@ function createLLMExecutionStep({
|
|
|
12732
12732
|
outputSchema: llmIterationOutputSchema,
|
|
12733
12733
|
execute: async ({ inputData, bail, tracingContext }) => {
|
|
12734
12734
|
currentIteration++;
|
|
12735
|
+
if (currentIteration > 1) {
|
|
12736
|
+
messageList.stepStart();
|
|
12737
|
+
}
|
|
12735
12738
|
let currentMessageId = inputData.isTaskCompleteCheckFailed ? `${messageIdPassed}-${currentIteration}` : inputData.messageId || messageIdPassed;
|
|
12736
12739
|
modelSpanTracker?.startStep();
|
|
12737
12740
|
let modelResult;
|
|
@@ -12803,8 +12806,8 @@ function createLLMExecutionStep({
|
|
|
12803
12806
|
if (processInputStepResult.tools && currentStep.tools) {
|
|
12804
12807
|
const convertedTools = {};
|
|
12805
12808
|
for (const [name, tool2] of Object.entries(currentStep.tools)) {
|
|
12806
|
-
if (
|
|
12807
|
-
convertedTools[name] =
|
|
12809
|
+
if (chunkK4NN2KQQ_cjs.isMastraTool(tool2)) {
|
|
12810
|
+
convertedTools[name] = chunkRQBBPR64_cjs.makeCoreTool(
|
|
12808
12811
|
tool2,
|
|
12809
12812
|
{
|
|
12810
12813
|
name,
|
|
@@ -13011,7 +13014,7 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
|
|
|
13011
13014
|
}
|
|
13012
13015
|
});
|
|
13013
13016
|
let transportResolver;
|
|
13014
|
-
if (currentStep.model instanceof
|
|
13017
|
+
if (currentStep.model instanceof chunkHXFCAKO3_cjs.ModelRouterLanguageModel) {
|
|
13015
13018
|
const routerModel = currentStep.model;
|
|
13016
13019
|
transportResolver = () => routerModel._getStreamTransport();
|
|
13017
13020
|
}
|
|
@@ -13373,7 +13376,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13373
13376
|
toolInvocation: {
|
|
13374
13377
|
state: "result",
|
|
13375
13378
|
toolCallId: toolCall.toolCallId,
|
|
13376
|
-
toolName:
|
|
13379
|
+
toolName: chunkANLO4VM2_cjs.sanitizeToolName(toolCall.toolName),
|
|
13377
13380
|
args: toolCall.args,
|
|
13378
13381
|
result: toolCall.error?.message ?? toolCall.error
|
|
13379
13382
|
},
|
|
@@ -13408,7 +13411,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13408
13411
|
toolInvocation: {
|
|
13409
13412
|
state: "result",
|
|
13410
13413
|
toolCallId: toolCall.toolCallId,
|
|
13411
|
-
toolName:
|
|
13414
|
+
toolName: chunkANLO4VM2_cjs.sanitizeToolName(toolCall.toolName),
|
|
13412
13415
|
args: toolCall.args,
|
|
13413
13416
|
result: toolCall.result
|
|
13414
13417
|
},
|
|
@@ -13465,7 +13468,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13465
13468
|
toolInvocation: {
|
|
13466
13469
|
state: "result",
|
|
13467
13470
|
toolCallId: toolCall.toolCallId,
|
|
13468
|
-
toolName:
|
|
13471
|
+
toolName: chunkANLO4VM2_cjs.sanitizeToolName(toolCall.toolName),
|
|
13469
13472
|
args: toolCall.args,
|
|
13470
13473
|
result: toolCall.result
|
|
13471
13474
|
},
|
|
@@ -14758,7 +14761,7 @@ var MastraLLMVNext = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
14758
14761
|
const remainingTokens = parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"] ?? "", 10);
|
|
14759
14762
|
if (!isNaN(remainingTokens) && remainingTokens > 0 && remainingTokens < 2e3) {
|
|
14760
14763
|
this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
|
|
14761
|
-
await
|
|
14764
|
+
await chunkRQBBPR64_cjs.delay(10 * 1e3);
|
|
14762
14765
|
}
|
|
14763
14766
|
},
|
|
14764
14767
|
onFinish: async (props) => {
|
|
@@ -15034,7 +15037,7 @@ async function prepareMemoryStep({
|
|
|
15034
15037
|
);
|
|
15035
15038
|
}
|
|
15036
15039
|
} else {
|
|
15037
|
-
const messageList = new
|
|
15040
|
+
const messageList = new chunkANLO4VM2_cjs.MessageList({
|
|
15038
15041
|
threadId: thread?.id,
|
|
15039
15042
|
resourceId: thread?.resourceId
|
|
15040
15043
|
});
|
|
@@ -15091,7 +15094,7 @@ async function saveMessagesWithProcessors(memory, messages, processorRunner, con
|
|
|
15091
15094
|
await memory.saveMessages({ messages });
|
|
15092
15095
|
return;
|
|
15093
15096
|
}
|
|
15094
|
-
const messageList = new
|
|
15097
|
+
const messageList = new chunkANLO4VM2_cjs.MessageList();
|
|
15095
15098
|
for (const msg of messages) {
|
|
15096
15099
|
messageList.add(msg, "response");
|
|
15097
15100
|
}
|
|
@@ -16529,7 +16532,7 @@ async function networkLoop({
|
|
|
16529
16532
|
"resumeData": "string"
|
|
16530
16533
|
}
|
|
16531
16534
|
`;
|
|
16532
|
-
const messageList = new
|
|
16535
|
+
const messageList = new chunkANLO4VM2_cjs.MessageList();
|
|
16533
16536
|
messageList.addSystem(systemInstructions);
|
|
16534
16537
|
messageList.add(task, "user");
|
|
16535
16538
|
const result = llm.stream({
|
|
@@ -17185,7 +17188,7 @@ var AgentLegacyHandler = class {
|
|
|
17185
17188
|
methodType: methodType === "generate" ? "generateLegacy" : "streamLegacy",
|
|
17186
17189
|
memoryConfig
|
|
17187
17190
|
});
|
|
17188
|
-
let messageList = new
|
|
17191
|
+
let messageList = new chunkANLO4VM2_cjs.MessageList({
|
|
17189
17192
|
threadId,
|
|
17190
17193
|
resourceId,
|
|
17191
17194
|
generateMessageId: this.capabilities.mastra?.generateId?.bind(this.capabilities.mastra),
|
|
@@ -17354,7 +17357,7 @@ var AgentLegacyHandler = class {
|
|
|
17354
17357
|
result: resToLog,
|
|
17355
17358
|
threadId
|
|
17356
17359
|
});
|
|
17357
|
-
const messageListResponses = new
|
|
17360
|
+
const messageListResponses = new chunkANLO4VM2_cjs.MessageList({
|
|
17358
17361
|
threadId,
|
|
17359
17362
|
resourceId,
|
|
17360
17363
|
generateMessageId: this.capabilities.mastra?.generateId?.bind(this.capabilities.mastra),
|
|
@@ -18504,7 +18507,7 @@ var prepareToolsStepOutputSchema = v4.z.object({
|
|
|
18504
18507
|
var prepareMemoryStepOutputSchema = v4.z.object({
|
|
18505
18508
|
threadExists: v4.z.boolean(),
|
|
18506
18509
|
thread: storageThreadSchema.optional(),
|
|
18507
|
-
messageList: v4.z.instanceof(
|
|
18510
|
+
messageList: v4.z.instanceof(chunkANLO4VM2_cjs.MessageList),
|
|
18508
18511
|
/** Shared processor states map that persists across loop iterations for both input and output processors */
|
|
18509
18512
|
processorStates: v4.z.instanceof(Map),
|
|
18510
18513
|
/** Tripwire data when input processor triggered abort */
|
|
@@ -18545,7 +18548,7 @@ function createPrepareMemoryStep({
|
|
|
18545
18548
|
execute: async ({ ...rest }) => {
|
|
18546
18549
|
const observabilityContext = chunkG5HKDGNT_cjs.resolveObservabilityContext(rest);
|
|
18547
18550
|
const thread = threadFromArgs;
|
|
18548
|
-
const messageList = new
|
|
18551
|
+
const messageList = new chunkANLO4VM2_cjs.MessageList({
|
|
18549
18552
|
threadId: thread?.id,
|
|
18550
18553
|
resourceId,
|
|
18551
18554
|
generateMessageId: capabilities.generateMessageId,
|
|
@@ -19780,7 +19783,7 @@ ${errorMessages}`,
|
|
|
19780
19783
|
*/
|
|
19781
19784
|
listTools({ requestContext = new chunk5WBEMKE2_cjs.RequestContext() } = {}) {
|
|
19782
19785
|
if (typeof this.#tools !== "function") {
|
|
19783
|
-
return
|
|
19786
|
+
return chunkRQBBPR64_cjs.ensureToolProperties(this.#tools);
|
|
19784
19787
|
}
|
|
19785
19788
|
const result = this.#tools({
|
|
19786
19789
|
requestContext,
|
|
@@ -19801,7 +19804,7 @@ ${errorMessages}`,
|
|
|
19801
19804
|
this.logger.error(mastraError.toString());
|
|
19802
19805
|
throw mastraError;
|
|
19803
19806
|
}
|
|
19804
|
-
return
|
|
19807
|
+
return chunkRQBBPR64_cjs.ensureToolProperties(tools);
|
|
19805
19808
|
});
|
|
19806
19809
|
}
|
|
19807
19810
|
/**
|
|
@@ -19847,7 +19850,7 @@ ${errorMessages}`,
|
|
|
19847
19850
|
});
|
|
19848
19851
|
});
|
|
19849
19852
|
} else {
|
|
19850
|
-
llm = new
|
|
19853
|
+
llm = new chunk7L2ICIDI_cjs.MastraLLMV1({
|
|
19851
19854
|
model: modelInfo,
|
|
19852
19855
|
mastra: this.#mastra,
|
|
19853
19856
|
options: { tracingPolicy: this.#options?.tracingPolicy }
|
|
@@ -19873,7 +19876,7 @@ ${errorMessages}`,
|
|
|
19873
19876
|
*/
|
|
19874
19877
|
async resolveModelConfig(modelConfig, requestContext) {
|
|
19875
19878
|
try {
|
|
19876
|
-
return await
|
|
19879
|
+
return await chunkHXFCAKO3_cjs.resolveModelConfig(modelConfig, requestContext, this.#mastra);
|
|
19877
19880
|
} catch (error) {
|
|
19878
19881
|
const mastraError = new chunk4U7ZLI36_cjs.MastraError({
|
|
19879
19882
|
id: "AGENT_GET_MODEL_MISSING_MODEL_INSTANCE",
|
|
@@ -20201,7 +20204,7 @@ ${errorMessages}`,
|
|
|
20201
20204
|
}) {
|
|
20202
20205
|
const observabilityContext = chunkG5HKDGNT_cjs.resolveObservabilityContext(rest);
|
|
20203
20206
|
const llm = await this.getLLM({ requestContext, model });
|
|
20204
|
-
const normMessage = new
|
|
20207
|
+
const normMessage = new chunkANLO4VM2_cjs.MessageList().add(message, "user").get.all.aiV5.ui().at(-1);
|
|
20205
20208
|
if (!normMessage) {
|
|
20206
20209
|
throw new Error(`Could not generate title from input ${JSON.stringify(message)}`);
|
|
20207
20210
|
}
|
|
@@ -20224,7 +20227,7 @@ ${errorMessages}`,
|
|
|
20224
20227
|
const systemInstructions = await this.resolveTitleInstructions(requestContext, instructions);
|
|
20225
20228
|
let text = "";
|
|
20226
20229
|
if (isSupportedLanguageModel(llm.getModel())) {
|
|
20227
|
-
const messageList = new
|
|
20230
|
+
const messageList = new chunkANLO4VM2_cjs.MessageList().add(
|
|
20228
20231
|
[
|
|
20229
20232
|
{
|
|
20230
20233
|
role: "system",
|
|
@@ -20277,7 +20280,7 @@ ${errorMessages}`,
|
|
|
20277
20280
|
async genTitle(userMessage, requestContext, observabilityContext, model, instructions) {
|
|
20278
20281
|
try {
|
|
20279
20282
|
if (userMessage) {
|
|
20280
|
-
const normMessage = new
|
|
20283
|
+
const normMessage = new chunkANLO4VM2_cjs.MessageList().add(userMessage, "user").get.all.ui().at(-1);
|
|
20281
20284
|
if (normMessage) {
|
|
20282
20285
|
return await this.generateTitleFromUserMessage({
|
|
20283
20286
|
message: normMessage,
|
|
@@ -20359,7 +20362,7 @@ ${errorMessages}`,
|
|
|
20359
20362
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20360
20363
|
requireApproval: toolObj.requireApproval
|
|
20361
20364
|
};
|
|
20362
|
-
const convertedToCoreTool =
|
|
20365
|
+
const convertedToCoreTool = chunkRQBBPR64_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20363
20366
|
convertedMemoryTools[toolName] = convertedToCoreTool;
|
|
20364
20367
|
}
|
|
20365
20368
|
}
|
|
@@ -20388,7 +20391,7 @@ ${errorMessages}`,
|
|
|
20388
20391
|
if (!workspace) {
|
|
20389
20392
|
return convertedWorkspaceTools;
|
|
20390
20393
|
}
|
|
20391
|
-
const workspaceTools =
|
|
20394
|
+
const workspaceTools = chunkXW4B2RAG_cjs.createWorkspaceTools(workspace);
|
|
20392
20395
|
if (Object.keys(workspaceTools).length > 0) {
|
|
20393
20396
|
this.logger.debug(`[Agent:${this.name}] - Adding workspace tools: ${Object.keys(workspaceTools).join(", ")}`, {
|
|
20394
20397
|
runId
|
|
@@ -20411,7 +20414,7 @@ ${errorMessages}`,
|
|
|
20411
20414
|
requireApproval: toolObj.requireApproval,
|
|
20412
20415
|
workspace
|
|
20413
20416
|
};
|
|
20414
|
-
const convertedToCoreTool =
|
|
20417
|
+
const convertedToCoreTool = chunkRQBBPR64_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20415
20418
|
convertedWorkspaceTools[toolName] = convertedToCoreTool;
|
|
20416
20419
|
}
|
|
20417
20420
|
}
|
|
@@ -20442,7 +20445,7 @@ ${errorMessages}`,
|
|
|
20442
20445
|
if (!workspace?.skills) {
|
|
20443
20446
|
return convertedSkillTools;
|
|
20444
20447
|
}
|
|
20445
|
-
const skillTools =
|
|
20448
|
+
const skillTools = chunkXW4B2RAG_cjs.createSkillTools(workspace.skills);
|
|
20446
20449
|
if (Object.keys(skillTools).length > 0) {
|
|
20447
20450
|
this.logger.debug(`[Agent:${this.name}] - Adding skill tools: ${Object.keys(skillTools).join(", ")}`, {
|
|
20448
20451
|
runId
|
|
@@ -20466,7 +20469,7 @@ ${errorMessages}`,
|
|
|
20466
20469
|
// Skill tools never require approval
|
|
20467
20470
|
workspace
|
|
20468
20471
|
};
|
|
20469
|
-
const convertedToCoreTool =
|
|
20472
|
+
const convertedToCoreTool = chunkRQBBPR64_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20470
20473
|
convertedSkillTools[toolName] = convertedToCoreTool;
|
|
20471
20474
|
}
|
|
20472
20475
|
}
|
|
@@ -20683,7 +20686,7 @@ ${errorMessages}`,
|
|
|
20683
20686
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20684
20687
|
requireApproval: tool2.requireApproval
|
|
20685
20688
|
};
|
|
20686
|
-
return [k,
|
|
20689
|
+
return [k, chunkRQBBPR64_cjs.makeCoreTool(tool2, options, void 0, autoResumeSuspendedTools)];
|
|
20687
20690
|
})
|
|
20688
20691
|
);
|
|
20689
20692
|
const assignedToolEntriesConverted = Object.fromEntries(
|
|
@@ -20735,7 +20738,7 @@ ${errorMessages}`,
|
|
|
20735
20738
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20736
20739
|
requireApproval: toolObj.requireApproval
|
|
20737
20740
|
};
|
|
20738
|
-
const convertedToCoreTool =
|
|
20741
|
+
const convertedToCoreTool = chunkRQBBPR64_cjs.makeCoreTool(toolObj, options, "toolset", autoResumeSuspendedTools);
|
|
20739
20742
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
20740
20743
|
}
|
|
20741
20744
|
}
|
|
@@ -20782,7 +20785,7 @@ ${errorMessages}`,
|
|
|
20782
20785
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20783
20786
|
requireApproval: tool2.requireApproval
|
|
20784
20787
|
};
|
|
20785
|
-
const convertedToCoreTool =
|
|
20788
|
+
const convertedToCoreTool = chunkRQBBPR64_cjs.makeCoreTool(toolRest, options, "client-tool", autoResumeSuspendedTools);
|
|
20786
20789
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
20787
20790
|
}
|
|
20788
20791
|
}
|
|
@@ -20866,7 +20869,7 @@ ${errorMessages}`,
|
|
|
20866
20869
|
).describe("The results from the agent's tool calls").optional()
|
|
20867
20870
|
});
|
|
20868
20871
|
const modelVersion = (await agent.getModel({ requestContext })).specificationVersion;
|
|
20869
|
-
const toolObj =
|
|
20872
|
+
const toolObj = chunkK4NN2KQQ_cjs.createTool({
|
|
20870
20873
|
id: `agent-${agentName}`,
|
|
20871
20874
|
description: agent.getDescription() || `Agent: ${agentName}`,
|
|
20872
20875
|
inputSchema: agentInputSchema,
|
|
@@ -21443,7 +21446,7 @@ ${effectiveInstructions}`;
|
|
|
21443
21446
|
...observabilityContext,
|
|
21444
21447
|
tracingPolicy: this.#options?.tracingPolicy
|
|
21445
21448
|
};
|
|
21446
|
-
convertedAgentTools[`agent-${agentName}`] =
|
|
21449
|
+
convertedAgentTools[`agent-${agentName}`] = chunkRQBBPR64_cjs.makeCoreTool(
|
|
21447
21450
|
toolObj,
|
|
21448
21451
|
options,
|
|
21449
21452
|
void 0,
|
|
@@ -21508,7 +21511,7 @@ ${effectiveInstructions}`;
|
|
|
21508
21511
|
}
|
|
21509
21512
|
]
|
|
21510
21513
|
};
|
|
21511
|
-
const toolObj =
|
|
21514
|
+
const toolObj = chunkK4NN2KQQ_cjs.createTool({
|
|
21512
21515
|
id: `workflow-${workflowName}`,
|
|
21513
21516
|
description: workflow.description || `Workflow: ${workflowName}`,
|
|
21514
21517
|
inputSchema: extendedInputSchema,
|
|
@@ -21660,7 +21663,7 @@ ${effectiveInstructions}`;
|
|
|
21660
21663
|
...observabilityContext,
|
|
21661
21664
|
tracingPolicy: this.#options?.tracingPolicy
|
|
21662
21665
|
};
|
|
21663
|
-
convertedWorkflowTools[`workflow-${workflowName}`] =
|
|
21666
|
+
convertedWorkflowTools[`workflow-${workflowName}`] = chunkRQBBPR64_cjs.makeCoreTool(
|
|
21664
21667
|
toolObj,
|
|
21665
21668
|
options,
|
|
21666
21669
|
void 0,
|
|
@@ -21692,7 +21695,7 @@ ${effectiveInstructions}`;
|
|
|
21692
21695
|
let mastraProxy = void 0;
|
|
21693
21696
|
const logger = this.logger;
|
|
21694
21697
|
if (this.#mastra) {
|
|
21695
|
-
mastraProxy =
|
|
21698
|
+
mastraProxy = chunkRQBBPR64_cjs.createMastraProxy({ mastra: this.#mastra, logger });
|
|
21696
21699
|
}
|
|
21697
21700
|
const assignedTools = await this.listAssignedTools({
|
|
21698
21701
|
runId,
|
|
@@ -21944,7 +21947,7 @@ ${effectiveInstructions}`;
|
|
|
21944
21947
|
const resolvedModel = await this.resolveModelConfig(selection, requestContext);
|
|
21945
21948
|
this.assertSupportsPreparedModels(resolvedModel);
|
|
21946
21949
|
let headers;
|
|
21947
|
-
if (resolvedModel instanceof
|
|
21950
|
+
if (resolvedModel instanceof chunkHXFCAKO3_cjs.ModelRouterLanguageModel) {
|
|
21948
21951
|
headers = resolvedModel.config?.headers;
|
|
21949
21952
|
}
|
|
21950
21953
|
return [
|
|
@@ -21977,7 +21980,7 @@ ${effectiveInstructions}`;
|
|
|
21977
21980
|
throw mastraError;
|
|
21978
21981
|
}
|
|
21979
21982
|
let headers;
|
|
21980
|
-
if (model instanceof
|
|
21983
|
+
if (model instanceof chunkHXFCAKO3_cjs.ModelRouterLanguageModel) {
|
|
21981
21984
|
headers = model.config?.headers;
|
|
21982
21985
|
}
|
|
21983
21986
|
return {
|
|
@@ -22428,7 +22431,7 @@ ${effectiveInstructions}`;
|
|
|
22428
22431
|
const defaultOptions = await this.getDefaultOptions({
|
|
22429
22432
|
requestContext: options?.requestContext
|
|
22430
22433
|
});
|
|
22431
|
-
const mergedOptions =
|
|
22434
|
+
const mergedOptions = chunkRQBBPR64_cjs.deepMerge(
|
|
22432
22435
|
defaultOptions,
|
|
22433
22436
|
options ?? {}
|
|
22434
22437
|
);
|
|
@@ -22498,7 +22501,7 @@ ${effectiveInstructions}`;
|
|
|
22498
22501
|
const defaultOptions = await this.getDefaultOptions({
|
|
22499
22502
|
requestContext: streamOptions?.requestContext
|
|
22500
22503
|
});
|
|
22501
|
-
const mergedOptions =
|
|
22504
|
+
const mergedOptions = chunkRQBBPR64_cjs.deepMerge(
|
|
22502
22505
|
defaultOptions,
|
|
22503
22506
|
streamOptions ?? {}
|
|
22504
22507
|
);
|
|
@@ -22562,7 +22565,7 @@ ${effectiveInstructions}`;
|
|
|
22562
22565
|
const defaultOptions = await this.getDefaultOptions({
|
|
22563
22566
|
requestContext: streamOptions?.requestContext
|
|
22564
22567
|
});
|
|
22565
|
-
let mergedStreamOptions =
|
|
22568
|
+
let mergedStreamOptions = chunkRQBBPR64_cjs.deepMerge(
|
|
22566
22569
|
defaultOptions,
|
|
22567
22570
|
streamOptions ?? {}
|
|
22568
22571
|
);
|
|
@@ -22627,7 +22630,7 @@ ${effectiveInstructions}`;
|
|
|
22627
22630
|
const defaultOptions = await this.getDefaultOptions({
|
|
22628
22631
|
requestContext: options?.requestContext
|
|
22629
22632
|
});
|
|
22630
|
-
const mergedOptions =
|
|
22633
|
+
const mergedOptions = chunkRQBBPR64_cjs.deepMerge(
|
|
22631
22634
|
defaultOptions,
|
|
22632
22635
|
options ?? {}
|
|
22633
22636
|
);
|
|
@@ -24201,7 +24204,7 @@ var TokenLimiterProcessor = class _TokenLimiterProcessor {
|
|
|
24201
24204
|
return new TiktokenClass(this.customEncoding);
|
|
24202
24205
|
});
|
|
24203
24206
|
} else {
|
|
24204
|
-
this.encoderPromise =
|
|
24207
|
+
this.encoderPromise = chunkXW4B2RAG_cjs.getTiktoken();
|
|
24205
24208
|
}
|
|
24206
24209
|
}
|
|
24207
24210
|
return this.encoderPromise;
|
|
@@ -24886,7 +24889,7 @@ var ToolSearchProcessor = class {
|
|
|
24886
24889
|
minScore: options.search?.minScore ?? 0
|
|
24887
24890
|
};
|
|
24888
24891
|
this.ttl = options.ttl ?? 36e5;
|
|
24889
|
-
this.bm25Index = new
|
|
24892
|
+
this.bm25Index = new chunkXW4B2RAG_cjs.BM25Index({}, TOOL_SEARCH_TOKENIZE_OPTIONS);
|
|
24890
24893
|
this.indexTools();
|
|
24891
24894
|
if (this.ttl > 0) {
|
|
24892
24895
|
this.scheduleCleanup();
|
|
@@ -25051,7 +25054,7 @@ var ToolSearchProcessor = class {
|
|
|
25051
25054
|
messageList.addSystem(
|
|
25052
25055
|
"To discover available tools, call search_tools with a keyword query. To add a tool to the conversation, call load_tool with the tool name. Tools must be loaded before they can be used."
|
|
25053
25056
|
);
|
|
25054
|
-
const searchTool =
|
|
25057
|
+
const searchTool = chunkK4NN2KQQ_cjs.createTool({
|
|
25055
25058
|
id: "search_tools",
|
|
25056
25059
|
description: "Search for available tools by keyword. Use this when you need a capability you don't currently have. Returns a list of matching tools with their names and descriptions. After finding a useful tool, use load_tool to make it available.",
|
|
25057
25060
|
inputSchema: v4.z.object({
|
|
@@ -25081,7 +25084,7 @@ var ToolSearchProcessor = class {
|
|
|
25081
25084
|
};
|
|
25082
25085
|
}
|
|
25083
25086
|
});
|
|
25084
|
-
const loadTool =
|
|
25087
|
+
const loadTool = chunkK4NN2KQQ_cjs.createTool({
|
|
25085
25088
|
id: "load_tool",
|
|
25086
25089
|
description: "Load a specific tool into your context. Call this after finding a tool with search_tools. Once loaded, the tool will be available for use. Args: toolName - The exact name of the tool to load (from search results).",
|
|
25087
25090
|
inputSchema: v4.z.object({
|
|
@@ -25415,7 +25418,7 @@ var WorkingMemory = class {
|
|
|
25415
25418
|
return messageList;
|
|
25416
25419
|
}
|
|
25417
25420
|
generateEmptyFromSchemaInternal(schema) {
|
|
25418
|
-
const result =
|
|
25421
|
+
const result = chunkRQBBPR64_cjs.generateEmptyFromSchema(schema);
|
|
25419
25422
|
return Object.keys(result).length > 0 ? result : null;
|
|
25420
25423
|
}
|
|
25421
25424
|
getWorkingMemoryToolInstruction({
|
|
@@ -25618,7 +25621,7 @@ var SemanticRecall = class {
|
|
|
25618
25621
|
*/
|
|
25619
25622
|
formatCrossThreadMessages(messages, currentThreadId) {
|
|
25620
25623
|
let result = ``;
|
|
25621
|
-
const v1Messages = new
|
|
25624
|
+
const v1Messages = new chunkANLO4VM2_cjs.MessageList().add(messages, "memory").get.all.v1();
|
|
25622
25625
|
let lastYmd = null;
|
|
25623
25626
|
for (const msg of v1Messages) {
|
|
25624
25627
|
const date = msg.createdAt;
|
|
@@ -26060,7 +26063,7 @@ https://mastra.ai/en/docs/memory/semantic-recall`
|
|
|
26060
26063
|
);
|
|
26061
26064
|
}
|
|
26062
26065
|
if (typeof config.embedder === "string") {
|
|
26063
|
-
this.embedder = new
|
|
26066
|
+
this.embedder = new chunkHXFCAKO3_cjs.ModelRouterEmbeddingModel(config.embedder);
|
|
26064
26067
|
} else {
|
|
26065
26068
|
this.embedder = config.embedder;
|
|
26066
26069
|
}
|
|
@@ -26099,7 +26102,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
26099
26102
|
}
|
|
26100
26103
|
setEmbedder(embedder, embedderOptions) {
|
|
26101
26104
|
if (typeof embedder === "string") {
|
|
26102
|
-
this.embedder = new
|
|
26105
|
+
this.embedder = new chunkHXFCAKO3_cjs.ModelRouterEmbeddingModel(embedder);
|
|
26103
26106
|
} else {
|
|
26104
26107
|
this.embedder = embedder;
|
|
26105
26108
|
}
|
|
@@ -26196,7 +26199,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
26196
26199
|
"The threads.generateTitle option has been moved. Use the top-level generateTitle option instead."
|
|
26197
26200
|
);
|
|
26198
26201
|
}
|
|
26199
|
-
const mergedConfig =
|
|
26202
|
+
const mergedConfig = chunkRQBBPR64_cjs.deepMerge(this.threadConfig, config || {});
|
|
26200
26203
|
if (typeof config?.workingMemory === "object" && config.workingMemory?.schema && typeof mergedConfig.workingMemory === "object") {
|
|
26201
26204
|
mergedConfig.workingMemory.schema = config.workingMemory.schema;
|
|
26202
26205
|
}
|
|
@@ -26548,7 +26551,7 @@ var MockMemory = class extends MastraMemory {
|
|
|
26548
26551
|
} = {}) {
|
|
26549
26552
|
super({
|
|
26550
26553
|
name: "mock",
|
|
26551
|
-
storage: storage || new
|
|
26554
|
+
storage: storage || new chunkR67VVUDR_cjs.InMemoryStore(),
|
|
26552
26555
|
options: {
|
|
26553
26556
|
...options,
|
|
26554
26557
|
workingMemory: enableWorkingMemory ? { enabled: true, template: workingMemoryTemplate } : options?.workingMemory,
|
|
@@ -26629,7 +26632,7 @@ var MockMemory = class extends MastraMemory {
|
|
|
26629
26632
|
return {};
|
|
26630
26633
|
}
|
|
26631
26634
|
return {
|
|
26632
|
-
updateWorkingMemory:
|
|
26635
|
+
updateWorkingMemory: chunkK4NN2KQQ_cjs.createTool({
|
|
26633
26636
|
id: "update-working-memory",
|
|
26634
26637
|
description: `Update the working memory with new information. Any data not included will be overwritten.`,
|
|
26635
26638
|
inputSchema: v4.z.object({ memory: v4.z.string() }),
|
|
@@ -26857,5 +26860,5 @@ exports.validateStepRequestContext = validateStepRequestContext;
|
|
|
26857
26860
|
exports.validateStepResumeData = validateStepResumeData;
|
|
26858
26861
|
exports.validateStepStateData = validateStepStateData;
|
|
26859
26862
|
exports.validateStepSuspendData = validateStepSuspendData;
|
|
26860
|
-
//# sourceMappingURL=chunk-
|
|
26861
|
-
//# sourceMappingURL=chunk-
|
|
26863
|
+
//# sourceMappingURL=chunk-ALCZ3AX7.cjs.map
|
|
26864
|
+
//# sourceMappingURL=chunk-ALCZ3AX7.cjs.map
|