@mastra/core 1.0.0-beta.6 → 1.0.0-beta.7
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 +175 -0
- package/dist/agent/agent-legacy.d.ts.map +1 -1
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/index.cjs +9 -9
- package/dist/agent/index.js +2 -2
- package/dist/agent/message-list/index.cjs +3 -3
- package/dist/agent/message-list/index.js +1 -1
- package/dist/agent/workflows/prepare-stream/map-results-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/prepare-memory-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/schema.d.ts +2 -1
- package/dist/agent/workflows/prepare-stream/schema.d.ts.map +1 -1
- package/dist/{chunk-LDWBLENZ.cjs → chunk-26YAGTXK.cjs} +23 -23
- package/dist/{chunk-LDWBLENZ.cjs.map → chunk-26YAGTXK.cjs.map} +1 -1
- package/dist/{chunk-NHNXIYDG.cjs → chunk-3EYBRHB2.cjs} +2 -2
- package/dist/chunk-3EYBRHB2.cjs.map +1 -0
- package/dist/{chunk-AQAIS7FH.cjs → chunk-3JA6VPNM.cjs} +2 -2
- package/dist/chunk-3JA6VPNM.cjs.map +1 -0
- package/dist/{chunk-IWTMMUQY.cjs → chunk-4AP234N6.cjs} +4 -4
- package/dist/{chunk-IWTMMUQY.cjs.map → chunk-4AP234N6.cjs.map} +1 -1
- package/dist/{chunk-WDRA4WKG.js → chunk-4GTU7MB2.js} +5 -5
- package/dist/{chunk-WDRA4WKG.js.map → chunk-4GTU7MB2.js.map} +1 -1
- package/dist/{chunk-XY337TTF.js → chunk-5T53HHNP.js} +4 -4
- package/dist/{chunk-XY337TTF.js.map → chunk-5T53HHNP.js.map} +1 -1
- package/dist/{chunk-RTROJFEU.cjs → chunk-6C2PU6J4.cjs} +8 -8
- package/dist/{chunk-RTROJFEU.cjs.map → chunk-6C2PU6J4.cjs.map} +1 -1
- package/dist/chunk-AZQMPE7G.cjs +4981 -0
- package/dist/chunk-AZQMPE7G.cjs.map +1 -0
- package/dist/{chunk-HNHZGFZY.cjs → chunk-CZEJQSWB.cjs} +10 -2
- package/dist/chunk-CZEJQSWB.cjs.map +1 -0
- package/dist/{chunk-APMPOYPI.js → chunk-DMPHPHMU.js} +3 -3
- package/dist/{chunk-APMPOYPI.js.map → chunk-DMPHPHMU.js.map} +1 -1
- package/dist/{chunk-TS7B26US.js → chunk-EE5NIGJ4.js} +3 -3
- package/dist/{chunk-TS7B26US.js.map → chunk-EE5NIGJ4.js.map} +1 -1
- package/dist/{chunk-NIUEWICQ.js → chunk-EPMSC67U.js} +8 -8
- package/dist/{chunk-NIUEWICQ.js.map → chunk-EPMSC67U.js.map} +1 -1
- package/dist/{chunk-LEZIKVRQ.js → chunk-F54IK3GJ.js} +2 -2
- package/dist/chunk-F54IK3GJ.js.map +1 -0
- package/dist/{chunk-FYP3AT6W.js → chunk-FNSFXWDN.js} +2 -2
- package/dist/chunk-FNSFXWDN.js.map +1 -0
- package/dist/{chunk-OPALPWAM.js → chunk-G32WDDGV.js} +42 -5
- package/dist/chunk-G32WDDGV.js.map +1 -0
- package/dist/{chunk-DXMSVGJ6.js → chunk-GZ6MCDK2.js} +20 -59
- package/dist/chunk-GZ6MCDK2.js.map +1 -0
- package/dist/{chunk-S5FPOCQF.cjs → chunk-HJNEZRI4.cjs} +24 -24
- package/dist/{chunk-S5FPOCQF.cjs.map → chunk-HJNEZRI4.cjs.map} +1 -1
- package/dist/{chunk-3TKNXJES.cjs → chunk-M7CQULF7.cjs} +46 -6
- package/dist/chunk-M7CQULF7.cjs.map +1 -0
- package/dist/{chunk-TARWUQG6.js → chunk-NAKPEQEQ.js} +8 -8
- package/dist/{chunk-TARWUQG6.js.map → chunk-NAKPEQEQ.js.map} +1 -1
- package/dist/{chunk-OIMB2SNZ.cjs → chunk-PJ7AYWAX.cjs} +14 -14
- package/dist/{chunk-OIMB2SNZ.cjs.map → chunk-PJ7AYWAX.cjs.map} +1 -1
- package/dist/{chunk-7ZADRRDW.js → chunk-PK2A5WBG.js} +3 -3
- package/dist/chunk-PK2A5WBG.js.map +1 -0
- package/dist/{chunk-45NA5ZD3.js → chunk-POM7FCH5.js} +87 -22
- package/dist/chunk-POM7FCH5.js.map +1 -0
- package/dist/{chunk-NN3NOFRU.cjs → chunk-RBBEMTMA.cjs} +134 -69
- package/dist/chunk-RBBEMTMA.cjs.map +1 -0
- package/dist/chunk-TLLXRG2Z.js +4959 -0
- package/dist/chunk-TLLXRG2Z.js.map +1 -0
- package/dist/{chunk-SVLMF4UZ.cjs → chunk-TQB2HMEC.cjs} +45 -44
- package/dist/chunk-TQB2HMEC.cjs.map +1 -0
- package/dist/{chunk-KZLP6TPJ.js → chunk-URBPEE67.js} +4 -4
- package/dist/{chunk-KZLP6TPJ.js.map → chunk-URBPEE67.js.map} +1 -1
- package/dist/{chunk-6J4NRNT2.cjs → chunk-URMN7TTH.cjs} +21 -60
- package/dist/chunk-URMN7TTH.cjs.map +1 -0
- package/dist/{chunk-4KUOSXJ7.cjs → chunk-VBKMNIWK.cjs} +11 -11
- package/dist/{chunk-4KUOSXJ7.cjs.map → chunk-VBKMNIWK.cjs.map} +1 -1
- package/dist/{chunk-VRFSEZBA.cjs → chunk-YBEW5YWC.cjs} +6 -6
- package/dist/{chunk-VRFSEZBA.cjs.map → chunk-YBEW5YWC.cjs.map} +1 -1
- package/dist/{chunk-SQAX4OW6.cjs → chunk-YUXTDKYN.cjs} +15 -15
- package/dist/{chunk-SQAX4OW6.cjs.map → chunk-YUXTDKYN.cjs.map} +1 -1
- package/dist/{chunk-RHTV5C5D.cjs → chunk-YWMMBIOM.cjs} +9 -9
- package/dist/{chunk-RHTV5C5D.cjs.map → chunk-YWMMBIOM.cjs.map} +1 -1
- package/dist/{chunk-6GOLI2EY.js → chunk-Z4Y554NX.js} +3 -3
- package/dist/{chunk-6GOLI2EY.js.map → chunk-Z4Y554NX.js.map} +1 -1
- package/dist/{chunk-WMAMOYRR.js → chunk-Z57R5WS4.js} +4 -4
- package/dist/{chunk-WMAMOYRR.js.map → chunk-Z57R5WS4.js.map} +1 -1
- package/dist/{chunk-QM5SRDJX.js → chunk-ZUWJCGLM.js} +5 -4
- package/dist/chunk-ZUWJCGLM.js.map +1 -0
- package/dist/evals/index.cjs +9 -9
- package/dist/evals/index.js +2 -2
- package/dist/evals/scoreTraces/index.cjs +5 -5
- package/dist/evals/scoreTraces/index.js +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/llm/index.cjs +15 -15
- package/dist/llm/index.js +5 -5
- package/dist/llm/model/gateways/constants.d.ts.map +1 -1
- package/dist/llm/model/gateways/models-dev.d.ts.map +1 -1
- package/dist/llm/model/model.loop.d.ts +1 -1
- package/dist/llm/model/model.loop.d.ts.map +1 -1
- package/dist/llm/model/provider-options.d.ts +4 -1
- package/dist/llm/model/provider-options.d.ts.map +1 -1
- package/dist/llm/model/provider-types.generated.d.ts +8 -22
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +1 -1
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
- package/dist/loop/workflows/stream.d.ts.map +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +6 -6
- package/dist/memory/index.js +1 -1
- package/dist/models-dev-6GD3644V.js +3 -0
- package/dist/{models-dev-F6MTIYTO.js.map → models-dev-6GD3644V.js.map} +1 -1
- package/dist/models-dev-IUQBXJSS.cjs +12 -0
- package/dist/{models-dev-XIVR5EJV.cjs.map → models-dev-IUQBXJSS.cjs.map} +1 -1
- package/dist/netlify-GXJ5D5DD.js +3 -0
- package/dist/{netlify-C2YBIK7A.js.map → netlify-GXJ5D5DD.js.map} +1 -1
- package/dist/netlify-KJLY3GFS.cjs +12 -0
- package/dist/{netlify-XWROOTP4.cjs.map → netlify-KJLY3GFS.cjs.map} +1 -1
- package/dist/observability/index.cjs +10 -10
- package/dist/observability/index.js +1 -1
- package/dist/observability/types/tracing.d.ts +18 -0
- package/dist/observability/types/tracing.d.ts.map +1 -1
- package/dist/processors/index.cjs +17 -17
- package/dist/processors/index.js +1 -1
- package/dist/provider-registry-7IFOXWPR.cjs +40 -0
- package/dist/{provider-registry-BXX7CA3H.cjs.map → provider-registry-7IFOXWPR.cjs.map} +1 -1
- package/dist/provider-registry-ZTMZMTVV.js +3 -0
- package/dist/{provider-registry-GRYJWVEM.js.map → provider-registry-ZTMZMTVV.js.map} +1 -1
- package/dist/provider-registry.json +16 -55
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +1 -1
- package/dist/storage/base.d.ts +22 -1
- package/dist/storage/base.d.ts.map +1 -1
- package/dist/storage/index.cjs +43 -31
- package/dist/storage/index.js +1 -1
- package/dist/storage/storageWithInit.d.ts.map +1 -1
- package/dist/storage/utils.d.ts +38 -0
- package/dist/storage/utils.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/execute.d.ts +3 -2
- package/dist/stream/aisdk/v5/execute.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/input.d.ts +4 -1
- package/dist/stream/aisdk/v5/input.d.ts.map +1 -1
- package/dist/stream/index.cjs +11 -11
- package/dist/stream/index.js +2 -2
- package/dist/test-utils/llm-mock.cjs +13 -13
- package/dist/test-utils/llm-mock.cjs.map +1 -1
- package/dist/test-utils/llm-mock.js +6 -6
- package/dist/test-utils/llm-mock.js.map +1 -1
- package/dist/tools/index.cjs +2 -2
- package/dist/tools/index.js +1 -1
- package/dist/tools/stream.d.ts +17 -1
- package/dist/tools/stream.d.ts.map +1 -1
- package/dist/tools/types.d.ts +2 -2
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/utils.cjs +22 -22
- package/dist/utils.js +1 -1
- package/dist/vector/index.cjs +2 -2
- package/dist/vector/index.js +1 -1
- package/dist/workflows/default.d.ts.map +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/index.cjs +20 -20
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/step.d.ts +1 -2
- package/dist/workflows/step.d.ts.map +1 -1
- package/dist/workflows/types.d.ts +1 -0
- package/dist/workflows/types.d.ts.map +1 -1
- package/package.json +3 -1
- package/src/llm/model/provider-types.generated.d.ts +8 -22
- package/dist/chunk-3TKNXJES.cjs.map +0 -1
- package/dist/chunk-45NA5ZD3.js.map +0 -1
- package/dist/chunk-6J4NRNT2.cjs.map +0 -1
- package/dist/chunk-7ZADRRDW.js.map +0 -1
- package/dist/chunk-AQAIS7FH.cjs.map +0 -1
- package/dist/chunk-DXMSVGJ6.js.map +0 -1
- package/dist/chunk-FYP3AT6W.js.map +0 -1
- package/dist/chunk-HNHZGFZY.cjs.map +0 -1
- package/dist/chunk-LEZIKVRQ.js.map +0 -1
- package/dist/chunk-NHNXIYDG.cjs.map +0 -1
- package/dist/chunk-NN3NOFRU.cjs.map +0 -1
- package/dist/chunk-OPALPWAM.js.map +0 -1
- package/dist/chunk-QGWNF2QJ.cjs +0 -1697
- package/dist/chunk-QGWNF2QJ.cjs.map +0 -1
- package/dist/chunk-QM5SRDJX.js.map +0 -1
- package/dist/chunk-SVLMF4UZ.cjs.map +0 -1
- package/dist/chunk-T2UNO766.js +0 -1694
- package/dist/chunk-T2UNO766.js.map +0 -1
- package/dist/models-dev-F6MTIYTO.js +0 -3
- package/dist/models-dev-XIVR5EJV.cjs +0 -12
- package/dist/netlify-C2YBIK7A.js +0 -3
- package/dist/netlify-XWROOTP4.cjs +0 -12
- package/dist/provider-registry-BXX7CA3H.cjs +0 -40
- package/dist/provider-registry-GRYJWVEM.js +0 -3
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
var chunk4JKEUSCC_cjs = require('./chunk-4JKEUSCC.cjs');
|
|
4
4
|
var chunkABJOUEVA_cjs = require('./chunk-ABJOUEVA.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
5
|
+
var chunkM7CQULF7_cjs = require('./chunk-M7CQULF7.cjs');
|
|
6
|
+
var chunkYBEW5YWC_cjs = require('./chunk-YBEW5YWC.cjs');
|
|
7
|
+
var chunkHJNEZRI4_cjs = require('./chunk-HJNEZRI4.cjs');
|
|
8
|
+
var chunkYUXTDKYN_cjs = require('./chunk-YUXTDKYN.cjs');
|
|
9
9
|
var chunkMR7ZWBL6_cjs = require('./chunk-MR7ZWBL6.cjs');
|
|
10
|
-
var
|
|
11
|
-
var
|
|
10
|
+
var chunk6C2PU6J4_cjs = require('./chunk-6C2PU6J4.cjs');
|
|
11
|
+
var chunk3EYBRHB2_cjs = require('./chunk-3EYBRHB2.cjs');
|
|
12
12
|
var chunkTWH4PTDG_cjs = require('./chunk-TWH4PTDG.cjs');
|
|
13
|
-
var
|
|
13
|
+
var chunk3JA6VPNM_cjs = require('./chunk-3JA6VPNM.cjs');
|
|
14
14
|
var chunkY24HI6ND_cjs = require('./chunk-Y24HI6ND.cjs');
|
|
15
15
|
var chunkUVHSM2GU_cjs = require('./chunk-UVHSM2GU.cjs');
|
|
16
16
|
var chunk4WQYXT2I_cjs = require('./chunk-4WQYXT2I.cjs');
|
|
@@ -1138,7 +1138,7 @@ var createTimeTravelExecutionParams = (params) => {
|
|
|
1138
1138
|
result = void 0;
|
|
1139
1139
|
}
|
|
1140
1140
|
if (result) {
|
|
1141
|
-
const formattedResult =
|
|
1141
|
+
const formattedResult = chunk6C2PU6J4_cjs.removeUndefinedValues(result);
|
|
1142
1142
|
stepResults[stepId] = formattedResult;
|
|
1143
1143
|
}
|
|
1144
1144
|
});
|
|
@@ -1364,7 +1364,7 @@ async function executeConditional(engine, params) {
|
|
|
1364
1364
|
[chunkABJOUEVA_cjs.STREAM_FORMAT_SYMBOL]: executionContext.format,
|
|
1365
1365
|
engine: engine.getEngineContext(),
|
|
1366
1366
|
abortSignal: abortController?.signal,
|
|
1367
|
-
writer: new
|
|
1367
|
+
writer: new chunk3JA6VPNM_cjs.ToolStream(
|
|
1368
1368
|
{
|
|
1369
1369
|
prefix: "workflow-step",
|
|
1370
1370
|
callId: crypto2.randomUUID(),
|
|
@@ -1579,7 +1579,7 @@ async function executeLoop(engine, params) {
|
|
|
1579
1579
|
const evalSpan = loopSpan?.createChildSpan({
|
|
1580
1580
|
type: "workflow_conditional_eval" /* WORKFLOW_CONDITIONAL_EVAL */,
|
|
1581
1581
|
name: `condition: '${entry.loopType}'`,
|
|
1582
|
-
input:
|
|
1582
|
+
input: chunk6C2PU6J4_cjs.selectFields(result.output, ["stepResult", "output.text", "output.object", "messages"]),
|
|
1583
1583
|
attributes: {
|
|
1584
1584
|
conditionIndex: iteration
|
|
1585
1585
|
},
|
|
@@ -1615,7 +1615,7 @@ async function executeLoop(engine, params) {
|
|
|
1615
1615
|
[chunkABJOUEVA_cjs.STREAM_FORMAT_SYMBOL]: executionContext.format,
|
|
1616
1616
|
engine: engine.getEngineContext(),
|
|
1617
1617
|
abortSignal: abortController?.signal,
|
|
1618
|
-
writer: new
|
|
1618
|
+
writer: new chunk3JA6VPNM_cjs.ToolStream(
|
|
1619
1619
|
{
|
|
1620
1620
|
prefix: "workflow-step",
|
|
1621
1621
|
callId: crypto2.randomUUID(),
|
|
@@ -2340,7 +2340,7 @@ async function executeSleep(engine, params) {
|
|
|
2340
2340
|
[chunkABJOUEVA_cjs.STREAM_FORMAT_SYMBOL]: executionContext.format,
|
|
2341
2341
|
engine: engine.getEngineContext(),
|
|
2342
2342
|
abortSignal: abortController?.signal,
|
|
2343
|
-
writer: new
|
|
2343
|
+
writer: new chunk3JA6VPNM_cjs.ToolStream(
|
|
2344
2344
|
{
|
|
2345
2345
|
prefix: "workflow-step",
|
|
2346
2346
|
callId: stepCallId,
|
|
@@ -2421,7 +2421,7 @@ async function executeSleepUntil(engine, params) {
|
|
|
2421
2421
|
[chunkABJOUEVA_cjs.STREAM_FORMAT_SYMBOL]: executionContext.format,
|
|
2422
2422
|
engine: engine.getEngineContext(),
|
|
2423
2423
|
abortSignal: abortController?.signal,
|
|
2424
|
-
writer: new
|
|
2424
|
+
writer: new chunk3JA6VPNM_cjs.ToolStream(
|
|
2425
2425
|
{
|
|
2426
2426
|
prefix: "workflow-step",
|
|
2427
2427
|
callId: stepCallId,
|
|
@@ -2605,7 +2605,7 @@ async function executeStep(engine, params) {
|
|
|
2605
2605
|
runId,
|
|
2606
2606
|
resourceId,
|
|
2607
2607
|
workflowId,
|
|
2608
|
-
mastra: engine.mastra ?
|
|
2608
|
+
mastra: engine.mastra ? chunk3EYBRHB2_cjs.wrapMastra(engine.mastra, { currentSpan: stepSpan }) : void 0,
|
|
2609
2609
|
requestContext,
|
|
2610
2610
|
inputData,
|
|
2611
2611
|
state: executionContext.state,
|
|
@@ -2671,7 +2671,7 @@ async function executeStep(engine, params) {
|
|
|
2671
2671
|
[chunkABJOUEVA_cjs.STREAM_FORMAT_SYMBOL]: executionContext.format,
|
|
2672
2672
|
engine: engine.getEngineContext(),
|
|
2673
2673
|
abortSignal: abortController?.signal,
|
|
2674
|
-
writer: new
|
|
2674
|
+
writer: new chunk3JA6VPNM_cjs.ToolStream(
|
|
2675
2675
|
{
|
|
2676
2676
|
prefix: "workflow-step",
|
|
2677
2677
|
callId: stepCallId,
|
|
@@ -3231,10 +3231,11 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
3231
3231
|
}
|
|
3232
3232
|
});
|
|
3233
3233
|
}
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3234
|
+
return {
|
|
3235
|
+
...result2,
|
|
3236
|
+
...lastOutput.result.status === "suspended" && params.outputOptions?.includeResumeLabels ? { resumeLabels: lastOutput.mutableContext.resumeLabels } : {},
|
|
3237
|
+
...params.outputOptions?.includeState ? { state: lastState } : {}
|
|
3238
|
+
};
|
|
3238
3239
|
}
|
|
3239
3240
|
}
|
|
3240
3241
|
const result = await this.fmtReturnValue(params.emitter, stepResults, lastOutput.result);
|
|
@@ -4373,7 +4374,7 @@ var Run = class {
|
|
|
4373
4374
|
format,
|
|
4374
4375
|
outputOptions
|
|
4375
4376
|
}) {
|
|
4376
|
-
const workflowSpan =
|
|
4377
|
+
const workflowSpan = chunk3EYBRHB2_cjs.getOrCreateSpan({
|
|
4377
4378
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
4378
4379
|
name: `workflow run: '${this.workflowId}'`,
|
|
4379
4380
|
input: inputData,
|
|
@@ -4868,7 +4869,7 @@ var Run = class {
|
|
|
4868
4869
|
requestContextToUse.set(key, value);
|
|
4869
4870
|
}
|
|
4870
4871
|
});
|
|
4871
|
-
const workflowSpan =
|
|
4872
|
+
const workflowSpan = chunk3EYBRHB2_cjs.getOrCreateSpan({
|
|
4872
4873
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
4873
4874
|
name: `workflow run: '${this.workflowId}'`,
|
|
4874
4875
|
input: resumeDataToUse,
|
|
@@ -4993,7 +4994,7 @@ var Run = class {
|
|
|
4993
4994
|
requestContextToUse.set(key, value);
|
|
4994
4995
|
}
|
|
4995
4996
|
}
|
|
4996
|
-
const workflowSpan =
|
|
4997
|
+
const workflowSpan = chunk3EYBRHB2_cjs.getOrCreateSpan({
|
|
4997
4998
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
4998
4999
|
name: `workflow run: '${this.workflowId}'`,
|
|
4999
5000
|
attributes: {
|
|
@@ -5098,7 +5099,7 @@ var Run = class {
|
|
|
5098
5099
|
requestContextToUse.set(key, value);
|
|
5099
5100
|
}
|
|
5100
5101
|
}
|
|
5101
|
-
const workflowSpan =
|
|
5102
|
+
const workflowSpan = chunk3EYBRHB2_cjs.getOrCreateSpan({
|
|
5102
5103
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
5103
5104
|
name: `workflow run: '${this.workflowId}'`,
|
|
5104
5105
|
input: inputData,
|
|
@@ -5409,7 +5410,7 @@ var ProcessorRunner = class {
|
|
|
5409
5410
|
requestContext
|
|
5410
5411
|
});
|
|
5411
5412
|
const mutations = messageList.stopRecording();
|
|
5412
|
-
if (result instanceof
|
|
5413
|
+
if (result instanceof chunkYBEW5YWC_cjs.MessageList) {
|
|
5413
5414
|
if (result !== messageList) {
|
|
5414
5415
|
throw new chunkTWH4PTDG_cjs.MastraError({
|
|
5415
5416
|
category: "USER",
|
|
@@ -5589,7 +5590,7 @@ var ProcessorRunner = class {
|
|
|
5589
5590
|
requestContext
|
|
5590
5591
|
});
|
|
5591
5592
|
let mutations;
|
|
5592
|
-
if (result instanceof
|
|
5593
|
+
if (result instanceof chunkYBEW5YWC_cjs.MessageList) {
|
|
5593
5594
|
if (result !== messageList) {
|
|
5594
5595
|
throw new chunkTWH4PTDG_cjs.MastraError({
|
|
5595
5596
|
category: "USER",
|
|
@@ -5710,7 +5711,7 @@ var ProcessorRunner = class {
|
|
|
5710
5711
|
requestContext
|
|
5711
5712
|
});
|
|
5712
5713
|
const mutations = messageList.stopRecording();
|
|
5713
|
-
if (result instanceof
|
|
5714
|
+
if (result instanceof chunkYBEW5YWC_cjs.MessageList) {
|
|
5714
5715
|
if (result !== messageList) {
|
|
5715
5716
|
throw new chunkTWH4PTDG_cjs.MastraError({
|
|
5716
5717
|
category: "USER",
|
|
@@ -6154,7 +6155,7 @@ function convertMastraChunkToAISDKv5({
|
|
|
6154
6155
|
if (mode === "generate") {
|
|
6155
6156
|
return {
|
|
6156
6157
|
type: "file",
|
|
6157
|
-
file: new
|
|
6158
|
+
file: new chunkYBEW5YWC_cjs.DefaultGeneratedFile({
|
|
6158
6159
|
data: chunk.payload.data,
|
|
6159
6160
|
mediaType: chunk.payload.mimeType
|
|
6160
6161
|
})
|
|
@@ -6162,7 +6163,7 @@ function convertMastraChunkToAISDKv5({
|
|
|
6162
6163
|
}
|
|
6163
6164
|
return {
|
|
6164
6165
|
type: "file",
|
|
6165
|
-
file: new
|
|
6166
|
+
file: new chunkYBEW5YWC_cjs.DefaultGeneratedFileWithType({
|
|
6166
6167
|
data: chunk.payload.data,
|
|
6167
6168
|
mediaType: chunk.payload.mimeType
|
|
6168
6169
|
})
|
|
@@ -6278,18 +6279,39 @@ function convertMastraChunkToAISDKv5({
|
|
|
6278
6279
|
}
|
|
6279
6280
|
|
|
6280
6281
|
// src/stream/aisdk/v5/input.ts
|
|
6282
|
+
function isNumericId(id) {
|
|
6283
|
+
return /^\d+$/.test(id);
|
|
6284
|
+
}
|
|
6281
6285
|
var AISDKV5InputStream = class extends MastraModelInput {
|
|
6282
|
-
|
|
6286
|
+
#generateId;
|
|
6287
|
+
constructor({
|
|
6288
|
+
component,
|
|
6289
|
+
name,
|
|
6290
|
+
generateId: generateId3
|
|
6291
|
+
}) {
|
|
6283
6292
|
super({ component, name });
|
|
6293
|
+
this.#generateId = generateId3 ?? aiV5.generateId;
|
|
6284
6294
|
}
|
|
6285
6295
|
async transform({
|
|
6286
6296
|
runId,
|
|
6287
6297
|
stream,
|
|
6288
6298
|
controller
|
|
6289
6299
|
}) {
|
|
6300
|
+
const idMap = /* @__PURE__ */ new Map();
|
|
6290
6301
|
for await (const chunk of stream) {
|
|
6291
|
-
const
|
|
6302
|
+
const rawChunk = chunk;
|
|
6303
|
+
if (rawChunk.type === "stream-start") {
|
|
6304
|
+
idMap.clear();
|
|
6305
|
+
}
|
|
6306
|
+
const transformedChunk = convertFullStreamChunkToMastra(rawChunk, { runId });
|
|
6292
6307
|
if (transformedChunk) {
|
|
6308
|
+
if ((transformedChunk.type === "text-start" || transformedChunk.type === "text-delta" || transformedChunk.type === "text-end") && transformedChunk.payload?.id && isNumericId(transformedChunk.payload.id)) {
|
|
6309
|
+
const originalId = transformedChunk.payload.id;
|
|
6310
|
+
if (!idMap.has(originalId)) {
|
|
6311
|
+
idMap.set(originalId, this.#generateId());
|
|
6312
|
+
}
|
|
6313
|
+
transformedChunk.payload.id = idMap.get(originalId);
|
|
6314
|
+
}
|
|
6293
6315
|
controller.enqueue(transformedChunk);
|
|
6294
6316
|
}
|
|
6295
6317
|
}
|
|
@@ -6318,11 +6340,13 @@ function execute({
|
|
|
6318
6340
|
structuredOutput,
|
|
6319
6341
|
headers,
|
|
6320
6342
|
shouldThrowError,
|
|
6321
|
-
methodType
|
|
6343
|
+
methodType,
|
|
6344
|
+
generateId: generateId3
|
|
6322
6345
|
}) {
|
|
6323
6346
|
const v5 = new AISDKV5InputStream({
|
|
6324
6347
|
component: "LLM",
|
|
6325
|
-
name: model.modelId
|
|
6348
|
+
name: model.modelId,
|
|
6349
|
+
generateId: generateId3
|
|
6326
6350
|
});
|
|
6327
6351
|
const toolsAndToolChoice = prepareToolsAndToolChoice({
|
|
6328
6352
|
tools,
|
|
@@ -6948,7 +6972,7 @@ function createLLMExecutionStep({
|
|
|
6948
6972
|
}
|
|
6949
6973
|
if (prepareStepResult.messages) {
|
|
6950
6974
|
const newMessages = prepareStepResult.messages;
|
|
6951
|
-
const newMessageList = new
|
|
6975
|
+
const newMessageList = new chunkYBEW5YWC_cjs.MessageList();
|
|
6952
6976
|
for (const message of newMessages) {
|
|
6953
6977
|
if (message.role === "system") {
|
|
6954
6978
|
newMessageList.addSystem(message);
|
|
@@ -6965,7 +6989,7 @@ function createLLMExecutionStep({
|
|
|
6965
6989
|
console.error("Error in prepareStep callback:", error);
|
|
6966
6990
|
}
|
|
6967
6991
|
}
|
|
6968
|
-
modelResult =
|
|
6992
|
+
modelResult = chunk3EYBRHB2_cjs.executeWithContextSync({
|
|
6969
6993
|
span: modelSpanTracker?.getTracingContext()?.currentSpan,
|
|
6970
6994
|
fn: () => execute({
|
|
6971
6995
|
runId,
|
|
@@ -6980,6 +7004,7 @@ function createLLMExecutionStep({
|
|
|
6980
7004
|
structuredOutput,
|
|
6981
7005
|
headers,
|
|
6982
7006
|
methodType,
|
|
7007
|
+
generateId: _internal?.generateId,
|
|
6983
7008
|
onResult: ({
|
|
6984
7009
|
warnings: warningsFromStream,
|
|
6985
7010
|
request: requestFromStream,
|
|
@@ -7795,6 +7820,31 @@ function workflowLoopStream({
|
|
|
7795
7820
|
requestContext
|
|
7796
7821
|
});
|
|
7797
7822
|
if (executionResult.status !== "success") {
|
|
7823
|
+
if (executionResult.status === "failed") {
|
|
7824
|
+
let executionResultError = executionResult.error;
|
|
7825
|
+
if (typeof executionResult.error === "string") {
|
|
7826
|
+
const prependedErrorString = "Error: ";
|
|
7827
|
+
if (executionResult.error.startsWith(`${prependedErrorString}${prependedErrorString}`)) {
|
|
7828
|
+
executionResultError = executionResult.error.substring(
|
|
7829
|
+
`${prependedErrorString}${prependedErrorString}`.length
|
|
7830
|
+
);
|
|
7831
|
+
} else if (executionResult.error.startsWith(prependedErrorString)) {
|
|
7832
|
+
executionResultError = executionResult.error.substring(prependedErrorString.length);
|
|
7833
|
+
}
|
|
7834
|
+
}
|
|
7835
|
+
const error = chunkTWH4PTDG_cjs.getErrorFromUnknown(executionResultError, {
|
|
7836
|
+
fallbackMessage: "Unknown error in agent workflow stream"
|
|
7837
|
+
});
|
|
7838
|
+
controller.enqueue({
|
|
7839
|
+
type: "error",
|
|
7840
|
+
runId,
|
|
7841
|
+
from: "AGENT" /* AGENT */,
|
|
7842
|
+
payload: { error }
|
|
7843
|
+
});
|
|
7844
|
+
if (rest.options?.onError) {
|
|
7845
|
+
await rest.options?.onError?.({ error });
|
|
7846
|
+
}
|
|
7847
|
+
}
|
|
7798
7848
|
controller.close();
|
|
7799
7849
|
return;
|
|
7800
7850
|
}
|
|
@@ -8043,6 +8093,7 @@ var MastraLLMVNext = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
8043
8093
|
resourceId,
|
|
8044
8094
|
structuredOutput,
|
|
8045
8095
|
options,
|
|
8096
|
+
inputProcessors,
|
|
8046
8097
|
outputProcessors,
|
|
8047
8098
|
returnScorerData,
|
|
8048
8099
|
providerOptions,
|
|
@@ -8106,6 +8157,7 @@ var MastraLLMVNext = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
8106
8157
|
providerOptions,
|
|
8107
8158
|
_internal,
|
|
8108
8159
|
structuredOutput,
|
|
8160
|
+
inputProcessors,
|
|
8109
8161
|
outputProcessors,
|
|
8110
8162
|
returnScorerData,
|
|
8111
8163
|
modelSpanTracker,
|
|
@@ -8154,7 +8206,7 @@ var MastraLLMVNext = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
8154
8206
|
const remainingTokens = parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"] ?? "", 10);
|
|
8155
8207
|
if (!isNaN(remainingTokens) && remainingTokens > 0 && remainingTokens < 2e3) {
|
|
8156
8208
|
this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
|
|
8157
|
-
await
|
|
8209
|
+
await chunk6C2PU6J4_cjs.delay(10 * 1e3);
|
|
8158
8210
|
}
|
|
8159
8211
|
},
|
|
8160
8212
|
onFinish: async (props) => {
|
|
@@ -8176,7 +8228,9 @@ var MastraLLMVNext = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
8176
8228
|
totalTokens: props?.totalUsage?.totalTokens,
|
|
8177
8229
|
reasoningTokens: props?.totalUsage?.reasoningTokens,
|
|
8178
8230
|
cachedInputTokens: props?.totalUsage?.cachedInputTokens
|
|
8179
|
-
}
|
|
8231
|
+
},
|
|
8232
|
+
responseId: props?.response.id,
|
|
8233
|
+
responseModel: props?.response.modelId
|
|
8180
8234
|
}
|
|
8181
8235
|
});
|
|
8182
8236
|
try {
|
|
@@ -8466,7 +8520,7 @@ async function prepareMemoryStep({
|
|
|
8466
8520
|
);
|
|
8467
8521
|
}
|
|
8468
8522
|
} else {
|
|
8469
|
-
const messageList = new
|
|
8523
|
+
const messageList = new chunkYBEW5YWC_cjs.MessageList({
|
|
8470
8524
|
threadId: thread?.id,
|
|
8471
8525
|
resourceId: thread?.resourceId
|
|
8472
8526
|
});
|
|
@@ -9526,7 +9580,7 @@ var AgentLegacyHandler = class {
|
|
|
9526
9580
|
if (process.env.NODE_ENV !== "test") {
|
|
9527
9581
|
this.capabilities.logger.debug(`[Agents:${this.capabilities.name}] - Starting generation`, { runId });
|
|
9528
9582
|
}
|
|
9529
|
-
const agentSpan =
|
|
9583
|
+
const agentSpan = chunk3EYBRHB2_cjs.getOrCreateSpan({
|
|
9530
9584
|
type: "agent_run" /* AGENT_RUN */,
|
|
9531
9585
|
name: `agent run: '${this.capabilities.id}'`,
|
|
9532
9586
|
input: {
|
|
@@ -9534,6 +9588,7 @@ var AgentLegacyHandler = class {
|
|
|
9534
9588
|
},
|
|
9535
9589
|
attributes: {
|
|
9536
9590
|
agentId: this.capabilities.id,
|
|
9591
|
+
agentName: this.capabilities.name,
|
|
9537
9592
|
instructions: this.capabilities.convertInstructionsToString(instructions),
|
|
9538
9593
|
availableTools: [
|
|
9539
9594
|
...toolsets ? Object.keys(toolsets) : [],
|
|
@@ -9579,7 +9634,7 @@ var AgentLegacyHandler = class {
|
|
|
9579
9634
|
methodType: methodType === "generate" ? "generateLegacy" : "streamLegacy",
|
|
9580
9635
|
memoryConfig
|
|
9581
9636
|
});
|
|
9582
|
-
let messageList = new
|
|
9637
|
+
let messageList = new chunkYBEW5YWC_cjs.MessageList({
|
|
9583
9638
|
threadId,
|
|
9584
9639
|
resourceId,
|
|
9585
9640
|
generateMessageId: this.capabilities.mastra?.generateId?.bind(this.capabilities.mastra),
|
|
@@ -9720,7 +9775,7 @@ var AgentLegacyHandler = class {
|
|
|
9720
9775
|
result: resToLog,
|
|
9721
9776
|
threadId
|
|
9722
9777
|
});
|
|
9723
|
-
const messageListResponses = new
|
|
9778
|
+
const messageListResponses = new chunkYBEW5YWC_cjs.MessageList({
|
|
9724
9779
|
threadId,
|
|
9725
9780
|
resourceId,
|
|
9726
9781
|
generateMessageId: this.capabilities.mastra?.generateId?.bind(this.capabilities.mastra),
|
|
@@ -12101,7 +12156,7 @@ var BatchPartsProcessor = class {
|
|
|
12101
12156
|
const combinedText = textChunks.map((part) => part.type === "text-delta" ? part.payload.text : "").join("");
|
|
12102
12157
|
const combinedChunk = {
|
|
12103
12158
|
type: "text-delta",
|
|
12104
|
-
payload: { text: combinedText, id: "1" },
|
|
12159
|
+
payload: { text: combinedText, id: "text-1" },
|
|
12105
12160
|
runId: "1",
|
|
12106
12161
|
from: "AGENT" /* AGENT */
|
|
12107
12162
|
};
|
|
@@ -12788,6 +12843,9 @@ var isAugmentedSymbol = Symbol("isAugmented");
|
|
|
12788
12843
|
function augmentWithInit(storage) {
|
|
12789
12844
|
let hasInitialized = null;
|
|
12790
12845
|
const ensureInit = async () => {
|
|
12846
|
+
if (storage.disableInit) {
|
|
12847
|
+
return;
|
|
12848
|
+
}
|
|
12791
12849
|
if (!hasInitialized) {
|
|
12792
12850
|
hasInitialized = storage.init();
|
|
12793
12851
|
}
|
|
@@ -12904,7 +12962,7 @@ https://mastra.ai/en/docs/memory/semantic-recall`
|
|
|
12904
12962
|
);
|
|
12905
12963
|
}
|
|
12906
12964
|
if (typeof config.embedder === "string") {
|
|
12907
|
-
this.embedder = new
|
|
12965
|
+
this.embedder = new chunkHJNEZRI4_cjs.ModelRouterEmbeddingModel(config.embedder);
|
|
12908
12966
|
} else {
|
|
12909
12967
|
this.embedder = config.embedder;
|
|
12910
12968
|
}
|
|
@@ -13000,7 +13058,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
13000
13058
|
"The threads.generateTitle option has been moved. Use the top-level generateTitle option instead."
|
|
13001
13059
|
);
|
|
13002
13060
|
}
|
|
13003
|
-
const mergedConfig =
|
|
13061
|
+
const mergedConfig = chunk6C2PU6J4_cjs.deepMerge(this.threadConfig, config || {});
|
|
13004
13062
|
if (typeof config?.workingMemory === "object" && config.workingMemory?.schema && typeof mergedConfig.workingMemory === "object") {
|
|
13005
13063
|
mergedConfig.workingMemory.schema = config.workingMemory.schema;
|
|
13006
13064
|
}
|
|
@@ -13236,7 +13294,7 @@ var MockMemory = class extends MastraMemory {
|
|
|
13236
13294
|
} = {}) {
|
|
13237
13295
|
super({
|
|
13238
13296
|
name: "mock",
|
|
13239
|
-
storage: storage || new
|
|
13297
|
+
storage: storage || new chunkM7CQULF7_cjs.InMemoryStore(),
|
|
13240
13298
|
options: {
|
|
13241
13299
|
workingMemory: enableWorkingMemory ? { enabled: true, template: workingMemoryTemplate } : void 0,
|
|
13242
13300
|
lastMessages: enableMessageHistory ? 10 : void 0
|
|
@@ -13750,7 +13808,7 @@ var SemanticRecall = class {
|
|
|
13750
13808
|
*/
|
|
13751
13809
|
formatCrossThreadMessages(messages, currentThreadId) {
|
|
13752
13810
|
let result = ``;
|
|
13753
|
-
const v1Messages = new
|
|
13811
|
+
const v1Messages = new chunkYBEW5YWC_cjs.MessageList().add(messages, "memory").get.all.v1();
|
|
13754
13812
|
let lastYmd = null;
|
|
13755
13813
|
for (const msg of v1Messages) {
|
|
13756
13814
|
const date = msg.createdAt;
|
|
@@ -14091,6 +14149,9 @@ function createMapResultsStep({
|
|
|
14091
14149
|
const structuredProcessor = new StructuredOutputProcessor(options.structuredOutput);
|
|
14092
14150
|
effectiveOutputProcessors = effectiveOutputProcessors ? [...effectiveOutputProcessors, structuredProcessor] : [structuredProcessor];
|
|
14093
14151
|
}
|
|
14152
|
+
const effectiveInputProcessors = options.inputProcessors || (capabilities.inputProcessors ? typeof capabilities.inputProcessors === "function" ? await capabilities.inputProcessors({
|
|
14153
|
+
requestContext: result.requestContext
|
|
14154
|
+
}) : capabilities.inputProcessors : []);
|
|
14094
14155
|
const messageList = memoryData.messageList;
|
|
14095
14156
|
const modelMethodType = getModelMethodFromAgentMethod(methodType);
|
|
14096
14157
|
const loopOptions = {
|
|
@@ -14157,6 +14218,7 @@ function createMapResultsStep({
|
|
|
14157
14218
|
abortSignal: options.abortSignal
|
|
14158
14219
|
},
|
|
14159
14220
|
structuredOutput: options.structuredOutput,
|
|
14221
|
+
inputProcessors: effectiveInputProcessors,
|
|
14160
14222
|
outputProcessors: effectiveOutputProcessors,
|
|
14161
14223
|
modelSettings: {
|
|
14162
14224
|
temperature: 0,
|
|
@@ -14198,7 +14260,7 @@ var prepareToolsStepOutputSchema = z5.z.object({
|
|
|
14198
14260
|
var prepareMemoryStepOutputSchema = z5.z.object({
|
|
14199
14261
|
threadExists: z5.z.boolean(),
|
|
14200
14262
|
thread: storageThreadSchema.optional(),
|
|
14201
|
-
messageList: z5.z.instanceof(
|
|
14263
|
+
messageList: z5.z.instanceof(chunkYBEW5YWC_cjs.MessageList),
|
|
14202
14264
|
tripwire: z5.z.boolean().optional(),
|
|
14203
14265
|
tripwireReason: z5.z.string().optional()
|
|
14204
14266
|
});
|
|
@@ -14231,7 +14293,7 @@ function createPrepareMemoryStep({
|
|
|
14231
14293
|
outputSchema: prepareMemoryStepOutputSchema,
|
|
14232
14294
|
execute: async ({ tracingContext }) => {
|
|
14233
14295
|
const thread = threadFromArgs;
|
|
14234
|
-
const messageList = new
|
|
14296
|
+
const messageList = new chunkYBEW5YWC_cjs.MessageList({
|
|
14235
14297
|
threadId: thread?.id,
|
|
14236
14298
|
resourceId,
|
|
14237
14299
|
generateMessageId: capabilities.generateMessageId,
|
|
@@ -14303,7 +14365,7 @@ function createPrepareMemoryStep({
|
|
|
14303
14365
|
title: thread.title,
|
|
14304
14366
|
memoryConfig,
|
|
14305
14367
|
resourceId,
|
|
14306
|
-
saveThread:
|
|
14368
|
+
saveThread: true
|
|
14307
14369
|
});
|
|
14308
14370
|
}
|
|
14309
14371
|
requestContext.set("MastraMemory", {
|
|
@@ -15103,7 +15165,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
15103
15165
|
*/
|
|
15104
15166
|
listTools({ requestContext = new chunkUVHSM2GU_cjs.RequestContext() } = {}) {
|
|
15105
15167
|
if (typeof this.#tools !== "function") {
|
|
15106
|
-
return
|
|
15168
|
+
return chunk6C2PU6J4_cjs.ensureToolProperties(this.#tools);
|
|
15107
15169
|
}
|
|
15108
15170
|
const result = this.#tools({ requestContext, mastra: this.#mastra });
|
|
15109
15171
|
return resolveMaybePromise(result, (tools) => {
|
|
@@ -15121,7 +15183,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
15121
15183
|
this.logger.error(mastraError.toString());
|
|
15122
15184
|
throw mastraError;
|
|
15123
15185
|
}
|
|
15124
|
-
return
|
|
15186
|
+
return chunk6C2PU6J4_cjs.ensureToolProperties(tools);
|
|
15125
15187
|
});
|
|
15126
15188
|
}
|
|
15127
15189
|
/**
|
|
@@ -15153,7 +15215,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
15153
15215
|
});
|
|
15154
15216
|
});
|
|
15155
15217
|
} else {
|
|
15156
|
-
llm = new
|
|
15218
|
+
llm = new chunkYUXTDKYN_cjs.MastraLLMV1({
|
|
15157
15219
|
model: resolvedModel,
|
|
15158
15220
|
mastra: this.#mastra,
|
|
15159
15221
|
options: { tracingPolicy: this.#options?.tracingPolicy }
|
|
@@ -15178,7 +15240,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
15178
15240
|
*/
|
|
15179
15241
|
async resolveModelConfig(modelConfig, requestContext) {
|
|
15180
15242
|
try {
|
|
15181
|
-
return await
|
|
15243
|
+
return await chunkHJNEZRI4_cjs.resolveModelConfig(modelConfig, requestContext, this.#mastra);
|
|
15182
15244
|
} catch (error) {
|
|
15183
15245
|
const mastraError = new chunkTWH4PTDG_cjs.MastraError({
|
|
15184
15246
|
id: "AGENT_GET_MODEL_MISSING_MODEL_INSTANCE",
|
|
@@ -15384,7 +15446,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
15384
15446
|
instructions
|
|
15385
15447
|
}) {
|
|
15386
15448
|
const llm = await this.getLLM({ requestContext, model });
|
|
15387
|
-
const normMessage = new
|
|
15449
|
+
const normMessage = new chunkYBEW5YWC_cjs.MessageList().add(message, "user").get.all.ui().at(-1);
|
|
15388
15450
|
if (!normMessage) {
|
|
15389
15451
|
throw new Error(`Could not generate title from input ${JSON.stringify(message)}`);
|
|
15390
15452
|
}
|
|
@@ -15407,7 +15469,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
15407
15469
|
const systemInstructions = await this.resolveTitleInstructions(requestContext, instructions);
|
|
15408
15470
|
let text = "";
|
|
15409
15471
|
if (llm.getModel().specificationVersion === "v2") {
|
|
15410
|
-
const messageList = new
|
|
15472
|
+
const messageList = new chunkYBEW5YWC_cjs.MessageList().add(
|
|
15411
15473
|
[
|
|
15412
15474
|
{
|
|
15413
15475
|
role: "system",
|
|
@@ -15459,7 +15521,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
15459
15521
|
async genTitle(userMessage, requestContext, tracingContext, model, instructions) {
|
|
15460
15522
|
try {
|
|
15461
15523
|
if (userMessage) {
|
|
15462
|
-
const normMessage = new
|
|
15524
|
+
const normMessage = new chunkYBEW5YWC_cjs.MessageList().add(userMessage, "user").get.all.ui().at(-1);
|
|
15463
15525
|
if (normMessage) {
|
|
15464
15526
|
return await this.generateTitleFromUserMessage({
|
|
15465
15527
|
message: normMessage,
|
|
@@ -15523,7 +15585,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
15523
15585
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
15524
15586
|
requireApproval: toolObj.requireApproval
|
|
15525
15587
|
};
|
|
15526
|
-
const convertedToCoreTool =
|
|
15588
|
+
const convertedToCoreTool = chunk6C2PU6J4_cjs.makeCoreTool(toolObj, options);
|
|
15527
15589
|
convertedMemoryTools[toolName] = convertedToCoreTool;
|
|
15528
15590
|
}
|
|
15529
15591
|
}
|
|
@@ -15673,7 +15735,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
15673
15735
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
15674
15736
|
requireApproval: tool.requireApproval
|
|
15675
15737
|
};
|
|
15676
|
-
return [k,
|
|
15738
|
+
return [k, chunk6C2PU6J4_cjs.makeCoreTool(tool, options)];
|
|
15677
15739
|
})
|
|
15678
15740
|
);
|
|
15679
15741
|
const assignedToolEntriesConverted = Object.fromEntries(
|
|
@@ -15722,7 +15784,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
15722
15784
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
15723
15785
|
requireApproval: toolObj.requireApproval
|
|
15724
15786
|
};
|
|
15725
|
-
const convertedToCoreTool =
|
|
15787
|
+
const convertedToCoreTool = chunk6C2PU6J4_cjs.makeCoreTool(toolObj, options, "toolset");
|
|
15726
15788
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
15727
15789
|
}
|
|
15728
15790
|
}
|
|
@@ -15766,7 +15828,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
15766
15828
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
15767
15829
|
requireApproval: tool.requireApproval
|
|
15768
15830
|
};
|
|
15769
|
-
const convertedToCoreTool =
|
|
15831
|
+
const convertedToCoreTool = chunk6C2PU6J4_cjs.makeCoreTool(rest, options, "client-tool");
|
|
15770
15832
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
15771
15833
|
}
|
|
15772
15834
|
}
|
|
@@ -15802,10 +15864,10 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
15802
15864
|
subAgentThreadId: z5.z.string().describe("The thread ID of the agent").optional(),
|
|
15803
15865
|
subAgentResourceId: z5.z.string().describe("The resource ID of the agent").optional()
|
|
15804
15866
|
});
|
|
15805
|
-
const modelVersion = (await agent.getModel()).specificationVersion;
|
|
15867
|
+
const modelVersion = (await agent.getModel({ requestContext })).specificationVersion;
|
|
15806
15868
|
const toolObj = chunkY24HI6ND_cjs.createTool({
|
|
15807
15869
|
id: `agent-${agentName}`,
|
|
15808
|
-
description: `Agent: ${agentName}`,
|
|
15870
|
+
description: agent.getDescription() || `Agent: ${agentName}`,
|
|
15809
15871
|
inputSchema: agentInputSchema,
|
|
15810
15872
|
outputSchema: agentOutputSchema,
|
|
15811
15873
|
mastra: this.#mastra,
|
|
@@ -15935,7 +15997,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
15935
15997
|
tracingContext,
|
|
15936
15998
|
tracingPolicy: this.#options?.tracingPolicy
|
|
15937
15999
|
};
|
|
15938
|
-
convertedAgentTools[`agent-${agentName}`] =
|
|
16000
|
+
convertedAgentTools[`agent-${agentName}`] = chunk6C2PU6J4_cjs.makeCoreTool(toolObj, options);
|
|
15939
16001
|
}
|
|
15940
16002
|
}
|
|
15941
16003
|
return convertedAgentTools;
|
|
@@ -16078,7 +16140,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16078
16140
|
tracingContext,
|
|
16079
16141
|
tracingPolicy: this.#options?.tracingPolicy
|
|
16080
16142
|
};
|
|
16081
|
-
convertedWorkflowTools[`workflow-${workflowName}`] =
|
|
16143
|
+
convertedWorkflowTools[`workflow-${workflowName}`] = chunk6C2PU6J4_cjs.makeCoreTool(toolObj, options);
|
|
16082
16144
|
}
|
|
16083
16145
|
}
|
|
16084
16146
|
return convertedWorkflowTools;
|
|
@@ -16102,7 +16164,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16102
16164
|
let mastraProxy = void 0;
|
|
16103
16165
|
const logger = this.logger;
|
|
16104
16166
|
if (this.#mastra) {
|
|
16105
|
-
mastraProxy =
|
|
16167
|
+
mastraProxy = chunk6C2PU6J4_cjs.createMastraProxy({ mastra: this.#mastra, logger });
|
|
16106
16168
|
}
|
|
16107
16169
|
const assignedTools = await this.listAssignedTools({
|
|
16108
16170
|
runId,
|
|
@@ -16426,7 +16488,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16426
16488
|
const targetProvider = structuredOutputModel.provider;
|
|
16427
16489
|
const targetModelId = structuredOutputModel.modelId;
|
|
16428
16490
|
if (targetProvider.includes("openai") || targetModelId.includes("openai")) {
|
|
16429
|
-
if (
|
|
16491
|
+
if (chunk6C2PU6J4_cjs.isZodType(options.structuredOutput.schema) && targetModelId) {
|
|
16430
16492
|
const modelInfo = {
|
|
16431
16493
|
provider: targetProvider,
|
|
16432
16494
|
modelId: targetModelId,
|
|
@@ -16445,12 +16507,14 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16445
16507
|
}
|
|
16446
16508
|
const runId = options.runId || this.#mastra?.generateId() || crypto2.randomUUID();
|
|
16447
16509
|
const instructions = options.instructions || await this.getInstructions({ requestContext });
|
|
16448
|
-
const agentSpan =
|
|
16510
|
+
const agentSpan = chunk3EYBRHB2_cjs.getOrCreateSpan({
|
|
16449
16511
|
type: "agent_run" /* AGENT_RUN */,
|
|
16450
16512
|
name: `agent run: '${this.id}'`,
|
|
16451
16513
|
input: options.messages,
|
|
16452
16514
|
attributes: {
|
|
16453
16515
|
agentId: this.id,
|
|
16516
|
+
agentName: this.name,
|
|
16517
|
+
conversationId: threadFromArgs?.id,
|
|
16454
16518
|
instructions: this.#convertInstructionsToString(instructions)
|
|
16455
16519
|
},
|
|
16456
16520
|
metadata: {
|
|
@@ -16484,6 +16548,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
16484
16548
|
getMemoryMessages: this.getMemoryMessages.bind(this),
|
|
16485
16549
|
runInputProcessors: this.__runInputProcessors.bind(this),
|
|
16486
16550
|
executeOnFinish: this.#executeOnFinish.bind(this),
|
|
16551
|
+
inputProcessors: async ({ requestContext: requestContext2 }) => this.listResolvedInputProcessors(requestContext2),
|
|
16487
16552
|
outputProcessors: async ({ requestContext: requestContext2 }) => this.listResolvedOutputProcessors(requestContext2),
|
|
16488
16553
|
llm
|
|
16489
16554
|
};
|
|
@@ -18163,7 +18228,7 @@ var MastraModelOutput = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
|
18163
18228
|
options.tracingContext,
|
|
18164
18229
|
self.#options.requestContext
|
|
18165
18230
|
);
|
|
18166
|
-
const outputText = self.messageList.get.response.aiV4.core().map((m) =>
|
|
18231
|
+
const outputText = self.messageList.get.response.aiV4.core().map((m) => chunkYBEW5YWC_cjs.MessageList.coreContentToString(m.content)).join("\n");
|
|
18167
18232
|
self.#delayedPromises.text.resolve(outputText);
|
|
18168
18233
|
self.#delayedPromises.finishReason.resolve(self.#finishReason);
|
|
18169
18234
|
if (chunk.payload.metadata) {
|
|
@@ -18811,5 +18876,5 @@ exports.tryStreamWithJsonFallback = tryStreamWithJsonFallback;
|
|
|
18811
18876
|
exports.validateStepInput = validateStepInput;
|
|
18812
18877
|
exports.validateStepResumeData = validateStepResumeData;
|
|
18813
18878
|
exports.validateStepSuspendData = validateStepSuspendData;
|
|
18814
|
-
//# sourceMappingURL=chunk-
|
|
18815
|
-
//# sourceMappingURL=chunk-
|
|
18879
|
+
//# sourceMappingURL=chunk-RBBEMTMA.cjs.map
|
|
18880
|
+
//# sourceMappingURL=chunk-RBBEMTMA.cjs.map
|