@mastra/core 1.21.0-alpha.2 → 1.22.0-alpha.0
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 +84 -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/adapters/AIV5Adapter.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/{chunk-QTLGELHE.cjs → chunk-2G5U5LCK.cjs} +148 -17
- package/dist/chunk-2G5U5LCK.cjs.map +1 -0
- package/dist/{chunk-6BIGXDKX.js → chunk-2VC36BDH.js} +6 -6
- package/dist/{chunk-6BIGXDKX.js.map → chunk-2VC36BDH.js.map} +1 -1
- package/dist/{chunk-UQHC7ELQ.js → chunk-3RAYTSPI.js} +16 -9
- package/dist/chunk-3RAYTSPI.js.map +1 -0
- package/dist/{chunk-2YKXARRF.js → chunk-46DASRFB.js} +3 -3
- package/dist/{chunk-2YKXARRF.js.map → chunk-46DASRFB.js.map} +1 -1
- package/dist/{chunk-YPMF3QLA.cjs → chunk-AVRRH42W.cjs} +233 -233
- package/dist/chunk-AVRRH42W.cjs.map +1 -0
- package/dist/{chunk-ZRP4BAK4.js → chunk-B7PS7GR7.js} +147 -17
- package/dist/{chunk-ZRP4BAK4.js.map → chunk-B7PS7GR7.js.map} +1 -1
- package/dist/{chunk-PZG4R64R.cjs → chunk-BFOGUVFL.cjs} +5 -5
- package/dist/{chunk-PZG4R64R.cjs.map → chunk-BFOGUVFL.cjs.map} +1 -1
- package/dist/{chunk-UWYGTSWV.cjs → chunk-DOPULILR.cjs} +34 -30
- package/dist/chunk-DOPULILR.cjs.map +1 -0
- package/dist/{chunk-WICDXZLH.cjs → chunk-DTQCQXSX.cjs} +56 -56
- package/dist/{chunk-WICDXZLH.cjs.map → chunk-DTQCQXSX.cjs.map} +1 -1
- package/dist/{chunk-ELDEBCZS.js → chunk-EFXVHFAI.js} +12 -4
- package/dist/chunk-EFXVHFAI.js.map +1 -0
- package/dist/{chunk-7CSQG6IA.cjs → chunk-FHQY4G2O.cjs} +12 -3
- package/dist/chunk-FHQY4G2O.cjs.map +1 -0
- package/dist/{chunk-2WUDN6HI.js → chunk-FXONBE4Y.js} +4 -4
- package/dist/{chunk-2WUDN6HI.js.map → chunk-FXONBE4Y.js.map} +1 -1
- package/dist/{chunk-LOA2BVRK.js → chunk-HJBVUY76.js} +230 -230
- package/dist/chunk-HJBVUY76.js.map +1 -0
- package/dist/{chunk-ZLBAC3BN.cjs → chunk-HVE6QR4G.cjs} +6 -6
- package/dist/{chunk-ZLBAC3BN.cjs.map → chunk-HVE6QR4G.cjs.map} +1 -1
- package/dist/{chunk-DGX6FWSX.cjs → chunk-JZBAUINL.cjs} +91 -83
- package/dist/chunk-JZBAUINL.cjs.map +1 -0
- package/dist/{chunk-V2MOZKZ2.cjs → chunk-K7TAXUW5.cjs} +13 -13
- package/dist/{chunk-V2MOZKZ2.cjs.map → chunk-K7TAXUW5.cjs.map} +1 -1
- package/dist/{chunk-NHWPIKUM.js → chunk-KYIYBC6A.js} +4 -4
- package/dist/{chunk-NHWPIKUM.js.map → chunk-KYIYBC6A.js.map} +1 -1
- package/dist/{chunk-AJB745SL.js → chunk-M5PKEDYH.js} +3 -3
- package/dist/{chunk-AJB745SL.js.map → chunk-M5PKEDYH.js.map} +1 -1
- package/dist/{chunk-NRA3BO5W.js → chunk-MOVQYN2F.js} +34 -30
- package/dist/chunk-MOVQYN2F.js.map +1 -0
- package/dist/{chunk-PSGEUNAH.js → chunk-NB435LXG.js} +4 -4
- package/dist/{chunk-PSGEUNAH.js.map → chunk-NB435LXG.js.map} +1 -1
- package/dist/{chunk-67X7ZYMH.js → chunk-NHWDBHFY.js} +3 -3
- package/dist/{chunk-67X7ZYMH.js.map → chunk-NHWDBHFY.js.map} +1 -1
- package/dist/{chunk-CDO4JQEO.cjs → chunk-O2FAC2JL.cjs} +186 -185
- package/dist/{chunk-CDO4JQEO.cjs.map → chunk-O2FAC2JL.cjs.map} +1 -1
- package/dist/{chunk-L3QX2IX7.js → chunk-PBVPRLDI.js} +17 -10
- package/dist/chunk-PBVPRLDI.js.map +1 -0
- package/dist/{chunk-J2CBK7QL.cjs → chunk-PCDPQEYH.cjs} +7 -7
- package/dist/{chunk-J2CBK7QL.cjs.map → chunk-PCDPQEYH.cjs.map} +1 -1
- package/dist/{chunk-OPR6DNSN.js → chunk-PJRKKSYW.js} +29 -17
- package/dist/chunk-PJRKKSYW.js.map +1 -0
- package/dist/{chunk-DRWYPRD7.cjs → chunk-QF4KRWYU.cjs} +94 -82
- package/dist/chunk-QF4KRWYU.cjs.map +1 -0
- package/dist/{chunk-EKR6FZOG.js → chunk-RZISMMDM.js} +4 -4
- package/dist/{chunk-EKR6FZOG.js.map → chunk-RZISMMDM.js.map} +1 -1
- package/dist/{chunk-MBWY7AOA.cjs → chunk-TDTG2WDG.cjs} +7 -7
- package/dist/{chunk-MBWY7AOA.cjs.map → chunk-TDTG2WDG.cjs.map} +1 -1
- package/dist/{chunk-246GELHA.js → chunk-U63DZ6E6.js} +4 -4
- package/dist/{chunk-246GELHA.js.map → chunk-U63DZ6E6.js.map} +1 -1
- package/dist/{chunk-YF5TQNL3.cjs → chunk-WTV62NHE.cjs} +9 -9
- package/dist/{chunk-YF5TQNL3.cjs.map → chunk-WTV62NHE.cjs.map} +1 -1
- package/dist/{chunk-Q63LQZN5.cjs → chunk-YYPOSWKA.cjs} +23 -16
- package/dist/chunk-YYPOSWKA.cjs.map +1 -0
- package/dist/{chunk-OMKFSCBO.cjs → chunk-ZTC3TLFM.cjs} +3 -3
- package/dist/{chunk-OMKFSCBO.cjs.map → chunk-ZTC3TLFM.cjs.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 +263 -245
- 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 +13 -13
- package/dist/harness/index.js +7 -7
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/llm/index.cjs +36 -20
- package/dist/llm/index.d.ts +5 -4
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +5 -5
- package/dist/llm/model/gateways/base.d.ts +5 -0
- package/dist/llm/model/gateways/base.d.ts.map +1 -1
- package/dist/llm/model/gateways/constants.d.ts +1 -0
- package/dist/llm/model/gateways/constants.d.ts.map +1 -1
- package/dist/llm/model/gateways/index.d.ts +1 -0
- package/dist/llm/model/gateways/index.d.ts.map +1 -1
- package/dist/llm/model/gateways/mastra.d.ts +25 -0
- package/dist/llm/model/gateways/mastra.d.ts.map +1 -0
- package/dist/llm/model/provider-registry.d.ts.map +1 -1
- package/dist/llm/model/provider-types.generated.d.ts +1 -0
- package/dist/llm/model/registry-generator.d.ts.map +1 -1
- package/dist/llm/model/router.d.ts +4 -2
- package/dist/llm/model/router.d.ts.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/mastra-2EQZYM7C.js +3 -0
- package/dist/mastra-2EQZYM7C.js.map +1 -0
- package/dist/mastra-XPBVZO54.cjs +12 -0
- package/dist/mastra-XPBVZO54.cjs.map +1 -0
- package/dist/memory/index.cjs +14 -14
- package/dist/memory/index.js +1 -1
- package/dist/models-dev-DA5OEOGQ.js +3 -0
- package/dist/{models-dev-PGMVTTO7.js.map → models-dev-DA5OEOGQ.js.map} +1 -1
- package/dist/models-dev-HDA3INHC.cjs +12 -0
- package/dist/{models-dev-NB7CKJAS.cjs.map → models-dev-HDA3INHC.cjs.map} +1 -1
- package/dist/netlify-6PWJPWSI.cjs +12 -0
- package/dist/{netlify-NFMAID4M.cjs.map → netlify-6PWJPWSI.cjs.map} +1 -1
- package/dist/netlify-EENUHCAW.js +3 -0
- package/dist/{netlify-3BL6W3LY.js.map → netlify-EENUHCAW.js.map} +1 -1
- package/dist/processor-provider/index.cjs +10 -10
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +44 -44
- package/dist/processors/index.js +1 -1
- package/dist/provider-registry-TQS5D74S.js +3 -0
- package/dist/{provider-registry-CHVK2YJI.js.map → provider-registry-TQS5D74S.js.map} +1 -1
- package/dist/provider-registry-VE7OCGGU.cjs +40 -0
- package/dist/{provider-registry-A6OIBOAB.cjs.map → provider-registry-VE7OCGGU.cjs.map} +1 -1
- package/dist/{registry-generator-BRPCL2LG.js → registry-generator-QMLHG25G.js} +10 -3
- package/dist/registry-generator-QMLHG25G.js.map +1 -0
- package/dist/{registry-generator-PUWKZKVW.cjs → registry-generator-VNYH6GDH.cjs} +10 -3
- package/dist/registry-generator-VNYH6GDH.cjs.map +1 -0
- 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/utils.cjs +25 -25
- 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/sandbox/local-process-manager.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/llm/model/provider-types.generated.d.ts +1 -0
- package/dist/chunk-7CSQG6IA.cjs.map +0 -1
- package/dist/chunk-DGX6FWSX.cjs.map +0 -1
- package/dist/chunk-DRWYPRD7.cjs.map +0 -1
- package/dist/chunk-ELDEBCZS.js.map +0 -1
- package/dist/chunk-L3QX2IX7.js.map +0 -1
- package/dist/chunk-LOA2BVRK.js.map +0 -1
- package/dist/chunk-NRA3BO5W.js.map +0 -1
- package/dist/chunk-OPR6DNSN.js.map +0 -1
- package/dist/chunk-Q63LQZN5.cjs.map +0 -1
- package/dist/chunk-QTLGELHE.cjs.map +0 -1
- package/dist/chunk-UQHC7ELQ.js.map +0 -1
- package/dist/chunk-UWYGTSWV.cjs.map +0 -1
- package/dist/chunk-YPMF3QLA.cjs.map +0 -1
- package/dist/models-dev-NB7CKJAS.cjs +0 -12
- package/dist/models-dev-PGMVTTO7.js +0 -3
- package/dist/netlify-3BL6W3LY.js +0 -3
- package/dist/netlify-NFMAID4M.cjs +0 -12
- package/dist/provider-registry-A6OIBOAB.cjs +0 -40
- package/dist/provider-registry-CHVK2YJI.js +0 -3
- package/dist/registry-generator-BRPCL2LG.js.map +0 -1
- package/dist/registry-generator-PUWKZKVW.cjs.map +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunkAVRRH42W_cjs = require('./chunk-AVRRH42W.cjs');
|
|
3
4
|
var chunkX7SJO3JJ_cjs = require('./chunk-X7SJO3JJ.cjs');
|
|
4
5
|
var chunkZCBG4ZQT_cjs = require('./chunk-ZCBG4ZQT.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var chunkUWYGTSWV_cjs = require('./chunk-UWYGTSWV.cjs');
|
|
6
|
+
var chunkK7TAXUW5_cjs = require('./chunk-K7TAXUW5.cjs');
|
|
7
|
+
var chunkDOPULILR_cjs = require('./chunk-DOPULILR.cjs');
|
|
8
8
|
var chunkY3APFUXZ_cjs = require('./chunk-Y3APFUXZ.cjs');
|
|
9
9
|
var chunkCFMZZDO2_cjs = require('./chunk-CFMZZDO2.cjs');
|
|
10
|
-
var chunkOQDRPRKM_cjs = require('./chunk-OQDRPRKM.cjs');
|
|
11
10
|
var chunkMR7ZWBL6_cjs = require('./chunk-MR7ZWBL6.cjs');
|
|
12
|
-
var
|
|
13
|
-
var
|
|
11
|
+
var chunkJZBAUINL_cjs = require('./chunk-JZBAUINL.cjs');
|
|
12
|
+
var chunkTDTG2WDG_cjs = require('./chunk-TDTG2WDG.cjs');
|
|
14
13
|
var chunk22FSGATE_cjs = require('./chunk-22FSGATE.cjs');
|
|
15
|
-
var
|
|
14
|
+
var chunkOQDRPRKM_cjs = require('./chunk-OQDRPRKM.cjs');
|
|
15
|
+
var chunkZTC3TLFM_cjs = require('./chunk-ZTC3TLFM.cjs');
|
|
16
16
|
var chunkW6PDQCCN_cjs = require('./chunk-W6PDQCCN.cjs');
|
|
17
|
-
var chunkDLBIUFZL_cjs = require('./chunk-DLBIUFZL.cjs');
|
|
18
17
|
var chunkKJBMTK5B_cjs = require('./chunk-KJBMTK5B.cjs');
|
|
19
18
|
var chunkLDLHW3QN_cjs = require('./chunk-LDLHW3QN.cjs');
|
|
20
19
|
var chunkXB4FLS7A_cjs = require('./chunk-XB4FLS7A.cjs');
|
|
20
|
+
var chunkDLBIUFZL_cjs = require('./chunk-DLBIUFZL.cjs');
|
|
21
21
|
var chunk5WBEMKE2_cjs = require('./chunk-5WBEMKE2.cjs');
|
|
22
22
|
var chunk4U7ZLI36_cjs = require('./chunk-4U7ZLI36.cjs');
|
|
23
23
|
var chunkC5WSRMJD_cjs = require('./chunk-C5WSRMJD.cjs');
|
|
@@ -1306,7 +1306,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1306
1306
|
writer
|
|
1307
1307
|
});
|
|
1308
1308
|
const mutations = messageList.stopRecording();
|
|
1309
|
-
if (processResult instanceof
|
|
1309
|
+
if (processResult instanceof chunkDOPULILR_cjs.MessageList) {
|
|
1310
1310
|
if (processResult !== messageList) {
|
|
1311
1311
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
1312
1312
|
category: "USER",
|
|
@@ -1600,7 +1600,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1600
1600
|
retryCount
|
|
1601
1601
|
});
|
|
1602
1602
|
let mutations;
|
|
1603
|
-
if (result instanceof
|
|
1603
|
+
if (result instanceof chunkDOPULILR_cjs.MessageList) {
|
|
1604
1604
|
if (result !== messageList) {
|
|
1605
1605
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
1606
1606
|
category: "USER",
|
|
@@ -1970,7 +1970,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1970
1970
|
writer
|
|
1971
1971
|
});
|
|
1972
1972
|
const mutations = messageList.stopRecording();
|
|
1973
|
-
if (result instanceof
|
|
1973
|
+
if (result instanceof chunkDOPULILR_cjs.MessageList) {
|
|
1974
1974
|
if (result !== messageList) {
|
|
1975
1975
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
1976
1976
|
category: "USER",
|
|
@@ -2042,7 +2042,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
2042
2042
|
processor,
|
|
2043
2043
|
stepNumber
|
|
2044
2044
|
}) {
|
|
2045
|
-
if (result instanceof
|
|
2045
|
+
if (result instanceof chunkDOPULILR_cjs.MessageList) {
|
|
2046
2046
|
if (result !== messageList) {
|
|
2047
2047
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
2048
2048
|
category: "USER",
|
|
@@ -2077,7 +2077,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
2077
2077
|
}
|
|
2078
2078
|
const { model: _model, ...rest } = result;
|
|
2079
2079
|
if (result.model) {
|
|
2080
|
-
const resolvedModel = await
|
|
2080
|
+
const resolvedModel = await chunkJZBAUINL_cjs.resolveModelConfig(result.model);
|
|
2081
2081
|
const isSupported = isSupportedLanguageModel(resolvedModel);
|
|
2082
2082
|
if (!isSupported) {
|
|
2083
2083
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
@@ -3284,7 +3284,7 @@ var MastraModelOutput = class extends chunkC5WSRMJD_cjs.MastraBase {
|
|
|
3284
3284
|
);
|
|
3285
3285
|
const responseMessages = self.messageList.get.response.aiV4.core();
|
|
3286
3286
|
const lastResponseMessage = responseMessages[responseMessages.length - 1];
|
|
3287
|
-
const outputText = lastResponseMessage ?
|
|
3287
|
+
const outputText = lastResponseMessage ? chunkDOPULILR_cjs.coreContentToString(lastResponseMessage.content) : "";
|
|
3288
3288
|
if (lastStep && outputText && outputText !== originalText) {
|
|
3289
3289
|
lastStep.text = outputText;
|
|
3290
3290
|
}
|
|
@@ -4656,7 +4656,7 @@ function convertMastraChunkToAISDKv5({
|
|
|
4656
4656
|
if (mode === "generate") {
|
|
4657
4657
|
return {
|
|
4658
4658
|
type: "file",
|
|
4659
|
-
file: new
|
|
4659
|
+
file: new chunkDOPULILR_cjs.DefaultGeneratedFile({
|
|
4660
4660
|
data: chunk.payload.data,
|
|
4661
4661
|
mediaType: chunk.payload.mimeType
|
|
4662
4662
|
})
|
|
@@ -4664,7 +4664,7 @@ function convertMastraChunkToAISDKv5({
|
|
|
4664
4664
|
}
|
|
4665
4665
|
return {
|
|
4666
4666
|
type: "file",
|
|
4667
|
-
file: new
|
|
4667
|
+
file: new chunkDOPULILR_cjs.DefaultGeneratedFileWithType({
|
|
4668
4668
|
data: chunk.payload.data,
|
|
4669
4669
|
mediaType: chunk.payload.mimeType
|
|
4670
4670
|
})
|
|
@@ -5503,7 +5503,7 @@ var createTimeTravelExecutionParams = (params) => {
|
|
|
5503
5503
|
result = void 0;
|
|
5504
5504
|
}
|
|
5505
5505
|
if (result) {
|
|
5506
|
-
const formattedResult =
|
|
5506
|
+
const formattedResult = chunkZTC3TLFM_cjs.removeUndefinedValues(result);
|
|
5507
5507
|
stepResults[stepId] = formattedResult;
|
|
5508
5508
|
}
|
|
5509
5509
|
});
|
|
@@ -6061,7 +6061,7 @@ async function executeLoop(engine, params) {
|
|
|
6061
6061
|
options: {
|
|
6062
6062
|
type: "workflow_conditional_eval" /* WORKFLOW_CONDITIONAL_EVAL */,
|
|
6063
6063
|
name: `condition: '${entry.loopType}'`,
|
|
6064
|
-
input:
|
|
6064
|
+
input: chunkZTC3TLFM_cjs.selectFields(result.output, ["stepResult", "output.text", "output.object", "messages"]),
|
|
6065
6065
|
attributes: {
|
|
6066
6066
|
conditionIndex: iteration
|
|
6067
6067
|
},
|
|
@@ -8699,7 +8699,7 @@ function createStepFromProcessor(processor) {
|
|
|
8699
8699
|
phase,
|
|
8700
8700
|
// Auto-create MessageList from messages if not provided
|
|
8701
8701
|
// This enables running processor workflows from the UI where messageList can't be serialized
|
|
8702
|
-
messageList: messageList ?? (Array.isArray(messages) ? new
|
|
8702
|
+
messageList: messageList ?? (Array.isArray(messages) ? new chunkDOPULILR_cjs.MessageList().add(messages, "input").addSystem(systemMessages ?? []) : void 0),
|
|
8703
8703
|
stepNumber,
|
|
8704
8704
|
systemMessages,
|
|
8705
8705
|
streamParts,
|
|
@@ -8756,7 +8756,7 @@ function createStepFromProcessor(processor) {
|
|
|
8756
8756
|
messageList: checkedMessageList,
|
|
8757
8757
|
systemMessages: systemMessages ?? []
|
|
8758
8758
|
});
|
|
8759
|
-
if (result instanceof
|
|
8759
|
+
if (result instanceof chunkDOPULILR_cjs.MessageList) {
|
|
8760
8760
|
if (result !== checkedMessageList) {
|
|
8761
8761
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
8762
8762
|
category: "USER" /* USER */,
|
|
@@ -8939,7 +8939,7 @@ function createStepFromProcessor(processor) {
|
|
|
8939
8939
|
messageList: passThrough.messageList,
|
|
8940
8940
|
result: passThrough.result ?? defaultResult
|
|
8941
8941
|
});
|
|
8942
|
-
if (result instanceof
|
|
8942
|
+
if (result instanceof chunkDOPULILR_cjs.MessageList) {
|
|
8943
8943
|
if (result !== passThrough.messageList) {
|
|
8944
8944
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
8945
8945
|
category: "USER" /* USER */,
|
|
@@ -9006,7 +9006,7 @@ function createStepFromProcessor(processor) {
|
|
|
9006
9006
|
systemMessages: systemMessages ?? [],
|
|
9007
9007
|
steps: steps ?? []
|
|
9008
9008
|
});
|
|
9009
|
-
if (result instanceof
|
|
9009
|
+
if (result instanceof chunkDOPULILR_cjs.MessageList) {
|
|
9010
9010
|
if (result !== checkedMessageList) {
|
|
9011
9011
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
9012
9012
|
category: "USER" /* USER */,
|
|
@@ -11517,7 +11517,7 @@ var MastraScorer = class _MastraScorer {
|
|
|
11517
11517
|
}
|
|
11518
11518
|
});
|
|
11519
11519
|
}
|
|
11520
|
-
const resolvedModel = await
|
|
11520
|
+
const resolvedModel = await chunkJZBAUINL_cjs.resolveModelConfig(modelConfig, void 0, this.#mastra);
|
|
11521
11521
|
const judgeModel = resolvedModel.modelId;
|
|
11522
11522
|
const judge = new Agent({
|
|
11523
11523
|
id: "judge",
|
|
@@ -11748,7 +11748,7 @@ async function runDefaultCompletionCheck(agent, context, streamContext, abortSig
|
|
|
11748
11748
|
Primitives already executed: ${completedPrimitives.join(", ")}` : "";
|
|
11749
11749
|
const completionPrompt = `
|
|
11750
11750
|
The ${context.selectedPrimitive.type} ${context.selectedPrimitive.id} has contributed to the task.
|
|
11751
|
-
This is the result: ${
|
|
11751
|
+
This is the result: ${chunkZTC3TLFM_cjs.safeStringify(context.primitiveResult)}
|
|
11752
11752
|
|
|
11753
11753
|
${completedSection}
|
|
11754
11754
|
|
|
@@ -11844,7 +11844,7 @@ async function generateFinalResult(agent, context, streamContext, abortSignal, o
|
|
|
11844
11844
|
Original task: ${context.originalTask}
|
|
11845
11845
|
|
|
11846
11846
|
The ${context.selectedPrimitive.type} ${context.selectedPrimitive.id} produced this result:
|
|
11847
|
-
${
|
|
11847
|
+
${chunkZTC3TLFM_cjs.safeStringify(context.primitiveResult)}
|
|
11848
11848
|
|
|
11849
11849
|
IMPORTANT: If the above result is from an AGENT PRIMITIVE and it is a suitable final result itself considering the original task, then finalResult should be an empty string or undefined.
|
|
11850
11850
|
You should evaluate if the above result is comprehensive enough to accomplish the user's original task.
|
|
@@ -11902,7 +11902,7 @@ async function generateStructuredFinalResult(agent, context, structuredOutputOpt
|
|
|
11902
11902
|
Original task: ${context.originalTask}
|
|
11903
11903
|
|
|
11904
11904
|
The ${context.selectedPrimitive.type} ${context.selectedPrimitive.id} produced this result:
|
|
11905
|
-
${
|
|
11905
|
+
${chunkZTC3TLFM_cjs.safeStringify(context.primitiveResult)}
|
|
11906
11906
|
|
|
11907
11907
|
Based on the task and result above, generate a structured response according to the provided schema.
|
|
11908
11908
|
Use the conversation history and primitive results to craft the response.
|
|
@@ -13002,7 +13002,7 @@ function createLLMExecutionStep({
|
|
|
13002
13002
|
const convertedTools = {};
|
|
13003
13003
|
for (const [name, tool2] of Object.entries(currentStep.tools)) {
|
|
13004
13004
|
if (chunkLDLHW3QN_cjs.isMastraTool(tool2)) {
|
|
13005
|
-
convertedTools[name] =
|
|
13005
|
+
convertedTools[name] = chunkZTC3TLFM_cjs.makeCoreTool(
|
|
13006
13006
|
tool2,
|
|
13007
13007
|
{
|
|
13008
13008
|
name,
|
|
@@ -13160,9 +13160,19 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
|
|
|
13160
13160
|
modelSettings: { ...currentStep.modelSettings, maxRetries: modelConfig.maxRetries },
|
|
13161
13161
|
includeRawChunks,
|
|
13162
13162
|
structuredOutput: currentStep.structuredOutput,
|
|
13163
|
-
// Merge headers:
|
|
13164
|
-
//
|
|
13165
|
-
headers:
|
|
13163
|
+
// Merge headers: memory context first, then modelConfig headers, then modelSettings overrides
|
|
13164
|
+
// x-thread-id / x-resource-id enable server-side memory enrichment (e.g. Memory Gateway)
|
|
13165
|
+
headers: (() => {
|
|
13166
|
+
const memoryHeaders = {};
|
|
13167
|
+
if (_internal?.threadId) memoryHeaders["x-thread-id"] = _internal.threadId;
|
|
13168
|
+
if (_internal?.resourceId) memoryHeaders["x-resource-id"] = _internal.resourceId;
|
|
13169
|
+
const merged = {
|
|
13170
|
+
...memoryHeaders,
|
|
13171
|
+
...modelHeaders,
|
|
13172
|
+
...currentStep.modelSettings?.headers
|
|
13173
|
+
};
|
|
13174
|
+
return Object.keys(merged).length > 0 ? merged : void 0;
|
|
13175
|
+
})(),
|
|
13166
13176
|
methodType,
|
|
13167
13177
|
generateId: _internal?.generateId,
|
|
13168
13178
|
onResult: ({
|
|
@@ -13214,7 +13224,7 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
|
|
|
13214
13224
|
}
|
|
13215
13225
|
});
|
|
13216
13226
|
let transportResolver;
|
|
13217
|
-
if (currentStep.model instanceof
|
|
13227
|
+
if (currentStep.model instanceof chunkJZBAUINL_cjs.ModelRouterLanguageModel) {
|
|
13218
13228
|
const routerModel = currentStep.model;
|
|
13219
13229
|
transportResolver = () => routerModel._getStreamTransport();
|
|
13220
13230
|
}
|
|
@@ -13581,7 +13591,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13581
13591
|
toolInvocation: {
|
|
13582
13592
|
state: "result",
|
|
13583
13593
|
toolCallId: toolCall.toolCallId,
|
|
13584
|
-
toolName:
|
|
13594
|
+
toolName: chunkDOPULILR_cjs.sanitizeToolName(toolCall.toolName),
|
|
13585
13595
|
args: toolCall.args,
|
|
13586
13596
|
result: toolCall.error?.message ?? toolCall.error
|
|
13587
13597
|
},
|
|
@@ -13616,7 +13626,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13616
13626
|
toolInvocation: {
|
|
13617
13627
|
state: "result",
|
|
13618
13628
|
toolCallId: toolCall.toolCallId,
|
|
13619
|
-
toolName:
|
|
13629
|
+
toolName: chunkDOPULILR_cjs.sanitizeToolName(toolCall.toolName),
|
|
13620
13630
|
args: toolCall.args,
|
|
13621
13631
|
result: toolCall.result
|
|
13622
13632
|
},
|
|
@@ -13673,7 +13683,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13673
13683
|
toolInvocation: {
|
|
13674
13684
|
state: "result",
|
|
13675
13685
|
toolCallId: toolCall.toolCallId,
|
|
13676
|
-
toolName:
|
|
13686
|
+
toolName: chunkDOPULILR_cjs.sanitizeToolName(toolCall.toolName),
|
|
13677
13687
|
args: toolCall.args,
|
|
13678
13688
|
result: toolCall.result
|
|
13679
13689
|
},
|
|
@@ -14110,7 +14120,7 @@ function createToolCallStep({
|
|
|
14110
14120
|
}
|
|
14111
14121
|
}
|
|
14112
14122
|
const rawResult = await tool2.execute(args, toolOptions);
|
|
14113
|
-
const result =
|
|
14123
|
+
const result = chunkZTC3TLFM_cjs.ensureSerializable(rawResult);
|
|
14114
14124
|
if (tool2 && "onOutput" in tool2 && typeof tool2.onOutput === "function") {
|
|
14115
14125
|
try {
|
|
14116
14126
|
await tool2.onOutput({
|
|
@@ -14970,7 +14980,7 @@ var MastraLLMVNext = class extends chunkC5WSRMJD_cjs.MastraBase {
|
|
|
14970
14980
|
const remainingTokens = parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"] ?? "", 10);
|
|
14971
14981
|
if (!isNaN(remainingTokens) && remainingTokens > 0 && remainingTokens < 2e3) {
|
|
14972
14982
|
this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
|
|
14973
|
-
await
|
|
14983
|
+
await chunkZTC3TLFM_cjs.delay(10 * 1e3);
|
|
14974
14984
|
}
|
|
14975
14985
|
},
|
|
14976
14986
|
onFinish: async (props) => {
|
|
@@ -15246,7 +15256,7 @@ async function prepareMemoryStep({
|
|
|
15246
15256
|
);
|
|
15247
15257
|
}
|
|
15248
15258
|
} else {
|
|
15249
|
-
const messageList = new
|
|
15259
|
+
const messageList = new chunkDOPULILR_cjs.MessageList({
|
|
15250
15260
|
threadId: thread?.id,
|
|
15251
15261
|
resourceId: thread?.resourceId
|
|
15252
15262
|
});
|
|
@@ -15303,7 +15313,7 @@ async function saveMessagesWithProcessors(memory, messages, processorRunner, con
|
|
|
15303
15313
|
await memory.saveMessages({ messages });
|
|
15304
15314
|
return;
|
|
15305
15315
|
}
|
|
15306
|
-
const messageList = new
|
|
15316
|
+
const messageList = new chunkDOPULILR_cjs.MessageList();
|
|
15307
15317
|
for (const msg of messages) {
|
|
15308
15318
|
messageList.add(msg, "response");
|
|
15309
15319
|
}
|
|
@@ -16741,7 +16751,7 @@ async function networkLoop({
|
|
|
16741
16751
|
"resumeData": "string"
|
|
16742
16752
|
}
|
|
16743
16753
|
`;
|
|
16744
|
-
const messageList = new
|
|
16754
|
+
const messageList = new chunkDOPULILR_cjs.MessageList();
|
|
16745
16755
|
messageList.addSystem(systemInstructions);
|
|
16746
16756
|
messageList.add(task, "user");
|
|
16747
16757
|
const result = llm.stream({
|
|
@@ -17382,7 +17392,7 @@ var AgentLegacyHandler = class {
|
|
|
17382
17392
|
methodType: methodType === "generate" ? "generateLegacy" : "streamLegacy",
|
|
17383
17393
|
memoryConfig
|
|
17384
17394
|
});
|
|
17385
|
-
let messageList = new
|
|
17395
|
+
let messageList = new chunkDOPULILR_cjs.MessageList({
|
|
17386
17396
|
threadId,
|
|
17387
17397
|
resourceId,
|
|
17388
17398
|
generateMessageId: this.capabilities.mastra?.generateId?.bind(this.capabilities.mastra),
|
|
@@ -17541,7 +17551,7 @@ var AgentLegacyHandler = class {
|
|
|
17541
17551
|
result: resToLog,
|
|
17542
17552
|
threadId
|
|
17543
17553
|
});
|
|
17544
|
-
const messageListResponses = new
|
|
17554
|
+
const messageListResponses = new chunkDOPULILR_cjs.MessageList({
|
|
17545
17555
|
threadId,
|
|
17546
17556
|
resourceId,
|
|
17547
17557
|
generateMessageId: this.capabilities.mastra?.generateId?.bind(this.capabilities.mastra),
|
|
@@ -18717,7 +18727,7 @@ var prepareToolsStepOutputSchema = v4.z.object({
|
|
|
18717
18727
|
var prepareMemoryStepOutputSchema = v4.z.object({
|
|
18718
18728
|
threadExists: v4.z.boolean(),
|
|
18719
18729
|
thread: storageThreadSchema.optional(),
|
|
18720
|
-
messageList: v4.z.instanceof(
|
|
18730
|
+
messageList: v4.z.instanceof(chunkDOPULILR_cjs.MessageList),
|
|
18721
18731
|
/** Shared processor states map that persists across loop iterations for both input and output processors */
|
|
18722
18732
|
processorStates: v4.z.instanceof(Map),
|
|
18723
18733
|
/** Tripwire data when input processor triggered abort */
|
|
@@ -18759,7 +18769,7 @@ function createPrepareMemoryStep({
|
|
|
18759
18769
|
execute: async ({ ...rest }) => {
|
|
18760
18770
|
const observabilityContext = chunkW6PDQCCN_cjs.resolveObservabilityContext(rest);
|
|
18761
18771
|
const thread = threadFromArgs;
|
|
18762
|
-
const messageList = new
|
|
18772
|
+
const messageList = new chunkDOPULILR_cjs.MessageList({
|
|
18763
18773
|
threadId: thread?.id,
|
|
18764
18774
|
resourceId,
|
|
18765
18775
|
generateMessageId: capabilities.generateMessageId,
|
|
@@ -18785,7 +18795,7 @@ function createPrepareMemoryStep({
|
|
|
18785
18795
|
}
|
|
18786
18796
|
return {
|
|
18787
18797
|
threadExists: false,
|
|
18788
|
-
thread
|
|
18798
|
+
thread,
|
|
18789
18799
|
messageList,
|
|
18790
18800
|
processorStates,
|
|
18791
18801
|
tripwire: tripwire2
|
|
@@ -19997,7 +20007,7 @@ ${errorMessages}`,
|
|
|
19997
20007
|
*/
|
|
19998
20008
|
listTools({ requestContext = new chunk5WBEMKE2_cjs.RequestContext() } = {}) {
|
|
19999
20009
|
if (typeof this.#tools !== "function") {
|
|
20000
|
-
return
|
|
20010
|
+
return chunkZTC3TLFM_cjs.ensureToolProperties(this.#tools);
|
|
20001
20011
|
}
|
|
20002
20012
|
const result = this.#tools({
|
|
20003
20013
|
requestContext,
|
|
@@ -20017,7 +20027,7 @@ ${errorMessages}`,
|
|
|
20017
20027
|
this.logger.trackException(mastraError);
|
|
20018
20028
|
throw mastraError;
|
|
20019
20029
|
}
|
|
20020
|
-
return
|
|
20030
|
+
return chunkZTC3TLFM_cjs.ensureToolProperties(tools);
|
|
20021
20031
|
});
|
|
20022
20032
|
}
|
|
20023
20033
|
/**
|
|
@@ -20065,7 +20075,7 @@ ${errorMessages}`,
|
|
|
20065
20075
|
});
|
|
20066
20076
|
});
|
|
20067
20077
|
} else {
|
|
20068
|
-
llm = new
|
|
20078
|
+
llm = new chunkTDTG2WDG_cjs.MastraLLMV1({
|
|
20069
20079
|
model: modelInfo,
|
|
20070
20080
|
mastra: this.#mastra,
|
|
20071
20081
|
options: { tracingPolicy: this.#options?.tracingPolicy }
|
|
@@ -20091,7 +20101,7 @@ ${errorMessages}`,
|
|
|
20091
20101
|
*/
|
|
20092
20102
|
async resolveModelConfig(modelConfig, requestContext) {
|
|
20093
20103
|
try {
|
|
20094
|
-
return await
|
|
20104
|
+
return await chunkJZBAUINL_cjs.resolveModelConfig(modelConfig, requestContext, this.#mastra);
|
|
20095
20105
|
} catch (error) {
|
|
20096
20106
|
const mastraError = new chunk4U7ZLI36_cjs.MastraError({
|
|
20097
20107
|
id: "AGENT_GET_MODEL_MISSING_MODEL_INSTANCE",
|
|
@@ -20411,7 +20421,7 @@ ${errorMessages}`,
|
|
|
20411
20421
|
}) {
|
|
20412
20422
|
const observabilityContext = chunkW6PDQCCN_cjs.resolveObservabilityContext(rest);
|
|
20413
20423
|
const llm = await this.getLLM({ requestContext, model });
|
|
20414
|
-
const normMessage = new
|
|
20424
|
+
const normMessage = new chunkDOPULILR_cjs.MessageList().add(message, "user").get.all.aiV5.ui().at(-1);
|
|
20415
20425
|
if (!normMessage) {
|
|
20416
20426
|
throw new Error(`Could not generate title from input ${JSON.stringify(message)}`);
|
|
20417
20427
|
}
|
|
@@ -20434,7 +20444,7 @@ ${errorMessages}`,
|
|
|
20434
20444
|
const systemInstructions = await this.resolveTitleInstructions(requestContext, instructions);
|
|
20435
20445
|
let text = "";
|
|
20436
20446
|
if (isSupportedLanguageModel(llm.getModel())) {
|
|
20437
|
-
const messageList = new
|
|
20447
|
+
const messageList = new chunkDOPULILR_cjs.MessageList().add(
|
|
20438
20448
|
[
|
|
20439
20449
|
{
|
|
20440
20450
|
role: "system",
|
|
@@ -20487,7 +20497,7 @@ ${errorMessages}`,
|
|
|
20487
20497
|
async genTitle(userMessage, requestContext, observabilityContext, model, instructions) {
|
|
20488
20498
|
try {
|
|
20489
20499
|
if (userMessage) {
|
|
20490
|
-
const normMessage = new
|
|
20500
|
+
const normMessage = new chunkDOPULILR_cjs.MessageList().add(userMessage, "user").get.all.ui().at(-1);
|
|
20491
20501
|
if (normMessage) {
|
|
20492
20502
|
return await this.generateTitleFromUserMessage({
|
|
20493
20503
|
message: normMessage,
|
|
@@ -20563,7 +20573,7 @@ ${errorMessages}`,
|
|
|
20563
20573
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20564
20574
|
requireApproval: toolObj.requireApproval
|
|
20565
20575
|
};
|
|
20566
|
-
const convertedToCoreTool =
|
|
20576
|
+
const convertedToCoreTool = chunkZTC3TLFM_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20567
20577
|
convertedMemoryTools[toolName] = convertedToCoreTool;
|
|
20568
20578
|
}
|
|
20569
20579
|
}
|
|
@@ -20592,7 +20602,7 @@ ${errorMessages}`,
|
|
|
20592
20602
|
if (!workspace) {
|
|
20593
20603
|
return convertedWorkspaceTools;
|
|
20594
20604
|
}
|
|
20595
|
-
const workspaceTools =
|
|
20605
|
+
const workspaceTools = chunkAVRRH42W_cjs.createWorkspaceTools(workspace);
|
|
20596
20606
|
if (Object.keys(workspaceTools).length > 0) {
|
|
20597
20607
|
this.logger.debug("Adding workspace tools", { agent: this.name, tools: Object.keys(workspaceTools), runId });
|
|
20598
20608
|
for (const [toolName, tool2] of Object.entries(workspaceTools)) {
|
|
@@ -20613,7 +20623,7 @@ ${errorMessages}`,
|
|
|
20613
20623
|
requireApproval: toolObj.requireApproval,
|
|
20614
20624
|
workspace
|
|
20615
20625
|
};
|
|
20616
|
-
const convertedToCoreTool =
|
|
20626
|
+
const convertedToCoreTool = chunkZTC3TLFM_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20617
20627
|
convertedWorkspaceTools[toolName] = convertedToCoreTool;
|
|
20618
20628
|
}
|
|
20619
20629
|
}
|
|
@@ -20644,7 +20654,7 @@ ${errorMessages}`,
|
|
|
20644
20654
|
if (!workspace?.skills) {
|
|
20645
20655
|
return convertedSkillTools;
|
|
20646
20656
|
}
|
|
20647
|
-
const skillTools =
|
|
20657
|
+
const skillTools = chunkAVRRH42W_cjs.createSkillTools(workspace.skills);
|
|
20648
20658
|
if (Object.keys(skillTools).length > 0) {
|
|
20649
20659
|
this.logger.debug("Adding skill tools", { agent: this.name, tools: Object.keys(skillTools), runId });
|
|
20650
20660
|
for (const [toolName, tool2] of Object.entries(skillTools)) {
|
|
@@ -20666,7 +20676,7 @@ ${errorMessages}`,
|
|
|
20666
20676
|
// Skill tools never require approval
|
|
20667
20677
|
workspace
|
|
20668
20678
|
};
|
|
20669
|
-
const convertedToCoreTool =
|
|
20679
|
+
const convertedToCoreTool = chunkZTC3TLFM_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20670
20680
|
convertedSkillTools[toolName] = convertedToCoreTool;
|
|
20671
20681
|
}
|
|
20672
20682
|
}
|
|
@@ -20899,7 +20909,7 @@ ${errorMessages}`,
|
|
|
20899
20909
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20900
20910
|
requireApproval: tool2.requireApproval
|
|
20901
20911
|
};
|
|
20902
|
-
return [k,
|
|
20912
|
+
return [k, chunkZTC3TLFM_cjs.makeCoreTool(tool2, options, void 0, autoResumeSuspendedTools)];
|
|
20903
20913
|
})
|
|
20904
20914
|
);
|
|
20905
20915
|
const assignedToolEntriesConverted = Object.fromEntries(
|
|
@@ -20953,7 +20963,7 @@ ${errorMessages}`,
|
|
|
20953
20963
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20954
20964
|
requireApproval: toolObj.requireApproval
|
|
20955
20965
|
};
|
|
20956
|
-
const convertedToCoreTool =
|
|
20966
|
+
const convertedToCoreTool = chunkZTC3TLFM_cjs.makeCoreTool(toolObj, options, "toolset", autoResumeSuspendedTools);
|
|
20957
20967
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
20958
20968
|
}
|
|
20959
20969
|
}
|
|
@@ -20998,7 +21008,7 @@ ${errorMessages}`,
|
|
|
20998
21008
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20999
21009
|
requireApproval: tool2.requireApproval
|
|
21000
21010
|
};
|
|
21001
|
-
const convertedToCoreTool =
|
|
21011
|
+
const convertedToCoreTool = chunkZTC3TLFM_cjs.makeCoreTool(toolRest, options, "client-tool", autoResumeSuspendedTools);
|
|
21002
21012
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
21003
21013
|
}
|
|
21004
21014
|
}
|
|
@@ -21680,7 +21690,7 @@ ${effectiveInstructions}`;
|
|
|
21680
21690
|
...observabilityContext,
|
|
21681
21691
|
tracingPolicy: this.#options?.tracingPolicy
|
|
21682
21692
|
};
|
|
21683
|
-
convertedAgentTools[`agent-${agentName}`] =
|
|
21693
|
+
convertedAgentTools[`agent-${agentName}`] = chunkZTC3TLFM_cjs.makeCoreTool(
|
|
21684
21694
|
toolObj,
|
|
21685
21695
|
options,
|
|
21686
21696
|
void 0,
|
|
@@ -21901,7 +21911,7 @@ ${effectiveInstructions}`;
|
|
|
21901
21911
|
...observabilityContext,
|
|
21902
21912
|
tracingPolicy: this.#options?.tracingPolicy
|
|
21903
21913
|
};
|
|
21904
|
-
convertedWorkflowTools[`workflow-${workflowName}`] =
|
|
21914
|
+
convertedWorkflowTools[`workflow-${workflowName}`] = chunkZTC3TLFM_cjs.makeCoreTool(
|
|
21905
21915
|
toolObj,
|
|
21906
21916
|
options,
|
|
21907
21917
|
void 0,
|
|
@@ -21933,7 +21943,7 @@ ${effectiveInstructions}`;
|
|
|
21933
21943
|
let mastraProxy = void 0;
|
|
21934
21944
|
const logger = this.logger;
|
|
21935
21945
|
if (this.#mastra) {
|
|
21936
|
-
mastraProxy =
|
|
21946
|
+
mastraProxy = chunkZTC3TLFM_cjs.createMastraProxy({ mastra: this.#mastra, logger });
|
|
21937
21947
|
}
|
|
21938
21948
|
const assignedTools = await this.listAssignedTools({
|
|
21939
21949
|
runId,
|
|
@@ -22185,7 +22195,7 @@ ${effectiveInstructions}`;
|
|
|
22185
22195
|
const resolvedModel = await this.resolveModelConfig(selection, requestContext);
|
|
22186
22196
|
this.assertSupportsPreparedModels(resolvedModel);
|
|
22187
22197
|
let headers;
|
|
22188
|
-
if (resolvedModel instanceof
|
|
22198
|
+
if (resolvedModel instanceof chunkJZBAUINL_cjs.ModelRouterLanguageModel) {
|
|
22189
22199
|
headers = resolvedModel.config?.headers;
|
|
22190
22200
|
}
|
|
22191
22201
|
return [
|
|
@@ -22217,7 +22227,7 @@ ${effectiveInstructions}`;
|
|
|
22217
22227
|
throw mastraError;
|
|
22218
22228
|
}
|
|
22219
22229
|
let headers;
|
|
22220
|
-
if (model instanceof
|
|
22230
|
+
if (model instanceof chunkJZBAUINL_cjs.ModelRouterLanguageModel) {
|
|
22221
22231
|
headers = model.config?.headers;
|
|
22222
22232
|
}
|
|
22223
22233
|
return {
|
|
@@ -22259,13 +22269,15 @@ ${effectiveInstructions}`;
|
|
|
22259
22269
|
});
|
|
22260
22270
|
const resourceId = resourceIdFromContext || options.memory?.resource || snapshotMemoryInfo?.resourceId;
|
|
22261
22271
|
const memoryConfig = options.memory?.options;
|
|
22262
|
-
if (resourceId && threadFromArgs && !this.hasOwnMemory()) {
|
|
22263
|
-
this.logger.warn("No memory is configured but resourceId and threadId were passed in args", { agent: this.name });
|
|
22264
|
-
}
|
|
22265
22272
|
const llm = await this.getLLM({
|
|
22266
22273
|
requestContext,
|
|
22267
22274
|
model: options.model
|
|
22268
22275
|
});
|
|
22276
|
+
const resolvedModel = llm.getModel();
|
|
22277
|
+
const isGatewayModel = resolvedModel instanceof chunkJZBAUINL_cjs.ModelRouterLanguageModel && resolvedModel.gatewayId === "mastra";
|
|
22278
|
+
if (resourceId && threadFromArgs && !this.hasOwnMemory() && !isGatewayModel) {
|
|
22279
|
+
this.logger.warn("No memory is configured but resourceId and threadId were passed in args", { agent: this.name });
|
|
22280
|
+
}
|
|
22269
22281
|
if ("structuredOutput" in options && options.structuredOutput?.schema && !options.structuredOutput?.model) {
|
|
22270
22282
|
const structuredOutputModel = llm.getModel();
|
|
22271
22283
|
const targetProvider = structuredOutputModel.provider;
|
|
@@ -22673,7 +22685,7 @@ ${effectiveInstructions}`;
|
|
|
22673
22685
|
const defaultOptions = await this.getDefaultOptions({
|
|
22674
22686
|
requestContext: options?.requestContext
|
|
22675
22687
|
});
|
|
22676
|
-
const mergedOptions =
|
|
22688
|
+
const mergedOptions = chunkZTC3TLFM_cjs.deepMerge(
|
|
22677
22689
|
defaultOptions,
|
|
22678
22690
|
options ?? {}
|
|
22679
22691
|
);
|
|
@@ -22744,7 +22756,7 @@ ${effectiveInstructions}`;
|
|
|
22744
22756
|
const defaultOptions = await this.getDefaultOptions({
|
|
22745
22757
|
requestContext: streamOptions?.requestContext
|
|
22746
22758
|
});
|
|
22747
|
-
const mergedOptions =
|
|
22759
|
+
const mergedOptions = chunkZTC3TLFM_cjs.deepMerge(
|
|
22748
22760
|
defaultOptions,
|
|
22749
22761
|
streamOptions ?? {}
|
|
22750
22762
|
);
|
|
@@ -22809,7 +22821,7 @@ ${effectiveInstructions}`;
|
|
|
22809
22821
|
const defaultOptions = await this.getDefaultOptions({
|
|
22810
22822
|
requestContext: streamOptions?.requestContext
|
|
22811
22823
|
});
|
|
22812
|
-
let mergedStreamOptions =
|
|
22824
|
+
let mergedStreamOptions = chunkZTC3TLFM_cjs.deepMerge(
|
|
22813
22825
|
defaultOptions,
|
|
22814
22826
|
streamOptions ?? {}
|
|
22815
22827
|
);
|
|
@@ -22875,7 +22887,7 @@ ${effectiveInstructions}`;
|
|
|
22875
22887
|
const defaultOptions = await this.getDefaultOptions({
|
|
22876
22888
|
requestContext: options?.requestContext
|
|
22877
22889
|
});
|
|
22878
|
-
const mergedOptions =
|
|
22890
|
+
const mergedOptions = chunkZTC3TLFM_cjs.deepMerge(
|
|
22879
22891
|
defaultOptions,
|
|
22880
22892
|
options ?? {}
|
|
22881
22893
|
);
|
|
@@ -24501,7 +24513,7 @@ var TokenLimiterProcessor = class _TokenLimiterProcessor {
|
|
|
24501
24513
|
return new TiktokenClass(this.customEncoding);
|
|
24502
24514
|
});
|
|
24503
24515
|
} else {
|
|
24504
|
-
this.encoderPromise =
|
|
24516
|
+
this.encoderPromise = chunkAVRRH42W_cjs.getTiktoken();
|
|
24505
24517
|
}
|
|
24506
24518
|
}
|
|
24507
24519
|
return this.encoderPromise;
|
|
@@ -25408,7 +25420,7 @@ var ToolSearchProcessor = class {
|
|
|
25408
25420
|
minScore: options.search?.minScore ?? 0
|
|
25409
25421
|
};
|
|
25410
25422
|
this.ttl = options.ttl ?? 36e5;
|
|
25411
|
-
this.bm25Index = new
|
|
25423
|
+
this.bm25Index = new chunkAVRRH42W_cjs.BM25Index({}, TOOL_SEARCH_TOKENIZE_OPTIONS);
|
|
25412
25424
|
this.indexTools();
|
|
25413
25425
|
if (this.ttl > 0) {
|
|
25414
25426
|
this.scheduleCleanup();
|
|
@@ -26190,7 +26202,7 @@ var WorkingMemory = class {
|
|
|
26190
26202
|
return messageList;
|
|
26191
26203
|
}
|
|
26192
26204
|
generateEmptyFromSchemaInternal(schema) {
|
|
26193
|
-
const result =
|
|
26205
|
+
const result = chunkZTC3TLFM_cjs.generateEmptyFromSchema(schema);
|
|
26194
26206
|
return Object.keys(result).length > 0 ? result : null;
|
|
26195
26207
|
}
|
|
26196
26208
|
getWorkingMemoryToolInstruction({
|
|
@@ -26393,7 +26405,7 @@ var SemanticRecall = class {
|
|
|
26393
26405
|
*/
|
|
26394
26406
|
formatCrossThreadMessages(messages, currentThreadId) {
|
|
26395
26407
|
let result = ``;
|
|
26396
|
-
const v1Messages = new
|
|
26408
|
+
const v1Messages = new chunkDOPULILR_cjs.MessageList().add(messages, "memory").get.all.v1();
|
|
26397
26409
|
let lastYmd = null;
|
|
26398
26410
|
for (const msg of v1Messages) {
|
|
26399
26411
|
const date = msg.createdAt;
|
|
@@ -26835,7 +26847,7 @@ https://mastra.ai/en/docs/memory/semantic-recall`
|
|
|
26835
26847
|
);
|
|
26836
26848
|
}
|
|
26837
26849
|
if (typeof config.embedder === "string") {
|
|
26838
|
-
this.embedder = new
|
|
26850
|
+
this.embedder = new chunkJZBAUINL_cjs.ModelRouterEmbeddingModel(config.embedder);
|
|
26839
26851
|
} else {
|
|
26840
26852
|
this.embedder = config.embedder;
|
|
26841
26853
|
}
|
|
@@ -26848,7 +26860,7 @@ https://mastra.ai/en/docs/memory/semantic-recall`
|
|
|
26848
26860
|
}
|
|
26849
26861
|
if (config.embedder) {
|
|
26850
26862
|
if (typeof config.embedder === "string") {
|
|
26851
|
-
this.embedder = new
|
|
26863
|
+
this.embedder = new chunkJZBAUINL_cjs.ModelRouterEmbeddingModel(config.embedder);
|
|
26852
26864
|
} else {
|
|
26853
26865
|
this.embedder = config.embedder;
|
|
26854
26866
|
}
|
|
@@ -26888,7 +26900,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
26888
26900
|
}
|
|
26889
26901
|
setEmbedder(embedder, embedderOptions) {
|
|
26890
26902
|
if (typeof embedder === "string") {
|
|
26891
|
-
this.embedder = new
|
|
26903
|
+
this.embedder = new chunkJZBAUINL_cjs.ModelRouterEmbeddingModel(embedder);
|
|
26892
26904
|
} else {
|
|
26893
26905
|
this.embedder = embedder;
|
|
26894
26906
|
}
|
|
@@ -26985,7 +26997,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
26985
26997
|
"The threads.generateTitle option has been moved. Use the top-level generateTitle option instead."
|
|
26986
26998
|
);
|
|
26987
26999
|
}
|
|
26988
|
-
const mergedConfig =
|
|
27000
|
+
const mergedConfig = chunkZTC3TLFM_cjs.deepMerge(this.threadConfig, config || {});
|
|
26989
27001
|
if (typeof config?.workingMemory === "object" && config.workingMemory?.schema && typeof mergedConfig.workingMemory === "object") {
|
|
26990
27002
|
mergedConfig.workingMemory.schema = config.workingMemory.schema;
|
|
26991
27003
|
}
|
|
@@ -27337,7 +27349,7 @@ var MockMemory = class extends MastraMemory {
|
|
|
27337
27349
|
} = {}) {
|
|
27338
27350
|
super({
|
|
27339
27351
|
name: "mock",
|
|
27340
|
-
storage: storage || new
|
|
27352
|
+
storage: storage || new chunkK7TAXUW5_cjs.InMemoryStore(),
|
|
27341
27353
|
options: {
|
|
27342
27354
|
...options,
|
|
27343
27355
|
workingMemory: enableWorkingMemory ? { enabled: true, template: workingMemoryTemplate } : options?.workingMemory,
|
|
@@ -27648,5 +27660,5 @@ exports.validateStepRequestContext = validateStepRequestContext;
|
|
|
27648
27660
|
exports.validateStepResumeData = validateStepResumeData;
|
|
27649
27661
|
exports.validateStepStateData = validateStepStateData;
|
|
27650
27662
|
exports.validateStepSuspendData = validateStepSuspendData;
|
|
27651
|
-
//# sourceMappingURL=chunk-
|
|
27652
|
-
//# sourceMappingURL=chunk-
|
|
27663
|
+
//# sourceMappingURL=chunk-QF4KRWYU.cjs.map
|
|
27664
|
+
//# sourceMappingURL=chunk-QF4KRWYU.cjs.map
|