@mastra/core 1.18.0-alpha.3 → 1.18.0-alpha.4
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 +51 -0
- package/dist/_types/@internal_core/dist/index.d.ts +521 -172
- package/dist/agent/index.cjs +8 -8
- package/dist/agent/index.js +1 -1
- package/dist/agent/workflows/prepare-stream/map-results-step.d.ts.map +1 -1
- package/dist/{chunk-4K2NKQGN.cjs → chunk-2OZQLYLM.cjs} +196 -194
- package/dist/chunk-2OZQLYLM.cjs.map +1 -0
- package/dist/{chunk-VVR3SFKH.cjs → chunk-2RGBP3A3.cjs} +70 -70
- package/dist/{chunk-VVR3SFKH.cjs.map → chunk-2RGBP3A3.cjs.map} +1 -1
- package/dist/{chunk-GVHBM6VU.cjs → chunk-4LDFFARO.cjs} +29 -11
- package/dist/chunk-4LDFFARO.cjs.map +1 -0
- package/dist/{chunk-T5XU5TAV.cjs → chunk-4QLIPOI7.cjs} +82 -82
- package/dist/{chunk-T5XU5TAV.cjs.map → chunk-4QLIPOI7.cjs.map} +1 -1
- package/dist/{chunk-ZFZ6HQFT.cjs → chunk-5M3CKUAS.cjs} +210 -187
- package/dist/chunk-5M3CKUAS.cjs.map +1 -0
- package/dist/{chunk-D5VCCQ4L.js → chunk-6DDSP6ZE.js} +5 -5
- package/dist/{chunk-D5VCCQ4L.js.map → chunk-6DDSP6ZE.js.map} +1 -1
- package/dist/{chunk-5IZ346TV.cjs → chunk-A2FSD2KN.cjs} +7 -7
- package/dist/{chunk-5IZ346TV.cjs.map → chunk-A2FSD2KN.cjs.map} +1 -1
- package/dist/{chunk-64565EZF.cjs → chunk-ATKRXBCX.cjs} +22 -22
- package/dist/{chunk-64565EZF.cjs.map → chunk-ATKRXBCX.cjs.map} +1 -1
- package/dist/{chunk-K4NN2KQQ.cjs → chunk-AV4YSAZL.cjs} +6 -2
- package/dist/chunk-AV4YSAZL.cjs.map +1 -0
- package/dist/{chunk-7USX5P3I.js → chunk-B5LIMU4I.js} +28 -5
- package/dist/chunk-B5LIMU4I.js.map +1 -0
- package/dist/{chunk-BFRUEBG3.js → chunk-CEWIMGYP.js} +4 -4
- package/dist/{chunk-BFRUEBG3.js.map → chunk-CEWIMGYP.js.map} +1 -1
- package/dist/{chunk-X36INADV.cjs → chunk-CGDV5YUS.cjs} +131 -48
- package/dist/chunk-CGDV5YUS.cjs.map +1 -0
- package/dist/{chunk-HDPQ3LEE.js → chunk-DJ2RXLO3.js} +4 -4
- package/dist/{chunk-HDPQ3LEE.js.map → chunk-DJ2RXLO3.js.map} +1 -1
- package/dist/{chunk-OKKJRRSS.cjs → chunk-E7LJ7F56.cjs} +32 -14
- package/dist/chunk-E7LJ7F56.cjs.map +1 -0
- package/dist/{chunk-W2QYKEBN.js → chunk-ERAZTMF6.js} +113 -30
- package/dist/chunk-ERAZTMF6.js.map +1 -0
- package/dist/{chunk-IR4WRS3N.js → chunk-F77BL7Z7.js} +31 -13
- package/dist/chunk-F77BL7Z7.js.map +1 -0
- package/dist/{chunk-GRMC2OYN.js → chunk-FA4PTEBK.js} +6 -3
- package/dist/chunk-FA4PTEBK.js.map +1 -0
- package/dist/{chunk-YBVRBNRY.js → chunk-GIBIKVUG.js} +7 -7
- package/dist/{chunk-YBVRBNRY.js.map → chunk-GIBIKVUG.js.map} +1 -1
- package/dist/{chunk-QVVWKMFM.cjs → chunk-GXXNF6NF.cjs} +25 -25
- package/dist/{chunk-QVVWKMFM.cjs.map → chunk-GXXNF6NF.cjs.map} +1 -1
- package/dist/{chunk-OYAHOEQP.js → chunk-HJVPOP5S.js} +27 -9
- package/dist/chunk-HJVPOP5S.js.map +1 -0
- package/dist/{chunk-ABA3KD3X.js → chunk-HRT662B6.js} +3 -3
- package/dist/{chunk-ABA3KD3X.js.map → chunk-HRT662B6.js.map} +1 -1
- package/dist/chunk-IHVB4C5U.cjs +4 -0
- package/dist/{chunk-ROOVGRNA.cjs.map → chunk-IHVB4C5U.cjs.map} +1 -1
- package/dist/{chunk-OVWOD5GI.cjs → chunk-IKYWIQB2.cjs} +20 -20
- package/dist/{chunk-OVWOD5GI.cjs.map → chunk-IKYWIQB2.cjs.map} +1 -1
- package/dist/{chunk-UORUVXKY.js → chunk-JYVH24UY.js} +6 -6
- package/dist/{chunk-UORUVXKY.js.map → chunk-JYVH24UY.js.map} +1 -1
- package/dist/{chunk-AHFHYQS6.js → chunk-LQHNR4L7.js} +4 -4
- package/dist/{chunk-AHFHYQS6.js.map → chunk-LQHNR4L7.js.map} +1 -1
- package/dist/{chunk-OXS5X7PW.cjs → chunk-OJQCLQK7.cjs} +13 -13
- package/dist/{chunk-OXS5X7PW.cjs.map → chunk-OJQCLQK7.cjs.map} +1 -1
- package/dist/{chunk-CX5I6VS4.js → chunk-QE7OKYS3.js} +111 -38
- package/dist/chunk-QE7OKYS3.js.map +1 -0
- package/dist/{chunk-FB6O7FNK.js → chunk-QOFOOVPM.js} +9 -9
- package/dist/{chunk-FB6O7FNK.js.map → chunk-QOFOOVPM.js.map} +1 -1
- package/dist/{chunk-SLHDZJ4B.js → chunk-RHQHBU6R.js} +5 -4
- package/dist/chunk-RHQHBU6R.js.map +1 -0
- package/dist/{chunk-3UM5VCQ5.cjs → chunk-RIUDLIP3.cjs} +3 -3
- package/dist/{chunk-3UM5VCQ5.cjs.map → chunk-RIUDLIP3.cjs.map} +1 -1
- package/dist/chunk-S43VACTO.js +3 -0
- package/dist/{chunk-DMX7MC4N.js.map → chunk-S43VACTO.js.map} +1 -1
- package/dist/{chunk-PYNUWPGW.cjs → chunk-SMWXSQXP.cjs} +19 -19
- package/dist/{chunk-PYNUWPGW.cjs.map → chunk-SMWXSQXP.cjs.map} +1 -1
- package/dist/{chunk-32NEFSTI.js → chunk-T3TFXXGP.js} +12 -10
- package/dist/chunk-T3TFXXGP.js.map +1 -0
- package/dist/{chunk-6LHF5UDX.cjs → chunk-ULPWI6DN.cjs} +9 -9
- package/dist/{chunk-6LHF5UDX.cjs.map → chunk-ULPWI6DN.cjs.map} +1 -1
- package/dist/{chunk-QXPUTX3W.cjs → chunk-UZ426KMJ.cjs} +33 -32
- package/dist/chunk-UZ426KMJ.cjs.map +1 -0
- package/dist/{chunk-B6D4D2CY.cjs → chunk-VYVPUH6H.cjs} +112 -37
- package/dist/chunk-VYVPUH6H.cjs.map +1 -0
- package/dist/{chunk-MP2VGF73.js → chunk-WINCOFML.js} +3 -3
- package/dist/{chunk-MP2VGF73.js.map → chunk-WINCOFML.js.map} +1 -1
- package/dist/{chunk-ZFH5KWHO.js → chunk-Z5FE6LBA.js} +3 -3
- package/dist/{chunk-ZFH5KWHO.js.map → chunk-Z5FE6LBA.js.map} +1 -1
- package/dist/datasets/dataset.d.ts +1 -0
- package/dist/datasets/dataset.d.ts.map +1 -1
- package/dist/datasets/experiment/index.d.ts.map +1 -1
- package/dist/datasets/index.cjs +17 -17
- package/dist/datasets/index.js +2 -2
- package/dist/datasets/manager.d.ts +1 -0
- package/dist/datasets/manager.d.ts.map +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +534 -521
- package/dist/docs/references/reference-configuration.md +24 -0
- package/dist/docs/references/reference-core-mastra-model-gateway.md +2 -0
- package/dist/evals/index.cjs +23 -23
- package/dist/evals/index.js +3 -3
- package/dist/evals/scoreTraces/index.cjs +7 -7
- package/dist/evals/scoreTraces/index.js +3 -3
- package/dist/harness/index.cjs +17 -17
- package/dist/harness/index.js +7 -7
- 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 +16 -16
- package/dist/llm/index.js +5 -5
- package/dist/llm/model/gateways/models-dev.d.ts.map +1 -1
- package/dist/llm/model/provider-types.generated.d.ts +11 -2
- package/dist/loop/index.cjs +14 -14
- package/dist/loop/index.js +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +14 -14
- package/dist/memory/index.js +1 -1
- package/dist/models-dev-JGKQCSEN.js +3 -0
- package/dist/{models-dev-VDZIOMAC.js.map → models-dev-JGKQCSEN.js.map} +1 -1
- package/dist/models-dev-THY3NOPF.cjs +12 -0
- package/dist/{models-dev-MIC2CW43.cjs.map → models-dev-THY3NOPF.cjs.map} +1 -1
- package/dist/netlify-6TILQFDV.js +3 -0
- package/dist/{netlify-2CGMKEKT.js.map → netlify-6TILQFDV.js.map} +1 -1
- package/dist/netlify-NL6O2R7M.cjs +12 -0
- package/dist/{netlify-KZ4HQR5N.cjs.map → netlify-NL6O2R7M.cjs.map} +1 -1
- package/dist/observability/index.cjs +18 -18
- package/dist/observability/index.js +1 -1
- package/dist/observability/no-op.d.ts +14 -1
- package/dist/observability/no-op.d.ts.map +1 -1
- package/dist/observability/types/core.d.ts +35 -4
- package/dist/observability/types/core.d.ts.map +1 -1
- package/dist/observability/types/feedback.d.ts +42 -11
- package/dist/observability/types/feedback.d.ts.map +1 -1
- package/dist/observability/types/logging.d.ts +6 -9
- package/dist/observability/types/logging.d.ts.map +1 -1
- package/dist/observability/types/metrics.d.ts +6 -4
- package/dist/observability/types/metrics.d.ts.map +1 -1
- package/dist/observability/types/scores.d.ts +25 -10
- package/dist/observability/types/scores.d.ts.map +1 -1
- package/dist/observability/types/tracing.d.ts +12 -5
- package/dist/observability/types/tracing.d.ts.map +1 -1
- package/dist/processor-provider/index.cjs +10 -10
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +44 -44
- package/dist/processors/index.js +1 -1
- package/dist/processors/runner.d.ts.map +1 -1
- package/dist/provider-registry-CRD5YYZY.js +3 -0
- package/dist/{provider-registry-QRWUBN5N.js.map → provider-registry-CRD5YYZY.js.map} +1 -1
- package/dist/provider-registry-KXOHTVQF.cjs +40 -0
- package/dist/{provider-registry-HGWTTWCL.cjs.map → provider-registry-KXOHTVQF.cjs.map} +1 -1
- package/dist/provider-registry.json +27 -9
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/server/types.d.ts +16 -0
- package/dist/server/types.d.ts.map +1 -1
- package/dist/storage/constants.cjs +56 -56
- package/dist/storage/constants.d.ts.map +1 -1
- package/dist/storage/constants.js +1 -1
- package/dist/storage/domains/datasets/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/observability/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/observability/record-builders.d.ts.map +1 -1
- package/dist/storage/domains/observability/tracing.d.ts +8 -8
- package/dist/storage/domains/shared.d.ts +1 -1
- package/dist/storage/domains/shared.d.ts.map +1 -1
- package/dist/storage/index.cjs +276 -268
- package/dist/storage/index.js +3 -3
- package/dist/storage/types.d.ts +3 -0
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/stream/index.cjs +8 -8
- package/dist/stream/index.js +1 -1
- 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 +11 -7
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- 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 +1 -0
- package/dist/tools/validation.d.ts.map +1 -1
- package/dist/utils.cjs +23 -23
- package/dist/utils.js +1 -1
- package/dist/vector/index.cjs +7 -7
- package/dist/vector/index.js +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/index.cjs +24 -24
- package/dist/workflows/index.js +1 -1
- package/dist/workspace/index.cjs +68 -68
- package/dist/workspace/index.js +1 -1
- package/package.json +3 -3
- package/src/llm/model/provider-types.generated.d.ts +11 -2
- package/dist/chunk-32NEFSTI.js.map +0 -1
- package/dist/chunk-4K2NKQGN.cjs.map +0 -1
- package/dist/chunk-7USX5P3I.js.map +0 -1
- package/dist/chunk-B6D4D2CY.cjs.map +0 -1
- package/dist/chunk-CX5I6VS4.js.map +0 -1
- package/dist/chunk-DMX7MC4N.js +0 -3
- package/dist/chunk-GRMC2OYN.js.map +0 -1
- package/dist/chunk-GVHBM6VU.cjs.map +0 -1
- package/dist/chunk-IR4WRS3N.js.map +0 -1
- package/dist/chunk-K4NN2KQQ.cjs.map +0 -1
- package/dist/chunk-OKKJRRSS.cjs.map +0 -1
- package/dist/chunk-OYAHOEQP.js.map +0 -1
- package/dist/chunk-QXPUTX3W.cjs.map +0 -1
- package/dist/chunk-ROOVGRNA.cjs +0 -4
- package/dist/chunk-SLHDZJ4B.js.map +0 -1
- package/dist/chunk-W2QYKEBN.js.map +0 -1
- package/dist/chunk-X36INADV.cjs.map +0 -1
- package/dist/chunk-ZFZ6HQFT.cjs.map +0 -1
- package/dist/models-dev-MIC2CW43.cjs +0 -12
- package/dist/models-dev-VDZIOMAC.js +0 -3
- package/dist/netlify-2CGMKEKT.js +0 -3
- package/dist/netlify-KZ4HQR5N.cjs +0 -12
- package/dist/provider-registry-HGWTTWCL.cjs +0 -40
- package/dist/provider-registry-QRWUBN5N.js +0 -3
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkZC4FJVJZ_cjs = require('./chunk-ZC4FJVJZ.cjs');
|
|
4
4
|
var chunkZCBG4ZQT_cjs = require('./chunk-ZCBG4ZQT.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var chunkGXXNF6NF_cjs = require('./chunk-GXXNF6NF.cjs');
|
|
6
|
+
var chunkCGDV5YUS_cjs = require('./chunk-CGDV5YUS.cjs');
|
|
7
7
|
var chunkANLO4VM2_cjs = require('./chunk-ANLO4VM2.cjs');
|
|
8
8
|
var chunkY3APFUXZ_cjs = require('./chunk-Y3APFUXZ.cjs');
|
|
9
9
|
var chunkCFMZZDO2_cjs = require('./chunk-CFMZZDO2.cjs');
|
|
10
10
|
var chunkMR7ZWBL6_cjs = require('./chunk-MR7ZWBL6.cjs');
|
|
11
|
-
var
|
|
12
|
-
var
|
|
11
|
+
var chunk4QLIPOI7_cjs = require('./chunk-4QLIPOI7.cjs');
|
|
12
|
+
var chunkOJQCLQK7_cjs = require('./chunk-OJQCLQK7.cjs');
|
|
13
13
|
var chunk6BJ7XHRH_cjs = require('./chunk-6BJ7XHRH.cjs');
|
|
14
14
|
var chunkOQDRPRKM_cjs = require('./chunk-OQDRPRKM.cjs');
|
|
15
|
-
var
|
|
16
|
-
var
|
|
15
|
+
var chunkATKRXBCX_cjs = require('./chunk-ATKRXBCX.cjs');
|
|
16
|
+
var chunkVYVPUH6H_cjs = require('./chunk-VYVPUH6H.cjs');
|
|
17
17
|
var chunkKJBMTK5B_cjs = require('./chunk-KJBMTK5B.cjs');
|
|
18
|
-
var
|
|
18
|
+
var chunkAV4YSAZL_cjs = require('./chunk-AV4YSAZL.cjs');
|
|
19
19
|
var chunkXB4FLS7A_cjs = require('./chunk-XB4FLS7A.cjs');
|
|
20
20
|
var chunk5WBEMKE2_cjs = require('./chunk-5WBEMKE2.cjs');
|
|
21
21
|
var chunk4U7ZLI36_cjs = require('./chunk-4U7ZLI36.cjs');
|
|
@@ -654,10 +654,10 @@ function prepareToolsAndToolChoice({
|
|
|
654
654
|
return {
|
|
655
655
|
tools: filteredTools.map(([name, tool2]) => {
|
|
656
656
|
try {
|
|
657
|
-
if (
|
|
657
|
+
if (chunkAV4YSAZL_cjs.isProviderDefinedTool(tool2)) {
|
|
658
658
|
return {
|
|
659
659
|
type: providerToolType,
|
|
660
|
-
name:
|
|
660
|
+
name: chunkAV4YSAZL_cjs.getProviderToolName(tool2.id),
|
|
661
661
|
id: tool2.id,
|
|
662
662
|
args: tool2.args ?? {}
|
|
663
663
|
};
|
|
@@ -711,7 +711,7 @@ function prepareToolsAndToolChoice({
|
|
|
711
711
|
const providerId = sdkTool.id;
|
|
712
712
|
return {
|
|
713
713
|
type: providerToolType,
|
|
714
|
-
name: providerId ?
|
|
714
|
+
name: providerId ? chunkAV4YSAZL_cjs.getProviderToolName(providerId) : name,
|
|
715
715
|
id: providerId,
|
|
716
716
|
args: sdkTool.args
|
|
717
717
|
};
|
|
@@ -795,7 +795,7 @@ var StructuredOutputProcessor = class {
|
|
|
795
795
|
}
|
|
796
796
|
async processOutputStream(args) {
|
|
797
797
|
const { part, state, streamParts, abort, ...rest } = args;
|
|
798
|
-
const observabilityContext =
|
|
798
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
799
799
|
const controller = state.controller;
|
|
800
800
|
switch (part.type) {
|
|
801
801
|
case "finish":
|
|
@@ -1092,7 +1092,7 @@ var ProcessorState = class {
|
|
|
1092
1092
|
this.span = parentSpan?.createChildSpan({
|
|
1093
1093
|
type: "processor_run" /* PROCESSOR_RUN */,
|
|
1094
1094
|
name: `output stream processor: ${options.processorName}`,
|
|
1095
|
-
entityType:
|
|
1095
|
+
entityType: chunkVYVPUH6H_cjs.EntityType.OUTPUT_PROCESSOR,
|
|
1096
1096
|
entityName: options.processorName,
|
|
1097
1097
|
attributes: {
|
|
1098
1098
|
processorExecutor: "legacy",
|
|
@@ -1269,7 +1269,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1269
1269
|
const processorSpan = parentSpan?.createChildSpan({
|
|
1270
1270
|
type: "processor_run" /* PROCESSOR_RUN */,
|
|
1271
1271
|
name: `output processor: ${processor.id}`,
|
|
1272
|
-
entityType:
|
|
1272
|
+
entityType: chunkVYVPUH6H_cjs.EntityType.OUTPUT_PROCESSOR,
|
|
1273
1273
|
entityId: processor.id,
|
|
1274
1274
|
entityName: processor.name,
|
|
1275
1275
|
attributes: {
|
|
@@ -1293,7 +1293,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1293
1293
|
state: processorState.customState,
|
|
1294
1294
|
result: result ?? defaultResult,
|
|
1295
1295
|
abort,
|
|
1296
|
-
...
|
|
1296
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: processorSpan }),
|
|
1297
1297
|
requestContext,
|
|
1298
1298
|
retryCount,
|
|
1299
1299
|
writer
|
|
@@ -1427,7 +1427,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1427
1427
|
abort: (reason, options) => {
|
|
1428
1428
|
throw new TripWire(reason || `Stream part blocked by ${processor.id}`, options, processor.id);
|
|
1429
1429
|
},
|
|
1430
|
-
...
|
|
1430
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: state.span }),
|
|
1431
1431
|
requestContext,
|
|
1432
1432
|
messageList,
|
|
1433
1433
|
retryCount,
|
|
@@ -1569,7 +1569,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1569
1569
|
const processorSpan = parentSpan?.createChildSpan({
|
|
1570
1570
|
type: "processor_run" /* PROCESSOR_RUN */,
|
|
1571
1571
|
name: `input processor: ${processor.id}`,
|
|
1572
|
-
entityType:
|
|
1572
|
+
entityType: chunkVYVPUH6H_cjs.EntityType.INPUT_PROCESSOR,
|
|
1573
1573
|
entityId: processor.id,
|
|
1574
1574
|
entityName: processor.name,
|
|
1575
1575
|
attributes: {
|
|
@@ -1587,7 +1587,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1587
1587
|
systemMessages: currentSystemMessages,
|
|
1588
1588
|
state: processorState.customState,
|
|
1589
1589
|
abort,
|
|
1590
|
-
...
|
|
1590
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: processorSpan }),
|
|
1591
1591
|
messageList,
|
|
1592
1592
|
requestContext,
|
|
1593
1593
|
retryCount
|
|
@@ -1698,7 +1698,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1698
1698
|
*/
|
|
1699
1699
|
async runProcessInputStep(args) {
|
|
1700
1700
|
const { messageList, stepNumber, steps, requestContext, writer } = args;
|
|
1701
|
-
const observabilityContext =
|
|
1701
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(args);
|
|
1702
1702
|
const stepInput = {
|
|
1703
1703
|
messageId: args.messageId,
|
|
1704
1704
|
tools: args.tools,
|
|
@@ -1724,6 +1724,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1724
1724
|
messages: processableMessages,
|
|
1725
1725
|
messageList,
|
|
1726
1726
|
stepNumber,
|
|
1727
|
+
steps,
|
|
1727
1728
|
systemMessages: currentSystemMessages2,
|
|
1728
1729
|
rotateResponseMessageId: args.rotateResponseMessageId ? () => {
|
|
1729
1730
|
const nextMessageId = args.rotateResponseMessageId();
|
|
@@ -1768,7 +1769,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1768
1769
|
const processorSpan = currentSpan?.createChildSpan({
|
|
1769
1770
|
type: "processor_run" /* PROCESSOR_RUN */,
|
|
1770
1771
|
name: `input step processor: ${processor.id}`,
|
|
1771
|
-
entityType:
|
|
1772
|
+
entityType: chunkVYVPUH6H_cjs.EntityType.INPUT_STEP_PROCESSOR,
|
|
1772
1773
|
entityId: processor.id,
|
|
1773
1774
|
entityName: processor.name,
|
|
1774
1775
|
attributes: {
|
|
@@ -1799,7 +1800,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1799
1800
|
return nextMessageId;
|
|
1800
1801
|
}
|
|
1801
1802
|
} : {},
|
|
1802
|
-
...
|
|
1803
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: processorSpan }),
|
|
1803
1804
|
retryCount: args.retryCount ?? 0,
|
|
1804
1805
|
writer,
|
|
1805
1806
|
abortSignal: args.abortSignal
|
|
@@ -1894,7 +1895,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1894
1895
|
retryCount = 0,
|
|
1895
1896
|
writer
|
|
1896
1897
|
} = args;
|
|
1897
|
-
const observabilityContext =
|
|
1898
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(args);
|
|
1898
1899
|
for (const [index, processorOrWorkflow] of this.outputProcessors.entries()) {
|
|
1899
1900
|
const processableMessages = messageList.get.all.db();
|
|
1900
1901
|
const idsBeforeProcessing = processableMessages.map((m) => m.id);
|
|
@@ -1934,7 +1935,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1934
1935
|
const processorSpan = parentSpan?.createChildSpan({
|
|
1935
1936
|
type: "processor_run" /* PROCESSOR_RUN */,
|
|
1936
1937
|
name: `output step processor: ${processor.id}`,
|
|
1937
|
-
entityType:
|
|
1938
|
+
entityType: chunkVYVPUH6H_cjs.EntityType.OUTPUT_STEP_PROCESSOR,
|
|
1938
1939
|
entityId: processor.id,
|
|
1939
1940
|
entityName: processor.name,
|
|
1940
1941
|
attributes: {
|
|
@@ -1958,7 +1959,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1958
1959
|
steps,
|
|
1959
1960
|
state: processorState.customState,
|
|
1960
1961
|
abort,
|
|
1961
|
-
...
|
|
1962
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: processorSpan }),
|
|
1962
1963
|
requestContext,
|
|
1963
1964
|
retryCount,
|
|
1964
1965
|
writer
|
|
@@ -2072,7 +2073,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
2072
2073
|
}
|
|
2073
2074
|
const { model: _model, ...rest } = result;
|
|
2074
2075
|
if (result.model) {
|
|
2075
|
-
const resolvedModel = await
|
|
2076
|
+
const resolvedModel = await chunk4QLIPOI7_cjs.resolveModelConfig(result.model);
|
|
2076
2077
|
const isSupported = isSupportedLanguageModel(resolvedModel);
|
|
2077
2078
|
if (!isSupported) {
|
|
2078
2079
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
@@ -2817,7 +2818,7 @@ var MastraModelOutput = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
2817
2818
|
this.#transportRef = options.transportRef;
|
|
2818
2819
|
this.#returnScorerData = !!options.returnScorerData;
|
|
2819
2820
|
this.runId = options.runId;
|
|
2820
|
-
const resultSpan =
|
|
2821
|
+
const resultSpan = chunkVYVPUH6H_cjs.getRootExportSpan(options.tracingContext?.currentSpan);
|
|
2821
2822
|
this.traceId = resultSpan?.externalTraceId;
|
|
2822
2823
|
this.spanId = resultSpan?.id;
|
|
2823
2824
|
this.#model = _model;
|
|
@@ -2879,7 +2880,7 @@ var MastraModelOutput = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
2879
2880
|
} = await processorRunner.processPart(
|
|
2880
2881
|
chunk,
|
|
2881
2882
|
processorStates,
|
|
2882
|
-
|
|
2883
|
+
chunkVYVPUH6H_cjs.resolveObservabilityContext(options),
|
|
2883
2884
|
options.requestContext,
|
|
2884
2885
|
self.messageList,
|
|
2885
2886
|
0,
|
|
@@ -3271,7 +3272,7 @@ var MastraModelOutput = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
3271
3272
|
};
|
|
3272
3273
|
self.messageList = await self.processorRunner.runOutputProcessors(
|
|
3273
3274
|
self.messageList,
|
|
3274
|
-
|
|
3275
|
+
chunkVYVPUH6H_cjs.resolveObservabilityContext(options),
|
|
3275
3276
|
self.#options.requestContext,
|
|
3276
3277
|
0,
|
|
3277
3278
|
outputResultWriter,
|
|
@@ -4846,7 +4847,7 @@ var getModelOutputForTripwire = async ({
|
|
|
4846
4847
|
messageList,
|
|
4847
4848
|
...rest
|
|
4848
4849
|
}) => {
|
|
4849
|
-
const observabilityContext =
|
|
4850
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
4850
4851
|
const tripwireStream = new web.ReadableStream({
|
|
4851
4852
|
start(controller) {
|
|
4852
4853
|
controller.enqueue({
|
|
@@ -5498,7 +5499,7 @@ var createTimeTravelExecutionParams = (params) => {
|
|
|
5498
5499
|
result = void 0;
|
|
5499
5500
|
}
|
|
5500
5501
|
if (result) {
|
|
5501
|
-
const formattedResult =
|
|
5502
|
+
const formattedResult = chunkATKRXBCX_cjs.removeUndefinedValues(result);
|
|
5502
5503
|
stepResults[stepId] = formattedResult;
|
|
5503
5504
|
}
|
|
5504
5505
|
});
|
|
@@ -5590,7 +5591,7 @@ async function executeParallel(engine, params) {
|
|
|
5590
5591
|
perStep,
|
|
5591
5592
|
...rest
|
|
5592
5593
|
} = params;
|
|
5593
|
-
const observabilityContext =
|
|
5594
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
5594
5595
|
const parallelSpan = await engine.createChildSpan({
|
|
5595
5596
|
parentSpan: observabilityContext.tracingContext.currentSpan,
|
|
5596
5597
|
operationId: `workflow.${workflowId}.run.${runId}.parallel.${executionContext.executionPath.join("-")}.span.start`,
|
|
@@ -5668,7 +5669,7 @@ async function executeParallel(engine, params) {
|
|
|
5668
5669
|
state: executionContext.state,
|
|
5669
5670
|
tracingIds: executionContext.tracingIds
|
|
5670
5671
|
},
|
|
5671
|
-
...
|
|
5672
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: parallelSpan }),
|
|
5672
5673
|
pubsub,
|
|
5673
5674
|
abortController,
|
|
5674
5675
|
requestContext,
|
|
@@ -5744,7 +5745,7 @@ async function executeConditional(engine, params) {
|
|
|
5744
5745
|
perStep,
|
|
5745
5746
|
...rest
|
|
5746
5747
|
} = params;
|
|
5747
|
-
const observabilityContext =
|
|
5748
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
5748
5749
|
const conditionalSpan = await engine.createChildSpan({
|
|
5749
5750
|
parentSpan: observabilityContext.tracingContext.currentSpan,
|
|
5750
5751
|
operationId: `workflow.${workflowId}.run.${runId}.conditional.${executionContext.executionPath.join("-")}.span.start`,
|
|
@@ -5786,7 +5787,7 @@ async function executeConditional(engine, params) {
|
|
|
5786
5787
|
inputData: prevOutput,
|
|
5787
5788
|
state: executionContext.state,
|
|
5788
5789
|
retryCount: -1,
|
|
5789
|
-
...
|
|
5790
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: evalSpan }),
|
|
5790
5791
|
getInitData: () => stepResults?.input,
|
|
5791
5792
|
getStepResult: getStepResult.bind(null, stepResults),
|
|
5792
5793
|
bail: (() => {
|
|
@@ -5907,7 +5908,7 @@ async function executeConditional(engine, params) {
|
|
|
5907
5908
|
state: executionContext.state,
|
|
5908
5909
|
tracingIds: executionContext.tracingIds
|
|
5909
5910
|
},
|
|
5910
|
-
...
|
|
5911
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: conditionalSpan }),
|
|
5911
5912
|
pubsub,
|
|
5912
5913
|
abortController,
|
|
5913
5914
|
requestContext,
|
|
@@ -5984,7 +5985,7 @@ async function executeLoop(engine, params) {
|
|
|
5984
5985
|
perStep,
|
|
5985
5986
|
...rest
|
|
5986
5987
|
} = params;
|
|
5987
|
-
const observabilityContext =
|
|
5988
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
5988
5989
|
const { step, condition } = entry;
|
|
5989
5990
|
const loopSpan = await engine.createChildSpan({
|
|
5990
5991
|
parentSpan: observabilityContext.tracingContext.currentSpan,
|
|
@@ -6020,7 +6021,7 @@ async function executeLoop(engine, params) {
|
|
|
6020
6021
|
resume: currentResume,
|
|
6021
6022
|
timeTravel: currentTimeTravel,
|
|
6022
6023
|
prevOutput: result.output,
|
|
6023
|
-
...
|
|
6024
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: loopSpan }),
|
|
6024
6025
|
pubsub,
|
|
6025
6026
|
abortController,
|
|
6026
6027
|
requestContext,
|
|
@@ -6056,7 +6057,7 @@ async function executeLoop(engine, params) {
|
|
|
6056
6057
|
options: {
|
|
6057
6058
|
type: "workflow_conditional_eval" /* WORKFLOW_CONDITIONAL_EVAL */,
|
|
6058
6059
|
name: `condition: '${entry.loopType}'`,
|
|
6059
|
-
input:
|
|
6060
|
+
input: chunkATKRXBCX_cjs.selectFields(result.output, ["stepResult", "output.text", "output.object", "messages"]),
|
|
6060
6061
|
attributes: {
|
|
6061
6062
|
conditionIndex: iteration
|
|
6062
6063
|
},
|
|
@@ -6074,7 +6075,7 @@ async function executeLoop(engine, params) {
|
|
|
6074
6075
|
inputData: result.output,
|
|
6075
6076
|
state: executionContext.state,
|
|
6076
6077
|
retryCount: -1,
|
|
6077
|
-
...
|
|
6078
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: evalSpan }),
|
|
6078
6079
|
iterationCount: iteration + 1,
|
|
6079
6080
|
getInitData: () => stepResults?.input,
|
|
6080
6081
|
getStepResult: getStepResult.bind(null, stepResults),
|
|
@@ -6146,7 +6147,7 @@ async function executeForeach(engine, params) {
|
|
|
6146
6147
|
perStep,
|
|
6147
6148
|
...rest
|
|
6148
6149
|
} = params;
|
|
6149
|
-
const observabilityContext =
|
|
6150
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
6150
6151
|
const { step, opts } = entry;
|
|
6151
6152
|
const results = [];
|
|
6152
6153
|
const concurrency = opts.concurrency;
|
|
@@ -6222,7 +6223,7 @@ async function executeForeach(engine, params) {
|
|
|
6222
6223
|
executionContext: { ...executionContext, foreachIndex: k },
|
|
6223
6224
|
resume: resumeToUse,
|
|
6224
6225
|
prevOutput: item,
|
|
6225
|
-
...
|
|
6226
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: loopSpan }),
|
|
6226
6227
|
pubsub,
|
|
6227
6228
|
abortController,
|
|
6228
6229
|
requestContext,
|
|
@@ -6509,7 +6510,7 @@ async function executeEntry(engine, params) {
|
|
|
6509
6510
|
perStep,
|
|
6510
6511
|
...rest
|
|
6511
6512
|
} = params;
|
|
6512
|
-
const observabilityContext =
|
|
6513
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
6513
6514
|
const prevOutput = engine.getStepOutput(stepResults, prevStep);
|
|
6514
6515
|
let execResults;
|
|
6515
6516
|
let entryRequestContext;
|
|
@@ -6978,7 +6979,7 @@ async function executeSleep(engine, params) {
|
|
|
6978
6979
|
outputWriter,
|
|
6979
6980
|
...rest
|
|
6980
6981
|
} = params;
|
|
6981
|
-
const observabilityContext =
|
|
6982
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
6982
6983
|
let { duration, fn } = entry;
|
|
6983
6984
|
const sleepSpan = await engine.createChildSpan({
|
|
6984
6985
|
parentSpan: observabilityContext.tracingContext.currentSpan,
|
|
@@ -7007,7 +7008,7 @@ async function executeSleep(engine, params) {
|
|
|
7007
7008
|
executionContext.state = state;
|
|
7008
7009
|
},
|
|
7009
7010
|
retryCount: -1,
|
|
7010
|
-
...
|
|
7011
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: sleepSpan }),
|
|
7011
7012
|
getInitData: () => stepResults?.input,
|
|
7012
7013
|
getStepResult: getStepResult.bind(null, stepResults),
|
|
7013
7014
|
// TODO: this function shouldn't have suspend probably?
|
|
@@ -7068,7 +7069,7 @@ async function executeSleepUntil(engine, params) {
|
|
|
7068
7069
|
outputWriter,
|
|
7069
7070
|
...rest
|
|
7070
7071
|
} = params;
|
|
7071
|
-
const observabilityContext =
|
|
7072
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
7072
7073
|
let { date, fn } = entry;
|
|
7073
7074
|
const sleepUntilSpan = await engine.createChildSpan({
|
|
7074
7075
|
parentSpan: observabilityContext.tracingContext.currentSpan,
|
|
@@ -7098,7 +7099,7 @@ async function executeSleepUntil(engine, params) {
|
|
|
7098
7099
|
executionContext.state = state;
|
|
7099
7100
|
},
|
|
7100
7101
|
retryCount: -1,
|
|
7101
|
-
...
|
|
7102
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: sleepUntilSpan }),
|
|
7102
7103
|
getInitData: () => stepResults?.input,
|
|
7103
7104
|
getStepResult: getStepResult.bind(null, stepResults),
|
|
7104
7105
|
// TODO: this function shouldn't have suspend probably?
|
|
@@ -7177,7 +7178,7 @@ async function executeStep(engine, params) {
|
|
|
7177
7178
|
perStep,
|
|
7178
7179
|
...rest
|
|
7179
7180
|
} = params;
|
|
7180
|
-
const observabilityContext =
|
|
7181
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
7181
7182
|
const stepCallId = crypto2.randomUUID();
|
|
7182
7183
|
const { inputData, validationError: inputValidationError } = await validateStepInput({
|
|
7183
7184
|
prevOutput,
|
|
@@ -7228,7 +7229,7 @@ async function executeStep(engine, params) {
|
|
|
7228
7229
|
options: {
|
|
7229
7230
|
name: `workflow step: '${step.id}'`,
|
|
7230
7231
|
type: "workflow_step" /* WORKFLOW_STEP */,
|
|
7231
|
-
entityType:
|
|
7232
|
+
entityType: chunkVYVPUH6H_cjs.EntityType.WORKFLOW_STEP,
|
|
7232
7233
|
entityId: step.id,
|
|
7233
7234
|
input: inputData,
|
|
7234
7235
|
tracingPolicy: engine.options?.tracingPolicy,
|
|
@@ -7316,7 +7317,7 @@ async function executeStep(engine, params) {
|
|
|
7316
7317
|
deprecationMessage: runCountDeprecationMessage,
|
|
7317
7318
|
logger: engine.getLogger()
|
|
7318
7319
|
});
|
|
7319
|
-
return
|
|
7320
|
+
return chunkVYVPUH6H_cjs.executeWithContext({ span: stepSpan, fn: () => step.execute(proxiedData) });
|
|
7320
7321
|
};
|
|
7321
7322
|
let execResults;
|
|
7322
7323
|
const retries = step.retries ?? executionContext.retryConfig.attempts ?? 0;
|
|
@@ -7341,7 +7342,7 @@ async function executeStep(engine, params) {
|
|
|
7341
7342
|
requestContextUpdate: null
|
|
7342
7343
|
};
|
|
7343
7344
|
const isNestedWorkflow = step.component === "WORKFLOW";
|
|
7344
|
-
const mastraForStep = engine.mastra ? isNestedWorkflow ? engine.mastra :
|
|
7345
|
+
const mastraForStep = engine.mastra ? isNestedWorkflow ? engine.mastra : chunkVYVPUH6H_cjs.wrapMastra(engine.mastra, { currentSpan: stepSpan }) : void 0;
|
|
7345
7346
|
const output = await runStep({
|
|
7346
7347
|
runId,
|
|
7347
7348
|
resourceId,
|
|
@@ -7364,7 +7365,7 @@ async function executeStep(engine, params) {
|
|
|
7364
7365
|
retryCount,
|
|
7365
7366
|
resumeData: resumeDataToUse,
|
|
7366
7367
|
suspendData: suspendDataToUse,
|
|
7367
|
-
...
|
|
7368
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: stepSpan }),
|
|
7368
7369
|
getInitData: () => stepResults?.input,
|
|
7369
7370
|
getStepResult: getStepResult.bind(null, stepResults),
|
|
7370
7371
|
suspend: async (suspendPayload, suspendOptions) => {
|
|
@@ -7466,7 +7467,7 @@ async function executeStep(engine, params) {
|
|
|
7466
7467
|
stepId: step.id,
|
|
7467
7468
|
requestContext,
|
|
7468
7469
|
disableScorers,
|
|
7469
|
-
...
|
|
7470
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: stepSpan })
|
|
7470
7471
|
});
|
|
7471
7472
|
}
|
|
7472
7473
|
if (durableResult.suspended) {
|
|
@@ -7522,7 +7523,7 @@ async function executeStep(engine, params) {
|
|
|
7522
7523
|
}
|
|
7523
7524
|
async function runScorersForStep(params) {
|
|
7524
7525
|
const { engine, scorers, runId, input, output, workflowId, stepId, requestContext, disableScorers, ...rest } = params;
|
|
7525
|
-
const observabilityContext =
|
|
7526
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
7526
7527
|
let scorersToUse = scorers;
|
|
7527
7528
|
if (typeof scorersToUse === "function") {
|
|
7528
7529
|
try {
|
|
@@ -8095,7 +8096,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
8095
8096
|
resume,
|
|
8096
8097
|
timeTravel,
|
|
8097
8098
|
restart,
|
|
8098
|
-
...
|
|
8099
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: workflowSpan }),
|
|
8099
8100
|
abortController: params.abortController,
|
|
8100
8101
|
pubsub: params.pubsub,
|
|
8101
8102
|
requestContext: currentRequestContext,
|
|
@@ -8326,10 +8327,10 @@ function isAgent(input) {
|
|
|
8326
8327
|
return input instanceof Agent;
|
|
8327
8328
|
}
|
|
8328
8329
|
function isToolStep(input) {
|
|
8329
|
-
return input instanceof
|
|
8330
|
+
return input instanceof chunkAV4YSAZL_cjs.Tool;
|
|
8330
8331
|
}
|
|
8331
8332
|
function isStepParams(input) {
|
|
8332
|
-
return input !== null && typeof input === "object" && "id" in input && "execute" in input && !(input instanceof Agent) && !(input instanceof
|
|
8333
|
+
return input !== null && typeof input === "object" && "id" in input && "execute" in input && !(input instanceof Agent) && !(input instanceof chunkAV4YSAZL_cjs.Tool);
|
|
8333
8334
|
}
|
|
8334
8335
|
function createStep(params, agentOrToolOptions) {
|
|
8335
8336
|
if (isAgent(params)) {
|
|
@@ -8391,7 +8392,7 @@ function createStepFromAgent(params, agentOrToolOptions) {
|
|
|
8391
8392
|
writer,
|
|
8392
8393
|
...rest
|
|
8393
8394
|
}) => {
|
|
8394
|
-
const observabilityContext =
|
|
8395
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
8395
8396
|
let streamPromise = {};
|
|
8396
8397
|
streamPromise.promise = new Promise((resolve2, reject) => {
|
|
8397
8398
|
streamPromise.resolve = resolve2;
|
|
@@ -8519,7 +8520,7 @@ function createStepFromTool(params, toolOpts) {
|
|
|
8519
8520
|
setState,
|
|
8520
8521
|
...rest
|
|
8521
8522
|
}) => {
|
|
8522
|
-
const observabilityContext =
|
|
8523
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
8523
8524
|
const toolContext = {
|
|
8524
8525
|
mastra,
|
|
8525
8526
|
requestContext,
|
|
@@ -8543,16 +8544,16 @@ function createStepFromProcessor(processor) {
|
|
|
8543
8544
|
const getProcessorEntityType = (phase) => {
|
|
8544
8545
|
switch (phase) {
|
|
8545
8546
|
case "input":
|
|
8546
|
-
return
|
|
8547
|
+
return chunkVYVPUH6H_cjs.EntityType.INPUT_PROCESSOR;
|
|
8547
8548
|
case "inputStep":
|
|
8548
|
-
return
|
|
8549
|
+
return chunkVYVPUH6H_cjs.EntityType.INPUT_STEP_PROCESSOR;
|
|
8549
8550
|
case "outputStream":
|
|
8550
8551
|
case "outputResult":
|
|
8551
|
-
return
|
|
8552
|
+
return chunkVYVPUH6H_cjs.EntityType.OUTPUT_PROCESSOR;
|
|
8552
8553
|
case "outputStep":
|
|
8553
|
-
return
|
|
8554
|
+
return chunkVYVPUH6H_cjs.EntityType.OUTPUT_STEP_PROCESSOR;
|
|
8554
8555
|
default:
|
|
8555
|
-
return
|
|
8556
|
+
return chunkVYVPUH6H_cjs.EntityType.OUTPUT_PROCESSOR;
|
|
8556
8557
|
}
|
|
8557
8558
|
};
|
|
8558
8559
|
const getSpanNamePrefix = (phase) => {
|
|
@@ -8650,7 +8651,7 @@ function createStepFromProcessor(processor) {
|
|
|
8650
8651
|
processorIndex: processor.processorIndex
|
|
8651
8652
|
}
|
|
8652
8653
|
}) : void 0;
|
|
8653
|
-
const processorObservabilityContext =
|
|
8654
|
+
const processorObservabilityContext = chunkVYVPUH6H_cjs.createObservabilityContext(
|
|
8654
8655
|
processorSpan ? { currentSpan: processorSpan } : tracingContext
|
|
8655
8656
|
);
|
|
8656
8657
|
const processorWriter = outputWriter ? {
|
|
@@ -8708,7 +8709,7 @@ function createStepFromProcessor(processor) {
|
|
|
8708
8709
|
};
|
|
8709
8710
|
const executePhaseWithSpan = async (fn) => {
|
|
8710
8711
|
try {
|
|
8711
|
-
const result = await
|
|
8712
|
+
const result = await chunkVYVPUH6H_cjs.executeWithContext({ span: processorSpan, fn });
|
|
8712
8713
|
processorSpan?.end({ output: result });
|
|
8713
8714
|
return result;
|
|
8714
8715
|
} catch (error) {
|
|
@@ -8852,7 +8853,7 @@ function createStepFromProcessor(processor) {
|
|
|
8852
8853
|
processorSpan2 = parentSpan.createChildSpan({
|
|
8853
8854
|
type: "processor_run" /* PROCESSOR_RUN */,
|
|
8854
8855
|
name: `output stream processor: ${processor.id}`,
|
|
8855
|
-
entityType:
|
|
8856
|
+
entityType: chunkVYVPUH6H_cjs.EntityType.OUTPUT_PROCESSOR,
|
|
8856
8857
|
entityId: processor.id,
|
|
8857
8858
|
entityName: processor.name ?? processor.id,
|
|
8858
8859
|
input: { phase, totalChunks: 0 },
|
|
@@ -8869,7 +8870,7 @@ function createStepFromProcessor(processor) {
|
|
|
8869
8870
|
totalChunks: (streamParts ?? []).length
|
|
8870
8871
|
};
|
|
8871
8872
|
}
|
|
8872
|
-
const processorObservabilityContext2 =
|
|
8873
|
+
const processorObservabilityContext2 = chunkVYVPUH6H_cjs.createObservabilityContext(
|
|
8873
8874
|
processorSpan2 ? { currentSpan: processorSpan2 } : baseContext.tracingContext
|
|
8874
8875
|
);
|
|
8875
8876
|
let result;
|
|
@@ -9059,7 +9060,7 @@ function cloneStep(step, opts) {
|
|
|
9059
9060
|
};
|
|
9060
9061
|
}
|
|
9061
9062
|
function isProcessor(obj) {
|
|
9062
|
-
return obj !== null && typeof obj === "object" && "id" in obj && typeof obj.id === "string" && !(obj instanceof Agent) && !(obj instanceof
|
|
9063
|
+
return obj !== null && typeof obj === "object" && "id" in obj && typeof obj.id === "string" && !(obj instanceof Agent) && !(obj instanceof chunkAV4YSAZL_cjs.Tool) && (typeof obj.processInput === "function" || typeof obj.processInputStep === "function" || typeof obj.processOutputStream === "function" || typeof obj.processOutputResult === "function" || typeof obj.processOutputStep === "function");
|
|
9063
9064
|
}
|
|
9064
9065
|
function createWorkflow(params) {
|
|
9065
9066
|
return new Workflow(params);
|
|
@@ -9615,7 +9616,7 @@ var Workflow = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
9615
9616
|
bail: _bail,
|
|
9616
9617
|
...rest
|
|
9617
9618
|
}) {
|
|
9618
|
-
const observabilityContext =
|
|
9619
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
9619
9620
|
this.__registerMastra(mastra);
|
|
9620
9621
|
const effectiveValidateInputs = validateInputs ?? this.#options.validateInputs ?? true;
|
|
9621
9622
|
this.#options = {
|
|
@@ -10113,11 +10114,11 @@ var Run = class {
|
|
|
10113
10114
|
perStep,
|
|
10114
10115
|
...rest
|
|
10115
10116
|
}) {
|
|
10116
|
-
const observabilityContext =
|
|
10117
|
-
const workflowSpan =
|
|
10117
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
10118
|
+
const workflowSpan = chunkVYVPUH6H_cjs.getOrCreateSpan({
|
|
10118
10119
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
10119
10120
|
name: `workflow run: '${this.workflowId}'`,
|
|
10120
|
-
entityType:
|
|
10121
|
+
entityType: chunkVYVPUH6H_cjs.EntityType.WORKFLOW_RUN,
|
|
10121
10122
|
entityId: this.workflowId,
|
|
10122
10123
|
input: inputData,
|
|
10123
10124
|
metadata: {
|
|
@@ -10194,7 +10195,7 @@ var Run = class {
|
|
|
10194
10195
|
tracingOptions,
|
|
10195
10196
|
...rest
|
|
10196
10197
|
} = {}) {
|
|
10197
|
-
const observabilityContext =
|
|
10198
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
10198
10199
|
if (this.closeStreamAction) {
|
|
10199
10200
|
return {
|
|
10200
10201
|
stream: this.observeStreamLegacy().stream,
|
|
@@ -10319,7 +10320,7 @@ var Run = class {
|
|
|
10319
10320
|
perStep,
|
|
10320
10321
|
...rest
|
|
10321
10322
|
}) {
|
|
10322
|
-
const observabilityContext =
|
|
10323
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
10323
10324
|
if (this.closeStreamAction && this.streamOutput) {
|
|
10324
10325
|
return this.streamOutput;
|
|
10325
10326
|
}
|
|
@@ -10420,7 +10421,7 @@ var Run = class {
|
|
|
10420
10421
|
perStep,
|
|
10421
10422
|
...rest
|
|
10422
10423
|
} = {}) {
|
|
10423
|
-
const observabilityContext =
|
|
10424
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
10424
10425
|
this.closeStreamAction = async () => {
|
|
10425
10426
|
};
|
|
10426
10427
|
const self = this;
|
|
@@ -10549,7 +10550,7 @@ var Run = class {
|
|
|
10549
10550
|
return this._restart(args);
|
|
10550
10551
|
}
|
|
10551
10552
|
async _resume(params) {
|
|
10552
|
-
const observabilityContext =
|
|
10553
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(params);
|
|
10553
10554
|
const workflowsStore = await this.#mastra?.getStorage()?.getStore("workflows");
|
|
10554
10555
|
const snapshot = await workflowsStore?.loadWorkflowSnapshot({
|
|
10555
10556
|
workflowName: this.workflowId,
|
|
@@ -10633,10 +10634,10 @@ var Run = class {
|
|
|
10633
10634
|
traceId: effectiveTraceId,
|
|
10634
10635
|
parentSpanId: shouldUsePersistedParentSpan ? persistedTracingContext?.spanId : params.tracingOptions?.parentSpanId
|
|
10635
10636
|
};
|
|
10636
|
-
const workflowSpan =
|
|
10637
|
+
const workflowSpan = chunkVYVPUH6H_cjs.getOrCreateSpan({
|
|
10637
10638
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
10638
10639
|
name: `workflow run: '${this.workflowId}' (resumed)`,
|
|
10639
|
-
entityType:
|
|
10640
|
+
entityType: chunkVYVPUH6H_cjs.EntityType.WORKFLOW_RUN,
|
|
10640
10641
|
entityId: this.workflowId,
|
|
10641
10642
|
input: resumeDataToUse,
|
|
10642
10643
|
metadata: {
|
|
@@ -10700,7 +10701,7 @@ var Run = class {
|
|
|
10700
10701
|
tracingOptions,
|
|
10701
10702
|
...rest
|
|
10702
10703
|
}) {
|
|
10703
|
-
const observabilityContext =
|
|
10704
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
10704
10705
|
if (this.workflowEngineType !== "default") {
|
|
10705
10706
|
throw new Error(`restart() is not supported on ${this.workflowEngineType} workflows`);
|
|
10706
10707
|
}
|
|
@@ -10752,10 +10753,10 @@ var Run = class {
|
|
|
10752
10753
|
requestContextToUse.set(key, value);
|
|
10753
10754
|
}
|
|
10754
10755
|
}
|
|
10755
|
-
const workflowSpan =
|
|
10756
|
+
const workflowSpan = chunkVYVPUH6H_cjs.getOrCreateSpan({
|
|
10756
10757
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
10757
10758
|
name: `workflow run: '${this.workflowId}'`,
|
|
10758
|
-
entityType:
|
|
10759
|
+
entityType: chunkVYVPUH6H_cjs.EntityType.WORKFLOW_RUN,
|
|
10759
10760
|
entityId: this.workflowId,
|
|
10760
10761
|
metadata: {
|
|
10761
10762
|
resourceId: this.resourceId,
|
|
@@ -10805,7 +10806,7 @@ var Run = class {
|
|
|
10805
10806
|
perStep,
|
|
10806
10807
|
...rest
|
|
10807
10808
|
}) {
|
|
10808
|
-
const observabilityContext =
|
|
10809
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
10809
10810
|
if (!stepParam || Array.isArray(stepParam) && stepParam.length === 0) {
|
|
10810
10811
|
throw new Error("Step is required and must be a valid step or array of steps");
|
|
10811
10812
|
}
|
|
@@ -10849,11 +10850,11 @@ var Run = class {
|
|
|
10849
10850
|
requestContextToUse.set(key, value);
|
|
10850
10851
|
}
|
|
10851
10852
|
}
|
|
10852
|
-
const workflowSpan =
|
|
10853
|
+
const workflowSpan = chunkVYVPUH6H_cjs.getOrCreateSpan({
|
|
10853
10854
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
10854
10855
|
name: `workflow run: '${this.workflowId}'`,
|
|
10855
10856
|
input: inputData,
|
|
10856
|
-
entityType:
|
|
10857
|
+
entityType: chunkVYVPUH6H_cjs.EntityType.WORKFLOW_RUN,
|
|
10857
10858
|
entityId: this.workflowId,
|
|
10858
10859
|
metadata: {
|
|
10859
10860
|
resourceId: this.resourceId,
|
|
@@ -10907,7 +10908,7 @@ var Run = class {
|
|
|
10907
10908
|
perStep,
|
|
10908
10909
|
...rest
|
|
10909
10910
|
}) {
|
|
10910
|
-
const observabilityContext =
|
|
10911
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
10911
10912
|
this.closeStreamAction = async () => {
|
|
10912
10913
|
};
|
|
10913
10914
|
const self = this;
|
|
@@ -11213,7 +11214,7 @@ var MastraScorer = class _MastraScorer {
|
|
|
11213
11214
|
}
|
|
11214
11215
|
});
|
|
11215
11216
|
}
|
|
11216
|
-
const observabilityContext =
|
|
11217
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(input);
|
|
11217
11218
|
let runId = input.runId;
|
|
11218
11219
|
if (!runId) {
|
|
11219
11220
|
runId = crypto2.randomUUID();
|
|
@@ -11266,7 +11267,7 @@ var MastraScorer = class _MastraScorer {
|
|
|
11266
11267
|
inputSchema: v4.z.any(),
|
|
11267
11268
|
outputSchema: v4.z.any(),
|
|
11268
11269
|
execute: async ({ inputData, getInitData, ...rest }) => {
|
|
11269
|
-
const observabilityContext =
|
|
11270
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
11270
11271
|
const { accumulatedResults = {}, generatedPrompts = {} } = inputData;
|
|
11271
11272
|
const { run } = getInitData();
|
|
11272
11273
|
const context = this.createScorerContext(scorerStep.name, run, accumulatedResults);
|
|
@@ -11357,7 +11358,7 @@ var MastraScorer = class _MastraScorer {
|
|
|
11357
11358
|
}
|
|
11358
11359
|
});
|
|
11359
11360
|
}
|
|
11360
|
-
const resolvedModel = await
|
|
11361
|
+
const resolvedModel = await chunk4QLIPOI7_cjs.resolveModelConfig(modelConfig, void 0, this.#mastra);
|
|
11361
11362
|
const judge = new Agent({
|
|
11362
11363
|
id: "judge",
|
|
11363
11364
|
name: "judge",
|
|
@@ -12212,11 +12213,11 @@ var DefaultStepResult = class {
|
|
|
12212
12213
|
// src/tools/provider-tool-utils.ts
|
|
12213
12214
|
function findProviderToolByName(tools, toolName) {
|
|
12214
12215
|
if (!tools) return void 0;
|
|
12215
|
-
return Object.values(tools).find((t) =>
|
|
12216
|
+
return Object.values(tools).find((t) => chunkAV4YSAZL_cjs.isProviderTool(t) && chunkAV4YSAZL_cjs.getProviderToolName(t.id) === toolName);
|
|
12216
12217
|
}
|
|
12217
12218
|
function inferProviderExecuted(providerExecuted, tool2) {
|
|
12218
12219
|
if (providerExecuted !== void 0) return providerExecuted;
|
|
12219
|
-
return
|
|
12220
|
+
return chunkAV4YSAZL_cjs.isProviderTool(tool2) ? true : void 0;
|
|
12220
12221
|
}
|
|
12221
12222
|
|
|
12222
12223
|
// src/loop/workflows/run-state.ts
|
|
@@ -12785,7 +12786,7 @@ function createLLMExecutionStep({
|
|
|
12785
12786
|
const processInputStepResult = await processorRunner.runProcessInputStep({
|
|
12786
12787
|
messageList,
|
|
12787
12788
|
stepNumber: inputData.output?.steps?.length || 0,
|
|
12788
|
-
...
|
|
12789
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext(stepTracingContext),
|
|
12789
12790
|
requestContext,
|
|
12790
12791
|
model,
|
|
12791
12792
|
steps: inputData.output?.steps || [],
|
|
@@ -12838,8 +12839,8 @@ function createLLMExecutionStep({
|
|
|
12838
12839
|
if (processInputStepResult.tools && currentStep.tools) {
|
|
12839
12840
|
const convertedTools = {};
|
|
12840
12841
|
for (const [name, tool2] of Object.entries(currentStep.tools)) {
|
|
12841
|
-
if (
|
|
12842
|
-
convertedTools[name] =
|
|
12842
|
+
if (chunkAV4YSAZL_cjs.isMastraTool(tool2)) {
|
|
12843
|
+
convertedTools[name] = chunkATKRXBCX_cjs.makeCoreTool(
|
|
12843
12844
|
tool2,
|
|
12844
12845
|
{
|
|
12845
12846
|
name,
|
|
@@ -12976,7 +12977,7 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
|
|
|
12976
12977
|
}
|
|
12977
12978
|
}
|
|
12978
12979
|
if (isSupportedLanguageModel(currentStep.model)) {
|
|
12979
|
-
modelResult =
|
|
12980
|
+
modelResult = chunkVYVPUH6H_cjs.executeWithContextSync({
|
|
12980
12981
|
span: modelSpanTracker?.getTracingContext()?.currentSpan,
|
|
12981
12982
|
fn: () => execute({
|
|
12982
12983
|
runId,
|
|
@@ -13046,7 +13047,7 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
|
|
|
13046
13047
|
}
|
|
13047
13048
|
});
|
|
13048
13049
|
let transportResolver;
|
|
13049
|
-
if (currentStep.model instanceof
|
|
13050
|
+
if (currentStep.model instanceof chunk4QLIPOI7_cjs.ModelRouterLanguageModel) {
|
|
13050
13051
|
const routerModel = currentStep.model;
|
|
13051
13052
|
transportResolver = () => routerModel._getStreamTransport();
|
|
13052
13053
|
}
|
|
@@ -13209,7 +13210,7 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
|
|
|
13209
13210
|
finishReason: immediateFinishReason,
|
|
13210
13211
|
toolCalls: toolCallInfos.length > 0 ? toolCallInfos : void 0,
|
|
13211
13212
|
text: immediateText,
|
|
13212
|
-
...
|
|
13213
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext(outputStepTracingContext),
|
|
13213
13214
|
requestContext,
|
|
13214
13215
|
retryCount: currentRetryCount,
|
|
13215
13216
|
writer: processorWriter
|
|
@@ -13324,7 +13325,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13324
13325
|
agentName: "LLMMappingStep",
|
|
13325
13326
|
processorStates: rest.processorStates
|
|
13326
13327
|
}) : void 0;
|
|
13327
|
-
const observabilityContext =
|
|
13328
|
+
const observabilityContext = chunkVYVPUH6H_cjs.createObservabilityContext(rest.modelSpanTracker?.getTracingContext());
|
|
13328
13329
|
const streamWriter = rest.outputWriter ? { custom: async (data) => rest.outputWriter(data) } : void 0;
|
|
13329
13330
|
async function processAndEnqueueChunk(chunk) {
|
|
13330
13331
|
if (processorRunner && rest.processorStates) {
|
|
@@ -14399,12 +14400,12 @@ function workflowLoopStream({
|
|
|
14399
14400
|
}
|
|
14400
14401
|
const executionResult = resumeContext ? await run.resume({
|
|
14401
14402
|
resumeData: resumeContext.resumeData,
|
|
14402
|
-
...
|
|
14403
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext(rest.modelSpanTracker?.getTracingContext()),
|
|
14403
14404
|
requestContext,
|
|
14404
14405
|
label: toolCallId
|
|
14405
14406
|
}) : await run.start({
|
|
14406
14407
|
inputData: initialData,
|
|
14407
|
-
...
|
|
14408
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext(rest.modelSpanTracker?.getTracingContext()),
|
|
14408
14409
|
requestContext
|
|
14409
14410
|
});
|
|
14410
14411
|
if (executionResult.status !== "success") {
|
|
@@ -14548,7 +14549,7 @@ function loop({
|
|
|
14548
14549
|
}
|
|
14549
14550
|
const baseStream = workflowLoopStream(workflowLoopProps);
|
|
14550
14551
|
const stream = rest.modelSpanTracker?.wrapStream(baseStream) ?? baseStream;
|
|
14551
|
-
const observabilityContext =
|
|
14552
|
+
const observabilityContext = chunkVYVPUH6H_cjs.createObservabilityContext(rest.modelSpanTracker?.getTracingContext());
|
|
14552
14553
|
modelOutput = new MastraModelOutput({
|
|
14553
14554
|
model: {
|
|
14554
14555
|
modelId: firstModel.model.modelId,
|
|
@@ -14681,7 +14682,7 @@ var MastraLLMVNext = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
14681
14682
|
workspace,
|
|
14682
14683
|
...rest
|
|
14683
14684
|
}) {
|
|
14684
|
-
const observabilityContext =
|
|
14685
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
14685
14686
|
let stopWhenToUse;
|
|
14686
14687
|
if (maxSteps && typeof maxSteps === "number") {
|
|
14687
14688
|
stopWhenToUse = chunkY3APFUXZ_cjs.stepCountIs(maxSteps);
|
|
@@ -14701,7 +14702,7 @@ var MastraLLMVNext = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
14701
14702
|
name: `llm: '${firstModel.modelId}'`,
|
|
14702
14703
|
type: "model_generation" /* MODEL_GENERATION */,
|
|
14703
14704
|
input: {
|
|
14704
|
-
messages: [...messageList.
|
|
14705
|
+
messages: [...messageList.getAllSystemMessages(), ...messages]
|
|
14705
14706
|
},
|
|
14706
14707
|
attributes: {
|
|
14707
14708
|
model: firstModel.modelId,
|
|
@@ -14793,7 +14794,7 @@ var MastraLLMVNext = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
14793
14794
|
const remainingTokens = parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"] ?? "", 10);
|
|
14794
14795
|
if (!isNaN(remainingTokens) && remainingTokens > 0 && remainingTokens < 2e3) {
|
|
14795
14796
|
this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
|
|
14796
|
-
await
|
|
14797
|
+
await chunkATKRXBCX_cjs.delay(10 * 1e3);
|
|
14797
14798
|
}
|
|
14798
14799
|
},
|
|
14799
14800
|
onFinish: async (props) => {
|
|
@@ -15031,7 +15032,7 @@ async function prepareMemoryStep({
|
|
|
15031
15032
|
memoryConfig,
|
|
15032
15033
|
...rest
|
|
15033
15034
|
}) {
|
|
15034
|
-
const observabilityContext =
|
|
15035
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
15035
15036
|
const memory = await routingAgent.getMemory({ requestContext });
|
|
15036
15037
|
let thread = await memory?.getThreadById({ threadId });
|
|
15037
15038
|
if (!thread) {
|
|
@@ -15133,7 +15134,7 @@ async function saveMessagesWithProcessors(memory, messages, processorRunner, con
|
|
|
15133
15134
|
const { requestContext, ...observabilityContext } = context ?? {};
|
|
15134
15135
|
await processorRunner.runOutputProcessors(
|
|
15135
15136
|
messageList,
|
|
15136
|
-
|
|
15137
|
+
chunkVYVPUH6H_cjs.resolveObservabilityContext(observabilityContext),
|
|
15137
15138
|
requestContext
|
|
15138
15139
|
);
|
|
15139
15140
|
const processedMessages = messageList.get.response.db();
|
|
@@ -16284,7 +16285,7 @@ async function createNetworkLoop({
|
|
|
16284
16285
|
memory,
|
|
16285
16286
|
context: inputDataToUse,
|
|
16286
16287
|
// TODO: Pass proper tracing context when network supports tracing
|
|
16287
|
-
...
|
|
16288
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: void 0 }),
|
|
16288
16289
|
writer
|
|
16289
16290
|
},
|
|
16290
16291
|
{ toolCallId, messages: [] }
|
|
@@ -16572,7 +16573,7 @@ async function networkLoop({
|
|
|
16572
16573
|
requestContext,
|
|
16573
16574
|
messageList,
|
|
16574
16575
|
agentId: routingAgent.id,
|
|
16575
|
-
...
|
|
16576
|
+
...chunkVYVPUH6H_cjs.resolveObservabilityContext(routingAgentOptions ?? {}),
|
|
16576
16577
|
structuredOutput: {
|
|
16577
16578
|
schema: v4.z.object({
|
|
16578
16579
|
resumeData: v4.z.string()
|
|
@@ -16950,7 +16951,7 @@ async function networkLoop({
|
|
|
16950
16951
|
messages,
|
|
16951
16952
|
routingAgent,
|
|
16952
16953
|
generateId: generateId2,
|
|
16953
|
-
...
|
|
16954
|
+
...chunkVYVPUH6H_cjs.resolveObservabilityContext(routingAgentOptions ?? {}),
|
|
16954
16955
|
memoryConfig: routingAgentMemoryOptions?.options
|
|
16955
16956
|
});
|
|
16956
16957
|
return new MastraAgentNetworkStream({
|
|
@@ -17159,16 +17160,16 @@ var AgentLegacyHandler = class {
|
|
|
17159
17160
|
tracingOptions,
|
|
17160
17161
|
...rest
|
|
17161
17162
|
}) {
|
|
17162
|
-
const observabilityContext =
|
|
17163
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
17163
17164
|
return {
|
|
17164
17165
|
before: async () => {
|
|
17165
17166
|
if (process.env.NODE_ENV !== "test") {
|
|
17166
17167
|
this.capabilities.logger.debug(`[Agents:${this.capabilities.name}] - Starting generation`, { runId });
|
|
17167
17168
|
}
|
|
17168
|
-
const agentSpan =
|
|
17169
|
+
const agentSpan = chunkVYVPUH6H_cjs.getOrCreateSpan({
|
|
17169
17170
|
type: "agent_run" /* AGENT_RUN */,
|
|
17170
17171
|
name: `agent run: '${this.capabilities.id}'`,
|
|
17171
|
-
entityType:
|
|
17172
|
+
entityType: chunkVYVPUH6H_cjs.EntityType.AGENT,
|
|
17172
17173
|
entityId: this.capabilities.id,
|
|
17173
17174
|
entityName: this.capabilities.name,
|
|
17174
17175
|
input: {
|
|
@@ -17192,7 +17193,7 @@ var AgentLegacyHandler = class {
|
|
|
17192
17193
|
requestContext,
|
|
17193
17194
|
mastra: this.capabilities.mastra
|
|
17194
17195
|
});
|
|
17195
|
-
const innerObservabilityContext =
|
|
17196
|
+
const innerObservabilityContext = chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: agentSpan });
|
|
17196
17197
|
const memory = await this.capabilities.getMemory({ requestContext });
|
|
17197
17198
|
const toolEnhancements = [
|
|
17198
17199
|
// toolsets
|
|
@@ -17439,7 +17440,7 @@ var AgentLegacyHandler = class {
|
|
|
17439
17440
|
instructions: titleInstructions
|
|
17440
17441
|
} = this.capabilities.resolveTitleGenerationConfig(config?.generateTitle);
|
|
17441
17442
|
if (shouldGenerate && !thread2.title && userMessage) {
|
|
17442
|
-
const observabilityContext2 =
|
|
17443
|
+
const observabilityContext2 = chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: agentSpan });
|
|
17443
17444
|
promises.push(
|
|
17444
17445
|
this.capabilities.genTitle(userMessage, requestContext, observabilityContext2, titleModel, titleInstructions).then((title) => {
|
|
17445
17446
|
if (title) {
|
|
@@ -17509,7 +17510,7 @@ var AgentLegacyHandler = class {
|
|
|
17509
17510
|
overrideScorers,
|
|
17510
17511
|
threadId,
|
|
17511
17512
|
resourceId,
|
|
17512
|
-
...
|
|
17513
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: agentSpan })
|
|
17513
17514
|
});
|
|
17514
17515
|
const scoringData = {
|
|
17515
17516
|
input: {
|
|
@@ -17593,7 +17594,7 @@ var AgentLegacyHandler = class {
|
|
|
17593
17594
|
writableStream,
|
|
17594
17595
|
methodType,
|
|
17595
17596
|
tracingOptions,
|
|
17596
|
-
...
|
|
17597
|
+
...chunkVYVPUH6H_cjs.resolveObservabilityContext(args)
|
|
17597
17598
|
});
|
|
17598
17599
|
let messageList;
|
|
17599
17600
|
let thread;
|
|
@@ -17758,7 +17759,7 @@ var AgentLegacyHandler = class {
|
|
|
17758
17759
|
return tripwireResult;
|
|
17759
17760
|
}
|
|
17760
17761
|
const { experimental_output, output, agentSpan, ...llmOptions } = beforeResult;
|
|
17761
|
-
const observabilityContext =
|
|
17762
|
+
const observabilityContext = chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: agentSpan });
|
|
17762
17763
|
let finalOutputProcessors = mergedGenerateOptions.outputProcessors;
|
|
17763
17764
|
if (!output || experimental_output) {
|
|
17764
17765
|
const result2 = await llmToUse.__text({
|
|
@@ -18046,7 +18047,7 @@ var AgentLegacyHandler = class {
|
|
|
18046
18047
|
}
|
|
18047
18048
|
const { onFinish, runId, output, experimental_output, agentSpan, messageList, requestContext, ...llmOptions } = beforeResult;
|
|
18048
18049
|
const overrideScorers = mergedStreamOptions.scorers;
|
|
18049
|
-
const observabilityContext =
|
|
18050
|
+
const observabilityContext = chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: agentSpan });
|
|
18050
18051
|
if (!output || experimental_output) {
|
|
18051
18052
|
this.capabilities.logger.debug(`Starting agent ${this.capabilities.name} llm stream call`, {
|
|
18052
18053
|
runId
|
|
@@ -18372,7 +18373,7 @@ function createMapResultsStep({
|
|
|
18372
18373
|
const modelOutput = await getModelOutputForTripwire({
|
|
18373
18374
|
tripwire: memoryData.tripwire,
|
|
18374
18375
|
runId,
|
|
18375
|
-
...
|
|
18376
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: agentSpan }),
|
|
18376
18377
|
options,
|
|
18377
18378
|
model: agentModel,
|
|
18378
18379
|
messageList: memoryData.messageList
|
|
@@ -18426,7 +18427,7 @@ function createMapResultsStep({
|
|
|
18426
18427
|
methodType: modelMethodType,
|
|
18427
18428
|
agentId,
|
|
18428
18429
|
requestContext: result.requestContext,
|
|
18429
|
-
...
|
|
18430
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: agentSpan }),
|
|
18430
18431
|
runId,
|
|
18431
18432
|
toolChoice: result.toolChoice,
|
|
18432
18433
|
tools: result.tools,
|
|
@@ -18460,6 +18461,7 @@ function createMapResultsStep({
|
|
|
18460
18461
|
...modelId && { modelId }
|
|
18461
18462
|
});
|
|
18462
18463
|
}
|
|
18464
|
+
agentSpan?.error({ error: payload.error, endSpan: true });
|
|
18463
18465
|
return;
|
|
18464
18466
|
}
|
|
18465
18467
|
const aborted = options.abortSignal?.aborted;
|
|
@@ -18579,7 +18581,7 @@ function createPrepareMemoryStep({
|
|
|
18579
18581
|
inputSchema: v4.z.object({}),
|
|
18580
18582
|
outputSchema: prepareMemoryStepOutputSchema,
|
|
18581
18583
|
execute: async ({ ...rest }) => {
|
|
18582
|
-
const observabilityContext =
|
|
18584
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
18583
18585
|
const thread = threadFromArgs;
|
|
18584
18586
|
const messageList = new chunkANLO4VM2_cjs.MessageList({
|
|
18585
18587
|
threadId: thread?.id,
|
|
@@ -18721,7 +18723,7 @@ function createPrepareToolsStep({
|
|
|
18721
18723
|
resourceId,
|
|
18722
18724
|
runId,
|
|
18723
18725
|
requestContext,
|
|
18724
|
-
...
|
|
18726
|
+
...chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: agentSpan }),
|
|
18725
18727
|
outputWriter: options.outputWriter,
|
|
18726
18728
|
methodType,
|
|
18727
18729
|
memoryConfig: options.memory?.options,
|
|
@@ -18778,7 +18780,7 @@ function createStreamStep({
|
|
|
18778
18780
|
...validatedInputData,
|
|
18779
18781
|
outputProcessors: processors,
|
|
18780
18782
|
returnScorerData,
|
|
18781
|
-
...
|
|
18783
|
+
...chunkVYVPUH6H_cjs.resolveObservabilityContext(observabilityContext),
|
|
18782
18784
|
requireToolApproval,
|
|
18783
18785
|
toolCallConcurrency,
|
|
18784
18786
|
resumeContext,
|
|
@@ -19854,7 +19856,7 @@ ${errorMessages}`,
|
|
|
19854
19856
|
*/
|
|
19855
19857
|
listTools({ requestContext = new chunk5WBEMKE2_cjs.RequestContext() } = {}) {
|
|
19856
19858
|
if (typeof this.#tools !== "function") {
|
|
19857
|
-
return
|
|
19859
|
+
return chunkATKRXBCX_cjs.ensureToolProperties(this.#tools);
|
|
19858
19860
|
}
|
|
19859
19861
|
const result = this.#tools({
|
|
19860
19862
|
requestContext,
|
|
@@ -19875,7 +19877,7 @@ ${errorMessages}`,
|
|
|
19875
19877
|
this.logger.error(mastraError.toString());
|
|
19876
19878
|
throw mastraError;
|
|
19877
19879
|
}
|
|
19878
|
-
return
|
|
19880
|
+
return chunkATKRXBCX_cjs.ensureToolProperties(tools);
|
|
19879
19881
|
});
|
|
19880
19882
|
}
|
|
19881
19883
|
/**
|
|
@@ -19924,7 +19926,7 @@ ${errorMessages}`,
|
|
|
19924
19926
|
});
|
|
19925
19927
|
});
|
|
19926
19928
|
} else {
|
|
19927
|
-
llm = new
|
|
19929
|
+
llm = new chunkOJQCLQK7_cjs.MastraLLMV1({
|
|
19928
19930
|
model: modelInfo,
|
|
19929
19931
|
mastra: this.#mastra,
|
|
19930
19932
|
options: { tracingPolicy: this.#options?.tracingPolicy }
|
|
@@ -19950,7 +19952,7 @@ ${errorMessages}`,
|
|
|
19950
19952
|
*/
|
|
19951
19953
|
async resolveModelConfig(modelConfig, requestContext) {
|
|
19952
19954
|
try {
|
|
19953
|
-
return await
|
|
19955
|
+
return await chunk4QLIPOI7_cjs.resolveModelConfig(modelConfig, requestContext, this.#mastra);
|
|
19954
19956
|
} catch (error) {
|
|
19955
19957
|
const mastraError = new chunk4U7ZLI36_cjs.MastraError({
|
|
19956
19958
|
id: "AGENT_GET_MODEL_MISSING_MODEL_INSTANCE",
|
|
@@ -20279,7 +20281,7 @@ ${errorMessages}`,
|
|
|
20279
20281
|
instructions,
|
|
20280
20282
|
...rest
|
|
20281
20283
|
}) {
|
|
20282
|
-
const observabilityContext =
|
|
20284
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
20283
20285
|
const llm = await this.getLLM({ requestContext, model });
|
|
20284
20286
|
const normMessage = new chunkANLO4VM2_cjs.MessageList().add(message, "user").get.all.aiV5.ui().at(-1);
|
|
20285
20287
|
if (!normMessage) {
|
|
@@ -20402,7 +20404,7 @@ ${errorMessages}`,
|
|
|
20402
20404
|
autoResumeSuspendedTools,
|
|
20403
20405
|
...rest
|
|
20404
20406
|
}) {
|
|
20405
|
-
const observabilityContext =
|
|
20407
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
20406
20408
|
let convertedMemoryTools = {};
|
|
20407
20409
|
if (this._agentNetworkAppend) {
|
|
20408
20410
|
this.logger.debug(`[Agent:${this.name}] - Skipping memory tools (agent network context)`, { runId });
|
|
@@ -20439,7 +20441,7 @@ ${errorMessages}`,
|
|
|
20439
20441
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20440
20442
|
requireApproval: toolObj.requireApproval
|
|
20441
20443
|
};
|
|
20442
|
-
const convertedToCoreTool =
|
|
20444
|
+
const convertedToCoreTool = chunkATKRXBCX_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20443
20445
|
convertedMemoryTools[toolName] = convertedToCoreTool;
|
|
20444
20446
|
}
|
|
20445
20447
|
}
|
|
@@ -20458,7 +20460,7 @@ ${errorMessages}`,
|
|
|
20458
20460
|
autoResumeSuspendedTools,
|
|
20459
20461
|
...rest
|
|
20460
20462
|
}) {
|
|
20461
|
-
const observabilityContext =
|
|
20463
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
20462
20464
|
let convertedWorkspaceTools = {};
|
|
20463
20465
|
if (this._agentNetworkAppend) {
|
|
20464
20466
|
this.logger.debug(`[Agent:${this.name}] - Skipping workspace tools (agent network context)`, { runId });
|
|
@@ -20468,7 +20470,7 @@ ${errorMessages}`,
|
|
|
20468
20470
|
if (!workspace) {
|
|
20469
20471
|
return convertedWorkspaceTools;
|
|
20470
20472
|
}
|
|
20471
|
-
const workspaceTools =
|
|
20473
|
+
const workspaceTools = chunkGXXNF6NF_cjs.createWorkspaceTools(workspace);
|
|
20472
20474
|
if (Object.keys(workspaceTools).length > 0) {
|
|
20473
20475
|
this.logger.debug(`[Agent:${this.name}] - Adding workspace tools: ${Object.keys(workspaceTools).join(", ")}`, {
|
|
20474
20476
|
runId
|
|
@@ -20491,7 +20493,7 @@ ${errorMessages}`,
|
|
|
20491
20493
|
requireApproval: toolObj.requireApproval,
|
|
20492
20494
|
workspace
|
|
20493
20495
|
};
|
|
20494
|
-
const convertedToCoreTool =
|
|
20496
|
+
const convertedToCoreTool = chunkATKRXBCX_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20495
20497
|
convertedWorkspaceTools[toolName] = convertedToCoreTool;
|
|
20496
20498
|
}
|
|
20497
20499
|
}
|
|
@@ -20513,7 +20515,7 @@ ${errorMessages}`,
|
|
|
20513
20515
|
autoResumeSuspendedTools,
|
|
20514
20516
|
...rest
|
|
20515
20517
|
}) {
|
|
20516
|
-
const observabilityContext =
|
|
20518
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
20517
20519
|
let convertedSkillTools = {};
|
|
20518
20520
|
if (this._agentNetworkAppend) {
|
|
20519
20521
|
return convertedSkillTools;
|
|
@@ -20522,7 +20524,7 @@ ${errorMessages}`,
|
|
|
20522
20524
|
if (!workspace?.skills) {
|
|
20523
20525
|
return convertedSkillTools;
|
|
20524
20526
|
}
|
|
20525
|
-
const skillTools =
|
|
20527
|
+
const skillTools = chunkGXXNF6NF_cjs.createSkillTools(workspace.skills);
|
|
20526
20528
|
if (Object.keys(skillTools).length > 0) {
|
|
20527
20529
|
this.logger.debug(`[Agent:${this.name}] - Adding skill tools: ${Object.keys(skillTools).join(", ")}`, {
|
|
20528
20530
|
runId
|
|
@@ -20546,7 +20548,7 @@ ${errorMessages}`,
|
|
|
20546
20548
|
// Skill tools never require approval
|
|
20547
20549
|
workspace
|
|
20548
20550
|
};
|
|
20549
|
-
const convertedToCoreTool =
|
|
20551
|
+
const convertedToCoreTool = chunkATKRXBCX_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20550
20552
|
convertedSkillTools[toolName] = convertedToCoreTool;
|
|
20551
20553
|
}
|
|
20552
20554
|
}
|
|
@@ -20606,7 +20608,7 @@ ${errorMessages}`,
|
|
|
20606
20608
|
*/
|
|
20607
20609
|
async __runProcessInputStep(args) {
|
|
20608
20610
|
const { requestContext, messageList, stepNumber = 0, processorStates, ...rest } = args;
|
|
20609
|
-
const observabilityContext =
|
|
20611
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
20610
20612
|
let tripwire;
|
|
20611
20613
|
if (this.#inputProcessors || this.#memory) {
|
|
20612
20614
|
const runner = await this.getProcessorRunner({
|
|
@@ -20735,7 +20737,7 @@ ${errorMessages}`,
|
|
|
20735
20737
|
autoResumeSuspendedTools,
|
|
20736
20738
|
...rest
|
|
20737
20739
|
}) {
|
|
20738
|
-
const observabilityContext =
|
|
20740
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
20739
20741
|
let toolsForRequest = {};
|
|
20740
20742
|
this.logger.debug(`[Agents:${this.name}] - Assembling assigned tools`, { runId, threadId, resourceId });
|
|
20741
20743
|
const memory = await this.getMemory({ requestContext });
|
|
@@ -20763,7 +20765,7 @@ ${errorMessages}`,
|
|
|
20763
20765
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20764
20766
|
requireApproval: tool2.requireApproval
|
|
20765
20767
|
};
|
|
20766
|
-
return [k,
|
|
20768
|
+
return [k, chunkATKRXBCX_cjs.makeCoreTool(tool2, options, void 0, autoResumeSuspendedTools)];
|
|
20767
20769
|
})
|
|
20768
20770
|
);
|
|
20769
20771
|
const assignedToolEntriesConverted = Object.fromEntries(
|
|
@@ -20788,7 +20790,7 @@ ${errorMessages}`,
|
|
|
20788
20790
|
autoResumeSuspendedTools,
|
|
20789
20791
|
...rest
|
|
20790
20792
|
}) {
|
|
20791
|
-
const observabilityContext =
|
|
20793
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
20792
20794
|
let toolsForRequest = {};
|
|
20793
20795
|
const memory = await this.getMemory({ requestContext });
|
|
20794
20796
|
const toolsFromToolsets = Object.values(toolsets || {});
|
|
@@ -20815,7 +20817,7 @@ ${errorMessages}`,
|
|
|
20815
20817
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20816
20818
|
requireApproval: toolObj.requireApproval
|
|
20817
20819
|
};
|
|
20818
|
-
const convertedToCoreTool =
|
|
20820
|
+
const convertedToCoreTool = chunkATKRXBCX_cjs.makeCoreTool(toolObj, options, "toolset", autoResumeSuspendedTools);
|
|
20819
20821
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
20820
20822
|
}
|
|
20821
20823
|
}
|
|
@@ -20836,7 +20838,7 @@ ${errorMessages}`,
|
|
|
20836
20838
|
autoResumeSuspendedTools,
|
|
20837
20839
|
...rest
|
|
20838
20840
|
}) {
|
|
20839
|
-
const observabilityContext =
|
|
20841
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
20840
20842
|
let toolsForRequest = {};
|
|
20841
20843
|
const memory = await this.getMemory({ requestContext });
|
|
20842
20844
|
const clientToolsForInput = Object.entries(clientTools || {});
|
|
@@ -20862,7 +20864,7 @@ ${errorMessages}`,
|
|
|
20862
20864
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20863
20865
|
requireApproval: tool2.requireApproval
|
|
20864
20866
|
};
|
|
20865
|
-
const convertedToCoreTool =
|
|
20867
|
+
const convertedToCoreTool = chunkATKRXBCX_cjs.makeCoreTool(toolRest, options, "client-tool", autoResumeSuspendedTools);
|
|
20866
20868
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
20867
20869
|
}
|
|
20868
20870
|
}
|
|
@@ -20914,7 +20916,7 @@ ${errorMessages}`,
|
|
|
20914
20916
|
delegation,
|
|
20915
20917
|
...rest
|
|
20916
20918
|
}) {
|
|
20917
|
-
const observabilityContext =
|
|
20919
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
20918
20920
|
const convertedAgentTools = {};
|
|
20919
20921
|
const agents = await this.listAgents({ requestContext });
|
|
20920
20922
|
if (Object.keys(agents).length > 0) {
|
|
@@ -20946,7 +20948,7 @@ ${errorMessages}`,
|
|
|
20946
20948
|
).describe("The results from the agent's tool calls").optional()
|
|
20947
20949
|
});
|
|
20948
20950
|
const modelVersion = (await agent.getModel({ requestContext })).specificationVersion;
|
|
20949
|
-
const toolObj =
|
|
20951
|
+
const toolObj = chunkAV4YSAZL_cjs.createTool({
|
|
20950
20952
|
id: `agent-${agentName}`,
|
|
20951
20953
|
description: agent.getDescription() || `Agent: ${agentName}`,
|
|
20952
20954
|
inputSchema: agentInputSchema,
|
|
@@ -21144,7 +21146,7 @@ ${effectiveInstructions}`;
|
|
|
21144
21146
|
const generateResult = resumeData ? await agent.resumeGenerate(resumeData, {
|
|
21145
21147
|
runId: suspendedToolRunId,
|
|
21146
21148
|
requestContext,
|
|
21147
|
-
...
|
|
21149
|
+
...chunkVYVPUH6H_cjs.resolveObservabilityContext(context ?? {}),
|
|
21148
21150
|
...effectiveInstructions && { instructions: effectiveInstructions },
|
|
21149
21151
|
...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
|
|
21150
21152
|
...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
|
|
@@ -21156,7 +21158,7 @@ ${effectiveInstructions}`;
|
|
|
21156
21158
|
} : {}
|
|
21157
21159
|
}) : await agent.generate(messagesForSubAgent, {
|
|
21158
21160
|
requestContext,
|
|
21159
|
-
...
|
|
21161
|
+
...chunkVYVPUH6H_cjs.resolveObservabilityContext(context ?? {}),
|
|
21160
21162
|
...effectiveInstructions && { instructions: effectiveInstructions },
|
|
21161
21163
|
...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
|
|
21162
21164
|
...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
|
|
@@ -21220,14 +21222,14 @@ ${effectiveInstructions}`;
|
|
|
21220
21222
|
} else if (methodType === "generate" && modelVersion === "v1") {
|
|
21221
21223
|
const generateResult = await agent.generateLegacy(messagesForSubAgent, {
|
|
21222
21224
|
requestContext,
|
|
21223
|
-
...
|
|
21225
|
+
...chunkVYVPUH6H_cjs.resolveObservabilityContext(context ?? {})
|
|
21224
21226
|
});
|
|
21225
21227
|
result = { text: generateResult.text };
|
|
21226
21228
|
} else if ((methodType === "stream" || methodType === "streamLegacy") && supportedLanguageModelSpecifications.includes(modelVersion)) {
|
|
21227
21229
|
const streamResult = resumeData ? await agent.resumeStream(resumeData, {
|
|
21228
21230
|
runId: suspendedToolRunId,
|
|
21229
21231
|
requestContext,
|
|
21230
|
-
...
|
|
21232
|
+
...chunkVYVPUH6H_cjs.resolveObservabilityContext(context ?? {}),
|
|
21231
21233
|
...effectiveInstructions && { instructions: effectiveInstructions },
|
|
21232
21234
|
...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
|
|
21233
21235
|
...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
|
|
@@ -21241,7 +21243,7 @@ ${effectiveInstructions}`;
|
|
|
21241
21243
|
} : {}
|
|
21242
21244
|
}) : await agent.stream(messagesForSubAgent, {
|
|
21243
21245
|
requestContext,
|
|
21244
|
-
...
|
|
21246
|
+
...chunkVYVPUH6H_cjs.resolveObservabilityContext(context ?? {}),
|
|
21245
21247
|
...effectiveInstructions && { instructions: effectiveInstructions },
|
|
21246
21248
|
...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
|
|
21247
21249
|
...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
|
|
@@ -21342,7 +21344,7 @@ ${effectiveInstructions}`;
|
|
|
21342
21344
|
} else {
|
|
21343
21345
|
const streamResult = await agent.streamLegacy(effectivePrompt, {
|
|
21344
21346
|
requestContext,
|
|
21345
|
-
...
|
|
21347
|
+
...chunkVYVPUH6H_cjs.resolveObservabilityContext(context ?? {})
|
|
21346
21348
|
});
|
|
21347
21349
|
let fullText = "";
|
|
21348
21350
|
for await (const chunk of streamResult.fullStream) {
|
|
@@ -21525,7 +21527,7 @@ ${effectiveInstructions}`;
|
|
|
21525
21527
|
...observabilityContext,
|
|
21526
21528
|
tracingPolicy: this.#options?.tracingPolicy
|
|
21527
21529
|
};
|
|
21528
|
-
convertedAgentTools[`agent-${agentName}`] =
|
|
21530
|
+
convertedAgentTools[`agent-${agentName}`] = chunkATKRXBCX_cjs.makeCoreTool(
|
|
21529
21531
|
toolObj,
|
|
21530
21532
|
options,
|
|
21531
21533
|
void 0,
|
|
@@ -21548,7 +21550,7 @@ ${effectiveInstructions}`;
|
|
|
21548
21550
|
autoResumeSuspendedTools,
|
|
21549
21551
|
...rest
|
|
21550
21552
|
}) {
|
|
21551
|
-
const observabilityContext =
|
|
21553
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
21552
21554
|
const convertedWorkflowTools = {};
|
|
21553
21555
|
const workflows = await this.listWorkflows({ requestContext });
|
|
21554
21556
|
if (Object.keys(workflows).length > 0) {
|
|
@@ -21590,7 +21592,7 @@ ${effectiveInstructions}`;
|
|
|
21590
21592
|
}
|
|
21591
21593
|
]
|
|
21592
21594
|
};
|
|
21593
|
-
const toolObj =
|
|
21595
|
+
const toolObj = chunkAV4YSAZL_cjs.createTool({
|
|
21594
21596
|
id: `workflow-${workflowName}`,
|
|
21595
21597
|
description: workflow.description || `Workflow: ${workflowName}`,
|
|
21596
21598
|
inputSchema: extendedInputSchema,
|
|
@@ -21619,13 +21621,13 @@ ${effectiveInstructions}`;
|
|
|
21619
21621
|
result = await run.resume({
|
|
21620
21622
|
resumeData,
|
|
21621
21623
|
requestContext,
|
|
21622
|
-
...
|
|
21624
|
+
...chunkVYVPUH6H_cjs.resolveObservabilityContext(context ?? {})
|
|
21623
21625
|
});
|
|
21624
21626
|
} else {
|
|
21625
21627
|
result = await run.start({
|
|
21626
21628
|
inputData: workflowInputData,
|
|
21627
21629
|
requestContext,
|
|
21628
|
-
...
|
|
21630
|
+
...chunkVYVPUH6H_cjs.resolveObservabilityContext(context ?? {}),
|
|
21629
21631
|
...initialState && { initialState }
|
|
21630
21632
|
});
|
|
21631
21633
|
}
|
|
@@ -21633,7 +21635,7 @@ ${effectiveInstructions}`;
|
|
|
21633
21635
|
const streamResult = run.streamLegacy({
|
|
21634
21636
|
inputData: workflowInputData,
|
|
21635
21637
|
requestContext,
|
|
21636
|
-
...
|
|
21638
|
+
...chunkVYVPUH6H_cjs.resolveObservabilityContext(context ?? {})
|
|
21637
21639
|
});
|
|
21638
21640
|
if (context?.writer) {
|
|
21639
21641
|
await streamResult.stream.pipeTo(context.writer);
|
|
@@ -21646,11 +21648,11 @@ ${effectiveInstructions}`;
|
|
|
21646
21648
|
const streamResult = resumeData ? run.resumeStream({
|
|
21647
21649
|
resumeData,
|
|
21648
21650
|
requestContext,
|
|
21649
|
-
...
|
|
21651
|
+
...chunkVYVPUH6H_cjs.resolveObservabilityContext(context ?? {})
|
|
21650
21652
|
}) : run.stream({
|
|
21651
21653
|
inputData: workflowInputData,
|
|
21652
21654
|
requestContext,
|
|
21653
|
-
...
|
|
21655
|
+
...chunkVYVPUH6H_cjs.resolveObservabilityContext(context ?? {}),
|
|
21654
21656
|
...initialState && { initialState }
|
|
21655
21657
|
});
|
|
21656
21658
|
if (context?.writer) {
|
|
@@ -21742,7 +21744,7 @@ ${effectiveInstructions}`;
|
|
|
21742
21744
|
...observabilityContext,
|
|
21743
21745
|
tracingPolicy: this.#options?.tracingPolicy
|
|
21744
21746
|
};
|
|
21745
|
-
convertedWorkflowTools[`workflow-${workflowName}`] =
|
|
21747
|
+
convertedWorkflowTools[`workflow-${workflowName}`] = chunkATKRXBCX_cjs.makeCoreTool(
|
|
21746
21748
|
toolObj,
|
|
21747
21749
|
options,
|
|
21748
21750
|
void 0,
|
|
@@ -21770,11 +21772,11 @@ ${effectiveInstructions}`;
|
|
|
21770
21772
|
delegation,
|
|
21771
21773
|
...rest
|
|
21772
21774
|
}) {
|
|
21773
|
-
const observabilityContext =
|
|
21775
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
21774
21776
|
let mastraProxy = void 0;
|
|
21775
21777
|
const logger = this.logger;
|
|
21776
21778
|
if (this.#mastra) {
|
|
21777
|
-
mastraProxy =
|
|
21779
|
+
mastraProxy = chunkATKRXBCX_cjs.createMastraProxy({ mastra: this.#mastra, logger });
|
|
21778
21780
|
}
|
|
21779
21781
|
const assignedTools = await this.listAssignedTools({
|
|
21780
21782
|
runId,
|
|
@@ -22026,7 +22028,7 @@ ${effectiveInstructions}`;
|
|
|
22026
22028
|
const resolvedModel = await this.resolveModelConfig(selection, requestContext);
|
|
22027
22029
|
this.assertSupportsPreparedModels(resolvedModel);
|
|
22028
22030
|
let headers;
|
|
22029
|
-
if (resolvedModel instanceof
|
|
22031
|
+
if (resolvedModel instanceof chunk4QLIPOI7_cjs.ModelRouterLanguageModel) {
|
|
22030
22032
|
headers = resolvedModel.config?.headers;
|
|
22031
22033
|
}
|
|
22032
22034
|
return [
|
|
@@ -22059,7 +22061,7 @@ ${effectiveInstructions}`;
|
|
|
22059
22061
|
throw mastraError;
|
|
22060
22062
|
}
|
|
22061
22063
|
let headers;
|
|
22062
|
-
if (model instanceof
|
|
22064
|
+
if (model instanceof chunk4QLIPOI7_cjs.ModelRouterLanguageModel) {
|
|
22063
22065
|
headers = model.config?.headers;
|
|
22064
22066
|
}
|
|
22065
22067
|
return {
|
|
@@ -22129,10 +22131,10 @@ ${effectiveInstructions}`;
|
|
|
22129
22131
|
resourceId
|
|
22130
22132
|
}) || crypto2.randomUUID();
|
|
22131
22133
|
const instructions = options.instructions || await this.getInstructions({ requestContext });
|
|
22132
|
-
const agentSpan =
|
|
22134
|
+
const agentSpan = chunkVYVPUH6H_cjs.getOrCreateSpan({
|
|
22133
22135
|
type: "agent_run" /* AGENT_RUN */,
|
|
22134
22136
|
name: `agent run: '${this.id}'`,
|
|
22135
|
-
entityType:
|
|
22137
|
+
entityType: chunkVYVPUH6H_cjs.EntityType.AGENT,
|
|
22136
22138
|
entityId: this.id,
|
|
22137
22139
|
entityName: this.name,
|
|
22138
22140
|
input: options.messages,
|
|
@@ -22205,7 +22207,7 @@ ${effectiveInstructions}`;
|
|
|
22205
22207
|
workspace
|
|
22206
22208
|
});
|
|
22207
22209
|
const run = await executionWorkflow.createRun();
|
|
22208
|
-
const observabilityContext =
|
|
22210
|
+
const observabilityContext = chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: agentSpan });
|
|
22209
22211
|
const result = await run.start({ ...observabilityContext });
|
|
22210
22212
|
return result;
|
|
22211
22213
|
}
|
|
@@ -22229,7 +22231,7 @@ ${effectiveInstructions}`;
|
|
|
22229
22231
|
structuredOutput = false,
|
|
22230
22232
|
overrideScorers
|
|
22231
22233
|
}) {
|
|
22232
|
-
const observabilityContext =
|
|
22234
|
+
const observabilityContext = chunkVYVPUH6H_cjs.createObservabilityContext({ currentSpan: agentSpan });
|
|
22233
22235
|
const resToLog = {
|
|
22234
22236
|
text: result.text,
|
|
22235
22237
|
object: result.object,
|
|
@@ -22512,7 +22514,7 @@ ${effectiveInstructions}`;
|
|
|
22512
22514
|
const defaultOptions = await this.getDefaultOptions({
|
|
22513
22515
|
requestContext: options?.requestContext
|
|
22514
22516
|
});
|
|
22515
|
-
const mergedOptions =
|
|
22517
|
+
const mergedOptions = chunkATKRXBCX_cjs.deepMerge(
|
|
22516
22518
|
defaultOptions,
|
|
22517
22519
|
options ?? {}
|
|
22518
22520
|
);
|
|
@@ -22582,7 +22584,7 @@ ${effectiveInstructions}`;
|
|
|
22582
22584
|
const defaultOptions = await this.getDefaultOptions({
|
|
22583
22585
|
requestContext: streamOptions?.requestContext
|
|
22584
22586
|
});
|
|
22585
|
-
const mergedOptions =
|
|
22587
|
+
const mergedOptions = chunkATKRXBCX_cjs.deepMerge(
|
|
22586
22588
|
defaultOptions,
|
|
22587
22589
|
streamOptions ?? {}
|
|
22588
22590
|
);
|
|
@@ -22646,7 +22648,7 @@ ${effectiveInstructions}`;
|
|
|
22646
22648
|
const defaultOptions = await this.getDefaultOptions({
|
|
22647
22649
|
requestContext: streamOptions?.requestContext
|
|
22648
22650
|
});
|
|
22649
|
-
let mergedStreamOptions =
|
|
22651
|
+
let mergedStreamOptions = chunkATKRXBCX_cjs.deepMerge(
|
|
22650
22652
|
defaultOptions,
|
|
22651
22653
|
streamOptions ?? {}
|
|
22652
22654
|
);
|
|
@@ -22711,7 +22713,7 @@ ${effectiveInstructions}`;
|
|
|
22711
22713
|
const defaultOptions = await this.getDefaultOptions({
|
|
22712
22714
|
requestContext: options?.requestContext
|
|
22713
22715
|
});
|
|
22714
|
-
const mergedOptions =
|
|
22716
|
+
const mergedOptions = chunkATKRXBCX_cjs.deepMerge(
|
|
22715
22717
|
defaultOptions,
|
|
22716
22718
|
options ?? {}
|
|
22717
22719
|
);
|
|
@@ -22948,7 +22950,7 @@ var ModerationProcessor = class _ModerationProcessor {
|
|
|
22948
22950
|
async processInput(args) {
|
|
22949
22951
|
try {
|
|
22950
22952
|
const { messages, abort, ...rest } = args;
|
|
22951
|
-
const observabilityContext =
|
|
22953
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
22952
22954
|
if (messages.length === 0) {
|
|
22953
22955
|
return messages;
|
|
22954
22956
|
}
|
|
@@ -22982,7 +22984,7 @@ var ModerationProcessor = class _ModerationProcessor {
|
|
|
22982
22984
|
async processOutputStream(args) {
|
|
22983
22985
|
try {
|
|
22984
22986
|
const { part, streamParts, abort, ...rest } = args;
|
|
22985
|
-
const observabilityContext =
|
|
22987
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
22986
22988
|
if (part.type !== "text-delta") {
|
|
22987
22989
|
return part;
|
|
22988
22990
|
}
|
|
@@ -23190,7 +23192,7 @@ var PromptInjectionDetector = class _PromptInjectionDetector {
|
|
|
23190
23192
|
async processInput(args) {
|
|
23191
23193
|
try {
|
|
23192
23194
|
const { messages, abort, ...rest } = args;
|
|
23193
|
-
const observabilityContext =
|
|
23195
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
23194
23196
|
if (messages.length === 0) {
|
|
23195
23197
|
return messages;
|
|
23196
23198
|
}
|
|
@@ -23438,7 +23440,7 @@ var PIIDetector = class _PIIDetector {
|
|
|
23438
23440
|
async processInput(args) {
|
|
23439
23441
|
try {
|
|
23440
23442
|
const { messages, abort, ...rest } = args;
|
|
23441
|
-
const observabilityContext =
|
|
23443
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
23442
23444
|
if (messages.length === 0) {
|
|
23443
23445
|
return messages;
|
|
23444
23446
|
}
|
|
@@ -23721,7 +23723,7 @@ IMPORTANT: Only include PII types that are actually detected. If no PII is found
|
|
|
23721
23723
|
*/
|
|
23722
23724
|
async processOutputStream(args) {
|
|
23723
23725
|
const { part, abort, ...rest } = args;
|
|
23724
|
-
const observabilityContext =
|
|
23726
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
23725
23727
|
try {
|
|
23726
23728
|
if (part.type !== "text-delta") {
|
|
23727
23729
|
return part;
|
|
@@ -23784,7 +23786,7 @@ IMPORTANT: Only include PII types that are actually detected. If no PII is found
|
|
|
23784
23786
|
abort,
|
|
23785
23787
|
...rest
|
|
23786
23788
|
}) {
|
|
23787
|
-
const observabilityContext =
|
|
23789
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
23788
23790
|
try {
|
|
23789
23791
|
if (messages.length === 0) {
|
|
23790
23792
|
return messages;
|
|
@@ -23913,7 +23915,7 @@ var LanguageDetector = class _LanguageDetector {
|
|
|
23913
23915
|
async processInput(args) {
|
|
23914
23916
|
try {
|
|
23915
23917
|
const { messages, abort, ...rest } = args;
|
|
23916
|
-
const observabilityContext =
|
|
23918
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
23917
23919
|
if (messages.length === 0) {
|
|
23918
23920
|
return messages;
|
|
23919
23921
|
}
|
|
@@ -24285,7 +24287,7 @@ var TokenLimiterProcessor = class _TokenLimiterProcessor {
|
|
|
24285
24287
|
return new TiktokenClass(this.customEncoding);
|
|
24286
24288
|
});
|
|
24287
24289
|
} else {
|
|
24288
|
-
this.encoderPromise =
|
|
24290
|
+
this.encoderPromise = chunkGXXNF6NF_cjs.getTiktoken();
|
|
24289
24291
|
}
|
|
24290
24292
|
}
|
|
24291
24293
|
return this.encoderPromise;
|
|
@@ -24578,7 +24580,7 @@ var SystemPromptScrubber = class {
|
|
|
24578
24580
|
*/
|
|
24579
24581
|
async processOutputStream(args) {
|
|
24580
24582
|
const { part, abort, ...rest } = args;
|
|
24581
|
-
const observabilityContext =
|
|
24583
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
24582
24584
|
if (part.type !== "text-delta") {
|
|
24583
24585
|
return part;
|
|
24584
24586
|
}
|
|
@@ -24633,7 +24635,7 @@ var SystemPromptScrubber = class {
|
|
|
24633
24635
|
abort,
|
|
24634
24636
|
...rest
|
|
24635
24637
|
}) {
|
|
24636
|
-
const observabilityContext =
|
|
24638
|
+
const observabilityContext = chunkVYVPUH6H_cjs.resolveObservabilityContext(rest);
|
|
24637
24639
|
const processedMessages = [];
|
|
24638
24640
|
for (const message of messages) {
|
|
24639
24641
|
if (message.role !== "assistant" || !message.content?.parts) {
|
|
@@ -25180,7 +25182,7 @@ var ToolSearchProcessor = class {
|
|
|
25180
25182
|
minScore: options.search?.minScore ?? 0
|
|
25181
25183
|
};
|
|
25182
25184
|
this.ttl = options.ttl ?? 36e5;
|
|
25183
|
-
this.bm25Index = new
|
|
25185
|
+
this.bm25Index = new chunkGXXNF6NF_cjs.BM25Index({}, TOOL_SEARCH_TOKENIZE_OPTIONS);
|
|
25184
25186
|
this.indexTools();
|
|
25185
25187
|
if (this.ttl > 0) {
|
|
25186
25188
|
this.scheduleCleanup();
|
|
@@ -25345,7 +25347,7 @@ var ToolSearchProcessor = class {
|
|
|
25345
25347
|
messageList.addSystem(
|
|
25346
25348
|
"To discover available tools, call search_tools with a keyword query. To add a tool to the conversation, call load_tool with the tool name. Tools must be loaded before they can be used."
|
|
25347
25349
|
);
|
|
25348
|
-
const searchTool =
|
|
25350
|
+
const searchTool = chunkAV4YSAZL_cjs.createTool({
|
|
25349
25351
|
id: "search_tools",
|
|
25350
25352
|
description: "Search for available tools by keyword. Use this when you need a capability you don't currently have. Returns a list of matching tools with their names and descriptions. After finding a useful tool, use load_tool to make it available.",
|
|
25351
25353
|
inputSchema: v4.z.object({
|
|
@@ -25375,7 +25377,7 @@ var ToolSearchProcessor = class {
|
|
|
25375
25377
|
};
|
|
25376
25378
|
}
|
|
25377
25379
|
});
|
|
25378
|
-
const loadTool =
|
|
25380
|
+
const loadTool = chunkAV4YSAZL_cjs.createTool({
|
|
25379
25381
|
id: "load_tool",
|
|
25380
25382
|
description: "Load a specific tool into your context. Call this after finding a tool with search_tools. Once loaded, the tool will be available for use. Args: toolName - The exact name of the tool to load (from search results).",
|
|
25381
25383
|
inputSchema: v4.z.object({
|
|
@@ -25573,7 +25575,7 @@ var SkillSearchProcessor = class {
|
|
|
25573
25575
|
messageList.addSystem(
|
|
25574
25576
|
"To discover available skills, call search_skills with a keyword query. To load a skill's instructions, call load_skill with the skill name. Loaded skills provide context and instructions for the conversation."
|
|
25575
25577
|
);
|
|
25576
|
-
const searchSkillTool =
|
|
25578
|
+
const searchSkillTool = chunkAV4YSAZL_cjs.createTool({
|
|
25577
25579
|
id: "search_skills",
|
|
25578
25580
|
description: "Search for available skills by keyword. Returns a list of matching skills with their names and descriptions. After finding a useful skill, use load_skill to load its instructions.",
|
|
25579
25581
|
inputSchema: v4.z.object({
|
|
@@ -25623,7 +25625,7 @@ var SkillSearchProcessor = class {
|
|
|
25623
25625
|
};
|
|
25624
25626
|
}
|
|
25625
25627
|
});
|
|
25626
|
-
const loadSkillTool =
|
|
25628
|
+
const loadSkillTool = chunkAV4YSAZL_cjs.createTool({
|
|
25627
25629
|
id: "load_skill",
|
|
25628
25630
|
description: "Load a skill's full instructions into the conversation. Call this after finding a skill with search_skills. The skill's instructions will be available as context.",
|
|
25629
25631
|
inputSchema: v4.z.object({
|
|
@@ -25962,7 +25964,7 @@ var WorkingMemory = class {
|
|
|
25962
25964
|
return messageList;
|
|
25963
25965
|
}
|
|
25964
25966
|
generateEmptyFromSchemaInternal(schema) {
|
|
25965
|
-
const result =
|
|
25967
|
+
const result = chunkATKRXBCX_cjs.generateEmptyFromSchema(schema);
|
|
25966
25968
|
return Object.keys(result).length > 0 ? result : null;
|
|
25967
25969
|
}
|
|
25968
25970
|
getWorkingMemoryToolInstruction({
|
|
@@ -26607,7 +26609,7 @@ https://mastra.ai/en/docs/memory/semantic-recall`
|
|
|
26607
26609
|
);
|
|
26608
26610
|
}
|
|
26609
26611
|
if (typeof config.embedder === "string") {
|
|
26610
|
-
this.embedder = new
|
|
26612
|
+
this.embedder = new chunk4QLIPOI7_cjs.ModelRouterEmbeddingModel(config.embedder);
|
|
26611
26613
|
} else {
|
|
26612
26614
|
this.embedder = config.embedder;
|
|
26613
26615
|
}
|
|
@@ -26620,7 +26622,7 @@ https://mastra.ai/en/docs/memory/semantic-recall`
|
|
|
26620
26622
|
}
|
|
26621
26623
|
if (config.embedder) {
|
|
26622
26624
|
if (typeof config.embedder === "string") {
|
|
26623
|
-
this.embedder = new
|
|
26625
|
+
this.embedder = new chunk4QLIPOI7_cjs.ModelRouterEmbeddingModel(config.embedder);
|
|
26624
26626
|
} else {
|
|
26625
26627
|
this.embedder = config.embedder;
|
|
26626
26628
|
}
|
|
@@ -26660,7 +26662,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
26660
26662
|
}
|
|
26661
26663
|
setEmbedder(embedder, embedderOptions) {
|
|
26662
26664
|
if (typeof embedder === "string") {
|
|
26663
|
-
this.embedder = new
|
|
26665
|
+
this.embedder = new chunk4QLIPOI7_cjs.ModelRouterEmbeddingModel(embedder);
|
|
26664
26666
|
} else {
|
|
26665
26667
|
this.embedder = embedder;
|
|
26666
26668
|
}
|
|
@@ -26757,7 +26759,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
26757
26759
|
"The threads.generateTitle option has been moved. Use the top-level generateTitle option instead."
|
|
26758
26760
|
);
|
|
26759
26761
|
}
|
|
26760
|
-
const mergedConfig =
|
|
26762
|
+
const mergedConfig = chunkATKRXBCX_cjs.deepMerge(this.threadConfig, config || {});
|
|
26761
26763
|
if (typeof config?.workingMemory === "object" && config.workingMemory?.schema && typeof mergedConfig.workingMemory === "object") {
|
|
26762
26764
|
mergedConfig.workingMemory.schema = config.workingMemory.schema;
|
|
26763
26765
|
}
|
|
@@ -27109,7 +27111,7 @@ var MockMemory = class extends MastraMemory {
|
|
|
27109
27111
|
} = {}) {
|
|
27110
27112
|
super({
|
|
27111
27113
|
name: "mock",
|
|
27112
|
-
storage: storage || new
|
|
27114
|
+
storage: storage || new chunkCGDV5YUS_cjs.InMemoryStore(),
|
|
27113
27115
|
options: {
|
|
27114
27116
|
...options,
|
|
27115
27117
|
workingMemory: enableWorkingMemory ? { enabled: true, template: workingMemoryTemplate } : options?.workingMemory,
|
|
@@ -27190,7 +27192,7 @@ var MockMemory = class extends MastraMemory {
|
|
|
27190
27192
|
return {};
|
|
27191
27193
|
}
|
|
27192
27194
|
return {
|
|
27193
|
-
updateWorkingMemory:
|
|
27195
|
+
updateWorkingMemory: chunkAV4YSAZL_cjs.createTool({
|
|
27194
27196
|
id: "update-working-memory",
|
|
27195
27197
|
description: `Update the working memory with new information. Any data not included will be overwritten.`,
|
|
27196
27198
|
inputSchema: v4.z.object({ memory: v4.z.string() }),
|
|
@@ -27420,5 +27422,5 @@ exports.validateStepRequestContext = validateStepRequestContext;
|
|
|
27420
27422
|
exports.validateStepResumeData = validateStepResumeData;
|
|
27421
27423
|
exports.validateStepStateData = validateStepStateData;
|
|
27422
27424
|
exports.validateStepSuspendData = validateStepSuspendData;
|
|
27423
|
-
//# sourceMappingURL=chunk-
|
|
27424
|
-
//# sourceMappingURL=chunk-
|
|
27425
|
+
//# sourceMappingURL=chunk-2OZQLYLM.cjs.map
|
|
27426
|
+
//# sourceMappingURL=chunk-2OZQLYLM.cjs.map
|