@mastra/core 0.10.15-alpha.0 → 0.10.15-alpha.1
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/dist/agent/index.cjs +4 -4
- package/dist/agent/index.d.cts +1 -1
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +2 -2
- package/dist/{base-qVqAnB-c.d.ts → base-5ZyKaTRr.d.ts} +17 -2
- package/dist/{base-CTj7ESwt.d.cts → base-DsnZAIo1.d.cts} +17 -2
- package/dist/{chunk-BVD7NVAR.cjs → chunk-224GGYYJ.cjs} +2 -2
- package/dist/{chunk-AOWJUV2N.js → chunk-3OHBKAKC.js} +37 -32
- package/dist/{chunk-Q33INUG2.cjs → chunk-4IBEMZ5D.cjs} +2 -2
- package/dist/{chunk-RVFWMGGR.js → chunk-BC2VBD36.js} +1 -1
- package/dist/{chunk-ULZ6MRTN.cjs → chunk-D6KIRZP6.cjs} +22 -13
- package/dist/{chunk-MVCHTRVB.js → chunk-IYBAMING.js} +13 -4
- package/dist/{chunk-J62R4M7K.js → chunk-OJ2V2VOQ.js} +1 -1
- package/dist/{chunk-ZCU3PLIL.cjs → chunk-RIDAFDLW.cjs} +38 -33
- package/dist/{chunk-DR4JS662.js → chunk-SLUSEJP2.js} +16 -31
- package/dist/{chunk-ZTPPDHQK.cjs → chunk-ZFHQHACB.cjs} +16 -31
- package/dist/eval/index.d.cts +1 -1
- package/dist/eval/index.d.ts +1 -1
- package/dist/index.cjs +20 -20
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/integration/index.d.cts +1 -1
- package/dist/integration/index.d.ts +1 -1
- package/dist/llm/index.d.cts +1 -1
- package/dist/llm/index.d.ts +1 -1
- package/dist/mastra/index.d.cts +1 -1
- package/dist/mastra/index.d.ts +1 -1
- package/dist/mcp/index.d.cts +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/memory/index.cjs +4 -4
- package/dist/memory/index.d.cts +1 -1
- package/dist/memory/index.d.ts +1 -1
- package/dist/memory/index.js +1 -1
- package/dist/network/index.cjs +2 -2
- package/dist/network/index.d.cts +1 -1
- package/dist/network/index.d.ts +1 -1
- package/dist/network/index.js +1 -1
- package/dist/network/vNext/index.cjs +16 -14
- package/dist/network/vNext/index.d.cts +1 -1
- package/dist/network/vNext/index.d.ts +1 -1
- package/dist/network/vNext/index.js +5 -3
- package/dist/relevance/index.cjs +4 -4
- package/dist/relevance/index.d.cts +1 -1
- package/dist/relevance/index.d.ts +1 -1
- package/dist/relevance/index.js +1 -1
- package/dist/server/index.d.cts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/storage/index.cjs +2 -2
- package/dist/storage/index.d.cts +2 -2
- package/dist/storage/index.d.ts +2 -2
- package/dist/storage/index.js +1 -1
- package/dist/telemetry/index.d.cts +1 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/tools/index.d.cts +2 -2
- package/dist/tools/index.d.ts +2 -2
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/voice/index.d.cts +1 -1
- package/dist/voice/index.d.ts +1 -1
- package/dist/workflows/index.cjs +10 -10
- package/dist/workflows/index.d.cts +4 -5
- package/dist/workflows/index.d.ts +4 -5
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/legacy/index.cjs +22 -22
- package/dist/workflows/legacy/index.d.cts +2 -2
- package/dist/workflows/legacy/index.d.ts +2 -2
- package/dist/workflows/legacy/index.js +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkBB6DPGIV_cjs = require('./chunk-BB6DPGIV.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkD6KIRZP6_cjs = require('./chunk-D6KIRZP6.cjs');
|
|
5
5
|
var chunk4Z3OU5RY_cjs = require('./chunk-4Z3OU5RY.cjs');
|
|
6
6
|
var chunkB6TOBUS6_cjs = require('./chunk-B6TOBUS6.cjs');
|
|
7
7
|
var chunkP3Q73CAW_cjs = require('./chunk-P3Q73CAW.cjs');
|
|
@@ -53,7 +53,6 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
53
53
|
this.runCounts.set(stepId, runCount);
|
|
54
54
|
return runCount;
|
|
55
55
|
}
|
|
56
|
-
runtimeContext = {};
|
|
57
56
|
async fmtReturnValue(executionSpan, emitter, stepResults, lastOutput, error) {
|
|
58
57
|
const base = {
|
|
59
58
|
status: lastOutput.status,
|
|
@@ -138,9 +137,6 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
138
137
|
startIdx = resume.resumePath[0];
|
|
139
138
|
resume.resumePath.shift();
|
|
140
139
|
}
|
|
141
|
-
if (resume?.snapshotRuntimeContext) {
|
|
142
|
-
this.runtimeContext = { ...this.runtimeContext, ...resume.snapshotRuntimeContext };
|
|
143
|
-
}
|
|
144
140
|
const stepResults = resume?.stepResults || { input };
|
|
145
141
|
let lastOutput;
|
|
146
142
|
for (let i = startIdx; i < steps.length; i++) {
|
|
@@ -184,7 +180,8 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
184
180
|
executionContext: lastOutput.executionContext,
|
|
185
181
|
workflowStatus: result2.status,
|
|
186
182
|
result: result2.result,
|
|
187
|
-
error: result2.error
|
|
183
|
+
error: result2.error,
|
|
184
|
+
runtimeContext: params.runtimeContext
|
|
188
185
|
});
|
|
189
186
|
return result2;
|
|
190
187
|
}
|
|
@@ -215,7 +212,8 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
215
212
|
executionContext: lastOutput.executionContext,
|
|
216
213
|
workflowStatus: result2.status,
|
|
217
214
|
result: result2.result,
|
|
218
|
-
error: result2.error
|
|
215
|
+
error: result2.error,
|
|
216
|
+
runtimeContext: params.runtimeContext
|
|
219
217
|
});
|
|
220
218
|
return result2;
|
|
221
219
|
}
|
|
@@ -229,7 +227,8 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
229
227
|
executionContext: lastOutput.executionContext,
|
|
230
228
|
workflowStatus: result.status,
|
|
231
229
|
result: result.result,
|
|
232
|
-
error: result.error
|
|
230
|
+
error: result.error,
|
|
231
|
+
runtimeContext: params.runtimeContext
|
|
233
232
|
});
|
|
234
233
|
return result;
|
|
235
234
|
}
|
|
@@ -453,16 +452,10 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
453
452
|
try {
|
|
454
453
|
let suspended;
|
|
455
454
|
let bailed;
|
|
456
|
-
let runtimeContextToUse = runtimeContext;
|
|
457
|
-
Object.entries(this.runtimeContext).forEach(([key, value]) => {
|
|
458
|
-
if (!runtimeContextToUse.has(key)) {
|
|
459
|
-
runtimeContextToUse.set(key, value);
|
|
460
|
-
}
|
|
461
|
-
});
|
|
462
455
|
const result = await runStep({
|
|
463
456
|
runId,
|
|
464
457
|
mastra: this.mastra,
|
|
465
|
-
runtimeContext
|
|
458
|
+
runtimeContext,
|
|
466
459
|
inputData: prevOutput,
|
|
467
460
|
runCount: this.getOrGenerateRunCount(step.id),
|
|
468
461
|
resumeData: resume?.steps[0] === step.id ? resume?.resumePayload : void 0,
|
|
@@ -497,11 +490,6 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
497
490
|
engine: {},
|
|
498
491
|
abortSignal: abortController?.signal
|
|
499
492
|
});
|
|
500
|
-
let runtimeContextObj = {};
|
|
501
|
-
runtimeContext.forEach((value, key) => {
|
|
502
|
-
runtimeContextObj[key] = value;
|
|
503
|
-
});
|
|
504
|
-
this.runtimeContext = { ...this.runtimeContext, ...runtimeContextObj };
|
|
505
493
|
if (suspended) {
|
|
506
494
|
execResults = { status: "suspended", suspendPayload: suspended.payload, suspendedAt: Date.now() };
|
|
507
495
|
} else if (bailed) {
|
|
@@ -996,8 +984,13 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
996
984
|
executionContext,
|
|
997
985
|
workflowStatus,
|
|
998
986
|
result,
|
|
999
|
-
error
|
|
987
|
+
error,
|
|
988
|
+
runtimeContext
|
|
1000
989
|
}) {
|
|
990
|
+
const runtimeContextObj = {};
|
|
991
|
+
runtimeContext.forEach((value, key) => {
|
|
992
|
+
runtimeContextObj[key] = value;
|
|
993
|
+
});
|
|
1001
994
|
await this.mastra?.getStorage()?.persistWorkflowSnapshot({
|
|
1002
995
|
workflowName: workflowId,
|
|
1003
996
|
runId,
|
|
@@ -1011,7 +1004,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
1011
1004
|
suspendedPaths: executionContext.suspendedPaths,
|
|
1012
1005
|
result,
|
|
1013
1006
|
error,
|
|
1014
|
-
runtimeContext:
|
|
1007
|
+
runtimeContext: runtimeContextObj,
|
|
1015
1008
|
// @ts-ignore
|
|
1016
1009
|
timestamp: Date.now()
|
|
1017
1010
|
}
|
|
@@ -1167,7 +1160,8 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
1167
1160
|
serializedStepGraph,
|
|
1168
1161
|
stepResults,
|
|
1169
1162
|
executionContext,
|
|
1170
|
-
workflowStatus: "waiting"
|
|
1163
|
+
workflowStatus: "waiting",
|
|
1164
|
+
runtimeContext
|
|
1171
1165
|
});
|
|
1172
1166
|
await this.executeSleep({
|
|
1173
1167
|
workflowId,
|
|
@@ -1189,7 +1183,8 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
1189
1183
|
serializedStepGraph,
|
|
1190
1184
|
stepResults,
|
|
1191
1185
|
executionContext,
|
|
1192
|
-
workflowStatus: "running"
|
|
1186
|
+
workflowStatus: "running",
|
|
1187
|
+
runtimeContext
|
|
1193
1188
|
});
|
|
1194
1189
|
const endedAt = Date.now();
|
|
1195
1190
|
const stepInfo = {
|
|
@@ -1276,7 +1271,8 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
1276
1271
|
serializedStepGraph,
|
|
1277
1272
|
stepResults,
|
|
1278
1273
|
executionContext,
|
|
1279
|
-
workflowStatus: "waiting"
|
|
1274
|
+
workflowStatus: "waiting",
|
|
1275
|
+
runtimeContext
|
|
1280
1276
|
});
|
|
1281
1277
|
await this.executeSleepUntil({
|
|
1282
1278
|
workflowId,
|
|
@@ -1298,7 +1294,8 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
1298
1294
|
serializedStepGraph,
|
|
1299
1295
|
stepResults,
|
|
1300
1296
|
executionContext,
|
|
1301
|
-
workflowStatus: "running"
|
|
1297
|
+
workflowStatus: "running",
|
|
1298
|
+
runtimeContext
|
|
1302
1299
|
});
|
|
1303
1300
|
const endedAt = Date.now();
|
|
1304
1301
|
const stepInfo = {
|
|
@@ -1386,7 +1383,8 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
1386
1383
|
serializedStepGraph,
|
|
1387
1384
|
stepResults,
|
|
1388
1385
|
executionContext,
|
|
1389
|
-
workflowStatus: "waiting"
|
|
1386
|
+
workflowStatus: "waiting",
|
|
1387
|
+
runtimeContext
|
|
1390
1388
|
});
|
|
1391
1389
|
try {
|
|
1392
1390
|
eventData = await this.executeWaitForEvent({ event: entry.event, emitter, timeout: entry.timeout });
|
|
@@ -1396,7 +1394,8 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
1396
1394
|
serializedStepGraph,
|
|
1397
1395
|
stepResults,
|
|
1398
1396
|
executionContext,
|
|
1399
|
-
workflowStatus: "running"
|
|
1397
|
+
workflowStatus: "running",
|
|
1398
|
+
runtimeContext
|
|
1400
1399
|
});
|
|
1401
1400
|
const { step } = entry;
|
|
1402
1401
|
execResults = await this.executeStep({
|
|
@@ -1440,7 +1439,8 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
1440
1439
|
serializedStepGraph,
|
|
1441
1440
|
stepResults,
|
|
1442
1441
|
executionContext,
|
|
1443
|
-
workflowStatus: execResults.status === "success" ? "running" : execResults.status
|
|
1442
|
+
workflowStatus: execResults.status === "success" ? "running" : execResults.status,
|
|
1443
|
+
runtimeContext
|
|
1444
1444
|
});
|
|
1445
1445
|
return { result: execResults, stepResults, executionContext };
|
|
1446
1446
|
}
|
|
@@ -1449,7 +1449,7 @@ function mapVariable(config) {
|
|
|
1449
1449
|
return config;
|
|
1450
1450
|
}
|
|
1451
1451
|
function createStep(params) {
|
|
1452
|
-
if (params instanceof
|
|
1452
|
+
if (params instanceof chunkD6KIRZP6_cjs.Agent) {
|
|
1453
1453
|
return {
|
|
1454
1454
|
id: params.name,
|
|
1455
1455
|
// @ts-ignore
|
|
@@ -2336,6 +2336,12 @@ var Run = class {
|
|
|
2336
2336
|
params.runtimeContext.delete("__mastraWorflowInputData");
|
|
2337
2337
|
}
|
|
2338
2338
|
const stepResults = { ...snapshot?.context ?? {}, input: runtimeContextInput ?? snapshot?.context?.input };
|
|
2339
|
+
let runtimeContextToUse = params.runtimeContext ?? new chunkLABUWBKX_cjs.RuntimeContext();
|
|
2340
|
+
Object.entries(snapshot?.runtimeContext ?? {}).forEach(([key, value]) => {
|
|
2341
|
+
if (!runtimeContextToUse.has(key)) {
|
|
2342
|
+
runtimeContextToUse.set(key, value);
|
|
2343
|
+
}
|
|
2344
|
+
});
|
|
2339
2345
|
const executionResultPromise = this.executionEngine.execute({
|
|
2340
2346
|
workflowId: this.workflowId,
|
|
2341
2347
|
runId: this.runId,
|
|
@@ -2347,8 +2353,7 @@ var Run = class {
|
|
|
2347
2353
|
stepResults,
|
|
2348
2354
|
resumePayload: params.resumeData,
|
|
2349
2355
|
// @ts-ignore
|
|
2350
|
-
resumePath: snapshot?.suspendedPaths?.[steps?.[0]]
|
|
2351
|
-
snapshotRuntimeContext: snapshot?.runtimeContext
|
|
2356
|
+
resumePath: snapshot?.suspendedPaths?.[steps?.[0]]
|
|
2352
2357
|
},
|
|
2353
2358
|
emitter: {
|
|
2354
2359
|
emit: (event, data) => {
|
|
@@ -2365,7 +2370,7 @@ var Run = class {
|
|
|
2365
2370
|
this.emitter.once(event, callback);
|
|
2366
2371
|
}
|
|
2367
2372
|
},
|
|
2368
|
-
runtimeContext:
|
|
2373
|
+
runtimeContext: runtimeContextToUse,
|
|
2369
2374
|
abortController: this.abortController
|
|
2370
2375
|
}).then((result) => {
|
|
2371
2376
|
if (result.status !== "suspended") {
|
|
@@ -329,15 +329,19 @@ var MessageList = class _MessageList {
|
|
|
329
329
|
newResponseMessages = /* @__PURE__ */ new Set();
|
|
330
330
|
userContextMessages = /* @__PURE__ */ new Set();
|
|
331
331
|
generateMessageId;
|
|
332
|
+
_agentNetworkAppend = false;
|
|
332
333
|
constructor({
|
|
333
334
|
threadId,
|
|
334
335
|
resourceId,
|
|
335
|
-
generateMessageId
|
|
336
|
+
generateMessageId,
|
|
337
|
+
// @ts-ignore Flag for agent network messages
|
|
338
|
+
_agentNetworkAppend
|
|
336
339
|
} = {}) {
|
|
337
340
|
if (threadId) {
|
|
338
341
|
this.memoryInfo = { threadId, resourceId };
|
|
339
342
|
this.generateMessageId = generateMessageId;
|
|
340
343
|
}
|
|
344
|
+
this._agentNetworkAppend = _agentNetworkAppend || false;
|
|
341
345
|
}
|
|
342
346
|
add(messages, messageSource) {
|
|
343
347
|
if (!messages) return this;
|
|
@@ -565,12 +569,6 @@ var MessageList = class _MessageList {
|
|
|
565
569
|
const messageV2 = this.inputToMastraMessageV2(message, messageSource);
|
|
566
570
|
const { exists, shouldReplace, id } = this.shouldReplaceMessage(messageV2);
|
|
567
571
|
const latestMessage = this.messages.at(-1);
|
|
568
|
-
const singleToolResult = messageV2.role === `assistant` && messageV2.content.parts.length === 1 && messageV2.content.parts[0]?.type === `tool-invocation` && messageV2.content.parts[0].toolInvocation.state === `result` && messageV2.content.parts[0];
|
|
569
|
-
if (singleToolResult && (latestMessage?.role !== `assistant` || !latestMessage.content.parts.some(
|
|
570
|
-
(p) => p.type === `tool-invocation` && p.toolInvocation.toolCallId === singleToolResult.toolInvocation.toolCallId
|
|
571
|
-
))) {
|
|
572
|
-
return;
|
|
573
|
-
}
|
|
574
572
|
if (messageSource === `memory`) {
|
|
575
573
|
for (const existingMessage of this.messages) {
|
|
576
574
|
if (_MessageList.messagesAreEqual(existingMessage, messageV2)) {
|
|
@@ -578,24 +576,10 @@ var MessageList = class _MessageList {
|
|
|
578
576
|
}
|
|
579
577
|
}
|
|
580
578
|
}
|
|
581
|
-
const
|
|
582
|
-
|
|
583
|
-
const
|
|
584
|
-
|
|
585
|
-
const shouldAppendToLastAssistantMessageParts = shouldAppendToLastAssistantMessage && newMessageFirstPartType && (newMessageFirstPartType === `tool-invocation` && latestMessagePartType !== `text` || newMessageFirstPartType === latestMessagePartType && shouldMergeNewMessages);
|
|
586
|
-
if (
|
|
587
|
-
// backwards compat check!
|
|
588
|
-
// this condition can technically be removed and it will make it so all new assistant parts will be added to the last assistant message parts instead of creating new db entries.
|
|
589
|
-
// however, for any downstream code that isn't based around using message parts yet, this may cause tool invocations to show up in the wrong order in their UI, because they use the message.toolInvocations and message.content properties which do not indicate how each is ordered in relation to each other.
|
|
590
|
-
// this code check then causes any tool invocation to be created as a new message and not update the previous assistant message parts.
|
|
591
|
-
// without this condition we will see something like
|
|
592
|
-
// parts: [{type:"step-start"}, {type: "text", text: "let me check the weather"}, {type: "tool-invocation", toolInvocation: x}, {type: "text", text: "the weather in x is y"}]
|
|
593
|
-
// with this condition we will see
|
|
594
|
-
// message1.parts: [{type:"step-start"}, {type: "text", text: "let me check the weather"}]
|
|
595
|
-
// message2.parts: [{type: "tool-invocation", toolInvocation: x}]
|
|
596
|
-
// message3.parts: [{type: "text", text: "the weather in x is y"}]
|
|
597
|
-
shouldAppendToLastAssistantMessageParts
|
|
598
|
-
) {
|
|
579
|
+
const shouldAppendToLastAssistantMessage = latestMessage?.role === "assistant" && messageV2.role === "assistant" && latestMessage.threadId === messageV2.threadId && // If the message is from memory, don't append to the last assistant message
|
|
580
|
+
messageSource !== "memory";
|
|
581
|
+
const appendNetworkMessage = this._agentNetworkAppend && latestMessage && !this.memoryMessages.has(latestMessage) || !this._agentNetworkAppend;
|
|
582
|
+
if (shouldAppendToLastAssistantMessage && appendNetworkMessage) {
|
|
599
583
|
latestMessage.createdAt = messageV2.createdAt || latestMessage.createdAt;
|
|
600
584
|
for (const [index, part] of messageV2.content.parts.entries()) {
|
|
601
585
|
if (part.type === "tool-invocation" && part.toolInvocation.state === "result") {
|
|
@@ -609,10 +593,13 @@ var MessageList = class _MessageList {
|
|
|
609
593
|
if (!latestMessage.content.toolInvocations) {
|
|
610
594
|
latestMessage.content.toolInvocations = [];
|
|
611
595
|
}
|
|
612
|
-
|
|
596
|
+
const toolInvocationIndex = latestMessage.content.toolInvocations.findIndex(
|
|
613
597
|
(t) => t.toolCallId === existingCallPart.toolInvocation.toolCallId
|
|
614
|
-
)
|
|
598
|
+
);
|
|
599
|
+
if (toolInvocationIndex === -1) {
|
|
615
600
|
latestMessage.content.toolInvocations.push(existingCallPart.toolInvocation);
|
|
601
|
+
} else {
|
|
602
|
+
latestMessage.content.toolInvocations[toolInvocationIndex] = existingCallPart.toolInvocation;
|
|
616
603
|
}
|
|
617
604
|
}
|
|
618
605
|
} else if (
|
|
@@ -632,10 +619,8 @@ var MessageList = class _MessageList {
|
|
|
632
619
|
if (latestMessage.content.content && messageV2.content.content && latestMessage.content.content !== messageV2.content.content) {
|
|
633
620
|
latestMessage.content.content = messageV2.content.content;
|
|
634
621
|
}
|
|
622
|
+
this.newResponseMessages.add(latestMessage);
|
|
635
623
|
} else {
|
|
636
|
-
if (messageV2.role === "assistant" && messageV2.content.parts[0]?.type !== `step-start`) {
|
|
637
|
-
messageV2.content.parts.unshift({ type: "step-start" });
|
|
638
|
-
}
|
|
639
624
|
const existingIndex = shouldReplace && this.messages.findIndex((m) => m.id === id) || -1;
|
|
640
625
|
const existingMessage = existingIndex !== -1 && this.messages[existingIndex];
|
|
641
626
|
if (shouldReplace && existingMessage) {
|
|
@@ -893,7 +878,7 @@ var MessageList = class _MessageList {
|
|
|
893
878
|
for (const part of parts) {
|
|
894
879
|
key += part.type;
|
|
895
880
|
if (part.type === `text`) {
|
|
896
|
-
key += part.text.length
|
|
881
|
+
key += `${part.text.length}${part.text}`;
|
|
897
882
|
}
|
|
898
883
|
if (part.type === `tool-invocation`) {
|
|
899
884
|
key += part.toolInvocation.toolCallId;
|
|
@@ -331,15 +331,19 @@ var MessageList = class _MessageList {
|
|
|
331
331
|
newResponseMessages = /* @__PURE__ */ new Set();
|
|
332
332
|
userContextMessages = /* @__PURE__ */ new Set();
|
|
333
333
|
generateMessageId;
|
|
334
|
+
_agentNetworkAppend = false;
|
|
334
335
|
constructor({
|
|
335
336
|
threadId,
|
|
336
337
|
resourceId,
|
|
337
|
-
generateMessageId
|
|
338
|
+
generateMessageId,
|
|
339
|
+
// @ts-ignore Flag for agent network messages
|
|
340
|
+
_agentNetworkAppend
|
|
338
341
|
} = {}) {
|
|
339
342
|
if (threadId) {
|
|
340
343
|
this.memoryInfo = { threadId, resourceId };
|
|
341
344
|
this.generateMessageId = generateMessageId;
|
|
342
345
|
}
|
|
346
|
+
this._agentNetworkAppend = _agentNetworkAppend || false;
|
|
343
347
|
}
|
|
344
348
|
add(messages, messageSource) {
|
|
345
349
|
if (!messages) return this;
|
|
@@ -567,12 +571,6 @@ var MessageList = class _MessageList {
|
|
|
567
571
|
const messageV2 = this.inputToMastraMessageV2(message, messageSource);
|
|
568
572
|
const { exists, shouldReplace, id } = this.shouldReplaceMessage(messageV2);
|
|
569
573
|
const latestMessage = this.messages.at(-1);
|
|
570
|
-
const singleToolResult = messageV2.role === `assistant` && messageV2.content.parts.length === 1 && messageV2.content.parts[0]?.type === `tool-invocation` && messageV2.content.parts[0].toolInvocation.state === `result` && messageV2.content.parts[0];
|
|
571
|
-
if (singleToolResult && (latestMessage?.role !== `assistant` || !latestMessage.content.parts.some(
|
|
572
|
-
(p) => p.type === `tool-invocation` && p.toolInvocation.toolCallId === singleToolResult.toolInvocation.toolCallId
|
|
573
|
-
))) {
|
|
574
|
-
return;
|
|
575
|
-
}
|
|
576
574
|
if (messageSource === `memory`) {
|
|
577
575
|
for (const existingMessage of this.messages) {
|
|
578
576
|
if (_MessageList.messagesAreEqual(existingMessage, messageV2)) {
|
|
@@ -580,24 +578,10 @@ var MessageList = class _MessageList {
|
|
|
580
578
|
}
|
|
581
579
|
}
|
|
582
580
|
}
|
|
583
|
-
const
|
|
584
|
-
|
|
585
|
-
const
|
|
586
|
-
|
|
587
|
-
const shouldAppendToLastAssistantMessageParts = shouldAppendToLastAssistantMessage && newMessageFirstPartType && (newMessageFirstPartType === `tool-invocation` && latestMessagePartType !== `text` || newMessageFirstPartType === latestMessagePartType && shouldMergeNewMessages);
|
|
588
|
-
if (
|
|
589
|
-
// backwards compat check!
|
|
590
|
-
// this condition can technically be removed and it will make it so all new assistant parts will be added to the last assistant message parts instead of creating new db entries.
|
|
591
|
-
// however, for any downstream code that isn't based around using message parts yet, this may cause tool invocations to show up in the wrong order in their UI, because they use the message.toolInvocations and message.content properties which do not indicate how each is ordered in relation to each other.
|
|
592
|
-
// this code check then causes any tool invocation to be created as a new message and not update the previous assistant message parts.
|
|
593
|
-
// without this condition we will see something like
|
|
594
|
-
// parts: [{type:"step-start"}, {type: "text", text: "let me check the weather"}, {type: "tool-invocation", toolInvocation: x}, {type: "text", text: "the weather in x is y"}]
|
|
595
|
-
// with this condition we will see
|
|
596
|
-
// message1.parts: [{type:"step-start"}, {type: "text", text: "let me check the weather"}]
|
|
597
|
-
// message2.parts: [{type: "tool-invocation", toolInvocation: x}]
|
|
598
|
-
// message3.parts: [{type: "text", text: "the weather in x is y"}]
|
|
599
|
-
shouldAppendToLastAssistantMessageParts
|
|
600
|
-
) {
|
|
581
|
+
const shouldAppendToLastAssistantMessage = latestMessage?.role === "assistant" && messageV2.role === "assistant" && latestMessage.threadId === messageV2.threadId && // If the message is from memory, don't append to the last assistant message
|
|
582
|
+
messageSource !== "memory";
|
|
583
|
+
const appendNetworkMessage = this._agentNetworkAppend && latestMessage && !this.memoryMessages.has(latestMessage) || !this._agentNetworkAppend;
|
|
584
|
+
if (shouldAppendToLastAssistantMessage && appendNetworkMessage) {
|
|
601
585
|
latestMessage.createdAt = messageV2.createdAt || latestMessage.createdAt;
|
|
602
586
|
for (const [index, part] of messageV2.content.parts.entries()) {
|
|
603
587
|
if (part.type === "tool-invocation" && part.toolInvocation.state === "result") {
|
|
@@ -611,10 +595,13 @@ var MessageList = class _MessageList {
|
|
|
611
595
|
if (!latestMessage.content.toolInvocations) {
|
|
612
596
|
latestMessage.content.toolInvocations = [];
|
|
613
597
|
}
|
|
614
|
-
|
|
598
|
+
const toolInvocationIndex = latestMessage.content.toolInvocations.findIndex(
|
|
615
599
|
(t) => t.toolCallId === existingCallPart.toolInvocation.toolCallId
|
|
616
|
-
)
|
|
600
|
+
);
|
|
601
|
+
if (toolInvocationIndex === -1) {
|
|
617
602
|
latestMessage.content.toolInvocations.push(existingCallPart.toolInvocation);
|
|
603
|
+
} else {
|
|
604
|
+
latestMessage.content.toolInvocations[toolInvocationIndex] = existingCallPart.toolInvocation;
|
|
618
605
|
}
|
|
619
606
|
}
|
|
620
607
|
} else if (
|
|
@@ -634,10 +621,8 @@ var MessageList = class _MessageList {
|
|
|
634
621
|
if (latestMessage.content.content && messageV2.content.content && latestMessage.content.content !== messageV2.content.content) {
|
|
635
622
|
latestMessage.content.content = messageV2.content.content;
|
|
636
623
|
}
|
|
624
|
+
this.newResponseMessages.add(latestMessage);
|
|
637
625
|
} else {
|
|
638
|
-
if (messageV2.role === "assistant" && messageV2.content.parts[0]?.type !== `step-start`) {
|
|
639
|
-
messageV2.content.parts.unshift({ type: "step-start" });
|
|
640
|
-
}
|
|
641
626
|
const existingIndex = shouldReplace && this.messages.findIndex((m) => m.id === id) || -1;
|
|
642
627
|
const existingMessage = existingIndex !== -1 && this.messages[existingIndex];
|
|
643
628
|
if (shouldReplace && existingMessage) {
|
|
@@ -895,7 +880,7 @@ var MessageList = class _MessageList {
|
|
|
895
880
|
for (const part of parts) {
|
|
896
881
|
key += part.type;
|
|
897
882
|
if (part.type === `text`) {
|
|
898
|
-
key += part.text.length
|
|
883
|
+
key += `${part.text.length}${part.text}`;
|
|
899
884
|
}
|
|
900
885
|
if (part.type === `tool-invocation`) {
|
|
901
886
|
key += part.toolInvocation.toolCallId;
|
package/dist/eval/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { M as Metric, T as TestInfo, E as EvaluationResult } from '../types-Bo1uigWx.cjs';
|
|
2
2
|
export { a as MetricResult } from '../types-Bo1uigWx.cjs';
|
|
3
|
-
import { A as Agent } from '../base-
|
|
3
|
+
import { A as Agent } from '../base-DsnZAIo1.cjs';
|
|
4
4
|
import 'ai';
|
|
5
5
|
import '../base-B_y9sMg0.cjs';
|
|
6
6
|
import '@opentelemetry/api';
|
package/dist/eval/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { M as Metric, T as TestInfo, E as EvaluationResult } from '../types-Bo1uigWx.js';
|
|
2
2
|
export { a as MetricResult } from '../types-Bo1uigWx.js';
|
|
3
|
-
import { A as Agent } from '../base-
|
|
3
|
+
import { A as Agent } from '../base-5ZyKaTRr.js';
|
|
4
4
|
import 'ai';
|
|
5
5
|
import '../base-ClrXcCRx.js';
|
|
6
6
|
import '@opentelemetry/api';
|
package/dist/index.cjs
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkGWFS5DAR_cjs = require('./chunk-GWFS5DAR.cjs');
|
|
4
4
|
var chunkMP2QBLUJ_cjs = require('./chunk-MP2QBLUJ.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var chunkRIDAFDLW_cjs = require('./chunk-RIDAFDLW.cjs');
|
|
6
|
+
var chunk224GGYYJ_cjs = require('./chunk-224GGYYJ.cjs');
|
|
7
|
+
var chunk4IBEMZ5D_cjs = require('./chunk-4IBEMZ5D.cjs');
|
|
8
8
|
var chunkF2WMR75C_cjs = require('./chunk-F2WMR75C.cjs');
|
|
9
9
|
var chunkJ52TXHZV_cjs = require('./chunk-J52TXHZV.cjs');
|
|
10
10
|
var chunkB7SQOKEC_cjs = require('./chunk-B7SQOKEC.cjs');
|
|
11
11
|
var chunkMUNFCOMB_cjs = require('./chunk-MUNFCOMB.cjs');
|
|
12
12
|
var chunk7H2GET5Z_cjs = require('./chunk-7H2GET5Z.cjs');
|
|
13
|
-
var
|
|
13
|
+
var chunkD6KIRZP6_cjs = require('./chunk-D6KIRZP6.cjs');
|
|
14
14
|
var chunkST5RMVLG_cjs = require('./chunk-ST5RMVLG.cjs');
|
|
15
15
|
var chunkQQ5K5TZE_cjs = require('./chunk-QQ5K5TZE.cjs');
|
|
16
16
|
var chunkLBUQ6YNU_cjs = require('./chunk-LBUQ6YNU.cjs');
|
|
@@ -19,7 +19,7 @@ var chunkZZLBNB3U_cjs = require('./chunk-ZZLBNB3U.cjs');
|
|
|
19
19
|
var chunkP3Q73CAW_cjs = require('./chunk-P3Q73CAW.cjs');
|
|
20
20
|
|
|
21
21
|
// src/agent/index.warning.ts
|
|
22
|
-
var Agent2 = class extends
|
|
22
|
+
var Agent2 = class extends chunkD6KIRZP6_cjs.Agent {
|
|
23
23
|
constructor(config) {
|
|
24
24
|
super(config);
|
|
25
25
|
this.logger.warn('Please import "Agent from "@mastra/core/agent" instead of "@mastra/core"');
|
|
@@ -69,7 +69,7 @@ var OpenAPIToolset2 = class extends chunkB7SQOKEC_cjs.OpenAPIToolset {
|
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
// src/memory/index.warning.ts
|
|
72
|
-
var MastraMemory2 = class extends
|
|
72
|
+
var MastraMemory2 = class extends chunk224GGYYJ_cjs.MastraMemory {
|
|
73
73
|
constructor(_arg) {
|
|
74
74
|
super({ name: `Deprecated memory` });
|
|
75
75
|
this.logger.warn('Please import "MastraMemory" from "@mastra/core/memory" instead of "@mastra/core"');
|
|
@@ -101,7 +101,7 @@ var MastraVector2 = class extends chunkMP2QBLUJ_cjs.MastraVector {
|
|
|
101
101
|
};
|
|
102
102
|
|
|
103
103
|
// src/workflows/workflow.warning.ts
|
|
104
|
-
var Workflow2 = class extends
|
|
104
|
+
var Workflow2 = class extends chunkRIDAFDLW_cjs.Workflow {
|
|
105
105
|
constructor(args) {
|
|
106
106
|
super(args);
|
|
107
107
|
this.logger.warn('Please import "Workflow" from "@mastra/core/workflows" instead of "@mastra/core"');
|
|
@@ -110,55 +110,55 @@ var Workflow2 = class extends chunkZCU3PLIL_cjs.Workflow {
|
|
|
110
110
|
|
|
111
111
|
Object.defineProperty(exports, "DefaultExecutionEngine", {
|
|
112
112
|
enumerable: true,
|
|
113
|
-
get: function () { return
|
|
113
|
+
get: function () { return chunkRIDAFDLW_cjs.DefaultExecutionEngine; }
|
|
114
114
|
});
|
|
115
115
|
Object.defineProperty(exports, "ExecutionEngine", {
|
|
116
116
|
enumerable: true,
|
|
117
|
-
get: function () { return
|
|
117
|
+
get: function () { return chunkRIDAFDLW_cjs.ExecutionEngine; }
|
|
118
118
|
});
|
|
119
119
|
Object.defineProperty(exports, "Run", {
|
|
120
120
|
enumerable: true,
|
|
121
|
-
get: function () { return
|
|
121
|
+
get: function () { return chunkRIDAFDLW_cjs.Run; }
|
|
122
122
|
});
|
|
123
123
|
Object.defineProperty(exports, "cloneStep", {
|
|
124
124
|
enumerable: true,
|
|
125
|
-
get: function () { return
|
|
125
|
+
get: function () { return chunkRIDAFDLW_cjs.cloneStep; }
|
|
126
126
|
});
|
|
127
127
|
Object.defineProperty(exports, "cloneWorkflow", {
|
|
128
128
|
enumerable: true,
|
|
129
|
-
get: function () { return
|
|
129
|
+
get: function () { return chunkRIDAFDLW_cjs.cloneWorkflow; }
|
|
130
130
|
});
|
|
131
131
|
Object.defineProperty(exports, "createStep", {
|
|
132
132
|
enumerable: true,
|
|
133
|
-
get: function () { return
|
|
133
|
+
get: function () { return chunkRIDAFDLW_cjs.createStep; }
|
|
134
134
|
});
|
|
135
135
|
Object.defineProperty(exports, "createWorkflow", {
|
|
136
136
|
enumerable: true,
|
|
137
|
-
get: function () { return
|
|
137
|
+
get: function () { return chunkRIDAFDLW_cjs.createWorkflow; }
|
|
138
138
|
});
|
|
139
139
|
Object.defineProperty(exports, "mapVariable", {
|
|
140
140
|
enumerable: true,
|
|
141
|
-
get: function () { return
|
|
141
|
+
get: function () { return chunkRIDAFDLW_cjs.mapVariable; }
|
|
142
142
|
});
|
|
143
143
|
Object.defineProperty(exports, "MemoryProcessor", {
|
|
144
144
|
enumerable: true,
|
|
145
|
-
get: function () { return
|
|
145
|
+
get: function () { return chunk224GGYYJ_cjs.MemoryProcessor; }
|
|
146
146
|
});
|
|
147
147
|
Object.defineProperty(exports, "memoryDefaultOptions", {
|
|
148
148
|
enumerable: true,
|
|
149
|
-
get: function () { return
|
|
149
|
+
get: function () { return chunk224GGYYJ_cjs.memoryDefaultOptions; }
|
|
150
150
|
});
|
|
151
151
|
Object.defineProperty(exports, "CohereRelevanceScorer", {
|
|
152
152
|
enumerable: true,
|
|
153
|
-
get: function () { return
|
|
153
|
+
get: function () { return chunk4IBEMZ5D_cjs.CohereRelevanceScorer; }
|
|
154
154
|
});
|
|
155
155
|
Object.defineProperty(exports, "MastraAgentRelevanceScorer", {
|
|
156
156
|
enumerable: true,
|
|
157
|
-
get: function () { return
|
|
157
|
+
get: function () { return chunk4IBEMZ5D_cjs.MastraAgentRelevanceScorer; }
|
|
158
158
|
});
|
|
159
159
|
Object.defineProperty(exports, "createSimilarityPrompt", {
|
|
160
160
|
enumerable: true,
|
|
161
|
-
get: function () { return
|
|
161
|
+
get: function () { return chunk4IBEMZ5D_cjs.createSimilarityPrompt; }
|
|
162
162
|
});
|
|
163
163
|
Object.defineProperty(exports, "Metric", {
|
|
164
164
|
enumerable: true,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { M as Metric } from './types-Bo1uigWx.cjs';
|
|
2
2
|
export { E as EvaluationResult, a as MetricResult, T as TestInfo } from './types-Bo1uigWx.cjs';
|
|
3
|
-
import { c as ToolAction, A as Agent$1, av as AgentConfig, o as MastraStorage$1, b as MastraMemory$1, aw as DefaultEngineType, f as Step, e as Workflow$1, ax as WorkflowConfig } from './base-
|
|
4
|
-
export { aG as BaseStructuredOutputType, aX as Config, aB as CoreAssistantMessage, az as CoreMessage, aA as CoreSystemMessage, C as CoreTool, aD as CoreToolMessage, aC as CoreUserMessage, aQ as DefaultLLMStreamObjectOptions, aP as DefaultLLMStreamOptions, aO as DefaultLLMTextObjectOptions, aN as DefaultLLMTextOptions, aZ as DynamicArgument, bw as DynamicMapping, aF as EmbedManyResult, aE as EmbedResult, bo as Emitter, E as EvalRow, bn as ExecuteFunction, bm as ExecutionEngine, bl as ExecutionGraph, bz as ExtractSchemaFromStep, by as ExtractSchemaType, aK as GenerateReturn, at as InternalCoreTool, aU as LLMInnerStreamOptions, aV as LLMStreamObjectOptions, aT as LLMStreamOptions, aS as LLMTextObjectOptions, aR as LLMTextOptions, ay as LanguageModel, z as LegacyWorkflowRun, y as LegacyWorkflowRuns, M as Mastra, aY as MastraLanguageModel, v as MastraMessageV1, t as MastraMessageV2, b1 as MemoryConfig, b7 as MemoryProcessor, b6 as MemoryProcessorOpts, a$ as MessageResponse, a_ as MessageType, aM as OutputType, B as PaginationArgs, P as PaginationInfo, bx as PathsToStringProps, bk as Run, bb as SerializedStep, bc as SerializedStepFlowEntry, b2 as SharedMemoryConfig, bq as StepFailure, ba as StepFlowEntry, bu as StepResult, bs as StepRunning, bp as StepSuccess, br as StepSuspended, bt as StepWaiting, bd as StepWithComponent, bv as StepsRecord, q as StorageColumn, u as StorageGetMessagesArg, D as StorageGetTracesArg, s as StorageResourceType, r as StorageThreadType, bB as StreamEvent, aL as StreamReturn, aJ as StructuredOutput, aI as StructuredOutputArrayItem, aH as StructuredOutputType, b9 as Tool, au as ToolExecutionContext, b3 as TraceType, bA as VariableReference, V as VercelTool, bD as WatchEvent, bj as WorkflowResult, x as WorkflowRun, bF as WorkflowRunState, bC as WorkflowRunStatus, w as WorkflowRuns, b0 as WorkingMemory, b4 as WorkingMemoryFormat, b5 as WorkingMemoryTemplate, bE as ZodPathType, bg as cloneStep, bi as cloneWorkflow, aW as createMockModel, bf as createStep, as as createTool, bh as createWorkflow, be as mapVariable, b8 as memoryDefaultOptions } from './base-
|
|
3
|
+
import { c as ToolAction, A as Agent$1, av as AgentConfig, o as MastraStorage$1, b as MastraMemory$1, aw as DefaultEngineType, f as Step, e as Workflow$1, ax as WorkflowConfig } from './base-DsnZAIo1.cjs';
|
|
4
|
+
export { aG as BaseStructuredOutputType, aX as Config, aB as CoreAssistantMessage, az as CoreMessage, aA as CoreSystemMessage, C as CoreTool, aD as CoreToolMessage, aC as CoreUserMessage, aQ as DefaultLLMStreamObjectOptions, aP as DefaultLLMStreamOptions, aO as DefaultLLMTextObjectOptions, aN as DefaultLLMTextOptions, aZ as DynamicArgument, bw as DynamicMapping, aF as EmbedManyResult, aE as EmbedResult, bo as Emitter, E as EvalRow, bn as ExecuteFunction, bm as ExecutionEngine, bl as ExecutionGraph, bz as ExtractSchemaFromStep, by as ExtractSchemaType, aK as GenerateReturn, at as InternalCoreTool, aU as LLMInnerStreamOptions, aV as LLMStreamObjectOptions, aT as LLMStreamOptions, aS as LLMTextObjectOptions, aR as LLMTextOptions, ay as LanguageModel, z as LegacyWorkflowRun, y as LegacyWorkflowRuns, M as Mastra, aY as MastraLanguageModel, v as MastraMessageV1, t as MastraMessageV2, b1 as MemoryConfig, b7 as MemoryProcessor, b6 as MemoryProcessorOpts, a$ as MessageResponse, a_ as MessageType, aM as OutputType, B as PaginationArgs, P as PaginationInfo, bx as PathsToStringProps, bk as Run, bb as SerializedStep, bc as SerializedStepFlowEntry, b2 as SharedMemoryConfig, bq as StepFailure, ba as StepFlowEntry, bu as StepResult, bs as StepRunning, bp as StepSuccess, br as StepSuspended, bt as StepWaiting, bd as StepWithComponent, bv as StepsRecord, q as StorageColumn, u as StorageGetMessagesArg, D as StorageGetTracesArg, s as StorageResourceType, r as StorageThreadType, bB as StreamEvent, aL as StreamReturn, aJ as StructuredOutput, aI as StructuredOutputArrayItem, aH as StructuredOutputType, b9 as Tool, au as ToolExecutionContext, b3 as TraceType, bA as VariableReference, V as VercelTool, bD as WatchEvent, bj as WorkflowResult, x as WorkflowRun, bF as WorkflowRunState, bC as WorkflowRunStatus, w as WorkflowRuns, b0 as WorkingMemory, b4 as WorkingMemoryFormat, b5 as WorkingMemoryTemplate, bE as ZodPathType, bg as cloneStep, bi as cloneWorkflow, aW as createMockModel, bf as createStep, as as createTool, bh as createWorkflow, be as mapVariable, b8 as memoryDefaultOptions } from './base-DsnZAIo1.cjs';
|
|
5
5
|
import { M as MastraBase$1 } from './base-B_y9sMg0.cjs';
|
|
6
6
|
export { O as OtelConfig, S as SamplingStrategy, a as Telemetry, T as Trace } from './base-B_y9sMg0.cjs';
|
|
7
7
|
import { R as RegisteredLogger } from './logger-B8XXh6ya.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { M as Metric } from './types-Bo1uigWx.js';
|
|
2
2
|
export { E as EvaluationResult, a as MetricResult, T as TestInfo } from './types-Bo1uigWx.js';
|
|
3
|
-
import { c as ToolAction, A as Agent$1, av as AgentConfig, o as MastraStorage$1, b as MastraMemory$1, aw as DefaultEngineType, f as Step, e as Workflow$1, ax as WorkflowConfig } from './base-
|
|
4
|
-
export { aG as BaseStructuredOutputType, aX as Config, aB as CoreAssistantMessage, az as CoreMessage, aA as CoreSystemMessage, C as CoreTool, aD as CoreToolMessage, aC as CoreUserMessage, aQ as DefaultLLMStreamObjectOptions, aP as DefaultLLMStreamOptions, aO as DefaultLLMTextObjectOptions, aN as DefaultLLMTextOptions, aZ as DynamicArgument, bw as DynamicMapping, aF as EmbedManyResult, aE as EmbedResult, bo as Emitter, E as EvalRow, bn as ExecuteFunction, bm as ExecutionEngine, bl as ExecutionGraph, bz as ExtractSchemaFromStep, by as ExtractSchemaType, aK as GenerateReturn, at as InternalCoreTool, aU as LLMInnerStreamOptions, aV as LLMStreamObjectOptions, aT as LLMStreamOptions, aS as LLMTextObjectOptions, aR as LLMTextOptions, ay as LanguageModel, z as LegacyWorkflowRun, y as LegacyWorkflowRuns, M as Mastra, aY as MastraLanguageModel, v as MastraMessageV1, t as MastraMessageV2, b1 as MemoryConfig, b7 as MemoryProcessor, b6 as MemoryProcessorOpts, a$ as MessageResponse, a_ as MessageType, aM as OutputType, B as PaginationArgs, P as PaginationInfo, bx as PathsToStringProps, bk as Run, bb as SerializedStep, bc as SerializedStepFlowEntry, b2 as SharedMemoryConfig, bq as StepFailure, ba as StepFlowEntry, bu as StepResult, bs as StepRunning, bp as StepSuccess, br as StepSuspended, bt as StepWaiting, bd as StepWithComponent, bv as StepsRecord, q as StorageColumn, u as StorageGetMessagesArg, D as StorageGetTracesArg, s as StorageResourceType, r as StorageThreadType, bB as StreamEvent, aL as StreamReturn, aJ as StructuredOutput, aI as StructuredOutputArrayItem, aH as StructuredOutputType, b9 as Tool, au as ToolExecutionContext, b3 as TraceType, bA as VariableReference, V as VercelTool, bD as WatchEvent, bj as WorkflowResult, x as WorkflowRun, bF as WorkflowRunState, bC as WorkflowRunStatus, w as WorkflowRuns, b0 as WorkingMemory, b4 as WorkingMemoryFormat, b5 as WorkingMemoryTemplate, bE as ZodPathType, bg as cloneStep, bi as cloneWorkflow, aW as createMockModel, bf as createStep, as as createTool, bh as createWorkflow, be as mapVariable, b8 as memoryDefaultOptions } from './base-
|
|
3
|
+
import { c as ToolAction, A as Agent$1, av as AgentConfig, o as MastraStorage$1, b as MastraMemory$1, aw as DefaultEngineType, f as Step, e as Workflow$1, ax as WorkflowConfig } from './base-5ZyKaTRr.js';
|
|
4
|
+
export { aG as BaseStructuredOutputType, aX as Config, aB as CoreAssistantMessage, az as CoreMessage, aA as CoreSystemMessage, C as CoreTool, aD as CoreToolMessage, aC as CoreUserMessage, aQ as DefaultLLMStreamObjectOptions, aP as DefaultLLMStreamOptions, aO as DefaultLLMTextObjectOptions, aN as DefaultLLMTextOptions, aZ as DynamicArgument, bw as DynamicMapping, aF as EmbedManyResult, aE as EmbedResult, bo as Emitter, E as EvalRow, bn as ExecuteFunction, bm as ExecutionEngine, bl as ExecutionGraph, bz as ExtractSchemaFromStep, by as ExtractSchemaType, aK as GenerateReturn, at as InternalCoreTool, aU as LLMInnerStreamOptions, aV as LLMStreamObjectOptions, aT as LLMStreamOptions, aS as LLMTextObjectOptions, aR as LLMTextOptions, ay as LanguageModel, z as LegacyWorkflowRun, y as LegacyWorkflowRuns, M as Mastra, aY as MastraLanguageModel, v as MastraMessageV1, t as MastraMessageV2, b1 as MemoryConfig, b7 as MemoryProcessor, b6 as MemoryProcessorOpts, a$ as MessageResponse, a_ as MessageType, aM as OutputType, B as PaginationArgs, P as PaginationInfo, bx as PathsToStringProps, bk as Run, bb as SerializedStep, bc as SerializedStepFlowEntry, b2 as SharedMemoryConfig, bq as StepFailure, ba as StepFlowEntry, bu as StepResult, bs as StepRunning, bp as StepSuccess, br as StepSuspended, bt as StepWaiting, bd as StepWithComponent, bv as StepsRecord, q as StorageColumn, u as StorageGetMessagesArg, D as StorageGetTracesArg, s as StorageResourceType, r as StorageThreadType, bB as StreamEvent, aL as StreamReturn, aJ as StructuredOutput, aI as StructuredOutputArrayItem, aH as StructuredOutputType, b9 as Tool, au as ToolExecutionContext, b3 as TraceType, bA as VariableReference, V as VercelTool, bD as WatchEvent, bj as WorkflowResult, x as WorkflowRun, bF as WorkflowRunState, bC as WorkflowRunStatus, w as WorkflowRuns, b0 as WorkingMemory, b4 as WorkingMemoryFormat, b5 as WorkingMemoryTemplate, bE as ZodPathType, bg as cloneStep, bi as cloneWorkflow, aW as createMockModel, bf as createStep, as as createTool, bh as createWorkflow, be as mapVariable, b8 as memoryDefaultOptions } from './base-5ZyKaTRr.js';
|
|
5
5
|
import { M as MastraBase$1 } from './base-ClrXcCRx.js';
|
|
6
6
|
export { O as OtelConfig, S as SamplingStrategy, a as Telemetry, T as Trace } from './base-ClrXcCRx.js';
|
|
7
7
|
import { R as RegisteredLogger } from './logger-Bpa2oLL4.js';
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { MastraTTS } from './chunk-GH2KM66J.js';
|
|
2
2
|
import { MastraVector } from './chunk-V5D2LIF5.js';
|
|
3
|
-
import { Workflow } from './chunk-
|
|
4
|
-
export { DefaultExecutionEngine, ExecutionEngine, Run, cloneStep, cloneWorkflow, createStep, createWorkflow, mapVariable } from './chunk-
|
|
5
|
-
import { MastraMemory } from './chunk-
|
|
6
|
-
export { MemoryProcessor, memoryDefaultOptions } from './chunk-
|
|
7
|
-
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from './chunk-
|
|
3
|
+
import { Workflow } from './chunk-3OHBKAKC.js';
|
|
4
|
+
export { DefaultExecutionEngine, ExecutionEngine, Run, cloneStep, cloneWorkflow, createStep, createWorkflow, mapVariable } from './chunk-3OHBKAKC.js';
|
|
5
|
+
import { MastraMemory } from './chunk-OJ2V2VOQ.js';
|
|
6
|
+
export { MemoryProcessor, memoryDefaultOptions } from './chunk-OJ2V2VOQ.js';
|
|
7
|
+
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from './chunk-BC2VBD36.js';
|
|
8
8
|
import { MastraStorage } from './chunk-FL5SZ2XU.js';
|
|
9
9
|
export { Metric, evaluate } from './chunk-AKYTYALY.js';
|
|
10
10
|
import { Integration, OpenAPIToolset } from './chunk-4UWPFBC6.js';
|
|
11
11
|
export { createMockModel } from './chunk-HNEE7IF4.js';
|
|
12
12
|
export { Mastra } from './chunk-7XQIPES3.js';
|
|
13
|
-
import { Agent } from './chunk-
|
|
13
|
+
import { Agent } from './chunk-IYBAMING.js';
|
|
14
14
|
export { AvailableHooks, executeHook, registerHook } from './chunk-BB4KXGBU.js';
|
|
15
15
|
export { InstrumentClass, OTLPTraceExporter as OTLPStorageExporter, Telemetry, getBaggageValues, hasActiveTelemetry, withSpan } from './chunk-TC2SCOTE.js';
|
|
16
16
|
export { checkEvalStorageFields, createMastraProxy, deepMerge, delay, ensureToolProperties, generateEmptyFromSchema, isCoreMessage, isUiMessage, isZodType, makeCoreTool, maskStreamTags, parseFieldKey, parseSqlIdentifier, resolveSerializedZodOutput } from './chunk-IBKM5CLQ.js';
|
package/dist/llm/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'ai';
|
|
2
2
|
import 'json-schema';
|
|
3
3
|
import 'zod';
|
|
4
|
-
export { aG as BaseStructuredOutputType, aB as CoreAssistantMessage, az as CoreMessage, aA as CoreSystemMessage, aD as CoreToolMessage, aC as CoreUserMessage, aQ as DefaultLLMStreamObjectOptions, aP as DefaultLLMStreamOptions, aO as DefaultLLMTextObjectOptions, aN as DefaultLLMTextOptions, aF as EmbedManyResult, aE as EmbedResult, aK as GenerateReturn, aU as LLMInnerStreamOptions, aV as LLMStreamObjectOptions, aT as LLMStreamOptions, aS as LLMTextObjectOptions, aR as LLMTextOptions, ay as LanguageModel, aM as OutputType, aL as StreamReturn, aJ as StructuredOutput, aI as StructuredOutputArrayItem, aH as StructuredOutputType, aW as createMockModel } from '../base-
|
|
4
|
+
export { aG as BaseStructuredOutputType, aB as CoreAssistantMessage, az as CoreMessage, aA as CoreSystemMessage, aD as CoreToolMessage, aC as CoreUserMessage, aQ as DefaultLLMStreamObjectOptions, aP as DefaultLLMStreamOptions, aO as DefaultLLMTextObjectOptions, aN as DefaultLLMTextOptions, aF as EmbedManyResult, aE as EmbedResult, aK as GenerateReturn, aU as LLMInnerStreamOptions, aV as LLMStreamObjectOptions, aT as LLMStreamOptions, aS as LLMTextObjectOptions, aR as LLMTextOptions, ay as LanguageModel, aM as OutputType, aL as StreamReturn, aJ as StructuredOutput, aI as StructuredOutputArrayItem, aH as StructuredOutputType, aW as createMockModel } from '../base-DsnZAIo1.cjs';
|
|
5
5
|
import '../runtime-context/index.cjs';
|
|
6
6
|
import '../base-B_y9sMg0.cjs';
|
|
7
7
|
import '@opentelemetry/api';
|