@mastra/core 1.0.0-beta.18 → 1.0.0-beta.19
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 +73 -0
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/index.cjs +11 -11
- package/dist/agent/index.js +2 -2
- package/dist/agent/message-list/index.cjs +3 -3
- package/dist/agent/message-list/index.d.ts +8 -0
- package/dist/agent/message-list/index.d.ts.map +1 -1
- package/dist/agent/message-list/index.js +1 -1
- package/dist/{chunk-ZSQ7L6AW.cjs → chunk-3LVC2TGA.cjs} +7 -7
- package/dist/{chunk-ZSQ7L6AW.cjs.map → chunk-3LVC2TGA.cjs.map} +1 -1
- package/dist/{chunk-JBEKXEX6.js → chunk-43VR5ZNS.js} +3 -3
- package/dist/{chunk-JBEKXEX6.js.map → chunk-43VR5ZNS.js.map} +1 -1
- package/dist/{chunk-G6YCU7HJ.cjs → chunk-4BYMMTK6.cjs} +5 -5
- package/dist/{chunk-G6YCU7HJ.cjs.map → chunk-4BYMMTK6.cjs.map} +1 -1
- package/dist/{chunk-CHVWQDMP.js → chunk-5ABMEQEN.js} +86 -44
- package/dist/chunk-5ABMEQEN.js.map +1 -0
- package/dist/{chunk-XIYLL4DN.cjs → chunk-5ISEMRYZ.cjs} +87 -45
- package/dist/chunk-5ISEMRYZ.cjs.map +1 -0
- package/dist/{chunk-6R4744NH.js → chunk-6CJM5Y6Z.js} +4 -4
- package/dist/{chunk-6R4744NH.js.map → chunk-6CJM5Y6Z.js.map} +1 -1
- package/dist/{chunk-O4YSWWLB.cjs → chunk-ABHX6L4P.cjs} +20 -3
- package/dist/chunk-ABHX6L4P.cjs.map +1 -0
- package/dist/{chunk-IY5QWADY.cjs → chunk-DE4ZHUSC.cjs} +14 -14
- package/dist/{chunk-IY5QWADY.cjs.map → chunk-DE4ZHUSC.cjs.map} +1 -1
- package/dist/{chunk-SDR22R4D.cjs → chunk-E77HNO5E.cjs} +14 -14
- package/dist/{chunk-SDR22R4D.cjs.map → chunk-E77HNO5E.cjs.map} +1 -1
- package/dist/{chunk-QXL3F3T2.js → chunk-HUHM6BXV.js} +50 -6
- package/dist/chunk-HUHM6BXV.js.map +1 -0
- package/dist/{chunk-BWZ6UOBF.cjs → chunk-I7HSIQRP.cjs} +15 -15
- package/dist/{chunk-BWZ6UOBF.cjs.map → chunk-I7HSIQRP.cjs.map} +1 -1
- package/dist/{chunk-RC7RN5MY.js → chunk-IIGB2Z6S.js} +3 -3
- package/dist/{chunk-RC7RN5MY.js.map → chunk-IIGB2Z6S.js.map} +1 -1
- package/dist/{chunk-4DFWV4IR.js → chunk-ILOI5OB3.js} +3 -3
- package/dist/chunk-ILOI5OB3.js.map +1 -0
- package/dist/{chunk-AAX7ZOM7.cjs → chunk-IMMRWP4F.cjs} +3 -3
- package/dist/chunk-IMMRWP4F.cjs.map +1 -0
- package/dist/{chunk-5YYAQUEF.js → chunk-M55RALU2.js} +20 -3
- package/dist/chunk-M55RALU2.js.map +1 -0
- package/dist/{chunk-P3XQ3TNY.cjs → chunk-MV7R7B6Z.cjs} +30 -30
- package/dist/{chunk-P3XQ3TNY.cjs.map → chunk-MV7R7B6Z.cjs.map} +1 -1
- package/dist/{chunk-EMLEZXTQ.cjs → chunk-MVLOJX6I.cjs} +50 -6
- package/dist/chunk-MVLOJX6I.cjs.map +1 -0
- package/dist/{chunk-SGRMJZMJ.cjs → chunk-N55KRGVI.cjs} +6 -6
- package/dist/{chunk-SGRMJZMJ.cjs.map → chunk-N55KRGVI.cjs.map} +1 -1
- package/dist/{chunk-2XX35XRX.js → chunk-O3DUSIUY.js} +35 -20
- package/dist/chunk-O3DUSIUY.js.map +1 -0
- package/dist/{chunk-Y52PV3W4.js → chunk-OSXQXATR.js} +4 -4
- package/dist/{chunk-Y52PV3W4.js.map → chunk-OSXQXATR.js.map} +1 -1
- package/dist/{chunk-GFALVOBW.cjs → chunk-S6HUG6SH.cjs} +82 -67
- package/dist/chunk-S6HUG6SH.cjs.map +1 -0
- package/dist/{chunk-NGRUGDFP.cjs → chunk-TRSSKBDY.cjs} +18 -18
- package/dist/{chunk-NGRUGDFP.cjs.map → chunk-TRSSKBDY.cjs.map} +1 -1
- package/dist/{chunk-2OOMJRXZ.cjs → chunk-UT6MASE5.cjs} +3 -3
- package/dist/{chunk-2OOMJRXZ.cjs.map → chunk-UT6MASE5.cjs.map} +1 -1
- package/dist/{chunk-AR5CF3IN.js → chunk-WDXYPI3P.js} +3 -3
- package/dist/{chunk-AR5CF3IN.js.map → chunk-WDXYPI3P.js.map} +1 -1
- package/dist/{chunk-TI6D7CAN.js → chunk-XUQY6EIK.js} +4 -4
- package/dist/{chunk-TI6D7CAN.js.map → chunk-XUQY6EIK.js.map} +1 -1
- package/dist/{chunk-IHPCE24V.js → chunk-Y3PUB5GS.js} +7 -7
- package/dist/{chunk-IHPCE24V.js.map → chunk-Y3PUB5GS.js.map} +1 -1
- package/dist/{chunk-ABMWK6JU.js → chunk-Z2JFMLEA.js} +3 -3
- package/dist/{chunk-ABMWK6JU.js.map → chunk-Z2JFMLEA.js.map} +1 -1
- package/dist/{chunk-POSO2X6D.js → chunk-ZKE2ZPHB.js} +7 -7
- package/dist/{chunk-POSO2X6D.js.map → chunk-ZKE2ZPHB.js.map} +1 -1
- package/dist/evals/index.cjs +4 -4
- package/dist/evals/index.js +1 -1
- package/dist/evals/scoreTraces/index.cjs +3 -3
- package/dist/evals/scoreTraces/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/integration/index.cjs +2 -2
- package/dist/integration/index.js +1 -1
- package/dist/llm/index.cjs +13 -13
- package/dist/llm/index.js +4 -4
- package/dist/llm/model/gateways/models-dev.d.ts.map +1 -1
- package/dist/llm/model/provider-types.generated.d.ts +37 -20
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +1 -1
- package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts.map +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +11 -11
- package/dist/memory/index.js +1 -1
- package/dist/memory/memory.d.ts +1 -1
- package/dist/memory/memory.d.ts.map +1 -1
- package/dist/memory/types.d.ts +19 -1
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/models-dev-FHJWQQO5.cjs +12 -0
- package/dist/{models-dev-26XLUKVK.cjs.map → models-dev-FHJWQQO5.cjs.map} +1 -1
- package/dist/models-dev-JMCO6M5W.js +3 -0
- package/dist/{models-dev-HUFLQFPB.js.map → models-dev-JMCO6M5W.js.map} +1 -1
- package/dist/netlify-3MHHJG2E.js +3 -0
- package/dist/{netlify-J4QPOROO.js.map → netlify-3MHHJG2E.js.map} +1 -1
- package/dist/netlify-5Y33S7WL.cjs +12 -0
- package/dist/{netlify-CUYK2MZ2.cjs.map → netlify-5Y33S7WL.cjs.map} +1 -1
- package/dist/processors/index.cjs +37 -37
- package/dist/processors/index.js +1 -1
- package/dist/processors/memory/semantic-recall.d.ts +19 -1
- package/dist/processors/memory/semantic-recall.d.ts.map +1 -1
- package/dist/provider-registry-IZPSWLPV.js +3 -0
- package/dist/{provider-registry-IGILEKIM.js.map → provider-registry-IZPSWLPV.js.map} +1 -1
- package/dist/provider-registry-OZWLA7RR.cjs +40 -0
- package/dist/{provider-registry-XNQEGR56.cjs.map → provider-registry-OZWLA7RR.cjs.map} +1 -1
- package/dist/provider-registry.json +82 -40
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/storage/index.cjs +30 -30
- package/dist/storage/index.js +1 -1
- package/dist/stream/base/output-format-handlers.d.ts.map +1 -1
- package/dist/stream/base/schema.d.ts.map +1 -1
- package/dist/stream/index.cjs +12 -12
- 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 +4 -4
- package/dist/tools/index.js +1 -1
- package/dist/tools/is-vercel-tool.cjs +2 -2
- package/dist/tools/is-vercel-tool.js +1 -1
- package/dist/tools/validation.d.ts.map +1 -1
- package/dist/utils.cjs +22 -22
- package/dist/utils.js +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/index.cjs +23 -23
- package/dist/workflows/index.js +1 -1
- package/package.json +4 -4
- package/src/llm/model/provider-types.generated.d.ts +37 -20
- package/dist/chunk-2XX35XRX.js.map +0 -1
- package/dist/chunk-4DFWV4IR.js.map +0 -1
- package/dist/chunk-5YYAQUEF.js.map +0 -1
- package/dist/chunk-AAX7ZOM7.cjs.map +0 -1
- package/dist/chunk-CHVWQDMP.js.map +0 -1
- package/dist/chunk-EMLEZXTQ.cjs.map +0 -1
- package/dist/chunk-GFALVOBW.cjs.map +0 -1
- package/dist/chunk-O4YSWWLB.cjs.map +0 -1
- package/dist/chunk-QXL3F3T2.js.map +0 -1
- package/dist/chunk-XIYLL4DN.cjs.map +0 -1
- package/dist/models-dev-26XLUKVK.cjs +0 -12
- package/dist/models-dev-HUFLQFPB.js +0 -3
- package/dist/netlify-CUYK2MZ2.cjs +0 -12
- package/dist/netlify-J4QPOROO.js +0 -3
- package/dist/provider-registry-IGILEKIM.js +0 -3
- package/dist/provider-registry-XNQEGR56.cjs +0 -40
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkSSB4AVHU_cjs = require('./chunk-SSB4AVHU.cjs');
|
|
4
4
|
var chunkL3NKIMF5_cjs = require('./chunk-L3NKIMF5.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var chunk4BYMMTK6_cjs = require('./chunk-4BYMMTK6.cjs');
|
|
6
|
+
var chunkMVLOJX6I_cjs = require('./chunk-MVLOJX6I.cjs');
|
|
7
7
|
var chunkNESKUIRE_cjs = require('./chunk-NESKUIRE.cjs');
|
|
8
8
|
var chunkFVQTJUBD_cjs = require('./chunk-FVQTJUBD.cjs');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var chunkTRSSKBDY_cjs = require('./chunk-TRSSKBDY.cjs');
|
|
10
|
+
var chunkN55KRGVI_cjs = require('./chunk-N55KRGVI.cjs');
|
|
11
11
|
var chunk4D4KB75Y_cjs = require('./chunk-4D4KB75Y.cjs');
|
|
12
12
|
var chunkMR7ZWBL6_cjs = require('./chunk-MR7ZWBL6.cjs');
|
|
13
|
-
var
|
|
13
|
+
var chunkE77HNO5E_cjs = require('./chunk-E77HNO5E.cjs');
|
|
14
14
|
var chunkZSZOYPSJ_cjs = require('./chunk-ZSZOYPSJ.cjs');
|
|
15
15
|
var chunk4U7ZLI36_cjs = require('./chunk-4U7ZLI36.cjs');
|
|
16
16
|
var chunkKJBMTK5B_cjs = require('./chunk-KJBMTK5B.cjs');
|
|
17
|
-
var
|
|
17
|
+
var chunkABHX6L4P_cjs = require('./chunk-ABHX6L4P.cjs');
|
|
18
18
|
var chunkUVHSM2GU_cjs = require('./chunk-UVHSM2GU.cjs');
|
|
19
19
|
var chunk4WQYXT2I_cjs = require('./chunk-4WQYXT2I.cjs');
|
|
20
20
|
var chunkDGV2FWB4_cjs = require('./chunk-DGV2FWB4.cjs');
|
|
@@ -25,15 +25,15 @@ var crypto2 = require('crypto');
|
|
|
25
25
|
var web = require('stream/web');
|
|
26
26
|
var EventEmitter2 = require('events');
|
|
27
27
|
var providerV5 = require('@ai-sdk/provider-v5');
|
|
28
|
-
var z4 = require('zod/v4');
|
|
29
28
|
var schemaCompat = require('@mastra/schema-compat');
|
|
29
|
+
var zodToJson = require('@mastra/schema-compat/zod-to-json');
|
|
30
|
+
var z4 = require('zod/v4');
|
|
30
31
|
var radash = require('radash');
|
|
31
32
|
var providerUtilsV5 = require('@ai-sdk/provider-utils-v5');
|
|
32
33
|
var lite = require('js-tiktoken/lite');
|
|
33
34
|
var o200k_base = require('js-tiktoken/ranks/o200k_base');
|
|
34
35
|
var lruCache = require('lru-cache');
|
|
35
36
|
var xxhash = require('xxhash-wasm');
|
|
36
|
-
var zodToJson = require('@mastra/schema-compat/zod-to-json');
|
|
37
37
|
|
|
38
38
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
39
39
|
|
|
@@ -1000,7 +1000,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1000
1000
|
retryCount
|
|
1001
1001
|
});
|
|
1002
1002
|
const mutations = messageList.stopRecording();
|
|
1003
|
-
if (result instanceof
|
|
1003
|
+
if (result instanceof chunkMVLOJX6I_cjs.MessageList) {
|
|
1004
1004
|
if (result !== messageList) {
|
|
1005
1005
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
1006
1006
|
category: "USER",
|
|
@@ -1286,7 +1286,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1286
1286
|
retryCount
|
|
1287
1287
|
});
|
|
1288
1288
|
let mutations;
|
|
1289
|
-
if (result instanceof
|
|
1289
|
+
if (result instanceof chunkMVLOJX6I_cjs.MessageList) {
|
|
1290
1290
|
if (result !== messageList) {
|
|
1291
1291
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
1292
1292
|
category: "USER",
|
|
@@ -1647,7 +1647,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1647
1647
|
retryCount
|
|
1648
1648
|
});
|
|
1649
1649
|
const mutations = messageList.stopRecording();
|
|
1650
|
-
if (result instanceof
|
|
1650
|
+
if (result instanceof chunkMVLOJX6I_cjs.MessageList) {
|
|
1651
1651
|
if (result !== messageList) {
|
|
1652
1652
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
1653
1653
|
category: "USER",
|
|
@@ -1717,7 +1717,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1717
1717
|
processor,
|
|
1718
1718
|
stepNumber
|
|
1719
1719
|
}) {
|
|
1720
|
-
if (result instanceof
|
|
1720
|
+
if (result instanceof chunkMVLOJX6I_cjs.MessageList) {
|
|
1721
1721
|
if (result !== messageList) {
|
|
1722
1722
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
1723
1723
|
category: "USER",
|
|
@@ -1752,7 +1752,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1752
1752
|
}
|
|
1753
1753
|
const { model: _model, ...rest } = result;
|
|
1754
1754
|
if (result.model) {
|
|
1755
|
-
const resolvedModel = await
|
|
1755
|
+
const resolvedModel = await chunkTRSSKBDY_cjs.resolveModelConfig(result.model);
|
|
1756
1756
|
const isSupported = isSupportedLanguageModel(resolvedModel);
|
|
1757
1757
|
if (!isSupported) {
|
|
1758
1758
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
@@ -2063,7 +2063,7 @@ function convertMastraChunkToAISDKv5({
|
|
|
2063
2063
|
if (mode === "generate") {
|
|
2064
2064
|
return {
|
|
2065
2065
|
type: "file",
|
|
2066
|
-
file: new
|
|
2066
|
+
file: new chunkMVLOJX6I_cjs.DefaultGeneratedFile({
|
|
2067
2067
|
data: chunk.payload.data,
|
|
2068
2068
|
mediaType: chunk.payload.mimeType
|
|
2069
2069
|
})
|
|
@@ -2071,7 +2071,7 @@ function convertMastraChunkToAISDKv5({
|
|
|
2071
2071
|
}
|
|
2072
2072
|
return {
|
|
2073
2073
|
type: "file",
|
|
2074
|
-
file: new
|
|
2074
|
+
file: new chunkMVLOJX6I_cjs.DefaultGeneratedFileWithType({
|
|
2075
2075
|
data: chunk.payload.data,
|
|
2076
2076
|
mediaType: chunk.payload.mimeType
|
|
2077
2077
|
})
|
|
@@ -2526,8 +2526,6 @@ var AISDKV5OutputStream = class {
|
|
|
2526
2526
|
return this.#modelOutput.object;
|
|
2527
2527
|
}
|
|
2528
2528
|
};
|
|
2529
|
-
|
|
2530
|
-
// src/stream/base/schema.ts
|
|
2531
2529
|
function asJsonSchema(schema) {
|
|
2532
2530
|
if (!schema) {
|
|
2533
2531
|
return void 0;
|
|
@@ -2535,6 +2533,12 @@ function asJsonSchema(schema) {
|
|
|
2535
2533
|
if (schema && typeof schema === "object" && !schema.safeParse && !schema.jsonSchema) {
|
|
2536
2534
|
return schema;
|
|
2537
2535
|
}
|
|
2536
|
+
if (schemaCompat.isZodType(schema)) {
|
|
2537
|
+
return zodToJson.zodToJsonSchema(schema);
|
|
2538
|
+
}
|
|
2539
|
+
if (schema.jsonSchema) {
|
|
2540
|
+
return schema.jsonSchema;
|
|
2541
|
+
}
|
|
2538
2542
|
return chunkFVQTJUBD_cjs.asSchema(schema).jsonSchema;
|
|
2539
2543
|
}
|
|
2540
2544
|
function getTransformedSchema(schema) {
|
|
@@ -2655,7 +2659,7 @@ var BaseFormatHandler = class {
|
|
|
2655
2659
|
* Checks if the original schema is a Zod schema with safeParse method.
|
|
2656
2660
|
*/
|
|
2657
2661
|
isZodSchema(schema) {
|
|
2658
|
-
return schema
|
|
2662
|
+
return schemaCompat.isZodType(schema);
|
|
2659
2663
|
}
|
|
2660
2664
|
/**
|
|
2661
2665
|
* Validates a value against the schema, preferring Zod's safeParse.
|
|
@@ -2867,8 +2871,8 @@ var EnumFormatHandler = class extends BaseFormatHandler {
|
|
|
2867
2871
|
}
|
|
2868
2872
|
let enumValues;
|
|
2869
2873
|
if (this.isZodSchema(this.schema)) {
|
|
2870
|
-
const
|
|
2871
|
-
enumValues =
|
|
2874
|
+
const convertedSchema = zodToJson.zodToJsonSchema(this.schema);
|
|
2875
|
+
enumValues = convertedSchema?.enum;
|
|
2872
2876
|
} else if (typeof this.schema === "object" && !this.schema.jsonSchema) {
|
|
2873
2877
|
const wrappedSchema = chunkFVQTJUBD_cjs.jsonSchema(this.schema);
|
|
2874
2878
|
enumValues = wrappedSchema.jsonSchema?.enum;
|
|
@@ -3565,7 +3569,7 @@ var MastraModelOutput = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
3565
3569
|
);
|
|
3566
3570
|
const responseMessages = self.messageList.get.response.aiV4.core();
|
|
3567
3571
|
const lastResponseMessage = responseMessages[responseMessages.length - 1];
|
|
3568
|
-
const outputText = lastResponseMessage ?
|
|
3572
|
+
const outputText = lastResponseMessage ? chunkMVLOJX6I_cjs.MessageList.coreContentToString(lastResponseMessage.content) : "";
|
|
3569
3573
|
if (lastStep && outputText && outputText !== originalText) {
|
|
3570
3574
|
lastStep.text = outputText;
|
|
3571
3575
|
}
|
|
@@ -5345,7 +5349,7 @@ var createTimeTravelExecutionParams = (params) => {
|
|
|
5345
5349
|
result = void 0;
|
|
5346
5350
|
}
|
|
5347
5351
|
if (result) {
|
|
5348
|
-
const formattedResult =
|
|
5352
|
+
const formattedResult = chunkE77HNO5E_cjs.removeUndefinedValues(result);
|
|
5349
5353
|
stepResults[stepId] = formattedResult;
|
|
5350
5354
|
}
|
|
5351
5355
|
});
|
|
@@ -5819,7 +5823,7 @@ async function executeLoop(engine, params) {
|
|
|
5819
5823
|
const evalSpan = loopSpan?.createChildSpan({
|
|
5820
5824
|
type: "workflow_conditional_eval" /* WORKFLOW_CONDITIONAL_EVAL */,
|
|
5821
5825
|
name: `condition: '${entry.loopType}'`,
|
|
5822
|
-
input:
|
|
5826
|
+
input: chunkE77HNO5E_cjs.selectFields(result.output, ["stepResult", "output.text", "output.object", "messages"]),
|
|
5823
5827
|
attributes: {
|
|
5824
5828
|
conditionIndex: iteration
|
|
5825
5829
|
},
|
|
@@ -7812,7 +7816,7 @@ function createStep(params, agentOptions) {
|
|
|
7812
7816
|
component: params.component
|
|
7813
7817
|
};
|
|
7814
7818
|
}
|
|
7815
|
-
if (params instanceof
|
|
7819
|
+
if (params instanceof chunkABHX6L4P_cjs.Tool) {
|
|
7816
7820
|
if (!params.inputSchema || !params.outputSchema) {
|
|
7817
7821
|
throw new Error("Tool must have input and output schemas defined");
|
|
7818
7822
|
}
|
|
@@ -7906,7 +7910,7 @@ function createStep(params, agentOptions) {
|
|
|
7906
7910
|
phase,
|
|
7907
7911
|
// Auto-create MessageList from messages if not provided
|
|
7908
7912
|
// This enables running processor workflows from the UI where messageList can't be serialized
|
|
7909
|
-
messageList: messageList ?? (Array.isArray(messages) ? new
|
|
7913
|
+
messageList: messageList ?? (Array.isArray(messages) ? new chunkMVLOJX6I_cjs.MessageList().add(messages, "input").addSystem(systemMessages ?? []) : void 0),
|
|
7910
7914
|
stepNumber,
|
|
7911
7915
|
systemMessages,
|
|
7912
7916
|
streamParts,
|
|
@@ -7959,7 +7963,7 @@ function createStep(params, agentOptions) {
|
|
|
7959
7963
|
}
|
|
7960
7964
|
}
|
|
7961
7965
|
};
|
|
7962
|
-
if (result instanceof
|
|
7966
|
+
if (result instanceof chunkMVLOJX6I_cjs.MessageList) {
|
|
7963
7967
|
if (result !== passThrough.messageList) {
|
|
7964
7968
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
7965
7969
|
category: "USER" /* USER */,
|
|
@@ -8084,7 +8088,7 @@ function createStep(params, agentOptions) {
|
|
|
8084
8088
|
}
|
|
8085
8089
|
}
|
|
8086
8090
|
};
|
|
8087
|
-
if (result instanceof
|
|
8091
|
+
if (result instanceof chunkMVLOJX6I_cjs.MessageList) {
|
|
8088
8092
|
if (result !== passThrough.messageList) {
|
|
8089
8093
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
8090
8094
|
category: "USER" /* USER */,
|
|
@@ -8153,7 +8157,7 @@ function createStep(params, agentOptions) {
|
|
|
8153
8157
|
}
|
|
8154
8158
|
}
|
|
8155
8159
|
};
|
|
8156
|
-
if (result instanceof
|
|
8160
|
+
if (result instanceof chunkMVLOJX6I_cjs.MessageList) {
|
|
8157
8161
|
if (result !== passThrough.messageList) {
|
|
8158
8162
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
8159
8163
|
category: "USER" /* USER */,
|
|
@@ -8220,7 +8224,7 @@ function cloneStep(step, opts) {
|
|
|
8220
8224
|
};
|
|
8221
8225
|
}
|
|
8222
8226
|
function isProcessor(obj) {
|
|
8223
|
-
return obj !== null && typeof obj === "object" && "id" in obj && typeof obj.id === "string" && !(obj instanceof Agent) && !(obj instanceof
|
|
8227
|
+
return obj !== null && typeof obj === "object" && "id" in obj && typeof obj.id === "string" && !(obj instanceof Agent) && !(obj instanceof chunkABHX6L4P_cjs.Tool) && (typeof obj.processInput === "function" || typeof obj.processInputStep === "function" || typeof obj.processOutputStream === "function" || typeof obj.processOutputResult === "function" || typeof obj.processOutputStep === "function");
|
|
8224
8228
|
}
|
|
8225
8229
|
function createWorkflow(params) {
|
|
8226
8230
|
return new Workflow(params);
|
|
@@ -11440,7 +11444,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
11440
11444
|
}
|
|
11441
11445
|
};
|
|
11442
11446
|
await processAndEnqueueChunk(chunk);
|
|
11443
|
-
if (initialResult?.metadata?.modelVersion
|
|
11447
|
+
if (supportedLanguageModelSpecifications.includes(initialResult?.metadata?.modelVersion)) {
|
|
11444
11448
|
await rest.options?.onChunk?.({
|
|
11445
11449
|
chunk: convertMastraChunkToAISDKv5({
|
|
11446
11450
|
chunk
|
|
@@ -12426,7 +12430,7 @@ var MastraLLMVNext = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
12426
12430
|
const remainingTokens = parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"] ?? "", 10);
|
|
12427
12431
|
if (!isNaN(remainingTokens) && remainingTokens > 0 && remainingTokens < 2e3) {
|
|
12428
12432
|
this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
|
|
12429
|
-
await
|
|
12433
|
+
await chunkE77HNO5E_cjs.delay(10 * 1e3);
|
|
12430
12434
|
}
|
|
12431
12435
|
},
|
|
12432
12436
|
onFinish: async (props) => {
|
|
@@ -12636,7 +12640,7 @@ async function prepareMemoryStep({
|
|
|
12636
12640
|
);
|
|
12637
12641
|
}
|
|
12638
12642
|
} else {
|
|
12639
|
-
const messageList = new
|
|
12643
|
+
const messageList = new chunkMVLOJX6I_cjs.MessageList({
|
|
12640
12644
|
threadId: thread?.id,
|
|
12641
12645
|
resourceId: thread?.resourceId
|
|
12642
12646
|
});
|
|
@@ -13691,7 +13695,7 @@ var AgentLegacyHandler = class {
|
|
|
13691
13695
|
methodType: methodType === "generate" ? "generateLegacy" : "streamLegacy",
|
|
13692
13696
|
memoryConfig
|
|
13693
13697
|
});
|
|
13694
|
-
let messageList = new
|
|
13698
|
+
let messageList = new chunkMVLOJX6I_cjs.MessageList({
|
|
13695
13699
|
threadId,
|
|
13696
13700
|
resourceId,
|
|
13697
13701
|
generateMessageId: this.capabilities.mastra?.generateId?.bind(this.capabilities.mastra),
|
|
@@ -13822,7 +13826,7 @@ var AgentLegacyHandler = class {
|
|
|
13822
13826
|
result: resToLog,
|
|
13823
13827
|
threadId
|
|
13824
13828
|
});
|
|
13825
|
-
const messageListResponses = new
|
|
13829
|
+
const messageListResponses = new chunkMVLOJX6I_cjs.MessageList({
|
|
13826
13830
|
threadId,
|
|
13827
13831
|
resourceId,
|
|
13828
13832
|
generateMessageId: this.capabilities.mastra?.generateId?.bind(this.capabilities.mastra),
|
|
@@ -14826,7 +14830,7 @@ var prepareToolsStepOutputSchema = z8.z.object({
|
|
|
14826
14830
|
var prepareMemoryStepOutputSchema = z8.z.object({
|
|
14827
14831
|
threadExists: z8.z.boolean(),
|
|
14828
14832
|
thread: storageThreadSchema.optional(),
|
|
14829
|
-
messageList: z8.z.instanceof(
|
|
14833
|
+
messageList: z8.z.instanceof(chunkMVLOJX6I_cjs.MessageList),
|
|
14830
14834
|
/** Tripwire data when input processor triggered abort */
|
|
14831
14835
|
tripwire: z8.z.object({
|
|
14832
14836
|
reason: z8.z.string(),
|
|
@@ -14864,7 +14868,7 @@ function createPrepareMemoryStep({
|
|
|
14864
14868
|
outputSchema: prepareMemoryStepOutputSchema,
|
|
14865
14869
|
execute: async ({ tracingContext }) => {
|
|
14866
14870
|
const thread = threadFromArgs;
|
|
14867
|
-
const messageList = new
|
|
14871
|
+
const messageList = new chunkMVLOJX6I_cjs.MessageList({
|
|
14868
14872
|
threadId: thread?.id,
|
|
14869
14873
|
resourceId,
|
|
14870
14874
|
generateMessageId: capabilities.generateMessageId,
|
|
@@ -15817,7 +15821,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
15817
15821
|
*/
|
|
15818
15822
|
listTools({ requestContext = new chunkUVHSM2GU_cjs.RequestContext() } = {}) {
|
|
15819
15823
|
if (typeof this.#tools !== "function") {
|
|
15820
|
-
return
|
|
15824
|
+
return chunkE77HNO5E_cjs.ensureToolProperties(this.#tools);
|
|
15821
15825
|
}
|
|
15822
15826
|
const result = this.#tools({ requestContext, mastra: this.#mastra });
|
|
15823
15827
|
return resolveMaybePromise(result, (tools) => {
|
|
@@ -15835,7 +15839,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
15835
15839
|
this.logger.error(mastraError.toString());
|
|
15836
15840
|
throw mastraError;
|
|
15837
15841
|
}
|
|
15838
|
-
return
|
|
15842
|
+
return chunkE77HNO5E_cjs.ensureToolProperties(tools);
|
|
15839
15843
|
});
|
|
15840
15844
|
}
|
|
15841
15845
|
/**
|
|
@@ -15867,7 +15871,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
15867
15871
|
});
|
|
15868
15872
|
});
|
|
15869
15873
|
} else {
|
|
15870
|
-
llm = new
|
|
15874
|
+
llm = new chunkN55KRGVI_cjs.MastraLLMV1({
|
|
15871
15875
|
model: resolvedModel,
|
|
15872
15876
|
mastra: this.#mastra,
|
|
15873
15877
|
options: { tracingPolicy: this.#options?.tracingPolicy }
|
|
@@ -15892,7 +15896,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
15892
15896
|
*/
|
|
15893
15897
|
async resolveModelConfig(modelConfig, requestContext) {
|
|
15894
15898
|
try {
|
|
15895
|
-
return await
|
|
15899
|
+
return await chunkTRSSKBDY_cjs.resolveModelConfig(modelConfig, requestContext, this.#mastra);
|
|
15896
15900
|
} catch (error) {
|
|
15897
15901
|
const mastraError = new chunk4U7ZLI36_cjs.MastraError({
|
|
15898
15902
|
id: "AGENT_GET_MODEL_MISSING_MODEL_INSTANCE",
|
|
@@ -16098,7 +16102,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16098
16102
|
instructions
|
|
16099
16103
|
}) {
|
|
16100
16104
|
const llm = await this.getLLM({ requestContext, model });
|
|
16101
|
-
const normMessage = new
|
|
16105
|
+
const normMessage = new chunkMVLOJX6I_cjs.MessageList().add(message, "user").get.all.ui().at(-1);
|
|
16102
16106
|
if (!normMessage) {
|
|
16103
16107
|
throw new Error(`Could not generate title from input ${JSON.stringify(message)}`);
|
|
16104
16108
|
}
|
|
@@ -16121,7 +16125,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16121
16125
|
const systemInstructions = await this.resolveTitleInstructions(requestContext, instructions);
|
|
16122
16126
|
let text = "";
|
|
16123
16127
|
if (isSupportedLanguageModel(llm.getModel())) {
|
|
16124
|
-
const messageList = new
|
|
16128
|
+
const messageList = new chunkMVLOJX6I_cjs.MessageList().add(
|
|
16125
16129
|
[
|
|
16126
16130
|
{
|
|
16127
16131
|
role: "system",
|
|
@@ -16174,7 +16178,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16174
16178
|
async genTitle(userMessage, requestContext, tracingContext, model, instructions) {
|
|
16175
16179
|
try {
|
|
16176
16180
|
if (userMessage) {
|
|
16177
|
-
const normMessage = new
|
|
16181
|
+
const normMessage = new chunkMVLOJX6I_cjs.MessageList().add(userMessage, "user").get.all.ui().at(-1);
|
|
16178
16182
|
if (normMessage) {
|
|
16179
16183
|
return await this.generateTitleFromUserMessage({
|
|
16180
16184
|
message: normMessage,
|
|
@@ -16239,7 +16243,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16239
16243
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
16240
16244
|
requireApproval: toolObj.requireApproval
|
|
16241
16245
|
};
|
|
16242
|
-
const convertedToCoreTool =
|
|
16246
|
+
const convertedToCoreTool = chunkE77HNO5E_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
16243
16247
|
convertedMemoryTools[toolName] = convertedToCoreTool;
|
|
16244
16248
|
}
|
|
16245
16249
|
}
|
|
@@ -16394,7 +16398,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16394
16398
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
16395
16399
|
requireApproval: tool2.requireApproval
|
|
16396
16400
|
};
|
|
16397
|
-
return [k,
|
|
16401
|
+
return [k, chunkE77HNO5E_cjs.makeCoreTool(tool2, options, void 0, autoResumeSuspendedTools)];
|
|
16398
16402
|
})
|
|
16399
16403
|
);
|
|
16400
16404
|
const assignedToolEntriesConverted = Object.fromEntries(
|
|
@@ -16444,7 +16448,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16444
16448
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
16445
16449
|
requireApproval: toolObj.requireApproval
|
|
16446
16450
|
};
|
|
16447
|
-
const convertedToCoreTool =
|
|
16451
|
+
const convertedToCoreTool = chunkE77HNO5E_cjs.makeCoreTool(toolObj, options, "toolset", autoResumeSuspendedTools);
|
|
16448
16452
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
16449
16453
|
}
|
|
16450
16454
|
}
|
|
@@ -16489,7 +16493,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16489
16493
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
16490
16494
|
requireApproval: tool2.requireApproval
|
|
16491
16495
|
};
|
|
16492
|
-
const convertedToCoreTool =
|
|
16496
|
+
const convertedToCoreTool = chunkE77HNO5E_cjs.makeCoreTool(rest, options, "client-tool", autoResumeSuspendedTools);
|
|
16493
16497
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
16494
16498
|
}
|
|
16495
16499
|
}
|
|
@@ -16527,7 +16531,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16527
16531
|
subAgentResourceId: z8.z.string().describe("The resource ID of the agent").optional()
|
|
16528
16532
|
});
|
|
16529
16533
|
const modelVersion = (await agent.getModel({ requestContext })).specificationVersion;
|
|
16530
|
-
const toolObj =
|
|
16534
|
+
const toolObj = chunkABHX6L4P_cjs.createTool({
|
|
16531
16535
|
id: `agent-${agentName}`,
|
|
16532
16536
|
description: agent.getDescription() || `Agent: ${agentName}`,
|
|
16533
16537
|
inputSchema: agentInputSchema,
|
|
@@ -16548,7 +16552,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16548
16552
|
const slugify = await import('@sindresorhus/slugify');
|
|
16549
16553
|
const subAgentThreadId = inputData.threadId || context?.mastra?.generateId() || crypto2.randomUUID();
|
|
16550
16554
|
const subAgentResourceId = inputData.resourceId || context?.mastra?.generateId() || `${slugify.default(this.id)}-${agentName}`;
|
|
16551
|
-
if ((methodType === "generate" || methodType === "generateLegacy") && modelVersion
|
|
16555
|
+
if ((methodType === "generate" || methodType === "generateLegacy") && supportedLanguageModelSpecifications.includes(modelVersion)) {
|
|
16552
16556
|
if (!agent.hasOwnMemory() && this.#memory) {
|
|
16553
16557
|
agent.__setMemory(this.#memory);
|
|
16554
16558
|
}
|
|
@@ -16571,7 +16575,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16571
16575
|
tracingContext: context?.tracingContext
|
|
16572
16576
|
});
|
|
16573
16577
|
result = { text: generateResult.text };
|
|
16574
|
-
} else if ((methodType === "stream" || methodType === "streamLegacy") && modelVersion
|
|
16578
|
+
} else if ((methodType === "stream" || methodType === "streamLegacy") && supportedLanguageModelSpecifications.includes(modelVersion)) {
|
|
16575
16579
|
if (!agent.hasOwnMemory() && this.#memory) {
|
|
16576
16580
|
agent.__setMemory(this.#memory);
|
|
16577
16581
|
}
|
|
@@ -16659,7 +16663,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16659
16663
|
tracingContext,
|
|
16660
16664
|
tracingPolicy: this.#options?.tracingPolicy
|
|
16661
16665
|
};
|
|
16662
|
-
convertedAgentTools[`agent-${agentName}`] =
|
|
16666
|
+
convertedAgentTools[`agent-${agentName}`] = chunkE77HNO5E_cjs.makeCoreTool(
|
|
16663
16667
|
toolObj,
|
|
16664
16668
|
options,
|
|
16665
16669
|
void 0,
|
|
@@ -16690,7 +16694,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16690
16694
|
inputData: workflow.inputSchema,
|
|
16691
16695
|
...workflow.stateSchema ? { initialState: workflow.stateSchema } : {}
|
|
16692
16696
|
});
|
|
16693
|
-
const toolObj =
|
|
16697
|
+
const toolObj = chunkABHX6L4P_cjs.createTool({
|
|
16694
16698
|
id: `workflow-${workflowName}`,
|
|
16695
16699
|
description: workflow.description || `Workflow: ${workflowName}`,
|
|
16696
16700
|
inputSchema: extendedInputSchema,
|
|
@@ -16838,7 +16842,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16838
16842
|
tracingContext,
|
|
16839
16843
|
tracingPolicy: this.#options?.tracingPolicy
|
|
16840
16844
|
};
|
|
16841
|
-
convertedWorkflowTools[`workflow-${workflowName}`] =
|
|
16845
|
+
convertedWorkflowTools[`workflow-${workflowName}`] = chunkE77HNO5E_cjs.makeCoreTool(
|
|
16842
16846
|
toolObj,
|
|
16843
16847
|
options,
|
|
16844
16848
|
void 0,
|
|
@@ -16868,7 +16872,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16868
16872
|
let mastraProxy = void 0;
|
|
16869
16873
|
const logger = this.logger;
|
|
16870
16874
|
if (this.#mastra) {
|
|
16871
|
-
mastraProxy =
|
|
16875
|
+
mastraProxy = chunkE77HNO5E_cjs.createMastraProxy({ mastra: this.#mastra, logger });
|
|
16872
16876
|
}
|
|
16873
16877
|
const assignedTools = await this.listAssignedTools({
|
|
16874
16878
|
runId,
|
|
@@ -17108,7 +17112,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
17108
17112
|
throw mastraError;
|
|
17109
17113
|
}
|
|
17110
17114
|
let headers;
|
|
17111
|
-
if (resolvedModel instanceof
|
|
17115
|
+
if (resolvedModel instanceof chunkTRSSKBDY_cjs.ModelRouterLanguageModel) {
|
|
17112
17116
|
headers = resolvedModel.config?.headers;
|
|
17113
17117
|
}
|
|
17114
17118
|
return [
|
|
@@ -17154,7 +17158,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
17154
17158
|
throw mastraError;
|
|
17155
17159
|
}
|
|
17156
17160
|
let headers;
|
|
17157
|
-
if (model2 instanceof
|
|
17161
|
+
if (model2 instanceof chunkTRSSKBDY_cjs.ModelRouterLanguageModel) {
|
|
17158
17162
|
headers = model2.config?.headers;
|
|
17159
17163
|
}
|
|
17160
17164
|
return {
|
|
@@ -17214,7 +17218,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
17214
17218
|
const targetProvider = structuredOutputModel.provider;
|
|
17215
17219
|
const targetModelId = structuredOutputModel.modelId;
|
|
17216
17220
|
if (targetProvider.includes("openai") || targetModelId.includes("openai")) {
|
|
17217
|
-
if (
|
|
17221
|
+
if (chunkE77HNO5E_cjs.isZodType(options.structuredOutput.schema) && targetModelId) {
|
|
17218
17222
|
const modelInfo = {
|
|
17219
17223
|
provider: targetProvider,
|
|
17220
17224
|
modelId: targetModelId,
|
|
@@ -20052,6 +20056,7 @@ var SemanticRecall = class {
|
|
|
20052
20056
|
threshold;
|
|
20053
20057
|
indexName;
|
|
20054
20058
|
logger;
|
|
20059
|
+
embedderOptions;
|
|
20055
20060
|
// LRU cache for embeddings: contentHash -> embedding vector
|
|
20056
20061
|
embeddingCache;
|
|
20057
20062
|
// xxhash-wasm hasher instance (initialized as a promise)
|
|
@@ -20065,6 +20070,7 @@ var SemanticRecall = class {
|
|
|
20065
20070
|
this.threshold = options.threshold;
|
|
20066
20071
|
this.indexName = options.indexName;
|
|
20067
20072
|
this.logger = options.logger;
|
|
20073
|
+
this.embedderOptions = options.embedderOptions;
|
|
20068
20074
|
this.embeddingCache = new lruCache.LRUCache({
|
|
20069
20075
|
max: DEFAULT_CACHE_MAX_SIZE
|
|
20070
20076
|
});
|
|
@@ -20135,7 +20141,7 @@ var SemanticRecall = class {
|
|
|
20135
20141
|
*/
|
|
20136
20142
|
formatCrossThreadMessages(messages, currentThreadId) {
|
|
20137
20143
|
let result = ``;
|
|
20138
|
-
const v1Messages = new
|
|
20144
|
+
const v1Messages = new chunkMVLOJX6I_cjs.MessageList().add(messages, "memory").get.all.v1();
|
|
20139
20145
|
let lastYmd = null;
|
|
20140
20146
|
for (const msg of v1Messages) {
|
|
20141
20147
|
const date = msg.createdAt;
|
|
@@ -20261,7 +20267,8 @@ ${result}
|
|
|
20261
20267
|
};
|
|
20262
20268
|
}
|
|
20263
20269
|
const result = await this.embedder.doEmbed({
|
|
20264
|
-
values: [content]
|
|
20270
|
+
values: [content],
|
|
20271
|
+
...this.embedderOptions
|
|
20265
20272
|
});
|
|
20266
20273
|
if (result.embeddings[0]) {
|
|
20267
20274
|
this.embeddingCache.set(contentHash, result.embeddings[0]);
|
|
@@ -20540,10 +20547,13 @@ https://mastra.ai/en/docs/memory/semantic-recall`
|
|
|
20540
20547
|
);
|
|
20541
20548
|
}
|
|
20542
20549
|
if (typeof config.embedder === "string") {
|
|
20543
|
-
this.embedder = new
|
|
20550
|
+
this.embedder = new chunkTRSSKBDY_cjs.ModelRouterEmbeddingModel(config.embedder);
|
|
20544
20551
|
} else {
|
|
20545
20552
|
this.embedder = config.embedder;
|
|
20546
20553
|
}
|
|
20554
|
+
if (config.embedderOptions) {
|
|
20555
|
+
this.embedderOptions = config.embedderOptions;
|
|
20556
|
+
}
|
|
20547
20557
|
}
|
|
20548
20558
|
}
|
|
20549
20559
|
/**
|
|
@@ -20574,12 +20584,15 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
20574
20584
|
setVector(vector) {
|
|
20575
20585
|
this.vector = vector;
|
|
20576
20586
|
}
|
|
20577
|
-
setEmbedder(embedder) {
|
|
20587
|
+
setEmbedder(embedder, embedderOptions) {
|
|
20578
20588
|
if (typeof embedder === "string") {
|
|
20579
|
-
this.embedder = new
|
|
20589
|
+
this.embedder = new chunkTRSSKBDY_cjs.ModelRouterEmbeddingModel(embedder);
|
|
20580
20590
|
} else {
|
|
20581
20591
|
this.embedder = embedder;
|
|
20582
20592
|
}
|
|
20593
|
+
if (embedderOptions) {
|
|
20594
|
+
this.embedderOptions = embedderOptions;
|
|
20595
|
+
}
|
|
20583
20596
|
}
|
|
20584
20597
|
/**
|
|
20585
20598
|
* Get a system message to inject into the conversation.
|
|
@@ -20640,7 +20653,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
20640
20653
|
"The threads.generateTitle option has been moved. Use the top-level generateTitle option instead."
|
|
20641
20654
|
);
|
|
20642
20655
|
}
|
|
20643
|
-
const mergedConfig =
|
|
20656
|
+
const mergedConfig = chunkE77HNO5E_cjs.deepMerge(this.threadConfig, config || {});
|
|
20644
20657
|
if (typeof config?.workingMemory === "object" && config.workingMemory?.schema && typeof mergedConfig.workingMemory === "object") {
|
|
20645
20658
|
mergedConfig.workingMemory.schema = config.workingMemory.schema;
|
|
20646
20659
|
}
|
|
@@ -20786,6 +20799,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
20786
20799
|
storage: memoryStore,
|
|
20787
20800
|
vector: this.vector,
|
|
20788
20801
|
embedder: this.embedder,
|
|
20802
|
+
embedderOptions: this.embedderOptions,
|
|
20789
20803
|
indexName,
|
|
20790
20804
|
...semanticConfig
|
|
20791
20805
|
})
|
|
@@ -20840,6 +20854,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
20840
20854
|
storage: memoryStore,
|
|
20841
20855
|
vector: this.vector,
|
|
20842
20856
|
embedder: this.embedder,
|
|
20857
|
+
embedderOptions: this.embedderOptions,
|
|
20843
20858
|
indexName,
|
|
20844
20859
|
...semanticRecallConfig
|
|
20845
20860
|
})
|
|
@@ -20878,7 +20893,7 @@ var MockMemory = class extends MastraMemory {
|
|
|
20878
20893
|
} = {}) {
|
|
20879
20894
|
super({
|
|
20880
20895
|
name: "mock",
|
|
20881
|
-
storage: storage || new
|
|
20896
|
+
storage: storage || new chunk4BYMMTK6_cjs.InMemoryStore(),
|
|
20882
20897
|
options: {
|
|
20883
20898
|
workingMemory: enableWorkingMemory ? { enabled: true, template: workingMemoryTemplate } : void 0,
|
|
20884
20899
|
lastMessages: enableMessageHistory ? 10 : void 0
|
|
@@ -20963,7 +20978,7 @@ var MockMemory = class extends MastraMemory {
|
|
|
20963
20978
|
return {};
|
|
20964
20979
|
}
|
|
20965
20980
|
return {
|
|
20966
|
-
updateWorkingMemory:
|
|
20981
|
+
updateWorkingMemory: chunkABHX6L4P_cjs.createTool({
|
|
20967
20982
|
id: "update-working-memory",
|
|
20968
20983
|
description: `Update the working memory with new information. Any data not included will be overwritten.`,
|
|
20969
20984
|
inputSchema: z8__default.default.object({ memory: z8__default.default.string() }),
|
|
@@ -21161,5 +21176,5 @@ exports.validateStepInput = validateStepInput;
|
|
|
21161
21176
|
exports.validateStepResumeData = validateStepResumeData;
|
|
21162
21177
|
exports.validateStepStateData = validateStepStateData;
|
|
21163
21178
|
exports.validateStepSuspendData = validateStepSuspendData;
|
|
21164
|
-
//# sourceMappingURL=chunk-
|
|
21165
|
-
//# sourceMappingURL=chunk-
|
|
21179
|
+
//# sourceMappingURL=chunk-S6HUG6SH.cjs.map
|
|
21180
|
+
//# sourceMappingURL=chunk-S6HUG6SH.cjs.map
|