@mastra/core 1.16.0-alpha.2 → 1.16.0-alpha.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 +78 -0
- package/dist/agent/agent.d.ts.map +1 -1
- 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/{chunk-4DW75LWG.js → chunk-3HRPHNFN.js} +4 -4
- package/dist/{chunk-4DW75LWG.js.map → chunk-3HRPHNFN.js.map} +1 -1
- package/dist/{chunk-TQTUU6QD.cjs → chunk-4THMANGC.cjs} +82 -82
- package/dist/{chunk-TQTUU6QD.cjs.map → chunk-4THMANGC.cjs.map} +1 -1
- package/dist/{chunk-4R7XCDYZ.js → chunk-5SWCNP2L.js} +3 -3
- package/dist/{chunk-4R7XCDYZ.js.map → chunk-5SWCNP2L.js.map} +1 -1
- package/dist/{chunk-Q7EDK6IW.cjs → chunk-6VYFRSNT.cjs} +13 -13
- package/dist/{chunk-Q7EDK6IW.cjs.map → chunk-6VYFRSNT.cjs.map} +1 -1
- package/dist/{chunk-KWQ4YIWP.cjs → chunk-7L2ICIDI.cjs} +6 -6
- package/dist/{chunk-KWQ4YIWP.cjs.map → chunk-7L2ICIDI.cjs.map} +1 -1
- package/dist/{chunk-PLWEBAHH.cjs → chunk-BQA45RHN.cjs} +5 -5
- package/dist/{chunk-PLWEBAHH.cjs.map → chunk-BQA45RHN.cjs.map} +1 -1
- package/dist/{chunk-55W2K42G.js → chunk-GRMC2OYN.js} +32 -4
- package/dist/chunk-GRMC2OYN.js.map +1 -0
- package/dist/{chunk-CJVTGET7.js → chunk-IWIO6OOO.js} +3 -3
- package/dist/{chunk-CJVTGET7.js.map → chunk-IWIO6OOO.js.map} +1 -1
- package/dist/{chunk-L53XY7WT.js → chunk-J3NJXIJ4.js} +161 -63
- package/dist/chunk-J3NJXIJ4.js.map +1 -0
- package/dist/{chunk-GYLHNAH7.cjs → chunk-K4NN2KQQ.cjs} +32 -4
- package/dist/chunk-K4NN2KQQ.cjs.map +1 -0
- package/dist/{chunk-4MG6J5RS.cjs → chunk-LY7WIAF5.cjs} +3 -3
- package/dist/{chunk-4MG6J5RS.cjs.map → chunk-LY7WIAF5.cjs.map} +1 -1
- package/dist/{chunk-L4AQYWBK.cjs → chunk-M6632FUT.cjs} +7 -7
- package/dist/{chunk-L4AQYWBK.cjs.map → chunk-M6632FUT.cjs.map} +1 -1
- package/dist/{chunk-GXAKTLZ3.cjs → chunk-MDEWERCK.cjs} +185 -185
- package/dist/{chunk-GXAKTLZ3.cjs.map → chunk-MDEWERCK.cjs.map} +1 -1
- package/dist/{chunk-373WBBIV.js → chunk-MXISDFVM.js} +3 -3
- package/dist/{chunk-373WBBIV.js.map → chunk-MXISDFVM.js.map} +1 -1
- package/dist/{chunk-6FFPNMST.cjs → chunk-NEWK2BT5.cjs} +15 -15
- package/dist/{chunk-6FFPNMST.cjs.map → chunk-NEWK2BT5.cjs.map} +1 -1
- package/dist/{chunk-2DPHD6NF.cjs → chunk-NTF7UIBI.cjs} +95 -86
- package/dist/chunk-NTF7UIBI.cjs.map +1 -0
- package/dist/{chunk-O3WTNJXV.js → chunk-OPRJPAB7.js} +3 -3
- package/dist/{chunk-O3WTNJXV.js.map → chunk-OPRJPAB7.js.map} +1 -1
- package/dist/{chunk-GZ2ZPBMU.js → chunk-OYAS35A6.js} +21 -12
- package/dist/chunk-OYAS35A6.js.map +1 -0
- package/dist/{chunk-O6O5MD7Q.cjs → chunk-PCQBJ3NP.cjs} +5 -2
- package/dist/chunk-PCQBJ3NP.cjs.map +1 -0
- package/dist/{chunk-4B2CHAMZ.cjs → chunk-PNSY2ZGF.cjs} +9 -9
- package/dist/{chunk-4B2CHAMZ.cjs.map → chunk-PNSY2ZGF.cjs.map} +1 -1
- package/dist/{chunk-3XWXW2YI.cjs → chunk-RQBBPR64.cjs} +16 -15
- package/dist/chunk-RQBBPR64.cjs.map +1 -0
- package/dist/{chunk-YPJ5V2S5.js → chunk-S6VT4LMH.js} +5 -2
- package/dist/chunk-S6VT4LMH.js.map +1 -0
- package/dist/{chunk-HQKKB3UP.js → chunk-SVE7QF2W.js} +8 -8
- package/dist/{chunk-HQKKB3UP.js.map → chunk-SVE7QF2W.js.map} +1 -1
- package/dist/{chunk-DJLBGTUV.cjs → chunk-SXVV5X4E.cjs} +13 -13
- package/dist/chunk-SXVV5X4E.cjs.map +1 -0
- package/dist/{chunk-UA5AY2ES.js → chunk-UQ5BWWRH.js} +4 -4
- package/dist/{chunk-UA5AY2ES.js.map → chunk-UQ5BWWRH.js.map} +1 -1
- package/dist/{chunk-325Q6NH6.cjs → chunk-V2XNSBIT.cjs} +6 -6
- package/dist/{chunk-325Q6NH6.cjs.map → chunk-V2XNSBIT.cjs.map} +1 -1
- package/dist/{chunk-4TMCYZ72.cjs → chunk-XGTV24L5.cjs} +57 -57
- package/dist/{chunk-4TMCYZ72.cjs.map → chunk-XGTV24L5.cjs.map} +1 -1
- package/dist/{chunk-JY32HS2J.js → chunk-XKOCRXCP.js} +3 -3
- package/dist/{chunk-JY32HS2J.js.map → chunk-XKOCRXCP.js.map} +1 -1
- package/dist/{chunk-FQJZIBZ2.js → chunk-XU4ZIJEV.js} +6 -6
- package/dist/{chunk-FQJZIBZ2.js.map → chunk-XU4ZIJEV.js.map} +1 -1
- package/dist/{chunk-KQ3SJZG5.cjs → chunk-XW4B2RAG.cjs} +182 -84
- package/dist/chunk-XW4B2RAG.cjs.map +1 -0
- package/dist/{chunk-563KV7S2.js → chunk-YE4J2QEX.js} +4 -4
- package/dist/{chunk-563KV7S2.js.map → chunk-YE4J2QEX.js.map} +1 -1
- package/dist/{chunk-3OZVV5J7.js → chunk-YIUXBYAI.js} +12 -12
- package/dist/chunk-YIUXBYAI.js.map +1 -0
- package/dist/{chunk-P7KTLFJM.js → chunk-YXBNQTAA.js} +7 -7
- package/dist/{chunk-P7KTLFJM.js.map → chunk-YXBNQTAA.js.map} +1 -1
- package/dist/{chunk-D5DBRZH3.js → chunk-ZJMETLCP.js} +4 -3
- package/dist/chunk-ZJMETLCP.js.map +1 -0
- 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/docs-observability-tracing-exporters-datadog.md +132 -2
- package/dist/docs/references/docs-workspace-skills.md +23 -0
- package/dist/docs/references/reference-memory-observational-memory.md +42 -3
- package/dist/docs/references/reference-tools-create-tool.md +1 -1
- package/dist/docs/references/reference-workspace-workspace-class.md +13 -1
- 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/network/index.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-JCB4Q53F.js +3 -0
- package/dist/{models-dev-OU3ACSEQ.js.map → models-dev-JCB4Q53F.js.map} +1 -1
- package/dist/models-dev-SV7R75OF.cjs +12 -0
- package/dist/{models-dev-OFI5OSM7.cjs.map → models-dev-SV7R75OF.cjs.map} +1 -1
- package/dist/netlify-KG6ZIIC5.js +3 -0
- package/dist/{netlify-OPNSZBGQ.js.map → netlify-KG6ZIIC5.js.map} +1 -1
- package/dist/netlify-SGAVTHDG.cjs +12 -0
- package/dist/{netlify-YVCTG2Z3.cjs.map → netlify-SGAVTHDG.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/processors/processors/skills.d.ts.map +1 -1
- package/dist/provider-registry-INQUWPG6.js +3 -0
- package/dist/{provider-registry-KYR3I44P.js.map → provider-registry-INQUWPG6.js.map} +1 -1
- package/dist/provider-registry-UIDQJHBI.cjs +40 -0
- package/dist/{provider-registry-73NPBVKH.cjs.map → provider-registry-UIDQJHBI.cjs.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/tool-builder/builder.d.ts.map +1 -1
- package/dist/tools/tool.d.ts.map +1 -1
- package/dist/tools/types.d.ts +1 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/validation.d.ts.map +1 -1
- package/dist/utils.cjs +23 -23
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- 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/dist/workspace/skills/tools.d.ts.map +1 -1
- package/dist/workspace/skills/types.d.ts +9 -5
- package/dist/workspace/skills/types.d.ts.map +1 -1
- package/dist/workspace/skills/workspace-skills.d.ts.map +1 -1
- package/dist/workspace/workspace.d.ts +1 -1
- package/package.json +6 -6
- package/src/llm/model/provider-types.generated.d.ts +3 -3
- package/dist/chunk-2DPHD6NF.cjs.map +0 -1
- package/dist/chunk-3OZVV5J7.js.map +0 -1
- package/dist/chunk-3XWXW2YI.cjs.map +0 -1
- package/dist/chunk-55W2K42G.js.map +0 -1
- package/dist/chunk-D5DBRZH3.js.map +0 -1
- package/dist/chunk-DJLBGTUV.cjs.map +0 -1
- package/dist/chunk-GYLHNAH7.cjs.map +0 -1
- package/dist/chunk-GZ2ZPBMU.js.map +0 -1
- package/dist/chunk-KQ3SJZG5.cjs.map +0 -1
- package/dist/chunk-L53XY7WT.js.map +0 -1
- package/dist/chunk-O6O5MD7Q.cjs.map +0 -1
- package/dist/chunk-YPJ5V2S5.js.map +0 -1
- package/dist/models-dev-OFI5OSM7.cjs +0 -12
- package/dist/models-dev-OU3ACSEQ.js +0 -3
- package/dist/netlify-OPNSZBGQ.js +0 -3
- package/dist/netlify-YVCTG2Z3.cjs +0 -12
- package/dist/provider-registry-73NPBVKH.cjs +0 -40
- package/dist/provider-registry-KYR3I44P.js +0 -3
|
@@ -2,20 +2,20 @@
|
|
|
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 chunk6VYFRSNT_cjs = require('./chunk-6VYFRSNT.cjs');
|
|
7
|
+
var chunkPCQBJ3NP_cjs = require('./chunk-PCQBJ3NP.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 chunk4THMANGC_cjs = require('./chunk-4THMANGC.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
20
|
var chunk5WBEMKE2_cjs = require('./chunk-5WBEMKE2.cjs');
|
|
21
21
|
var chunk4U7ZLI36_cjs = require('./chunk-4U7ZLI36.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 chunkPCQBJ3NP_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 chunkPCQBJ3NP_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 chunkPCQBJ3NP_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 chunkPCQBJ3NP_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 chunk4THMANGC_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 ? chunkPCQBJ3NP_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 chunkPCQBJ3NP_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 chunkPCQBJ3NP_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 chunkPCQBJ3NP_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 chunkPCQBJ3NP_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 chunkPCQBJ3NP_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 chunkPCQBJ3NP_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 chunk4THMANGC_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
|
|
@@ -12803,8 +12803,8 @@ function createLLMExecutionStep({
|
|
|
12803
12803
|
if (processInputStepResult.tools && currentStep.tools) {
|
|
12804
12804
|
const convertedTools = {};
|
|
12805
12805
|
for (const [name, tool2] of Object.entries(currentStep.tools)) {
|
|
12806
|
-
if (
|
|
12807
|
-
convertedTools[name] =
|
|
12806
|
+
if (chunkK4NN2KQQ_cjs.isMastraTool(tool2)) {
|
|
12807
|
+
convertedTools[name] = chunkRQBBPR64_cjs.makeCoreTool(
|
|
12808
12808
|
tool2,
|
|
12809
12809
|
{
|
|
12810
12810
|
name,
|
|
@@ -13011,7 +13011,7 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
|
|
|
13011
13011
|
}
|
|
13012
13012
|
});
|
|
13013
13013
|
let transportResolver;
|
|
13014
|
-
if (currentStep.model instanceof
|
|
13014
|
+
if (currentStep.model instanceof chunk4THMANGC_cjs.ModelRouterLanguageModel) {
|
|
13015
13015
|
const routerModel = currentStep.model;
|
|
13016
13016
|
transportResolver = () => routerModel._getStreamTransport();
|
|
13017
13017
|
}
|
|
@@ -13373,7 +13373,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13373
13373
|
toolInvocation: {
|
|
13374
13374
|
state: "result",
|
|
13375
13375
|
toolCallId: toolCall.toolCallId,
|
|
13376
|
-
toolName:
|
|
13376
|
+
toolName: chunkPCQBJ3NP_cjs.sanitizeToolName(toolCall.toolName),
|
|
13377
13377
|
args: toolCall.args,
|
|
13378
13378
|
result: toolCall.error?.message ?? toolCall.error
|
|
13379
13379
|
},
|
|
@@ -13408,7 +13408,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13408
13408
|
toolInvocation: {
|
|
13409
13409
|
state: "result",
|
|
13410
13410
|
toolCallId: toolCall.toolCallId,
|
|
13411
|
-
toolName:
|
|
13411
|
+
toolName: chunkPCQBJ3NP_cjs.sanitizeToolName(toolCall.toolName),
|
|
13412
13412
|
args: toolCall.args,
|
|
13413
13413
|
result: toolCall.result
|
|
13414
13414
|
},
|
|
@@ -13465,7 +13465,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13465
13465
|
toolInvocation: {
|
|
13466
13466
|
state: "result",
|
|
13467
13467
|
toolCallId: toolCall.toolCallId,
|
|
13468
|
-
toolName:
|
|
13468
|
+
toolName: chunkPCQBJ3NP_cjs.sanitizeToolName(toolCall.toolName),
|
|
13469
13469
|
args: toolCall.args,
|
|
13470
13470
|
result: toolCall.result
|
|
13471
13471
|
},
|
|
@@ -14758,7 +14758,7 @@ var MastraLLMVNext = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
14758
14758
|
const remainingTokens = parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"] ?? "", 10);
|
|
14759
14759
|
if (!isNaN(remainingTokens) && remainingTokens > 0 && remainingTokens < 2e3) {
|
|
14760
14760
|
this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
|
|
14761
|
-
await
|
|
14761
|
+
await chunkRQBBPR64_cjs.delay(10 * 1e3);
|
|
14762
14762
|
}
|
|
14763
14763
|
},
|
|
14764
14764
|
onFinish: async (props) => {
|
|
@@ -15034,7 +15034,7 @@ async function prepareMemoryStep({
|
|
|
15034
15034
|
);
|
|
15035
15035
|
}
|
|
15036
15036
|
} else {
|
|
15037
|
-
const messageList = new
|
|
15037
|
+
const messageList = new chunkPCQBJ3NP_cjs.MessageList({
|
|
15038
15038
|
threadId: thread?.id,
|
|
15039
15039
|
resourceId: thread?.resourceId
|
|
15040
15040
|
});
|
|
@@ -15091,7 +15091,7 @@ async function saveMessagesWithProcessors(memory, messages, processorRunner, con
|
|
|
15091
15091
|
await memory.saveMessages({ messages });
|
|
15092
15092
|
return;
|
|
15093
15093
|
}
|
|
15094
|
-
const messageList = new
|
|
15094
|
+
const messageList = new chunkPCQBJ3NP_cjs.MessageList();
|
|
15095
15095
|
for (const msg of messages) {
|
|
15096
15096
|
messageList.add(msg, "response");
|
|
15097
15097
|
}
|
|
@@ -16177,6 +16177,7 @@ async function createNetworkLoop({
|
|
|
16177
16177
|
requestContext,
|
|
16178
16178
|
mastra: agent.getMastraInstance(),
|
|
16179
16179
|
agent: {
|
|
16180
|
+
agentId: agent.id,
|
|
16180
16181
|
resourceId: initData.threadResourceId || networkName,
|
|
16181
16182
|
toolCallId,
|
|
16182
16183
|
threadId: initData.threadId,
|
|
@@ -16528,7 +16529,7 @@ async function networkLoop({
|
|
|
16528
16529
|
"resumeData": "string"
|
|
16529
16530
|
}
|
|
16530
16531
|
`;
|
|
16531
|
-
const messageList = new
|
|
16532
|
+
const messageList = new chunkPCQBJ3NP_cjs.MessageList();
|
|
16532
16533
|
messageList.addSystem(systemInstructions);
|
|
16533
16534
|
messageList.add(task, "user");
|
|
16534
16535
|
const result = llm.stream({
|
|
@@ -16999,8 +17000,8 @@ var SkillsProcessor = class {
|
|
|
16999
17000
|
if (!skillsList || skillsList.length === 0) {
|
|
17000
17001
|
return "";
|
|
17001
17002
|
}
|
|
17002
|
-
const skillPromises = skillsList.map((meta) => this.skills?.get(meta.
|
|
17003
|
-
const fullSkills = (await Promise.all(skillPromises)).filter((s) => s !== void 0);
|
|
17003
|
+
const skillPromises = skillsList.map((meta) => this.skills?.get(meta.path));
|
|
17004
|
+
const fullSkills = (await Promise.all(skillPromises)).filter((s) => s !== void 0 && s !== null);
|
|
17004
17005
|
fullSkills.sort((a, b) => a.name.localeCompare(b.name));
|
|
17005
17006
|
switch (this._format) {
|
|
17006
17007
|
case "xml": {
|
|
@@ -17073,7 +17074,7 @@ ${skillsMd}`;
|
|
|
17073
17074
|
}
|
|
17074
17075
|
messageList.addSystem({
|
|
17075
17076
|
role: "system",
|
|
17076
|
-
content: 'IMPORTANT: Skills are NOT tools. Do not call skill names directly as tool names. To use a skill, call the `skill` tool with the skill name as the "name" parameter. When a user asks about a topic covered by an available skill, activate it immediately without asking for permission first.'
|
|
17077
|
+
content: 'IMPORTANT: Skills are NOT tools. Do not call skill names directly as tool names. To use a skill, call the `skill` tool with the skill name as the "name" parameter. If multiple skills share the same name, use the skill path (shown in the location field) instead of the name to disambiguate. When a user asks about a topic covered by an available skill, activate it immediately without asking for permission first.'
|
|
17077
17078
|
});
|
|
17078
17079
|
}
|
|
17079
17080
|
}
|
|
@@ -17184,7 +17185,7 @@ var AgentLegacyHandler = class {
|
|
|
17184
17185
|
methodType: methodType === "generate" ? "generateLegacy" : "streamLegacy",
|
|
17185
17186
|
memoryConfig
|
|
17186
17187
|
});
|
|
17187
|
-
let messageList = new
|
|
17188
|
+
let messageList = new chunkPCQBJ3NP_cjs.MessageList({
|
|
17188
17189
|
threadId,
|
|
17189
17190
|
resourceId,
|
|
17190
17191
|
generateMessageId: this.capabilities.mastra?.generateId?.bind(this.capabilities.mastra),
|
|
@@ -17353,7 +17354,7 @@ var AgentLegacyHandler = class {
|
|
|
17353
17354
|
result: resToLog,
|
|
17354
17355
|
threadId
|
|
17355
17356
|
});
|
|
17356
|
-
const messageListResponses = new
|
|
17357
|
+
const messageListResponses = new chunkPCQBJ3NP_cjs.MessageList({
|
|
17357
17358
|
threadId,
|
|
17358
17359
|
resourceId,
|
|
17359
17360
|
generateMessageId: this.capabilities.mastra?.generateId?.bind(this.capabilities.mastra),
|
|
@@ -18503,7 +18504,7 @@ var prepareToolsStepOutputSchema = v4.z.object({
|
|
|
18503
18504
|
var prepareMemoryStepOutputSchema = v4.z.object({
|
|
18504
18505
|
threadExists: v4.z.boolean(),
|
|
18505
18506
|
thread: storageThreadSchema.optional(),
|
|
18506
|
-
messageList: v4.z.instanceof(
|
|
18507
|
+
messageList: v4.z.instanceof(chunkPCQBJ3NP_cjs.MessageList),
|
|
18507
18508
|
/** Shared processor states map that persists across loop iterations for both input and output processors */
|
|
18508
18509
|
processorStates: v4.z.instanceof(Map),
|
|
18509
18510
|
/** Tripwire data when input processor triggered abort */
|
|
@@ -18544,7 +18545,7 @@ function createPrepareMemoryStep({
|
|
|
18544
18545
|
execute: async ({ ...rest }) => {
|
|
18545
18546
|
const observabilityContext = chunkG5HKDGNT_cjs.resolveObservabilityContext(rest);
|
|
18546
18547
|
const thread = threadFromArgs;
|
|
18547
|
-
const messageList = new
|
|
18548
|
+
const messageList = new chunkPCQBJ3NP_cjs.MessageList({
|
|
18548
18549
|
threadId: thread?.id,
|
|
18549
18550
|
resourceId,
|
|
18550
18551
|
generateMessageId: capabilities.generateMessageId,
|
|
@@ -19779,7 +19780,7 @@ ${errorMessages}`,
|
|
|
19779
19780
|
*/
|
|
19780
19781
|
listTools({ requestContext = new chunk5WBEMKE2_cjs.RequestContext() } = {}) {
|
|
19781
19782
|
if (typeof this.#tools !== "function") {
|
|
19782
|
-
return
|
|
19783
|
+
return chunkRQBBPR64_cjs.ensureToolProperties(this.#tools);
|
|
19783
19784
|
}
|
|
19784
19785
|
const result = this.#tools({
|
|
19785
19786
|
requestContext,
|
|
@@ -19800,7 +19801,7 @@ ${errorMessages}`,
|
|
|
19800
19801
|
this.logger.error(mastraError.toString());
|
|
19801
19802
|
throw mastraError;
|
|
19802
19803
|
}
|
|
19803
|
-
return
|
|
19804
|
+
return chunkRQBBPR64_cjs.ensureToolProperties(tools);
|
|
19804
19805
|
});
|
|
19805
19806
|
}
|
|
19806
19807
|
/**
|
|
@@ -19846,7 +19847,7 @@ ${errorMessages}`,
|
|
|
19846
19847
|
});
|
|
19847
19848
|
});
|
|
19848
19849
|
} else {
|
|
19849
|
-
llm = new
|
|
19850
|
+
llm = new chunk7L2ICIDI_cjs.MastraLLMV1({
|
|
19850
19851
|
model: modelInfo,
|
|
19851
19852
|
mastra: this.#mastra,
|
|
19852
19853
|
options: { tracingPolicy: this.#options?.tracingPolicy }
|
|
@@ -19872,7 +19873,7 @@ ${errorMessages}`,
|
|
|
19872
19873
|
*/
|
|
19873
19874
|
async resolveModelConfig(modelConfig, requestContext) {
|
|
19874
19875
|
try {
|
|
19875
|
-
return await
|
|
19876
|
+
return await chunk4THMANGC_cjs.resolveModelConfig(modelConfig, requestContext, this.#mastra);
|
|
19876
19877
|
} catch (error) {
|
|
19877
19878
|
const mastraError = new chunk4U7ZLI36_cjs.MastraError({
|
|
19878
19879
|
id: "AGENT_GET_MODEL_MISSING_MODEL_INSTANCE",
|
|
@@ -20200,7 +20201,7 @@ ${errorMessages}`,
|
|
|
20200
20201
|
}) {
|
|
20201
20202
|
const observabilityContext = chunkG5HKDGNT_cjs.resolveObservabilityContext(rest);
|
|
20202
20203
|
const llm = await this.getLLM({ requestContext, model });
|
|
20203
|
-
const normMessage = new
|
|
20204
|
+
const normMessage = new chunkPCQBJ3NP_cjs.MessageList().add(message, "user").get.all.aiV5.ui().at(-1);
|
|
20204
20205
|
if (!normMessage) {
|
|
20205
20206
|
throw new Error(`Could not generate title from input ${JSON.stringify(message)}`);
|
|
20206
20207
|
}
|
|
@@ -20223,7 +20224,7 @@ ${errorMessages}`,
|
|
|
20223
20224
|
const systemInstructions = await this.resolveTitleInstructions(requestContext, instructions);
|
|
20224
20225
|
let text = "";
|
|
20225
20226
|
if (isSupportedLanguageModel(llm.getModel())) {
|
|
20226
|
-
const messageList = new
|
|
20227
|
+
const messageList = new chunkPCQBJ3NP_cjs.MessageList().add(
|
|
20227
20228
|
[
|
|
20228
20229
|
{
|
|
20229
20230
|
role: "system",
|
|
@@ -20276,7 +20277,7 @@ ${errorMessages}`,
|
|
|
20276
20277
|
async genTitle(userMessage, requestContext, observabilityContext, model, instructions) {
|
|
20277
20278
|
try {
|
|
20278
20279
|
if (userMessage) {
|
|
20279
|
-
const normMessage = new
|
|
20280
|
+
const normMessage = new chunkPCQBJ3NP_cjs.MessageList().add(userMessage, "user").get.all.ui().at(-1);
|
|
20280
20281
|
if (normMessage) {
|
|
20281
20282
|
return await this.generateTitleFromUserMessage({
|
|
20282
20283
|
message: normMessage,
|
|
@@ -20351,13 +20352,14 @@ ${errorMessages}`,
|
|
|
20351
20352
|
mastra: mastraProxy,
|
|
20352
20353
|
memory,
|
|
20353
20354
|
agentName: this.name,
|
|
20355
|
+
agentId: this.id,
|
|
20354
20356
|
requestContext,
|
|
20355
20357
|
...observabilityContext,
|
|
20356
20358
|
model: await this.getModel({ requestContext }),
|
|
20357
20359
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20358
20360
|
requireApproval: toolObj.requireApproval
|
|
20359
20361
|
};
|
|
20360
|
-
const convertedToCoreTool =
|
|
20362
|
+
const convertedToCoreTool = chunkRQBBPR64_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20361
20363
|
convertedMemoryTools[toolName] = convertedToCoreTool;
|
|
20362
20364
|
}
|
|
20363
20365
|
}
|
|
@@ -20386,7 +20388,7 @@ ${errorMessages}`,
|
|
|
20386
20388
|
if (!workspace) {
|
|
20387
20389
|
return convertedWorkspaceTools;
|
|
20388
20390
|
}
|
|
20389
|
-
const workspaceTools =
|
|
20391
|
+
const workspaceTools = chunkXW4B2RAG_cjs.createWorkspaceTools(workspace);
|
|
20390
20392
|
if (Object.keys(workspaceTools).length > 0) {
|
|
20391
20393
|
this.logger.debug(`[Agent:${this.name}] - Adding workspace tools: ${Object.keys(workspaceTools).join(", ")}`, {
|
|
20392
20394
|
runId
|
|
@@ -20401,6 +20403,7 @@ ${errorMessages}`,
|
|
|
20401
20403
|
logger: this.logger,
|
|
20402
20404
|
mastra: mastraProxy,
|
|
20403
20405
|
agentName: this.name,
|
|
20406
|
+
agentId: this.id,
|
|
20404
20407
|
requestContext,
|
|
20405
20408
|
...observabilityContext,
|
|
20406
20409
|
model: await this.getModel({ requestContext }),
|
|
@@ -20408,7 +20411,7 @@ ${errorMessages}`,
|
|
|
20408
20411
|
requireApproval: toolObj.requireApproval,
|
|
20409
20412
|
workspace
|
|
20410
20413
|
};
|
|
20411
|
-
const convertedToCoreTool =
|
|
20414
|
+
const convertedToCoreTool = chunkRQBBPR64_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20412
20415
|
convertedWorkspaceTools[toolName] = convertedToCoreTool;
|
|
20413
20416
|
}
|
|
20414
20417
|
}
|
|
@@ -20439,7 +20442,7 @@ ${errorMessages}`,
|
|
|
20439
20442
|
if (!workspace?.skills) {
|
|
20440
20443
|
return convertedSkillTools;
|
|
20441
20444
|
}
|
|
20442
|
-
const skillTools =
|
|
20445
|
+
const skillTools = chunkXW4B2RAG_cjs.createSkillTools(workspace.skills);
|
|
20443
20446
|
if (Object.keys(skillTools).length > 0) {
|
|
20444
20447
|
this.logger.debug(`[Agent:${this.name}] - Adding skill tools: ${Object.keys(skillTools).join(", ")}`, {
|
|
20445
20448
|
runId
|
|
@@ -20454,6 +20457,7 @@ ${errorMessages}`,
|
|
|
20454
20457
|
logger: this.logger,
|
|
20455
20458
|
mastra: mastraProxy,
|
|
20456
20459
|
agentName: this.name,
|
|
20460
|
+
agentId: this.id,
|
|
20457
20461
|
requestContext,
|
|
20458
20462
|
...observabilityContext,
|
|
20459
20463
|
model: await this.getModel({ requestContext }),
|
|
@@ -20462,7 +20466,7 @@ ${errorMessages}`,
|
|
|
20462
20466
|
// Skill tools never require approval
|
|
20463
20467
|
workspace
|
|
20464
20468
|
};
|
|
20465
|
-
const convertedToCoreTool =
|
|
20469
|
+
const convertedToCoreTool = chunkRQBBPR64_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20466
20470
|
convertedSkillTools[toolName] = convertedToCoreTool;
|
|
20467
20471
|
}
|
|
20468
20472
|
}
|
|
@@ -20671,6 +20675,7 @@ ${errorMessages}`,
|
|
|
20671
20675
|
mastra: mastraProxy,
|
|
20672
20676
|
memory,
|
|
20673
20677
|
agentName: this.name,
|
|
20678
|
+
agentId: this.id,
|
|
20674
20679
|
requestContext,
|
|
20675
20680
|
...observabilityContext,
|
|
20676
20681
|
model: await this.getModel({ requestContext }),
|
|
@@ -20678,7 +20683,7 @@ ${errorMessages}`,
|
|
|
20678
20683
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20679
20684
|
requireApproval: tool2.requireApproval
|
|
20680
20685
|
};
|
|
20681
|
-
return [k,
|
|
20686
|
+
return [k, chunkRQBBPR64_cjs.makeCoreTool(tool2, options, void 0, autoResumeSuspendedTools)];
|
|
20682
20687
|
})
|
|
20683
20688
|
);
|
|
20684
20689
|
const assignedToolEntriesConverted = Object.fromEntries(
|
|
@@ -20723,13 +20728,14 @@ ${errorMessages}`,
|
|
|
20723
20728
|
mastra: mastraProxy,
|
|
20724
20729
|
memory,
|
|
20725
20730
|
agentName: this.name,
|
|
20731
|
+
agentId: this.id,
|
|
20726
20732
|
requestContext,
|
|
20727
20733
|
...observabilityContext,
|
|
20728
20734
|
model: await this.getModel({ requestContext }),
|
|
20729
20735
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20730
20736
|
requireApproval: toolObj.requireApproval
|
|
20731
20737
|
};
|
|
20732
|
-
const convertedToCoreTool =
|
|
20738
|
+
const convertedToCoreTool = chunkRQBBPR64_cjs.makeCoreTool(toolObj, options, "toolset", autoResumeSuspendedTools);
|
|
20733
20739
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
20734
20740
|
}
|
|
20735
20741
|
}
|
|
@@ -20769,13 +20775,14 @@ ${errorMessages}`,
|
|
|
20769
20775
|
mastra: mastraProxy,
|
|
20770
20776
|
memory,
|
|
20771
20777
|
agentName: this.name,
|
|
20778
|
+
agentId: this.id,
|
|
20772
20779
|
requestContext,
|
|
20773
20780
|
...observabilityContext,
|
|
20774
20781
|
model: await this.getModel({ requestContext }),
|
|
20775
20782
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20776
20783
|
requireApproval: tool2.requireApproval
|
|
20777
20784
|
};
|
|
20778
|
-
const convertedToCoreTool =
|
|
20785
|
+
const convertedToCoreTool = chunkRQBBPR64_cjs.makeCoreTool(toolRest, options, "client-tool", autoResumeSuspendedTools);
|
|
20779
20786
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
20780
20787
|
}
|
|
20781
20788
|
}
|
|
@@ -20859,7 +20866,7 @@ ${errorMessages}`,
|
|
|
20859
20866
|
).describe("The results from the agent's tool calls").optional()
|
|
20860
20867
|
});
|
|
20861
20868
|
const modelVersion = (await agent.getModel({ requestContext })).specificationVersion;
|
|
20862
|
-
const toolObj =
|
|
20869
|
+
const toolObj = chunkK4NN2KQQ_cjs.createTool({
|
|
20863
20870
|
id: `agent-${agentName}`,
|
|
20864
20871
|
description: agent.getDescription() || `Agent: ${agentName}`,
|
|
20865
20872
|
inputSchema: agentInputSchema,
|
|
@@ -21430,12 +21437,13 @@ ${effectiveInstructions}`;
|
|
|
21430
21437
|
mastra: this.#mastra,
|
|
21431
21438
|
memory: await this.getMemory({ requestContext }),
|
|
21432
21439
|
agentName: this.name,
|
|
21440
|
+
agentId: this.id,
|
|
21433
21441
|
requestContext,
|
|
21434
21442
|
model: await this.getModel({ requestContext }),
|
|
21435
21443
|
...observabilityContext,
|
|
21436
21444
|
tracingPolicy: this.#options?.tracingPolicy
|
|
21437
21445
|
};
|
|
21438
|
-
convertedAgentTools[`agent-${agentName}`] =
|
|
21446
|
+
convertedAgentTools[`agent-${agentName}`] = chunkRQBBPR64_cjs.makeCoreTool(
|
|
21439
21447
|
toolObj,
|
|
21440
21448
|
options,
|
|
21441
21449
|
void 0,
|
|
@@ -21500,7 +21508,7 @@ ${effectiveInstructions}`;
|
|
|
21500
21508
|
}
|
|
21501
21509
|
]
|
|
21502
21510
|
};
|
|
21503
|
-
const toolObj =
|
|
21511
|
+
const toolObj = chunkK4NN2KQQ_cjs.createTool({
|
|
21504
21512
|
id: `workflow-${workflowName}`,
|
|
21505
21513
|
description: workflow.description || `Workflow: ${workflowName}`,
|
|
21506
21514
|
inputSchema: extendedInputSchema,
|
|
@@ -21646,12 +21654,13 @@ ${effectiveInstructions}`;
|
|
|
21646
21654
|
mastra: this.#mastra,
|
|
21647
21655
|
memory: await this.getMemory({ requestContext }),
|
|
21648
21656
|
agentName: this.name,
|
|
21657
|
+
agentId: this.id,
|
|
21649
21658
|
requestContext,
|
|
21650
21659
|
model: await this.getModel({ requestContext }),
|
|
21651
21660
|
...observabilityContext,
|
|
21652
21661
|
tracingPolicy: this.#options?.tracingPolicy
|
|
21653
21662
|
};
|
|
21654
|
-
convertedWorkflowTools[`workflow-${workflowName}`] =
|
|
21663
|
+
convertedWorkflowTools[`workflow-${workflowName}`] = chunkRQBBPR64_cjs.makeCoreTool(
|
|
21655
21664
|
toolObj,
|
|
21656
21665
|
options,
|
|
21657
21666
|
void 0,
|
|
@@ -21683,7 +21692,7 @@ ${effectiveInstructions}`;
|
|
|
21683
21692
|
let mastraProxy = void 0;
|
|
21684
21693
|
const logger = this.logger;
|
|
21685
21694
|
if (this.#mastra) {
|
|
21686
|
-
mastraProxy =
|
|
21695
|
+
mastraProxy = chunkRQBBPR64_cjs.createMastraProxy({ mastra: this.#mastra, logger });
|
|
21687
21696
|
}
|
|
21688
21697
|
const assignedTools = await this.listAssignedTools({
|
|
21689
21698
|
runId,
|
|
@@ -21935,7 +21944,7 @@ ${effectiveInstructions}`;
|
|
|
21935
21944
|
const resolvedModel = await this.resolveModelConfig(selection, requestContext);
|
|
21936
21945
|
this.assertSupportsPreparedModels(resolvedModel);
|
|
21937
21946
|
let headers;
|
|
21938
|
-
if (resolvedModel instanceof
|
|
21947
|
+
if (resolvedModel instanceof chunk4THMANGC_cjs.ModelRouterLanguageModel) {
|
|
21939
21948
|
headers = resolvedModel.config?.headers;
|
|
21940
21949
|
}
|
|
21941
21950
|
return [
|
|
@@ -21968,7 +21977,7 @@ ${effectiveInstructions}`;
|
|
|
21968
21977
|
throw mastraError;
|
|
21969
21978
|
}
|
|
21970
21979
|
let headers;
|
|
21971
|
-
if (model instanceof
|
|
21980
|
+
if (model instanceof chunk4THMANGC_cjs.ModelRouterLanguageModel) {
|
|
21972
21981
|
headers = model.config?.headers;
|
|
21973
21982
|
}
|
|
21974
21983
|
return {
|
|
@@ -22419,7 +22428,7 @@ ${effectiveInstructions}`;
|
|
|
22419
22428
|
const defaultOptions = await this.getDefaultOptions({
|
|
22420
22429
|
requestContext: options?.requestContext
|
|
22421
22430
|
});
|
|
22422
|
-
const mergedOptions =
|
|
22431
|
+
const mergedOptions = chunkRQBBPR64_cjs.deepMerge(
|
|
22423
22432
|
defaultOptions,
|
|
22424
22433
|
options ?? {}
|
|
22425
22434
|
);
|
|
@@ -22489,7 +22498,7 @@ ${effectiveInstructions}`;
|
|
|
22489
22498
|
const defaultOptions = await this.getDefaultOptions({
|
|
22490
22499
|
requestContext: streamOptions?.requestContext
|
|
22491
22500
|
});
|
|
22492
|
-
const mergedOptions =
|
|
22501
|
+
const mergedOptions = chunkRQBBPR64_cjs.deepMerge(
|
|
22493
22502
|
defaultOptions,
|
|
22494
22503
|
streamOptions ?? {}
|
|
22495
22504
|
);
|
|
@@ -22553,7 +22562,7 @@ ${effectiveInstructions}`;
|
|
|
22553
22562
|
const defaultOptions = await this.getDefaultOptions({
|
|
22554
22563
|
requestContext: streamOptions?.requestContext
|
|
22555
22564
|
});
|
|
22556
|
-
let mergedStreamOptions =
|
|
22565
|
+
let mergedStreamOptions = chunkRQBBPR64_cjs.deepMerge(
|
|
22557
22566
|
defaultOptions,
|
|
22558
22567
|
streamOptions ?? {}
|
|
22559
22568
|
);
|
|
@@ -22618,7 +22627,7 @@ ${effectiveInstructions}`;
|
|
|
22618
22627
|
const defaultOptions = await this.getDefaultOptions({
|
|
22619
22628
|
requestContext: options?.requestContext
|
|
22620
22629
|
});
|
|
22621
|
-
const mergedOptions =
|
|
22630
|
+
const mergedOptions = chunkRQBBPR64_cjs.deepMerge(
|
|
22622
22631
|
defaultOptions,
|
|
22623
22632
|
options ?? {}
|
|
22624
22633
|
);
|
|
@@ -24192,7 +24201,7 @@ var TokenLimiterProcessor = class _TokenLimiterProcessor {
|
|
|
24192
24201
|
return new TiktokenClass(this.customEncoding);
|
|
24193
24202
|
});
|
|
24194
24203
|
} else {
|
|
24195
|
-
this.encoderPromise =
|
|
24204
|
+
this.encoderPromise = chunkXW4B2RAG_cjs.getTiktoken();
|
|
24196
24205
|
}
|
|
24197
24206
|
}
|
|
24198
24207
|
return this.encoderPromise;
|
|
@@ -24877,7 +24886,7 @@ var ToolSearchProcessor = class {
|
|
|
24877
24886
|
minScore: options.search?.minScore ?? 0
|
|
24878
24887
|
};
|
|
24879
24888
|
this.ttl = options.ttl ?? 36e5;
|
|
24880
|
-
this.bm25Index = new
|
|
24889
|
+
this.bm25Index = new chunkXW4B2RAG_cjs.BM25Index({}, TOOL_SEARCH_TOKENIZE_OPTIONS);
|
|
24881
24890
|
this.indexTools();
|
|
24882
24891
|
if (this.ttl > 0) {
|
|
24883
24892
|
this.scheduleCleanup();
|
|
@@ -25042,7 +25051,7 @@ var ToolSearchProcessor = class {
|
|
|
25042
25051
|
messageList.addSystem(
|
|
25043
25052
|
"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."
|
|
25044
25053
|
);
|
|
25045
|
-
const searchTool =
|
|
25054
|
+
const searchTool = chunkK4NN2KQQ_cjs.createTool({
|
|
25046
25055
|
id: "search_tools",
|
|
25047
25056
|
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.",
|
|
25048
25057
|
inputSchema: v4.z.object({
|
|
@@ -25072,7 +25081,7 @@ var ToolSearchProcessor = class {
|
|
|
25072
25081
|
};
|
|
25073
25082
|
}
|
|
25074
25083
|
});
|
|
25075
|
-
const loadTool =
|
|
25084
|
+
const loadTool = chunkK4NN2KQQ_cjs.createTool({
|
|
25076
25085
|
id: "load_tool",
|
|
25077
25086
|
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).",
|
|
25078
25087
|
inputSchema: v4.z.object({
|
|
@@ -25406,7 +25415,7 @@ var WorkingMemory = class {
|
|
|
25406
25415
|
return messageList;
|
|
25407
25416
|
}
|
|
25408
25417
|
generateEmptyFromSchemaInternal(schema) {
|
|
25409
|
-
const result =
|
|
25418
|
+
const result = chunkRQBBPR64_cjs.generateEmptyFromSchema(schema);
|
|
25410
25419
|
return Object.keys(result).length > 0 ? result : null;
|
|
25411
25420
|
}
|
|
25412
25421
|
getWorkingMemoryToolInstruction({
|
|
@@ -25609,7 +25618,7 @@ var SemanticRecall = class {
|
|
|
25609
25618
|
*/
|
|
25610
25619
|
formatCrossThreadMessages(messages, currentThreadId) {
|
|
25611
25620
|
let result = ``;
|
|
25612
|
-
const v1Messages = new
|
|
25621
|
+
const v1Messages = new chunkPCQBJ3NP_cjs.MessageList().add(messages, "memory").get.all.v1();
|
|
25613
25622
|
let lastYmd = null;
|
|
25614
25623
|
for (const msg of v1Messages) {
|
|
25615
25624
|
const date = msg.createdAt;
|
|
@@ -26051,7 +26060,7 @@ https://mastra.ai/en/docs/memory/semantic-recall`
|
|
|
26051
26060
|
);
|
|
26052
26061
|
}
|
|
26053
26062
|
if (typeof config.embedder === "string") {
|
|
26054
|
-
this.embedder = new
|
|
26063
|
+
this.embedder = new chunk4THMANGC_cjs.ModelRouterEmbeddingModel(config.embedder);
|
|
26055
26064
|
} else {
|
|
26056
26065
|
this.embedder = config.embedder;
|
|
26057
26066
|
}
|
|
@@ -26090,7 +26099,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
26090
26099
|
}
|
|
26091
26100
|
setEmbedder(embedder, embedderOptions) {
|
|
26092
26101
|
if (typeof embedder === "string") {
|
|
26093
|
-
this.embedder = new
|
|
26102
|
+
this.embedder = new chunk4THMANGC_cjs.ModelRouterEmbeddingModel(embedder);
|
|
26094
26103
|
} else {
|
|
26095
26104
|
this.embedder = embedder;
|
|
26096
26105
|
}
|
|
@@ -26187,7 +26196,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
26187
26196
|
"The threads.generateTitle option has been moved. Use the top-level generateTitle option instead."
|
|
26188
26197
|
);
|
|
26189
26198
|
}
|
|
26190
|
-
const mergedConfig =
|
|
26199
|
+
const mergedConfig = chunkRQBBPR64_cjs.deepMerge(this.threadConfig, config || {});
|
|
26191
26200
|
if (typeof config?.workingMemory === "object" && config.workingMemory?.schema && typeof mergedConfig.workingMemory === "object") {
|
|
26192
26201
|
mergedConfig.workingMemory.schema = config.workingMemory.schema;
|
|
26193
26202
|
}
|
|
@@ -26539,7 +26548,7 @@ var MockMemory = class extends MastraMemory {
|
|
|
26539
26548
|
} = {}) {
|
|
26540
26549
|
super({
|
|
26541
26550
|
name: "mock",
|
|
26542
|
-
storage: storage || new
|
|
26551
|
+
storage: storage || new chunk6VYFRSNT_cjs.InMemoryStore(),
|
|
26543
26552
|
options: {
|
|
26544
26553
|
...options,
|
|
26545
26554
|
workingMemory: enableWorkingMemory ? { enabled: true, template: workingMemoryTemplate } : options?.workingMemory,
|
|
@@ -26620,7 +26629,7 @@ var MockMemory = class extends MastraMemory {
|
|
|
26620
26629
|
return {};
|
|
26621
26630
|
}
|
|
26622
26631
|
return {
|
|
26623
|
-
updateWorkingMemory:
|
|
26632
|
+
updateWorkingMemory: chunkK4NN2KQQ_cjs.createTool({
|
|
26624
26633
|
id: "update-working-memory",
|
|
26625
26634
|
description: `Update the working memory with new information. Any data not included will be overwritten.`,
|
|
26626
26635
|
inputSchema: v4.z.object({ memory: v4.z.string() }),
|
|
@@ -26848,5 +26857,5 @@ exports.validateStepRequestContext = validateStepRequestContext;
|
|
|
26848
26857
|
exports.validateStepResumeData = validateStepResumeData;
|
|
26849
26858
|
exports.validateStepStateData = validateStepStateData;
|
|
26850
26859
|
exports.validateStepSuspendData = validateStepSuspendData;
|
|
26851
|
-
//# sourceMappingURL=chunk-
|
|
26852
|
-
//# sourceMappingURL=chunk-
|
|
26860
|
+
//# sourceMappingURL=chunk-NTF7UIBI.cjs.map
|
|
26861
|
+
//# sourceMappingURL=chunk-NTF7UIBI.cjs.map
|