@mastra/core 1.14.0-alpha.2 → 1.14.0-alpha.3
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 +12 -0
- package/dist/agent/agent.d.ts +1 -1
- 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/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/agent/types.d.ts +1 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/{chunk-PV2DBPYF.js → chunk-3X5TJK3I.js} +3 -3
- package/dist/{chunk-PV2DBPYF.js.map → chunk-3X5TJK3I.js.map} +1 -1
- package/dist/{chunk-XVH7SCZN.cjs → chunk-4334N37E.cjs} +5 -5
- package/dist/{chunk-XVH7SCZN.cjs.map → chunk-4334N37E.cjs.map} +1 -1
- package/dist/{chunk-KKNT7W4Q.js → chunk-62KO5UTR.js} +4 -4
- package/dist/{chunk-KKNT7W4Q.js.map → chunk-62KO5UTR.js.map} +1 -1
- package/dist/{chunk-OGR427FH.js → chunk-A4GHYWQL.js} +3 -3
- package/dist/{chunk-OGR427FH.js.map → chunk-A4GHYWQL.js.map} +1 -1
- package/dist/{chunk-2FDGDAJQ.cjs → chunk-C3D2EKGM.cjs} +3 -3
- package/dist/{chunk-2FDGDAJQ.cjs.map → chunk-C3D2EKGM.cjs.map} +1 -1
- package/dist/{chunk-SRVR5Z2F.js → chunk-EBQALGNN.js} +4 -4
- package/dist/{chunk-SRVR5Z2F.js.map → chunk-EBQALGNN.js.map} +1 -1
- package/dist/{chunk-UHO57W6H.cjs → chunk-EEEPQC2V.cjs} +7 -7
- package/dist/{chunk-UHO57W6H.cjs.map → chunk-EEEPQC2V.cjs.map} +1 -1
- package/dist/{chunk-SRNRUDZ2.cjs → chunk-K4TJAFNZ.cjs} +15 -15
- package/dist/{chunk-SRNRUDZ2.cjs.map → chunk-K4TJAFNZ.cjs.map} +1 -1
- package/dist/{chunk-EAKNCJKL.cjs → chunk-K5H3MT3B.cjs} +6 -6
- package/dist/{chunk-EAKNCJKL.cjs.map → chunk-K5H3MT3B.cjs.map} +1 -1
- package/dist/{chunk-ZSFSSMFT.cjs → chunk-KIL4FXNV.cjs} +75 -75
- package/dist/{chunk-ZSFSSMFT.cjs.map → chunk-KIL4FXNV.cjs.map} +1 -1
- package/dist/{chunk-EH5D56XV.cjs → chunk-MCYRJIZP.cjs} +6 -6
- package/dist/{chunk-EH5D56XV.cjs.map → chunk-MCYRJIZP.cjs.map} +1 -1
- package/dist/{chunk-W2LUCUUP.cjs → chunk-NN4C4AVA.cjs} +9 -3
- package/dist/chunk-NN4C4AVA.cjs.map +1 -0
- package/dist/{chunk-5WKCTOYN.js → chunk-NUIDV2VL.js} +5 -5
- package/dist/{chunk-5WKCTOYN.js.map → chunk-NUIDV2VL.js.map} +1 -1
- package/dist/{chunk-BMKSUZBT.cjs → chunk-NWC75FLU.cjs} +7 -6
- package/dist/chunk-NWC75FLU.cjs.map +1 -0
- package/dist/{chunk-3TECGW34.js → chunk-PDUI6NSB.js} +3 -3
- package/dist/{chunk-3TECGW34.js.map → chunk-PDUI6NSB.js.map} +1 -1
- package/dist/{chunk-YSQC2LEG.cjs → chunk-Q6MFBJ66.cjs} +9 -9
- package/dist/{chunk-YSQC2LEG.cjs.map → chunk-Q6MFBJ66.cjs.map} +1 -1
- package/dist/{chunk-UWTB4U2X.js → chunk-RKYLFJS2.js} +18 -15
- package/dist/chunk-RKYLFJS2.js.map +1 -0
- package/dist/{chunk-II3LKO2G.js → chunk-SHQKQEG2.js} +4 -3
- package/dist/chunk-SHQKQEG2.js.map +1 -0
- package/dist/{chunk-QROAUTDP.js → chunk-SLEXQRTX.js} +3 -3
- package/dist/{chunk-QROAUTDP.js.map → chunk-SLEXQRTX.js.map} +1 -1
- package/dist/{chunk-LAFTYVLN.cjs → chunk-TSMQOXL6.cjs} +55 -55
- package/dist/{chunk-LAFTYVLN.cjs.map → chunk-TSMQOXL6.cjs.map} +1 -1
- package/dist/{chunk-B3KIJAOJ.cjs → chunk-U3YH4FWP.cjs} +185 -185
- package/dist/{chunk-B3KIJAOJ.cjs.map → chunk-U3YH4FWP.cjs.map} +1 -1
- package/dist/{chunk-FZNKE4DK.js → chunk-UGD4IU3X.js} +3 -3
- package/dist/{chunk-FZNKE4DK.js.map → chunk-UGD4IU3X.js.map} +1 -1
- package/dist/{chunk-MCAE3D3S.js → chunk-ULOKD3QT.js} +9 -3
- package/dist/chunk-ULOKD3QT.js.map +1 -0
- package/dist/{chunk-RQFAL5VW.cjs → chunk-VVWXPSQE.cjs} +61 -9
- package/dist/chunk-VVWXPSQE.cjs.map +1 -0
- package/dist/{chunk-5LHPEIQQ.js → chunk-WY4RQDAN.js} +60 -8
- package/dist/chunk-WY4RQDAN.js.map +1 -0
- package/dist/{chunk-445B4SO3.cjs → chunk-XB4RTECX.cjs} +53 -50
- package/dist/chunk-XB4RTECX.cjs.map +1 -0
- package/dist/{chunk-TFV75T4H.js → chunk-XPG4Y2LE.js} +8 -8
- package/dist/{chunk-TFV75T4H.js.map → chunk-XPG4Y2LE.js.map} +1 -1
- package/dist/{chunk-5UAF67E3.js → chunk-ZEV6ZTTJ.js} +6 -6
- package/dist/{chunk-5UAF67E3.js.map → chunk-ZEV6ZTTJ.js.map} +1 -1
- package/dist/datasets/index.cjs +17 -17
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +224 -224
- package/dist/docs/references/docs-memory-working-memory.md +1 -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 +11 -11
- package/dist/harness/index.js +6 -6
- package/dist/index.cjs +2 -2
- package/dist/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 +19 -1
- package/dist/loop/index.cjs +14 -14
- package/dist/loop/index.js +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/memory/types.d.ts +3 -7
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/models-dev-YCVPUGGP.js +3 -0
- package/dist/{models-dev-F65PLXGJ.js.map → models-dev-YCVPUGGP.js.map} +1 -1
- package/dist/models-dev-ZDDICXZ3.cjs +12 -0
- package/dist/{models-dev-E24MAXL2.cjs.map → models-dev-ZDDICXZ3.cjs.map} +1 -1
- package/dist/netlify-6YMLOPZS.js +3 -0
- package/dist/{netlify-NYUZ5ZTO.js.map → netlify-6YMLOPZS.js.map} +1 -1
- package/dist/netlify-QHUTWBTR.cjs +12 -0
- package/dist/{netlify-FT3VYX27.cjs.map → netlify-QHUTWBTR.cjs.map} +1 -1
- package/dist/processor-provider/index.cjs +10 -10
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +42 -42
- package/dist/processors/index.js +1 -1
- package/dist/provider-registry-DZYIED4J.js +3 -0
- package/dist/{provider-registry-5R2TUINW.js.map → provider-registry-DZYIED4J.js.map} +1 -1
- package/dist/provider-registry-NSDAYLQL.cjs +40 -0
- package/dist/{provider-registry-TVYED7F2.cjs.map → provider-registry-NSDAYLQL.cjs.map} +1 -1
- package/dist/provider-registry.json +56 -4
- 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/tool-loop-agent/index.cjs +4 -4
- package/dist/tool-loop-agent/index.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 +67 -67
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/line-utils.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/llm/model/provider-types.generated.d.ts +19 -1
- package/dist/chunk-445B4SO3.cjs.map +0 -1
- package/dist/chunk-5LHPEIQQ.js.map +0 -1
- package/dist/chunk-BMKSUZBT.cjs.map +0 -1
- package/dist/chunk-II3LKO2G.js.map +0 -1
- package/dist/chunk-MCAE3D3S.js.map +0 -1
- package/dist/chunk-RQFAL5VW.cjs.map +0 -1
- package/dist/chunk-UWTB4U2X.js.map +0 -1
- package/dist/chunk-W2LUCUUP.cjs.map +0 -1
- package/dist/models-dev-E24MAXL2.cjs +0 -12
- package/dist/models-dev-F65PLXGJ.js +0 -3
- package/dist/netlify-FT3VYX27.cjs +0 -12
- package/dist/netlify-NYUZ5ZTO.js +0 -3
- package/dist/provider-registry-5R2TUINW.js +0 -3
- package/dist/provider-registry-TVYED7F2.cjs +0 -40
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkLDLSSJ7X_cjs = require('./chunk-LDLSSJ7X.cjs');
|
|
4
4
|
var chunkZCBG4ZQT_cjs = require('./chunk-ZCBG4ZQT.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var chunkNWC75FLU_cjs = require('./chunk-NWC75FLU.cjs');
|
|
6
|
+
var chunkK5H3MT3B_cjs = require('./chunk-K5H3MT3B.cjs');
|
|
7
|
+
var chunkNN4C4AVA_cjs = require('./chunk-NN4C4AVA.cjs');
|
|
8
8
|
var chunkVBVOKSJK_cjs = require('./chunk-VBVOKSJK.cjs');
|
|
9
9
|
var chunkCFMZZDO2_cjs = require('./chunk-CFMZZDO2.cjs');
|
|
10
10
|
var chunkMR7ZWBL6_cjs = require('./chunk-MR7ZWBL6.cjs');
|
|
11
|
-
var
|
|
11
|
+
var chunkKIL4FXNV_cjs = require('./chunk-KIL4FXNV.cjs');
|
|
12
12
|
var chunkJ7Q3CZI5_cjs = require('./chunk-J7Q3CZI5.cjs');
|
|
13
13
|
var chunk6BJ7XHRH_cjs = require('./chunk-6BJ7XHRH.cjs');
|
|
14
14
|
var chunkOQDRPRKM_cjs = require('./chunk-OQDRPRKM.cjs');
|
|
@@ -1297,7 +1297,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1297
1297
|
writer
|
|
1298
1298
|
});
|
|
1299
1299
|
const mutations = messageList.stopRecording();
|
|
1300
|
-
if (processResult instanceof
|
|
1300
|
+
if (processResult instanceof chunkNN4C4AVA_cjs.MessageList) {
|
|
1301
1301
|
if (processResult !== messageList) {
|
|
1302
1302
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
1303
1303
|
category: "USER",
|
|
@@ -1591,7 +1591,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1591
1591
|
retryCount
|
|
1592
1592
|
});
|
|
1593
1593
|
let mutations;
|
|
1594
|
-
if (result instanceof
|
|
1594
|
+
if (result instanceof chunkNN4C4AVA_cjs.MessageList) {
|
|
1595
1595
|
if (result !== messageList) {
|
|
1596
1596
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
1597
1597
|
category: "USER",
|
|
@@ -1962,7 +1962,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1962
1962
|
writer
|
|
1963
1963
|
});
|
|
1964
1964
|
const mutations = messageList.stopRecording();
|
|
1965
|
-
if (result instanceof
|
|
1965
|
+
if (result instanceof chunkNN4C4AVA_cjs.MessageList) {
|
|
1966
1966
|
if (result !== messageList) {
|
|
1967
1967
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
1968
1968
|
category: "USER",
|
|
@@ -2035,7 +2035,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
2035
2035
|
processor,
|
|
2036
2036
|
stepNumber
|
|
2037
2037
|
}) {
|
|
2038
|
-
if (result instanceof
|
|
2038
|
+
if (result instanceof chunkNN4C4AVA_cjs.MessageList) {
|
|
2039
2039
|
if (result !== messageList) {
|
|
2040
2040
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
2041
2041
|
category: "USER",
|
|
@@ -2070,7 +2070,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
2070
2070
|
}
|
|
2071
2071
|
const { model: _model, ...rest } = result;
|
|
2072
2072
|
if (result.model) {
|
|
2073
|
-
const resolvedModel = await
|
|
2073
|
+
const resolvedModel = await chunkKIL4FXNV_cjs.resolveModelConfig(result.model);
|
|
2074
2074
|
const isSupported = isSupportedLanguageModel(resolvedModel);
|
|
2075
2075
|
if (!isSupported) {
|
|
2076
2076
|
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 ? chunkNN4C4AVA_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 chunkNN4C4AVA_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 chunkNN4C4AVA_cjs.DefaultGeneratedFileWithType({
|
|
4660
4660
|
data: chunk.payload.data,
|
|
4661
4661
|
mediaType: chunk.payload.mimeType
|
|
4662
4662
|
})
|
|
@@ -8677,7 +8677,7 @@ function createStepFromProcessor(processor) {
|
|
|
8677
8677
|
phase,
|
|
8678
8678
|
// Auto-create MessageList from messages if not provided
|
|
8679
8679
|
// This enables running processor workflows from the UI where messageList can't be serialized
|
|
8680
|
-
messageList: messageList ?? (Array.isArray(messages) ? new
|
|
8680
|
+
messageList: messageList ?? (Array.isArray(messages) ? new chunkNN4C4AVA_cjs.MessageList().add(messages, "input").addSystem(systemMessages ?? []) : void 0),
|
|
8681
8681
|
stepNumber,
|
|
8682
8682
|
systemMessages,
|
|
8683
8683
|
streamParts,
|
|
@@ -8734,7 +8734,7 @@ function createStepFromProcessor(processor) {
|
|
|
8734
8734
|
messageList: checkedMessageList,
|
|
8735
8735
|
systemMessages: systemMessages ?? []
|
|
8736
8736
|
});
|
|
8737
|
-
if (result instanceof
|
|
8737
|
+
if (result instanceof chunkNN4C4AVA_cjs.MessageList) {
|
|
8738
8738
|
if (result !== checkedMessageList) {
|
|
8739
8739
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
8740
8740
|
category: "USER" /* USER */,
|
|
@@ -8917,7 +8917,7 @@ function createStepFromProcessor(processor) {
|
|
|
8917
8917
|
messageList: passThrough.messageList,
|
|
8918
8918
|
result: passThrough.result ?? defaultResult
|
|
8919
8919
|
});
|
|
8920
|
-
if (result instanceof
|
|
8920
|
+
if (result instanceof chunkNN4C4AVA_cjs.MessageList) {
|
|
8921
8921
|
if (result !== passThrough.messageList) {
|
|
8922
8922
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
8923
8923
|
category: "USER" /* USER */,
|
|
@@ -8984,7 +8984,7 @@ function createStepFromProcessor(processor) {
|
|
|
8984
8984
|
systemMessages: systemMessages ?? [],
|
|
8985
8985
|
steps: steps ?? []
|
|
8986
8986
|
});
|
|
8987
|
-
if (result instanceof
|
|
8987
|
+
if (result instanceof chunkNN4C4AVA_cjs.MessageList) {
|
|
8988
8988
|
if (result !== checkedMessageList) {
|
|
8989
8989
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
8990
8990
|
category: "USER" /* USER */,
|
|
@@ -11350,7 +11350,7 @@ var MastraScorer = class _MastraScorer {
|
|
|
11350
11350
|
}
|
|
11351
11351
|
});
|
|
11352
11352
|
}
|
|
11353
|
-
const resolvedModel = await
|
|
11353
|
+
const resolvedModel = await chunkKIL4FXNV_cjs.resolveModelConfig(modelConfig, void 0, this.#mastra);
|
|
11354
11354
|
const judge = new Agent({
|
|
11355
11355
|
id: "judge",
|
|
11356
11356
|
name: "judge",
|
|
@@ -13007,7 +13007,7 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
|
|
|
13007
13007
|
}
|
|
13008
13008
|
});
|
|
13009
13009
|
let transportResolver;
|
|
13010
|
-
if (currentStep.model instanceof
|
|
13010
|
+
if (currentStep.model instanceof chunkKIL4FXNV_cjs.ModelRouterLanguageModel) {
|
|
13011
13011
|
const routerModel = currentStep.model;
|
|
13012
13012
|
transportResolver = () => routerModel._getStreamTransport();
|
|
13013
13013
|
}
|
|
@@ -13369,7 +13369,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13369
13369
|
toolInvocation: {
|
|
13370
13370
|
state: "result",
|
|
13371
13371
|
toolCallId: toolCall.toolCallId,
|
|
13372
|
-
toolName:
|
|
13372
|
+
toolName: chunkNN4C4AVA_cjs.sanitizeToolName(toolCall.toolName),
|
|
13373
13373
|
args: toolCall.args,
|
|
13374
13374
|
result: toolCall.error?.message ?? toolCall.error
|
|
13375
13375
|
},
|
|
@@ -13404,7 +13404,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13404
13404
|
toolInvocation: {
|
|
13405
13405
|
state: "result",
|
|
13406
13406
|
toolCallId: toolCall.toolCallId,
|
|
13407
|
-
toolName:
|
|
13407
|
+
toolName: chunkNN4C4AVA_cjs.sanitizeToolName(toolCall.toolName),
|
|
13408
13408
|
args: toolCall.args,
|
|
13409
13409
|
result: toolCall.result
|
|
13410
13410
|
},
|
|
@@ -13461,7 +13461,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13461
13461
|
toolInvocation: {
|
|
13462
13462
|
state: "result",
|
|
13463
13463
|
toolCallId: toolCall.toolCallId,
|
|
13464
|
-
toolName:
|
|
13464
|
+
toolName: chunkNN4C4AVA_cjs.sanitizeToolName(toolCall.toolName),
|
|
13465
13465
|
args: toolCall.args,
|
|
13466
13466
|
result: toolCall.result
|
|
13467
13467
|
},
|
|
@@ -15030,7 +15030,7 @@ async function prepareMemoryStep({
|
|
|
15030
15030
|
);
|
|
15031
15031
|
}
|
|
15032
15032
|
} else {
|
|
15033
|
-
const messageList = new
|
|
15033
|
+
const messageList = new chunkNN4C4AVA_cjs.MessageList({
|
|
15034
15034
|
threadId: thread?.id,
|
|
15035
15035
|
resourceId: thread?.resourceId
|
|
15036
15036
|
});
|
|
@@ -15087,7 +15087,7 @@ async function saveMessagesWithProcessors(memory, messages, processorRunner, con
|
|
|
15087
15087
|
await memory.saveMessages({ messages });
|
|
15088
15088
|
return;
|
|
15089
15089
|
}
|
|
15090
|
-
const messageList = new
|
|
15090
|
+
const messageList = new chunkNN4C4AVA_cjs.MessageList();
|
|
15091
15091
|
for (const msg of messages) {
|
|
15092
15092
|
messageList.add(msg, "response");
|
|
15093
15093
|
}
|
|
@@ -16524,7 +16524,7 @@ async function networkLoop({
|
|
|
16524
16524
|
"resumeData": "string"
|
|
16525
16525
|
}
|
|
16526
16526
|
`;
|
|
16527
|
-
const messageList = new
|
|
16527
|
+
const messageList = new chunkNN4C4AVA_cjs.MessageList();
|
|
16528
16528
|
messageList.addSystem(systemInstructions);
|
|
16529
16529
|
messageList.add(task, "user");
|
|
16530
16530
|
const result = llm.stream({
|
|
@@ -17180,7 +17180,7 @@ var AgentLegacyHandler = class {
|
|
|
17180
17180
|
methodType: methodType === "generate" ? "generateLegacy" : "streamLegacy",
|
|
17181
17181
|
memoryConfig
|
|
17182
17182
|
});
|
|
17183
|
-
let messageList = new
|
|
17183
|
+
let messageList = new chunkNN4C4AVA_cjs.MessageList({
|
|
17184
17184
|
threadId,
|
|
17185
17185
|
resourceId,
|
|
17186
17186
|
generateMessageId: this.capabilities.mastra?.generateId?.bind(this.capabilities.mastra),
|
|
@@ -17349,7 +17349,7 @@ var AgentLegacyHandler = class {
|
|
|
17349
17349
|
result: resToLog,
|
|
17350
17350
|
threadId
|
|
17351
17351
|
});
|
|
17352
|
-
const messageListResponses = new
|
|
17352
|
+
const messageListResponses = new chunkNN4C4AVA_cjs.MessageList({
|
|
17353
17353
|
threadId,
|
|
17354
17354
|
resourceId,
|
|
17355
17355
|
generateMessageId: this.capabilities.mastra?.generateId?.bind(this.capabilities.mastra),
|
|
@@ -18499,7 +18499,7 @@ var prepareToolsStepOutputSchema = z9.z.object({
|
|
|
18499
18499
|
var prepareMemoryStepOutputSchema = z9.z.object({
|
|
18500
18500
|
threadExists: z9.z.boolean(),
|
|
18501
18501
|
thread: storageThreadSchema.optional(),
|
|
18502
|
-
messageList: z9.z.instanceof(
|
|
18502
|
+
messageList: z9.z.instanceof(chunkNN4C4AVA_cjs.MessageList),
|
|
18503
18503
|
/** Shared processor states map that persists across loop iterations for both input and output processors */
|
|
18504
18504
|
processorStates: z9.z.instanceof(Map),
|
|
18505
18505
|
/** Tripwire data when input processor triggered abort */
|
|
@@ -18540,7 +18540,7 @@ function createPrepareMemoryStep({
|
|
|
18540
18540
|
execute: async ({ ...rest }) => {
|
|
18541
18541
|
const observabilityContext = chunkLIRWMGGI_cjs.resolveObservabilityContext(rest);
|
|
18542
18542
|
const thread = threadFromArgs;
|
|
18543
|
-
const messageList = new
|
|
18543
|
+
const messageList = new chunkNN4C4AVA_cjs.MessageList({
|
|
18544
18544
|
threadId: thread?.id,
|
|
18545
18545
|
resourceId,
|
|
18546
18546
|
generateMessageId: capabilities.generateMessageId,
|
|
@@ -18988,7 +18988,7 @@ var Agent = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
18988
18988
|
this.#maxProcessorRetries = config.maxProcessorRetries;
|
|
18989
18989
|
}
|
|
18990
18990
|
if (config.requestContextSchema) {
|
|
18991
|
-
this.#requestContextSchema = config.requestContextSchema;
|
|
18991
|
+
this.#requestContextSchema = chunkVWJ7H3MJ_cjs.toStandardSchema(config.requestContextSchema);
|
|
18992
18992
|
}
|
|
18993
18993
|
this._agentNetworkAppend = config._agentNetworkAppend || false;
|
|
18994
18994
|
}
|
|
@@ -19032,12 +19032,15 @@ var Agent = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
19032
19032
|
* Throws an error if validation fails.
|
|
19033
19033
|
*/
|
|
19034
19034
|
async #validateRequestContext(requestContext) {
|
|
19035
|
-
if (this.#requestContextSchema
|
|
19035
|
+
if (this.#requestContextSchema) {
|
|
19036
19036
|
const contextValues = requestContext?.all ?? {};
|
|
19037
|
-
const
|
|
19038
|
-
if (
|
|
19039
|
-
const errors =
|
|
19040
|
-
const errorMessages = errors.map((e) =>
|
|
19037
|
+
const validation = await this.#requestContextSchema["~standard"].validate(contextValues);
|
|
19038
|
+
if (validation.issues) {
|
|
19039
|
+
const errors = validation.issues;
|
|
19040
|
+
const errorMessages = errors.map((e) => {
|
|
19041
|
+
const pathStr = e.path?.map((p) => typeof p === "object" ? p.key : p).join(".");
|
|
19042
|
+
return `- ${pathStr}: ${e.message}`;
|
|
19043
|
+
}).join("\n");
|
|
19041
19044
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
19042
19045
|
id: "AGENT_REQUEST_CONTEXT_VALIDATION_FAILED",
|
|
19043
19046
|
domain: "AGENT" /* AGENT */,
|
|
@@ -19857,7 +19860,7 @@ ${errorMessages}`,
|
|
|
19857
19860
|
*/
|
|
19858
19861
|
async resolveModelConfig(modelConfig, requestContext) {
|
|
19859
19862
|
try {
|
|
19860
|
-
return await
|
|
19863
|
+
return await chunkKIL4FXNV_cjs.resolveModelConfig(modelConfig, requestContext, this.#mastra);
|
|
19861
19864
|
} catch (error) {
|
|
19862
19865
|
const mastraError = new chunk4U7ZLI36_cjs.MastraError({
|
|
19863
19866
|
id: "AGENT_GET_MODEL_MISSING_MODEL_INSTANCE",
|
|
@@ -20185,7 +20188,7 @@ ${errorMessages}`,
|
|
|
20185
20188
|
}) {
|
|
20186
20189
|
const observabilityContext = chunkLIRWMGGI_cjs.resolveObservabilityContext(rest);
|
|
20187
20190
|
const llm = await this.getLLM({ requestContext, model });
|
|
20188
|
-
const normMessage = new
|
|
20191
|
+
const normMessage = new chunkNN4C4AVA_cjs.MessageList().add(message, "user").get.all.aiV5.ui().at(-1);
|
|
20189
20192
|
if (!normMessage) {
|
|
20190
20193
|
throw new Error(`Could not generate title from input ${JSON.stringify(message)}`);
|
|
20191
20194
|
}
|
|
@@ -20208,7 +20211,7 @@ ${errorMessages}`,
|
|
|
20208
20211
|
const systemInstructions = await this.resolveTitleInstructions(requestContext, instructions);
|
|
20209
20212
|
let text = "";
|
|
20210
20213
|
if (isSupportedLanguageModel(llm.getModel())) {
|
|
20211
|
-
const messageList = new
|
|
20214
|
+
const messageList = new chunkNN4C4AVA_cjs.MessageList().add(
|
|
20212
20215
|
[
|
|
20213
20216
|
{
|
|
20214
20217
|
role: "system",
|
|
@@ -20261,7 +20264,7 @@ ${errorMessages}`,
|
|
|
20261
20264
|
async genTitle(userMessage, requestContext, observabilityContext, model, instructions) {
|
|
20262
20265
|
try {
|
|
20263
20266
|
if (userMessage) {
|
|
20264
|
-
const normMessage = new
|
|
20267
|
+
const normMessage = new chunkNN4C4AVA_cjs.MessageList().add(userMessage, "user").get.all.ui().at(-1);
|
|
20265
20268
|
if (normMessage) {
|
|
20266
20269
|
return await this.generateTitleFromUserMessage({
|
|
20267
20270
|
message: normMessage,
|
|
@@ -20371,7 +20374,7 @@ ${errorMessages}`,
|
|
|
20371
20374
|
if (!workspace) {
|
|
20372
20375
|
return convertedWorkspaceTools;
|
|
20373
20376
|
}
|
|
20374
|
-
const workspaceTools =
|
|
20377
|
+
const workspaceTools = chunkNWC75FLU_cjs.createWorkspaceTools(workspace);
|
|
20375
20378
|
if (Object.keys(workspaceTools).length > 0) {
|
|
20376
20379
|
this.logger.debug(`[Agent:${this.name}] - Adding workspace tools: ${Object.keys(workspaceTools).join(", ")}`, {
|
|
20377
20380
|
runId
|
|
@@ -20424,7 +20427,7 @@ ${errorMessages}`,
|
|
|
20424
20427
|
if (!workspace?.skills) {
|
|
20425
20428
|
return convertedSkillTools;
|
|
20426
20429
|
}
|
|
20427
|
-
const skillTools =
|
|
20430
|
+
const skillTools = chunkNWC75FLU_cjs.createSkillTools(workspace.skills);
|
|
20428
20431
|
if (Object.keys(skillTools).length > 0) {
|
|
20429
20432
|
this.logger.debug(`[Agent:${this.name}] - Adding skill tools: ${Object.keys(skillTools).join(", ")}`, {
|
|
20430
20433
|
runId
|
|
@@ -21920,7 +21923,7 @@ ${effectiveInstructions}`;
|
|
|
21920
21923
|
const resolvedModel = await this.resolveModelConfig(selection, requestContext);
|
|
21921
21924
|
this.assertSupportsPreparedModels(resolvedModel);
|
|
21922
21925
|
let headers;
|
|
21923
|
-
if (resolvedModel instanceof
|
|
21926
|
+
if (resolvedModel instanceof chunkKIL4FXNV_cjs.ModelRouterLanguageModel) {
|
|
21924
21927
|
headers = resolvedModel.config?.headers;
|
|
21925
21928
|
}
|
|
21926
21929
|
return [
|
|
@@ -21953,7 +21956,7 @@ ${effectiveInstructions}`;
|
|
|
21953
21956
|
throw mastraError;
|
|
21954
21957
|
}
|
|
21955
21958
|
let headers;
|
|
21956
|
-
if (model instanceof
|
|
21959
|
+
if (model instanceof chunkKIL4FXNV_cjs.ModelRouterLanguageModel) {
|
|
21957
21960
|
headers = model.config?.headers;
|
|
21958
21961
|
}
|
|
21959
21962
|
return {
|
|
@@ -24177,7 +24180,7 @@ var TokenLimiterProcessor = class _TokenLimiterProcessor {
|
|
|
24177
24180
|
return new TiktokenClass(this.customEncoding);
|
|
24178
24181
|
});
|
|
24179
24182
|
} else {
|
|
24180
|
-
this.encoderPromise =
|
|
24183
|
+
this.encoderPromise = chunkNWC75FLU_cjs.getTiktoken();
|
|
24181
24184
|
}
|
|
24182
24185
|
}
|
|
24183
24186
|
return this.encoderPromise;
|
|
@@ -24862,7 +24865,7 @@ var ToolSearchProcessor = class {
|
|
|
24862
24865
|
minScore: options.search?.minScore ?? 0
|
|
24863
24866
|
};
|
|
24864
24867
|
this.ttl = options.ttl ?? 36e5;
|
|
24865
|
-
this.bm25Index = new
|
|
24868
|
+
this.bm25Index = new chunkNWC75FLU_cjs.BM25Index({}, TOOL_SEARCH_TOKENIZE_OPTIONS);
|
|
24866
24869
|
this.indexTools();
|
|
24867
24870
|
if (this.ttl > 0) {
|
|
24868
24871
|
this.scheduleCleanup();
|
|
@@ -25594,7 +25597,7 @@ var SemanticRecall = class {
|
|
|
25594
25597
|
*/
|
|
25595
25598
|
formatCrossThreadMessages(messages, currentThreadId) {
|
|
25596
25599
|
let result = ``;
|
|
25597
|
-
const v1Messages = new
|
|
25600
|
+
const v1Messages = new chunkNN4C4AVA_cjs.MessageList().add(messages, "memory").get.all.v1();
|
|
25598
25601
|
let lastYmd = null;
|
|
25599
25602
|
for (const msg of v1Messages) {
|
|
25600
25603
|
const date = msg.createdAt;
|
|
@@ -26036,7 +26039,7 @@ https://mastra.ai/en/docs/memory/semantic-recall`
|
|
|
26036
26039
|
);
|
|
26037
26040
|
}
|
|
26038
26041
|
if (typeof config.embedder === "string") {
|
|
26039
|
-
this.embedder = new
|
|
26042
|
+
this.embedder = new chunkKIL4FXNV_cjs.ModelRouterEmbeddingModel(config.embedder);
|
|
26040
26043
|
} else {
|
|
26041
26044
|
this.embedder = config.embedder;
|
|
26042
26045
|
}
|
|
@@ -26075,7 +26078,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
26075
26078
|
}
|
|
26076
26079
|
setEmbedder(embedder, embedderOptions) {
|
|
26077
26080
|
if (typeof embedder === "string") {
|
|
26078
|
-
this.embedder = new
|
|
26081
|
+
this.embedder = new chunkKIL4FXNV_cjs.ModelRouterEmbeddingModel(embedder);
|
|
26079
26082
|
} else {
|
|
26080
26083
|
this.embedder = embedder;
|
|
26081
26084
|
}
|
|
@@ -26522,7 +26525,7 @@ var MockMemory = class extends MastraMemory {
|
|
|
26522
26525
|
} = {}) {
|
|
26523
26526
|
super({
|
|
26524
26527
|
name: "mock",
|
|
26525
|
-
storage: storage || new
|
|
26528
|
+
storage: storage || new chunkK5H3MT3B_cjs.InMemoryStore(),
|
|
26526
26529
|
options: {
|
|
26527
26530
|
workingMemory: enableWorkingMemory ? { enabled: true, template: workingMemoryTemplate } : void 0,
|
|
26528
26531
|
lastMessages: enableMessageHistory ? 10 : void 0
|
|
@@ -26830,5 +26833,5 @@ exports.validateStepRequestContext = validateStepRequestContext;
|
|
|
26830
26833
|
exports.validateStepResumeData = validateStepResumeData;
|
|
26831
26834
|
exports.validateStepStateData = validateStepStateData;
|
|
26832
26835
|
exports.validateStepSuspendData = validateStepSuspendData;
|
|
26833
|
-
//# sourceMappingURL=chunk-
|
|
26834
|
-
//# sourceMappingURL=chunk-
|
|
26836
|
+
//# sourceMappingURL=chunk-XB4RTECX.cjs.map
|
|
26837
|
+
//# sourceMappingURL=chunk-XB4RTECX.cjs.map
|