@mastra/core 1.18.0-alpha.3 → 1.18.0-alpha.5
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 +74 -0
- package/dist/_types/@internal_core/dist/index.d.ts +1078 -256
- package/dist/agent/agent-legacy.d.ts +2 -0
- package/dist/agent/agent-legacy.d.ts.map +1 -1
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/index.cjs +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-ZFH5KWHO.js → chunk-27EVOYQC.js} +3 -3
- package/dist/{chunk-ZFH5KWHO.js.map → chunk-27EVOYQC.js.map} +1 -1
- package/dist/{chunk-32NEFSTI.js → chunk-3CTQJRNS.js} +17 -12
- package/dist/chunk-3CTQJRNS.js.map +1 -0
- package/dist/{chunk-QXPUTX3W.cjs → chunk-4BZRWJBH.cjs} +33 -32
- package/dist/chunk-4BZRWJBH.cjs.map +1 -0
- package/dist/{chunk-AHFHYQS6.js → chunk-4FMKWOPC.js} +4 -4
- package/dist/{chunk-AHFHYQS6.js.map → chunk-4FMKWOPC.js.map} +1 -1
- package/dist/{chunk-BFRUEBG3.js → chunk-5LA5TY63.js} +4 -4
- package/dist/{chunk-BFRUEBG3.js.map → chunk-5LA5TY63.js.map} +1 -1
- package/dist/{chunk-OKKJRRSS.cjs → chunk-7456ZWIM.cjs} +32 -14
- package/dist/chunk-7456ZWIM.cjs.map +1 -0
- package/dist/{chunk-D5VCCQ4L.js → chunk-7IKOVR4F.js} +5 -5
- package/dist/{chunk-D5VCCQ4L.js.map → chunk-7IKOVR4F.js.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-AYVJ4EXL.js} +28 -5
- package/dist/chunk-AYVJ4EXL.js.map +1 -0
- package/dist/{chunk-B6D4D2CY.cjs → chunk-BF7IH4JU.cjs} +297 -68
- package/dist/chunk-BF7IH4JU.cjs.map +1 -0
- package/dist/{chunk-5IZ346TV.cjs → chunk-BL7DAQXE.cjs} +7 -7
- package/dist/{chunk-5IZ346TV.cjs.map → chunk-BL7DAQXE.cjs.map} +1 -1
- package/dist/{chunk-ZFZ6HQFT.cjs → chunk-BZUTYPXP.cjs} +210 -187
- package/dist/chunk-BZUTYPXP.cjs.map +1 -0
- package/dist/{chunk-UORUVXKY.js → chunk-DBHNKGT2.js} +6 -6
- package/dist/{chunk-UORUVXKY.js.map → chunk-DBHNKGT2.js.map} +1 -1
- package/dist/{chunk-GRMC2OYN.js → chunk-FA4PTEBK.js} +6 -3
- package/dist/chunk-FA4PTEBK.js.map +1 -0
- 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-GVHBM6VU.cjs → chunk-H3DHOME4.cjs} +29 -11
- package/dist/chunk-H3DHOME4.cjs.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-FB6O7FNK.js → chunk-IM6BRUQI.js} +9 -9
- package/dist/{chunk-FB6O7FNK.js.map → chunk-IM6BRUQI.js.map} +1 -1
- package/dist/{chunk-6LHF5UDX.cjs → chunk-INENOZKZ.cjs} +9 -9
- package/dist/{chunk-6LHF5UDX.cjs.map → chunk-INENOZKZ.cjs.map} +1 -1
- package/dist/{chunk-PYNUWPGW.cjs → chunk-JVL4ANDA.cjs} +19 -19
- package/dist/{chunk-PYNUWPGW.cjs.map → chunk-JVL4ANDA.cjs.map} +1 -1
- package/dist/{chunk-OVWOD5GI.cjs → chunk-JWE3L5J2.cjs} +20 -20
- package/dist/{chunk-OVWOD5GI.cjs.map → chunk-JWE3L5J2.cjs.map} +1 -1
- package/dist/{chunk-HDPQ3LEE.js → chunk-K7AE4BHR.js} +4 -4
- package/dist/{chunk-HDPQ3LEE.js.map → chunk-K7AE4BHR.js.map} +1 -1
- package/dist/{chunk-4K2NKQGN.cjs → chunk-KCRQQDEF.cjs} +201 -196
- package/dist/chunk-KCRQQDEF.cjs.map +1 -0
- package/dist/{chunk-CX5I6VS4.js → chunk-KRFGPA2H.js} +280 -69
- package/dist/chunk-KRFGPA2H.js.map +1 -0
- package/dist/{chunk-OXS5X7PW.cjs → chunk-LKZQG2ZZ.cjs} +13 -13
- package/dist/{chunk-OXS5X7PW.cjs.map → chunk-LKZQG2ZZ.cjs.map} +1 -1
- package/dist/{chunk-W2QYKEBN.js → chunk-MJF7NZEF.js} +545 -33
- package/dist/chunk-MJF7NZEF.js.map +1 -0
- package/dist/{chunk-SLHDZJ4B.js → chunk-PMWMEK4T.js} +5 -4
- package/dist/chunk-PMWMEK4T.js.map +1 -0
- package/dist/chunk-S43VACTO.js +3 -0
- package/dist/{chunk-DMX7MC4N.js.map → chunk-S43VACTO.js.map} +1 -1
- package/dist/{chunk-X36INADV.cjs → chunk-V2NQOABM.cjs} +563 -51
- package/dist/chunk-V2NQOABM.cjs.map +1 -0
- package/dist/{chunk-IR4WRS3N.js → chunk-W4I7AX2S.js} +31 -13
- package/dist/chunk-W4I7AX2S.js.map +1 -0
- package/dist/{chunk-OYAHOEQP.js → chunk-W6QY3O3X.js} +27 -9
- package/dist/chunk-W6QY3O3X.js.map +1 -0
- package/dist/{chunk-MP2VGF73.js → chunk-WNI6ACXE.js} +3 -3
- package/dist/{chunk-MP2VGF73.js.map → chunk-WNI6ACXE.js.map} +1 -1
- package/dist/{chunk-VVR3SFKH.cjs → chunk-XC6ZFHUA.cjs} +70 -70
- package/dist/{chunk-VVR3SFKH.cjs.map → chunk-XC6ZFHUA.cjs.map} +1 -1
- package/dist/{chunk-3UM5VCQ5.cjs → chunk-XNWKYVLQ.cjs} +3 -3
- package/dist/{chunk-3UM5VCQ5.cjs.map → chunk-XNWKYVLQ.cjs.map} +1 -1
- package/dist/{chunk-64565EZF.cjs → chunk-XQRTJIC7.cjs} +22 -22
- package/dist/{chunk-64565EZF.cjs.map → chunk-XQRTJIC7.cjs.map} +1 -1
- package/dist/{chunk-T5XU5TAV.cjs → chunk-XRW4AYLH.cjs} +82 -82
- package/dist/{chunk-T5XU5TAV.cjs.map → chunk-XRW4AYLH.cjs.map} +1 -1
- package/dist/{chunk-YBVRBNRY.js → chunk-YIBYKN6M.js} +7 -7
- package/dist/{chunk-YBVRBNRY.js.map → chunk-YIBYKN6M.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 +611 -534
- 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-5X6CFNIO.cjs +12 -0
- package/dist/{models-dev-MIC2CW43.cjs.map → models-dev-5X6CFNIO.cjs.map} +1 -1
- package/dist/models-dev-NFYFNV6D.js +3 -0
- package/dist/{models-dev-VDZIOMAC.js.map → models-dev-NFYFNV6D.js.map} +1 -1
- package/dist/netlify-EYSCS3HJ.js +3 -0
- package/dist/{netlify-2CGMKEKT.js.map → netlify-EYSCS3HJ.js.map} +1 -1
- package/dist/netlify-MZJ7FN5B.cjs +12 -0
- package/dist/{netlify-KZ4HQR5N.cjs.map → netlify-MZJ7FN5B.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 +14 -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-ODJKK7NU.js +3 -0
- package/dist/{provider-registry-QRWUBN5N.js.map → provider-registry-ODJKK7NU.js.map} +1 -1
- package/dist/provider-registry-YGVNXVGE.cjs +40 -0
- package/dist/{provider-registry-HGWTTWCL.cjs.map → provider-registry-YGVNXVGE.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/base.d.ts +10 -2
- package/dist/storage/domains/observability/base.d.ts.map +1 -1
- package/dist/storage/domains/observability/feedback.d.ts +1 -1
- package/dist/storage/domains/observability/feedback.d.ts.map +1 -1
- package/dist/storage/domains/observability/inmemory.d.ts +13 -2
- 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/scores.d.ts +1 -1
- package/dist/storage/domains/observability/scores.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 +340 -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 +4 -4
- 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 chunkV2NQOABM_cjs = require('./chunk-V2NQOABM.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 chunkXRW4AYLH_cjs = require('./chunk-XRW4AYLH.cjs');
|
|
12
|
+
var chunkLKZQG2ZZ_cjs = require('./chunk-LKZQG2ZZ.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 chunkXQRTJIC7_cjs = require('./chunk-XQRTJIC7.cjs');
|
|
16
|
+
var chunkBF7IH4JU_cjs = require('./chunk-BF7IH4JU.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 = chunkBF7IH4JU_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: chunkBF7IH4JU_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: chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_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: chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_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 = chunkBF7IH4JU_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: chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_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 = chunkBF7IH4JU_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: chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_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 chunkXRW4AYLH_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 = chunkBF7IH4JU_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
|
+
chunkBF7IH4JU_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
|
+
chunkBF7IH4JU_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 = chunkBF7IH4JU_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 = chunkXQRTJIC7_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 = chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_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 = chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_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 = chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_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: chunkXQRTJIC7_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
|
+
...chunkBF7IH4JU_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 = chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_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 = chunkBF7IH4JU_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 = chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_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 = chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_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 = chunkBF7IH4JU_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: chunkBF7IH4JU_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 chunkBF7IH4JU_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 : chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_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 = chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_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 = chunkBF7IH4JU_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 = chunkBF7IH4JU_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 chunkBF7IH4JU_cjs.EntityType.INPUT_PROCESSOR;
|
|
8547
8548
|
case "inputStep":
|
|
8548
|
-
return
|
|
8549
|
+
return chunkBF7IH4JU_cjs.EntityType.INPUT_STEP_PROCESSOR;
|
|
8549
8550
|
case "outputStream":
|
|
8550
8551
|
case "outputResult":
|
|
8551
|
-
return
|
|
8552
|
+
return chunkBF7IH4JU_cjs.EntityType.OUTPUT_PROCESSOR;
|
|
8552
8553
|
case "outputStep":
|
|
8553
|
-
return
|
|
8554
|
+
return chunkBF7IH4JU_cjs.EntityType.OUTPUT_STEP_PROCESSOR;
|
|
8554
8555
|
default:
|
|
8555
|
-
return
|
|
8556
|
+
return chunkBF7IH4JU_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 = chunkBF7IH4JU_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 chunkBF7IH4JU_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: chunkBF7IH4JU_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 = chunkBF7IH4JU_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 = chunkBF7IH4JU_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 = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
10118
|
+
const workflowSpan = chunkBF7IH4JU_cjs.getOrCreateSpan({
|
|
10118
10119
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
10119
10120
|
name: `workflow run: '${this.workflowId}'`,
|
|
10120
|
-
entityType:
|
|
10121
|
+
entityType: chunkBF7IH4JU_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 = chunkBF7IH4JU_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 = chunkBF7IH4JU_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 = chunkBF7IH4JU_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 = chunkBF7IH4JU_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 = chunkBF7IH4JU_cjs.getOrCreateSpan({
|
|
10637
10638
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
10638
10639
|
name: `workflow run: '${this.workflowId}' (resumed)`,
|
|
10639
|
-
entityType:
|
|
10640
|
+
entityType: chunkBF7IH4JU_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 = chunkBF7IH4JU_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 = chunkBF7IH4JU_cjs.getOrCreateSpan({
|
|
10756
10757
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
10757
10758
|
name: `workflow run: '${this.workflowId}'`,
|
|
10758
|
-
entityType:
|
|
10759
|
+
entityType: chunkBF7IH4JU_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 = chunkBF7IH4JU_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 = chunkBF7IH4JU_cjs.getOrCreateSpan({
|
|
10853
10854
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
10854
10855
|
name: `workflow run: '${this.workflowId}'`,
|
|
10855
10856
|
input: inputData,
|
|
10856
|
-
entityType:
|
|
10857
|
+
entityType: chunkBF7IH4JU_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 = chunkBF7IH4JU_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 = chunkBF7IH4JU_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 = chunkBF7IH4JU_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 chunkXRW4AYLH_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
|
+
...chunkBF7IH4JU_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] = chunkXQRTJIC7_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 = chunkBF7IH4JU_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 chunkXRW4AYLH_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
|
+
...chunkBF7IH4JU_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 = chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext(rest.modelSpanTracker?.getTracingContext()),
|
|
14403
14404
|
requestContext,
|
|
14404
14405
|
label: toolCallId
|
|
14405
14406
|
}) : await run.start({
|
|
14406
14407
|
inputData: initialData,
|
|
14407
|
-
...
|
|
14408
|
+
...chunkBF7IH4JU_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 = chunkBF7IH4JU_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 = chunkBF7IH4JU_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 chunkXQRTJIC7_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 = chunkBF7IH4JU_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
|
+
chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_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
|
+
...chunkBF7IH4JU_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 = chunkBF7IH4JU_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 = chunkBF7IH4JU_cjs.getOrCreateSpan({
|
|
17169
17170
|
type: "agent_run" /* AGENT_RUN */,
|
|
17170
17171
|
name: `agent run: '${this.capabilities.id}'`,
|
|
17171
|
-
entityType:
|
|
17172
|
+
entityType: chunkBF7IH4JU_cjs.EntityType.AGENT,
|
|
17172
17173
|
entityId: this.capabilities.id,
|
|
17173
17174
|
entityName: this.capabilities.name,
|
|
17174
17175
|
input: {
|
|
@@ -17179,7 +17180,8 @@ var AgentLegacyHandler = class {
|
|
|
17179
17180
|
availableTools: [
|
|
17180
17181
|
...toolsets ? Object.keys(toolsets) : [],
|
|
17181
17182
|
...clientTools ? Object.keys(clientTools) : []
|
|
17182
|
-
]
|
|
17183
|
+
],
|
|
17184
|
+
...this.capabilities.resolvedVersionId ? { resolvedVersionId: this.capabilities.resolvedVersionId } : {}
|
|
17183
17185
|
},
|
|
17184
17186
|
metadata: {
|
|
17185
17187
|
runId,
|
|
@@ -17192,7 +17194,7 @@ var AgentLegacyHandler = class {
|
|
|
17192
17194
|
requestContext,
|
|
17193
17195
|
mastra: this.capabilities.mastra
|
|
17194
17196
|
});
|
|
17195
|
-
const innerObservabilityContext =
|
|
17197
|
+
const innerObservabilityContext = chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan });
|
|
17196
17198
|
const memory = await this.capabilities.getMemory({ requestContext });
|
|
17197
17199
|
const toolEnhancements = [
|
|
17198
17200
|
// toolsets
|
|
@@ -17439,7 +17441,7 @@ var AgentLegacyHandler = class {
|
|
|
17439
17441
|
instructions: titleInstructions
|
|
17440
17442
|
} = this.capabilities.resolveTitleGenerationConfig(config?.generateTitle);
|
|
17441
17443
|
if (shouldGenerate && !thread2.title && userMessage) {
|
|
17442
|
-
const observabilityContext2 =
|
|
17444
|
+
const observabilityContext2 = chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan });
|
|
17443
17445
|
promises.push(
|
|
17444
17446
|
this.capabilities.genTitle(userMessage, requestContext, observabilityContext2, titleModel, titleInstructions).then((title) => {
|
|
17445
17447
|
if (title) {
|
|
@@ -17509,7 +17511,7 @@ var AgentLegacyHandler = class {
|
|
|
17509
17511
|
overrideScorers,
|
|
17510
17512
|
threadId,
|
|
17511
17513
|
resourceId,
|
|
17512
|
-
...
|
|
17514
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan })
|
|
17513
17515
|
});
|
|
17514
17516
|
const scoringData = {
|
|
17515
17517
|
input: {
|
|
@@ -17593,7 +17595,7 @@ var AgentLegacyHandler = class {
|
|
|
17593
17595
|
writableStream,
|
|
17594
17596
|
methodType,
|
|
17595
17597
|
tracingOptions,
|
|
17596
|
-
...
|
|
17598
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(args)
|
|
17597
17599
|
});
|
|
17598
17600
|
let messageList;
|
|
17599
17601
|
let thread;
|
|
@@ -17758,7 +17760,7 @@ var AgentLegacyHandler = class {
|
|
|
17758
17760
|
return tripwireResult;
|
|
17759
17761
|
}
|
|
17760
17762
|
const { experimental_output, output, agentSpan, ...llmOptions } = beforeResult;
|
|
17761
|
-
const observabilityContext =
|
|
17763
|
+
const observabilityContext = chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan });
|
|
17762
17764
|
let finalOutputProcessors = mergedGenerateOptions.outputProcessors;
|
|
17763
17765
|
if (!output || experimental_output) {
|
|
17764
17766
|
const result2 = await llmToUse.__text({
|
|
@@ -18046,7 +18048,7 @@ var AgentLegacyHandler = class {
|
|
|
18046
18048
|
}
|
|
18047
18049
|
const { onFinish, runId, output, experimental_output, agentSpan, messageList, requestContext, ...llmOptions } = beforeResult;
|
|
18048
18050
|
const overrideScorers = mergedStreamOptions.scorers;
|
|
18049
|
-
const observabilityContext =
|
|
18051
|
+
const observabilityContext = chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan });
|
|
18050
18052
|
if (!output || experimental_output) {
|
|
18051
18053
|
this.capabilities.logger.debug(`Starting agent ${this.capabilities.name} llm stream call`, {
|
|
18052
18054
|
runId
|
|
@@ -18372,7 +18374,7 @@ function createMapResultsStep({
|
|
|
18372
18374
|
const modelOutput = await getModelOutputForTripwire({
|
|
18373
18375
|
tripwire: memoryData.tripwire,
|
|
18374
18376
|
runId,
|
|
18375
|
-
...
|
|
18377
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan }),
|
|
18376
18378
|
options,
|
|
18377
18379
|
model: agentModel,
|
|
18378
18380
|
messageList: memoryData.messageList
|
|
@@ -18426,7 +18428,7 @@ function createMapResultsStep({
|
|
|
18426
18428
|
methodType: modelMethodType,
|
|
18427
18429
|
agentId,
|
|
18428
18430
|
requestContext: result.requestContext,
|
|
18429
|
-
...
|
|
18431
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan }),
|
|
18430
18432
|
runId,
|
|
18431
18433
|
toolChoice: result.toolChoice,
|
|
18432
18434
|
tools: result.tools,
|
|
@@ -18460,6 +18462,7 @@ function createMapResultsStep({
|
|
|
18460
18462
|
...modelId && { modelId }
|
|
18461
18463
|
});
|
|
18462
18464
|
}
|
|
18465
|
+
agentSpan?.error({ error: payload.error, endSpan: true });
|
|
18463
18466
|
return;
|
|
18464
18467
|
}
|
|
18465
18468
|
const aborted = options.abortSignal?.aborted;
|
|
@@ -18579,7 +18582,7 @@ function createPrepareMemoryStep({
|
|
|
18579
18582
|
inputSchema: v4.z.object({}),
|
|
18580
18583
|
outputSchema: prepareMemoryStepOutputSchema,
|
|
18581
18584
|
execute: async ({ ...rest }) => {
|
|
18582
|
-
const observabilityContext =
|
|
18585
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
18583
18586
|
const thread = threadFromArgs;
|
|
18584
18587
|
const messageList = new chunkANLO4VM2_cjs.MessageList({
|
|
18585
18588
|
threadId: thread?.id,
|
|
@@ -18721,7 +18724,7 @@ function createPrepareToolsStep({
|
|
|
18721
18724
|
resourceId,
|
|
18722
18725
|
runId,
|
|
18723
18726
|
requestContext,
|
|
18724
|
-
...
|
|
18727
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan }),
|
|
18725
18728
|
outputWriter: options.outputWriter,
|
|
18726
18729
|
methodType,
|
|
18727
18730
|
memoryConfig: options.memory?.options,
|
|
@@ -18778,7 +18781,7 @@ function createStreamStep({
|
|
|
18778
18781
|
...validatedInputData,
|
|
18779
18782
|
outputProcessors: processors,
|
|
18780
18783
|
returnScorerData,
|
|
18781
|
-
...
|
|
18784
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(observabilityContext),
|
|
18782
18785
|
requireToolApproval,
|
|
18783
18786
|
toolCallConcurrency,
|
|
18784
18787
|
resumeContext,
|
|
@@ -19683,6 +19686,7 @@ ${errorMessages}`,
|
|
|
19683
19686
|
saveStepMessages: this.saveStepMessages.bind(this),
|
|
19684
19687
|
convertInstructionsToString: this.#convertInstructionsToString.bind(this),
|
|
19685
19688
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
19689
|
+
resolvedVersionId: this.toRawConfig()?.resolvedVersionId,
|
|
19686
19690
|
_agentNetworkAppend: this._agentNetworkAppend,
|
|
19687
19691
|
listResolvedOutputProcessors: this.listResolvedOutputProcessors.bind(this),
|
|
19688
19692
|
__runOutputProcessors: this.__runOutputProcessors.bind(this),
|
|
@@ -19854,7 +19858,7 @@ ${errorMessages}`,
|
|
|
19854
19858
|
*/
|
|
19855
19859
|
listTools({ requestContext = new chunk5WBEMKE2_cjs.RequestContext() } = {}) {
|
|
19856
19860
|
if (typeof this.#tools !== "function") {
|
|
19857
|
-
return
|
|
19861
|
+
return chunkXQRTJIC7_cjs.ensureToolProperties(this.#tools);
|
|
19858
19862
|
}
|
|
19859
19863
|
const result = this.#tools({
|
|
19860
19864
|
requestContext,
|
|
@@ -19875,7 +19879,7 @@ ${errorMessages}`,
|
|
|
19875
19879
|
this.logger.error(mastraError.toString());
|
|
19876
19880
|
throw mastraError;
|
|
19877
19881
|
}
|
|
19878
|
-
return
|
|
19882
|
+
return chunkXQRTJIC7_cjs.ensureToolProperties(tools);
|
|
19879
19883
|
});
|
|
19880
19884
|
}
|
|
19881
19885
|
/**
|
|
@@ -19924,7 +19928,7 @@ ${errorMessages}`,
|
|
|
19924
19928
|
});
|
|
19925
19929
|
});
|
|
19926
19930
|
} else {
|
|
19927
|
-
llm = new
|
|
19931
|
+
llm = new chunkLKZQG2ZZ_cjs.MastraLLMV1({
|
|
19928
19932
|
model: modelInfo,
|
|
19929
19933
|
mastra: this.#mastra,
|
|
19930
19934
|
options: { tracingPolicy: this.#options?.tracingPolicy }
|
|
@@ -19950,7 +19954,7 @@ ${errorMessages}`,
|
|
|
19950
19954
|
*/
|
|
19951
19955
|
async resolveModelConfig(modelConfig, requestContext) {
|
|
19952
19956
|
try {
|
|
19953
|
-
return await
|
|
19957
|
+
return await chunkXRW4AYLH_cjs.resolveModelConfig(modelConfig, requestContext, this.#mastra);
|
|
19954
19958
|
} catch (error) {
|
|
19955
19959
|
const mastraError = new chunk4U7ZLI36_cjs.MastraError({
|
|
19956
19960
|
id: "AGENT_GET_MODEL_MISSING_MODEL_INSTANCE",
|
|
@@ -20279,7 +20283,7 @@ ${errorMessages}`,
|
|
|
20279
20283
|
instructions,
|
|
20280
20284
|
...rest
|
|
20281
20285
|
}) {
|
|
20282
|
-
const observabilityContext =
|
|
20286
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
20283
20287
|
const llm = await this.getLLM({ requestContext, model });
|
|
20284
20288
|
const normMessage = new chunkANLO4VM2_cjs.MessageList().add(message, "user").get.all.aiV5.ui().at(-1);
|
|
20285
20289
|
if (!normMessage) {
|
|
@@ -20402,7 +20406,7 @@ ${errorMessages}`,
|
|
|
20402
20406
|
autoResumeSuspendedTools,
|
|
20403
20407
|
...rest
|
|
20404
20408
|
}) {
|
|
20405
|
-
const observabilityContext =
|
|
20409
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
20406
20410
|
let convertedMemoryTools = {};
|
|
20407
20411
|
if (this._agentNetworkAppend) {
|
|
20408
20412
|
this.logger.debug(`[Agent:${this.name}] - Skipping memory tools (agent network context)`, { runId });
|
|
@@ -20439,7 +20443,7 @@ ${errorMessages}`,
|
|
|
20439
20443
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20440
20444
|
requireApproval: toolObj.requireApproval
|
|
20441
20445
|
};
|
|
20442
|
-
const convertedToCoreTool =
|
|
20446
|
+
const convertedToCoreTool = chunkXQRTJIC7_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20443
20447
|
convertedMemoryTools[toolName] = convertedToCoreTool;
|
|
20444
20448
|
}
|
|
20445
20449
|
}
|
|
@@ -20458,7 +20462,7 @@ ${errorMessages}`,
|
|
|
20458
20462
|
autoResumeSuspendedTools,
|
|
20459
20463
|
...rest
|
|
20460
20464
|
}) {
|
|
20461
|
-
const observabilityContext =
|
|
20465
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
20462
20466
|
let convertedWorkspaceTools = {};
|
|
20463
20467
|
if (this._agentNetworkAppend) {
|
|
20464
20468
|
this.logger.debug(`[Agent:${this.name}] - Skipping workspace tools (agent network context)`, { runId });
|
|
@@ -20468,7 +20472,7 @@ ${errorMessages}`,
|
|
|
20468
20472
|
if (!workspace) {
|
|
20469
20473
|
return convertedWorkspaceTools;
|
|
20470
20474
|
}
|
|
20471
|
-
const workspaceTools =
|
|
20475
|
+
const workspaceTools = chunkGXXNF6NF_cjs.createWorkspaceTools(workspace);
|
|
20472
20476
|
if (Object.keys(workspaceTools).length > 0) {
|
|
20473
20477
|
this.logger.debug(`[Agent:${this.name}] - Adding workspace tools: ${Object.keys(workspaceTools).join(", ")}`, {
|
|
20474
20478
|
runId
|
|
@@ -20491,7 +20495,7 @@ ${errorMessages}`,
|
|
|
20491
20495
|
requireApproval: toolObj.requireApproval,
|
|
20492
20496
|
workspace
|
|
20493
20497
|
};
|
|
20494
|
-
const convertedToCoreTool =
|
|
20498
|
+
const convertedToCoreTool = chunkXQRTJIC7_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20495
20499
|
convertedWorkspaceTools[toolName] = convertedToCoreTool;
|
|
20496
20500
|
}
|
|
20497
20501
|
}
|
|
@@ -20513,7 +20517,7 @@ ${errorMessages}`,
|
|
|
20513
20517
|
autoResumeSuspendedTools,
|
|
20514
20518
|
...rest
|
|
20515
20519
|
}) {
|
|
20516
|
-
const observabilityContext =
|
|
20520
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
20517
20521
|
let convertedSkillTools = {};
|
|
20518
20522
|
if (this._agentNetworkAppend) {
|
|
20519
20523
|
return convertedSkillTools;
|
|
@@ -20522,7 +20526,7 @@ ${errorMessages}`,
|
|
|
20522
20526
|
if (!workspace?.skills) {
|
|
20523
20527
|
return convertedSkillTools;
|
|
20524
20528
|
}
|
|
20525
|
-
const skillTools =
|
|
20529
|
+
const skillTools = chunkGXXNF6NF_cjs.createSkillTools(workspace.skills);
|
|
20526
20530
|
if (Object.keys(skillTools).length > 0) {
|
|
20527
20531
|
this.logger.debug(`[Agent:${this.name}] - Adding skill tools: ${Object.keys(skillTools).join(", ")}`, {
|
|
20528
20532
|
runId
|
|
@@ -20546,7 +20550,7 @@ ${errorMessages}`,
|
|
|
20546
20550
|
// Skill tools never require approval
|
|
20547
20551
|
workspace
|
|
20548
20552
|
};
|
|
20549
|
-
const convertedToCoreTool =
|
|
20553
|
+
const convertedToCoreTool = chunkXQRTJIC7_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20550
20554
|
convertedSkillTools[toolName] = convertedToCoreTool;
|
|
20551
20555
|
}
|
|
20552
20556
|
}
|
|
@@ -20606,7 +20610,7 @@ ${errorMessages}`,
|
|
|
20606
20610
|
*/
|
|
20607
20611
|
async __runProcessInputStep(args) {
|
|
20608
20612
|
const { requestContext, messageList, stepNumber = 0, processorStates, ...rest } = args;
|
|
20609
|
-
const observabilityContext =
|
|
20613
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
20610
20614
|
let tripwire;
|
|
20611
20615
|
if (this.#inputProcessors || this.#memory) {
|
|
20612
20616
|
const runner = await this.getProcessorRunner({
|
|
@@ -20735,7 +20739,7 @@ ${errorMessages}`,
|
|
|
20735
20739
|
autoResumeSuspendedTools,
|
|
20736
20740
|
...rest
|
|
20737
20741
|
}) {
|
|
20738
|
-
const observabilityContext =
|
|
20742
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
20739
20743
|
let toolsForRequest = {};
|
|
20740
20744
|
this.logger.debug(`[Agents:${this.name}] - Assembling assigned tools`, { runId, threadId, resourceId });
|
|
20741
20745
|
const memory = await this.getMemory({ requestContext });
|
|
@@ -20763,7 +20767,7 @@ ${errorMessages}`,
|
|
|
20763
20767
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20764
20768
|
requireApproval: tool2.requireApproval
|
|
20765
20769
|
};
|
|
20766
|
-
return [k,
|
|
20770
|
+
return [k, chunkXQRTJIC7_cjs.makeCoreTool(tool2, options, void 0, autoResumeSuspendedTools)];
|
|
20767
20771
|
})
|
|
20768
20772
|
);
|
|
20769
20773
|
const assignedToolEntriesConverted = Object.fromEntries(
|
|
@@ -20788,7 +20792,7 @@ ${errorMessages}`,
|
|
|
20788
20792
|
autoResumeSuspendedTools,
|
|
20789
20793
|
...rest
|
|
20790
20794
|
}) {
|
|
20791
|
-
const observabilityContext =
|
|
20795
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
20792
20796
|
let toolsForRequest = {};
|
|
20793
20797
|
const memory = await this.getMemory({ requestContext });
|
|
20794
20798
|
const toolsFromToolsets = Object.values(toolsets || {});
|
|
@@ -20815,7 +20819,7 @@ ${errorMessages}`,
|
|
|
20815
20819
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20816
20820
|
requireApproval: toolObj.requireApproval
|
|
20817
20821
|
};
|
|
20818
|
-
const convertedToCoreTool =
|
|
20822
|
+
const convertedToCoreTool = chunkXQRTJIC7_cjs.makeCoreTool(toolObj, options, "toolset", autoResumeSuspendedTools);
|
|
20819
20823
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
20820
20824
|
}
|
|
20821
20825
|
}
|
|
@@ -20836,7 +20840,7 @@ ${errorMessages}`,
|
|
|
20836
20840
|
autoResumeSuspendedTools,
|
|
20837
20841
|
...rest
|
|
20838
20842
|
}) {
|
|
20839
|
-
const observabilityContext =
|
|
20843
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
20840
20844
|
let toolsForRequest = {};
|
|
20841
20845
|
const memory = await this.getMemory({ requestContext });
|
|
20842
20846
|
const clientToolsForInput = Object.entries(clientTools || {});
|
|
@@ -20862,7 +20866,7 @@ ${errorMessages}`,
|
|
|
20862
20866
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20863
20867
|
requireApproval: tool2.requireApproval
|
|
20864
20868
|
};
|
|
20865
|
-
const convertedToCoreTool =
|
|
20869
|
+
const convertedToCoreTool = chunkXQRTJIC7_cjs.makeCoreTool(toolRest, options, "client-tool", autoResumeSuspendedTools);
|
|
20866
20870
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
20867
20871
|
}
|
|
20868
20872
|
}
|
|
@@ -20914,7 +20918,7 @@ ${errorMessages}`,
|
|
|
20914
20918
|
delegation,
|
|
20915
20919
|
...rest
|
|
20916
20920
|
}) {
|
|
20917
|
-
const observabilityContext =
|
|
20921
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
20918
20922
|
const convertedAgentTools = {};
|
|
20919
20923
|
const agents = await this.listAgents({ requestContext });
|
|
20920
20924
|
if (Object.keys(agents).length > 0) {
|
|
@@ -20946,7 +20950,7 @@ ${errorMessages}`,
|
|
|
20946
20950
|
).describe("The results from the agent's tool calls").optional()
|
|
20947
20951
|
});
|
|
20948
20952
|
const modelVersion = (await agent.getModel({ requestContext })).specificationVersion;
|
|
20949
|
-
const toolObj =
|
|
20953
|
+
const toolObj = chunkAV4YSAZL_cjs.createTool({
|
|
20950
20954
|
id: `agent-${agentName}`,
|
|
20951
20955
|
description: agent.getDescription() || `Agent: ${agentName}`,
|
|
20952
20956
|
inputSchema: agentInputSchema,
|
|
@@ -21144,7 +21148,7 @@ ${effectiveInstructions}`;
|
|
|
21144
21148
|
const generateResult = resumeData ? await agent.resumeGenerate(resumeData, {
|
|
21145
21149
|
runId: suspendedToolRunId,
|
|
21146
21150
|
requestContext,
|
|
21147
|
-
...
|
|
21151
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {}),
|
|
21148
21152
|
...effectiveInstructions && { instructions: effectiveInstructions },
|
|
21149
21153
|
...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
|
|
21150
21154
|
...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
|
|
@@ -21156,7 +21160,7 @@ ${effectiveInstructions}`;
|
|
|
21156
21160
|
} : {}
|
|
21157
21161
|
}) : await agent.generate(messagesForSubAgent, {
|
|
21158
21162
|
requestContext,
|
|
21159
|
-
...
|
|
21163
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {}),
|
|
21160
21164
|
...effectiveInstructions && { instructions: effectiveInstructions },
|
|
21161
21165
|
...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
|
|
21162
21166
|
...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
|
|
@@ -21220,14 +21224,14 @@ ${effectiveInstructions}`;
|
|
|
21220
21224
|
} else if (methodType === "generate" && modelVersion === "v1") {
|
|
21221
21225
|
const generateResult = await agent.generateLegacy(messagesForSubAgent, {
|
|
21222
21226
|
requestContext,
|
|
21223
|
-
...
|
|
21227
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {})
|
|
21224
21228
|
});
|
|
21225
21229
|
result = { text: generateResult.text };
|
|
21226
21230
|
} else if ((methodType === "stream" || methodType === "streamLegacy") && supportedLanguageModelSpecifications.includes(modelVersion)) {
|
|
21227
21231
|
const streamResult = resumeData ? await agent.resumeStream(resumeData, {
|
|
21228
21232
|
runId: suspendedToolRunId,
|
|
21229
21233
|
requestContext,
|
|
21230
|
-
...
|
|
21234
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {}),
|
|
21231
21235
|
...effectiveInstructions && { instructions: effectiveInstructions },
|
|
21232
21236
|
...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
|
|
21233
21237
|
...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
|
|
@@ -21241,7 +21245,7 @@ ${effectiveInstructions}`;
|
|
|
21241
21245
|
} : {}
|
|
21242
21246
|
}) : await agent.stream(messagesForSubAgent, {
|
|
21243
21247
|
requestContext,
|
|
21244
|
-
...
|
|
21248
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {}),
|
|
21245
21249
|
...effectiveInstructions && { instructions: effectiveInstructions },
|
|
21246
21250
|
...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
|
|
21247
21251
|
...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
|
|
@@ -21342,7 +21346,7 @@ ${effectiveInstructions}`;
|
|
|
21342
21346
|
} else {
|
|
21343
21347
|
const streamResult = await agent.streamLegacy(effectivePrompt, {
|
|
21344
21348
|
requestContext,
|
|
21345
|
-
...
|
|
21349
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {})
|
|
21346
21350
|
});
|
|
21347
21351
|
let fullText = "";
|
|
21348
21352
|
for await (const chunk of streamResult.fullStream) {
|
|
@@ -21525,7 +21529,7 @@ ${effectiveInstructions}`;
|
|
|
21525
21529
|
...observabilityContext,
|
|
21526
21530
|
tracingPolicy: this.#options?.tracingPolicy
|
|
21527
21531
|
};
|
|
21528
|
-
convertedAgentTools[`agent-${agentName}`] =
|
|
21532
|
+
convertedAgentTools[`agent-${agentName}`] = chunkXQRTJIC7_cjs.makeCoreTool(
|
|
21529
21533
|
toolObj,
|
|
21530
21534
|
options,
|
|
21531
21535
|
void 0,
|
|
@@ -21548,7 +21552,7 @@ ${effectiveInstructions}`;
|
|
|
21548
21552
|
autoResumeSuspendedTools,
|
|
21549
21553
|
...rest
|
|
21550
21554
|
}) {
|
|
21551
|
-
const observabilityContext =
|
|
21555
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
21552
21556
|
const convertedWorkflowTools = {};
|
|
21553
21557
|
const workflows = await this.listWorkflows({ requestContext });
|
|
21554
21558
|
if (Object.keys(workflows).length > 0) {
|
|
@@ -21590,7 +21594,7 @@ ${effectiveInstructions}`;
|
|
|
21590
21594
|
}
|
|
21591
21595
|
]
|
|
21592
21596
|
};
|
|
21593
|
-
const toolObj =
|
|
21597
|
+
const toolObj = chunkAV4YSAZL_cjs.createTool({
|
|
21594
21598
|
id: `workflow-${workflowName}`,
|
|
21595
21599
|
description: workflow.description || `Workflow: ${workflowName}`,
|
|
21596
21600
|
inputSchema: extendedInputSchema,
|
|
@@ -21619,13 +21623,13 @@ ${effectiveInstructions}`;
|
|
|
21619
21623
|
result = await run.resume({
|
|
21620
21624
|
resumeData,
|
|
21621
21625
|
requestContext,
|
|
21622
|
-
...
|
|
21626
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {})
|
|
21623
21627
|
});
|
|
21624
21628
|
} else {
|
|
21625
21629
|
result = await run.start({
|
|
21626
21630
|
inputData: workflowInputData,
|
|
21627
21631
|
requestContext,
|
|
21628
|
-
...
|
|
21632
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {}),
|
|
21629
21633
|
...initialState && { initialState }
|
|
21630
21634
|
});
|
|
21631
21635
|
}
|
|
@@ -21633,7 +21637,7 @@ ${effectiveInstructions}`;
|
|
|
21633
21637
|
const streamResult = run.streamLegacy({
|
|
21634
21638
|
inputData: workflowInputData,
|
|
21635
21639
|
requestContext,
|
|
21636
|
-
...
|
|
21640
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {})
|
|
21637
21641
|
});
|
|
21638
21642
|
if (context?.writer) {
|
|
21639
21643
|
await streamResult.stream.pipeTo(context.writer);
|
|
@@ -21646,11 +21650,11 @@ ${effectiveInstructions}`;
|
|
|
21646
21650
|
const streamResult = resumeData ? run.resumeStream({
|
|
21647
21651
|
resumeData,
|
|
21648
21652
|
requestContext,
|
|
21649
|
-
...
|
|
21653
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {})
|
|
21650
21654
|
}) : run.stream({
|
|
21651
21655
|
inputData: workflowInputData,
|
|
21652
21656
|
requestContext,
|
|
21653
|
-
...
|
|
21657
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {}),
|
|
21654
21658
|
...initialState && { initialState }
|
|
21655
21659
|
});
|
|
21656
21660
|
if (context?.writer) {
|
|
@@ -21742,7 +21746,7 @@ ${effectiveInstructions}`;
|
|
|
21742
21746
|
...observabilityContext,
|
|
21743
21747
|
tracingPolicy: this.#options?.tracingPolicy
|
|
21744
21748
|
};
|
|
21745
|
-
convertedWorkflowTools[`workflow-${workflowName}`] =
|
|
21749
|
+
convertedWorkflowTools[`workflow-${workflowName}`] = chunkXQRTJIC7_cjs.makeCoreTool(
|
|
21746
21750
|
toolObj,
|
|
21747
21751
|
options,
|
|
21748
21752
|
void 0,
|
|
@@ -21770,11 +21774,11 @@ ${effectiveInstructions}`;
|
|
|
21770
21774
|
delegation,
|
|
21771
21775
|
...rest
|
|
21772
21776
|
}) {
|
|
21773
|
-
const observabilityContext =
|
|
21777
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
21774
21778
|
let mastraProxy = void 0;
|
|
21775
21779
|
const logger = this.logger;
|
|
21776
21780
|
if (this.#mastra) {
|
|
21777
|
-
mastraProxy =
|
|
21781
|
+
mastraProxy = chunkXQRTJIC7_cjs.createMastraProxy({ mastra: this.#mastra, logger });
|
|
21778
21782
|
}
|
|
21779
21783
|
const assignedTools = await this.listAssignedTools({
|
|
21780
21784
|
runId,
|
|
@@ -22026,7 +22030,7 @@ ${effectiveInstructions}`;
|
|
|
22026
22030
|
const resolvedModel = await this.resolveModelConfig(selection, requestContext);
|
|
22027
22031
|
this.assertSupportsPreparedModels(resolvedModel);
|
|
22028
22032
|
let headers;
|
|
22029
|
-
if (resolvedModel instanceof
|
|
22033
|
+
if (resolvedModel instanceof chunkXRW4AYLH_cjs.ModelRouterLanguageModel) {
|
|
22030
22034
|
headers = resolvedModel.config?.headers;
|
|
22031
22035
|
}
|
|
22032
22036
|
return [
|
|
@@ -22059,7 +22063,7 @@ ${effectiveInstructions}`;
|
|
|
22059
22063
|
throw mastraError;
|
|
22060
22064
|
}
|
|
22061
22065
|
let headers;
|
|
22062
|
-
if (model instanceof
|
|
22066
|
+
if (model instanceof chunkXRW4AYLH_cjs.ModelRouterLanguageModel) {
|
|
22063
22067
|
headers = model.config?.headers;
|
|
22064
22068
|
}
|
|
22065
22069
|
return {
|
|
@@ -22129,16 +22133,17 @@ ${effectiveInstructions}`;
|
|
|
22129
22133
|
resourceId
|
|
22130
22134
|
}) || crypto2.randomUUID();
|
|
22131
22135
|
const instructions = options.instructions || await this.getInstructions({ requestContext });
|
|
22132
|
-
const agentSpan =
|
|
22136
|
+
const agentSpan = chunkBF7IH4JU_cjs.getOrCreateSpan({
|
|
22133
22137
|
type: "agent_run" /* AGENT_RUN */,
|
|
22134
22138
|
name: `agent run: '${this.id}'`,
|
|
22135
|
-
entityType:
|
|
22139
|
+
entityType: chunkBF7IH4JU_cjs.EntityType.AGENT,
|
|
22136
22140
|
entityId: this.id,
|
|
22137
22141
|
entityName: this.name,
|
|
22138
22142
|
input: options.messages,
|
|
22139
22143
|
attributes: {
|
|
22140
22144
|
conversationId: threadFromArgs?.id,
|
|
22141
|
-
instructions: this.#convertInstructionsToString(instructions)
|
|
22145
|
+
instructions: this.#convertInstructionsToString(instructions),
|
|
22146
|
+
...this.toRawConfig()?.resolvedVersionId ? { resolvedVersionId: this.toRawConfig().resolvedVersionId } : {}
|
|
22142
22147
|
},
|
|
22143
22148
|
metadata: {
|
|
22144
22149
|
runId,
|
|
@@ -22205,7 +22210,7 @@ ${effectiveInstructions}`;
|
|
|
22205
22210
|
workspace
|
|
22206
22211
|
});
|
|
22207
22212
|
const run = await executionWorkflow.createRun();
|
|
22208
|
-
const observabilityContext =
|
|
22213
|
+
const observabilityContext = chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan });
|
|
22209
22214
|
const result = await run.start({ ...observabilityContext });
|
|
22210
22215
|
return result;
|
|
22211
22216
|
}
|
|
@@ -22229,7 +22234,7 @@ ${effectiveInstructions}`;
|
|
|
22229
22234
|
structuredOutput = false,
|
|
22230
22235
|
overrideScorers
|
|
22231
22236
|
}) {
|
|
22232
|
-
const observabilityContext =
|
|
22237
|
+
const observabilityContext = chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan });
|
|
22233
22238
|
const resToLog = {
|
|
22234
22239
|
text: result.text,
|
|
22235
22240
|
object: result.object,
|
|
@@ -22512,7 +22517,7 @@ ${effectiveInstructions}`;
|
|
|
22512
22517
|
const defaultOptions = await this.getDefaultOptions({
|
|
22513
22518
|
requestContext: options?.requestContext
|
|
22514
22519
|
});
|
|
22515
|
-
const mergedOptions =
|
|
22520
|
+
const mergedOptions = chunkXQRTJIC7_cjs.deepMerge(
|
|
22516
22521
|
defaultOptions,
|
|
22517
22522
|
options ?? {}
|
|
22518
22523
|
);
|
|
@@ -22582,7 +22587,7 @@ ${effectiveInstructions}`;
|
|
|
22582
22587
|
const defaultOptions = await this.getDefaultOptions({
|
|
22583
22588
|
requestContext: streamOptions?.requestContext
|
|
22584
22589
|
});
|
|
22585
|
-
const mergedOptions =
|
|
22590
|
+
const mergedOptions = chunkXQRTJIC7_cjs.deepMerge(
|
|
22586
22591
|
defaultOptions,
|
|
22587
22592
|
streamOptions ?? {}
|
|
22588
22593
|
);
|
|
@@ -22646,7 +22651,7 @@ ${effectiveInstructions}`;
|
|
|
22646
22651
|
const defaultOptions = await this.getDefaultOptions({
|
|
22647
22652
|
requestContext: streamOptions?.requestContext
|
|
22648
22653
|
});
|
|
22649
|
-
let mergedStreamOptions =
|
|
22654
|
+
let mergedStreamOptions = chunkXQRTJIC7_cjs.deepMerge(
|
|
22650
22655
|
defaultOptions,
|
|
22651
22656
|
streamOptions ?? {}
|
|
22652
22657
|
);
|
|
@@ -22711,7 +22716,7 @@ ${effectiveInstructions}`;
|
|
|
22711
22716
|
const defaultOptions = await this.getDefaultOptions({
|
|
22712
22717
|
requestContext: options?.requestContext
|
|
22713
22718
|
});
|
|
22714
|
-
const mergedOptions =
|
|
22719
|
+
const mergedOptions = chunkXQRTJIC7_cjs.deepMerge(
|
|
22715
22720
|
defaultOptions,
|
|
22716
22721
|
options ?? {}
|
|
22717
22722
|
);
|
|
@@ -22948,7 +22953,7 @@ var ModerationProcessor = class _ModerationProcessor {
|
|
|
22948
22953
|
async processInput(args) {
|
|
22949
22954
|
try {
|
|
22950
22955
|
const { messages, abort, ...rest } = args;
|
|
22951
|
-
const observabilityContext =
|
|
22956
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
22952
22957
|
if (messages.length === 0) {
|
|
22953
22958
|
return messages;
|
|
22954
22959
|
}
|
|
@@ -22982,7 +22987,7 @@ var ModerationProcessor = class _ModerationProcessor {
|
|
|
22982
22987
|
async processOutputStream(args) {
|
|
22983
22988
|
try {
|
|
22984
22989
|
const { part, streamParts, abort, ...rest } = args;
|
|
22985
|
-
const observabilityContext =
|
|
22990
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
22986
22991
|
if (part.type !== "text-delta") {
|
|
22987
22992
|
return part;
|
|
22988
22993
|
}
|
|
@@ -23190,7 +23195,7 @@ var PromptInjectionDetector = class _PromptInjectionDetector {
|
|
|
23190
23195
|
async processInput(args) {
|
|
23191
23196
|
try {
|
|
23192
23197
|
const { messages, abort, ...rest } = args;
|
|
23193
|
-
const observabilityContext =
|
|
23198
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
23194
23199
|
if (messages.length === 0) {
|
|
23195
23200
|
return messages;
|
|
23196
23201
|
}
|
|
@@ -23438,7 +23443,7 @@ var PIIDetector = class _PIIDetector {
|
|
|
23438
23443
|
async processInput(args) {
|
|
23439
23444
|
try {
|
|
23440
23445
|
const { messages, abort, ...rest } = args;
|
|
23441
|
-
const observabilityContext =
|
|
23446
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
23442
23447
|
if (messages.length === 0) {
|
|
23443
23448
|
return messages;
|
|
23444
23449
|
}
|
|
@@ -23721,7 +23726,7 @@ IMPORTANT: Only include PII types that are actually detected. If no PII is found
|
|
|
23721
23726
|
*/
|
|
23722
23727
|
async processOutputStream(args) {
|
|
23723
23728
|
const { part, abort, ...rest } = args;
|
|
23724
|
-
const observabilityContext =
|
|
23729
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
23725
23730
|
try {
|
|
23726
23731
|
if (part.type !== "text-delta") {
|
|
23727
23732
|
return part;
|
|
@@ -23784,7 +23789,7 @@ IMPORTANT: Only include PII types that are actually detected. If no PII is found
|
|
|
23784
23789
|
abort,
|
|
23785
23790
|
...rest
|
|
23786
23791
|
}) {
|
|
23787
|
-
const observabilityContext =
|
|
23792
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
23788
23793
|
try {
|
|
23789
23794
|
if (messages.length === 0) {
|
|
23790
23795
|
return messages;
|
|
@@ -23913,7 +23918,7 @@ var LanguageDetector = class _LanguageDetector {
|
|
|
23913
23918
|
async processInput(args) {
|
|
23914
23919
|
try {
|
|
23915
23920
|
const { messages, abort, ...rest } = args;
|
|
23916
|
-
const observabilityContext =
|
|
23921
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
23917
23922
|
if (messages.length === 0) {
|
|
23918
23923
|
return messages;
|
|
23919
23924
|
}
|
|
@@ -24285,7 +24290,7 @@ var TokenLimiterProcessor = class _TokenLimiterProcessor {
|
|
|
24285
24290
|
return new TiktokenClass(this.customEncoding);
|
|
24286
24291
|
});
|
|
24287
24292
|
} else {
|
|
24288
|
-
this.encoderPromise =
|
|
24293
|
+
this.encoderPromise = chunkGXXNF6NF_cjs.getTiktoken();
|
|
24289
24294
|
}
|
|
24290
24295
|
}
|
|
24291
24296
|
return this.encoderPromise;
|
|
@@ -24578,7 +24583,7 @@ var SystemPromptScrubber = class {
|
|
|
24578
24583
|
*/
|
|
24579
24584
|
async processOutputStream(args) {
|
|
24580
24585
|
const { part, abort, ...rest } = args;
|
|
24581
|
-
const observabilityContext =
|
|
24586
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
24582
24587
|
if (part.type !== "text-delta") {
|
|
24583
24588
|
return part;
|
|
24584
24589
|
}
|
|
@@ -24633,7 +24638,7 @@ var SystemPromptScrubber = class {
|
|
|
24633
24638
|
abort,
|
|
24634
24639
|
...rest
|
|
24635
24640
|
}) {
|
|
24636
|
-
const observabilityContext =
|
|
24641
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
24637
24642
|
const processedMessages = [];
|
|
24638
24643
|
for (const message of messages) {
|
|
24639
24644
|
if (message.role !== "assistant" || !message.content?.parts) {
|
|
@@ -25180,7 +25185,7 @@ var ToolSearchProcessor = class {
|
|
|
25180
25185
|
minScore: options.search?.minScore ?? 0
|
|
25181
25186
|
};
|
|
25182
25187
|
this.ttl = options.ttl ?? 36e5;
|
|
25183
|
-
this.bm25Index = new
|
|
25188
|
+
this.bm25Index = new chunkGXXNF6NF_cjs.BM25Index({}, TOOL_SEARCH_TOKENIZE_OPTIONS);
|
|
25184
25189
|
this.indexTools();
|
|
25185
25190
|
if (this.ttl > 0) {
|
|
25186
25191
|
this.scheduleCleanup();
|
|
@@ -25345,7 +25350,7 @@ var ToolSearchProcessor = class {
|
|
|
25345
25350
|
messageList.addSystem(
|
|
25346
25351
|
"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
25352
|
);
|
|
25348
|
-
const searchTool =
|
|
25353
|
+
const searchTool = chunkAV4YSAZL_cjs.createTool({
|
|
25349
25354
|
id: "search_tools",
|
|
25350
25355
|
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
25356
|
inputSchema: v4.z.object({
|
|
@@ -25375,7 +25380,7 @@ var ToolSearchProcessor = class {
|
|
|
25375
25380
|
};
|
|
25376
25381
|
}
|
|
25377
25382
|
});
|
|
25378
|
-
const loadTool =
|
|
25383
|
+
const loadTool = chunkAV4YSAZL_cjs.createTool({
|
|
25379
25384
|
id: "load_tool",
|
|
25380
25385
|
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
25386
|
inputSchema: v4.z.object({
|
|
@@ -25573,7 +25578,7 @@ var SkillSearchProcessor = class {
|
|
|
25573
25578
|
messageList.addSystem(
|
|
25574
25579
|
"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
25580
|
);
|
|
25576
|
-
const searchSkillTool =
|
|
25581
|
+
const searchSkillTool = chunkAV4YSAZL_cjs.createTool({
|
|
25577
25582
|
id: "search_skills",
|
|
25578
25583
|
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
25584
|
inputSchema: v4.z.object({
|
|
@@ -25623,7 +25628,7 @@ var SkillSearchProcessor = class {
|
|
|
25623
25628
|
};
|
|
25624
25629
|
}
|
|
25625
25630
|
});
|
|
25626
|
-
const loadSkillTool =
|
|
25631
|
+
const loadSkillTool = chunkAV4YSAZL_cjs.createTool({
|
|
25627
25632
|
id: "load_skill",
|
|
25628
25633
|
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
25634
|
inputSchema: v4.z.object({
|
|
@@ -25962,7 +25967,7 @@ var WorkingMemory = class {
|
|
|
25962
25967
|
return messageList;
|
|
25963
25968
|
}
|
|
25964
25969
|
generateEmptyFromSchemaInternal(schema) {
|
|
25965
|
-
const result =
|
|
25970
|
+
const result = chunkXQRTJIC7_cjs.generateEmptyFromSchema(schema);
|
|
25966
25971
|
return Object.keys(result).length > 0 ? result : null;
|
|
25967
25972
|
}
|
|
25968
25973
|
getWorkingMemoryToolInstruction({
|
|
@@ -26607,7 +26612,7 @@ https://mastra.ai/en/docs/memory/semantic-recall`
|
|
|
26607
26612
|
);
|
|
26608
26613
|
}
|
|
26609
26614
|
if (typeof config.embedder === "string") {
|
|
26610
|
-
this.embedder = new
|
|
26615
|
+
this.embedder = new chunkXRW4AYLH_cjs.ModelRouterEmbeddingModel(config.embedder);
|
|
26611
26616
|
} else {
|
|
26612
26617
|
this.embedder = config.embedder;
|
|
26613
26618
|
}
|
|
@@ -26620,7 +26625,7 @@ https://mastra.ai/en/docs/memory/semantic-recall`
|
|
|
26620
26625
|
}
|
|
26621
26626
|
if (config.embedder) {
|
|
26622
26627
|
if (typeof config.embedder === "string") {
|
|
26623
|
-
this.embedder = new
|
|
26628
|
+
this.embedder = new chunkXRW4AYLH_cjs.ModelRouterEmbeddingModel(config.embedder);
|
|
26624
26629
|
} else {
|
|
26625
26630
|
this.embedder = config.embedder;
|
|
26626
26631
|
}
|
|
@@ -26660,7 +26665,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
26660
26665
|
}
|
|
26661
26666
|
setEmbedder(embedder, embedderOptions) {
|
|
26662
26667
|
if (typeof embedder === "string") {
|
|
26663
|
-
this.embedder = new
|
|
26668
|
+
this.embedder = new chunkXRW4AYLH_cjs.ModelRouterEmbeddingModel(embedder);
|
|
26664
26669
|
} else {
|
|
26665
26670
|
this.embedder = embedder;
|
|
26666
26671
|
}
|
|
@@ -26757,7 +26762,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
26757
26762
|
"The threads.generateTitle option has been moved. Use the top-level generateTitle option instead."
|
|
26758
26763
|
);
|
|
26759
26764
|
}
|
|
26760
|
-
const mergedConfig =
|
|
26765
|
+
const mergedConfig = chunkXQRTJIC7_cjs.deepMerge(this.threadConfig, config || {});
|
|
26761
26766
|
if (typeof config?.workingMemory === "object" && config.workingMemory?.schema && typeof mergedConfig.workingMemory === "object") {
|
|
26762
26767
|
mergedConfig.workingMemory.schema = config.workingMemory.schema;
|
|
26763
26768
|
}
|
|
@@ -27109,7 +27114,7 @@ var MockMemory = class extends MastraMemory {
|
|
|
27109
27114
|
} = {}) {
|
|
27110
27115
|
super({
|
|
27111
27116
|
name: "mock",
|
|
27112
|
-
storage: storage || new
|
|
27117
|
+
storage: storage || new chunkV2NQOABM_cjs.InMemoryStore(),
|
|
27113
27118
|
options: {
|
|
27114
27119
|
...options,
|
|
27115
27120
|
workingMemory: enableWorkingMemory ? { enabled: true, template: workingMemoryTemplate } : options?.workingMemory,
|
|
@@ -27190,7 +27195,7 @@ var MockMemory = class extends MastraMemory {
|
|
|
27190
27195
|
return {};
|
|
27191
27196
|
}
|
|
27192
27197
|
return {
|
|
27193
|
-
updateWorkingMemory:
|
|
27198
|
+
updateWorkingMemory: chunkAV4YSAZL_cjs.createTool({
|
|
27194
27199
|
id: "update-working-memory",
|
|
27195
27200
|
description: `Update the working memory with new information. Any data not included will be overwritten.`,
|
|
27196
27201
|
inputSchema: v4.z.object({ memory: v4.z.string() }),
|
|
@@ -27420,5 +27425,5 @@ exports.validateStepRequestContext = validateStepRequestContext;
|
|
|
27420
27425
|
exports.validateStepResumeData = validateStepResumeData;
|
|
27421
27426
|
exports.validateStepStateData = validateStepStateData;
|
|
27422
27427
|
exports.validateStepSuspendData = validateStepSuspendData;
|
|
27423
|
-
//# sourceMappingURL=chunk-
|
|
27424
|
-
//# sourceMappingURL=chunk-
|
|
27428
|
+
//# sourceMappingURL=chunk-KCRQQDEF.cjs.map
|
|
27429
|
+
//# sourceMappingURL=chunk-KCRQQDEF.cjs.map
|