@mastra/core 1.18.0-alpha.4 → 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 +23 -0
- package/dist/_types/@internal_core/dist/index.d.ts +502 -29
- 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/{chunk-Z5FE6LBA.js → chunk-27EVOYQC.js} +3 -3
- package/dist/{chunk-Z5FE6LBA.js.map → chunk-27EVOYQC.js.map} +1 -1
- package/dist/{chunk-T3TFXXGP.js → chunk-3CTQJRNS.js} +12 -9
- package/dist/chunk-3CTQJRNS.js.map +1 -0
- package/dist/{chunk-UZ426KMJ.cjs → chunk-4BZRWJBH.cjs} +32 -32
- package/dist/{chunk-UZ426KMJ.cjs.map → chunk-4BZRWJBH.cjs.map} +1 -1
- package/dist/{chunk-LQHNR4L7.js → chunk-4FMKWOPC.js} +3 -3
- package/dist/{chunk-LQHNR4L7.js.map → chunk-4FMKWOPC.js.map} +1 -1
- package/dist/{chunk-CEWIMGYP.js → chunk-5LA5TY63.js} +4 -4
- package/dist/{chunk-CEWIMGYP.js.map → chunk-5LA5TY63.js.map} +1 -1
- package/dist/{chunk-E7LJ7F56.cjs → chunk-7456ZWIM.cjs} +5 -5
- package/dist/{chunk-E7LJ7F56.cjs.map → chunk-7456ZWIM.cjs.map} +1 -1
- package/dist/{chunk-6DDSP6ZE.js → chunk-7IKOVR4F.js} +5 -5
- package/dist/{chunk-6DDSP6ZE.js.map → chunk-7IKOVR4F.js.map} +1 -1
- package/dist/{chunk-B5LIMU4I.js → chunk-AYVJ4EXL.js} +3 -3
- package/dist/{chunk-B5LIMU4I.js.map → chunk-AYVJ4EXL.js.map} +1 -1
- package/dist/{chunk-VYVPUH6H.cjs → chunk-BF7IH4JU.cjs} +189 -35
- package/dist/chunk-BF7IH4JU.cjs.map +1 -0
- package/dist/{chunk-A2FSD2KN.cjs → chunk-BL7DAQXE.cjs} +7 -7
- package/dist/{chunk-A2FSD2KN.cjs.map → chunk-BL7DAQXE.cjs.map} +1 -1
- package/dist/{chunk-5M3CKUAS.cjs → chunk-BZUTYPXP.cjs} +185 -185
- package/dist/{chunk-5M3CKUAS.cjs.map → chunk-BZUTYPXP.cjs.map} +1 -1
- package/dist/{chunk-JYVH24UY.js → chunk-DBHNKGT2.js} +5 -5
- package/dist/{chunk-JYVH24UY.js.map → chunk-DBHNKGT2.js.map} +1 -1
- package/dist/{chunk-4LDFFARO.cjs → chunk-H3DHOME4.cjs} +6 -6
- package/dist/{chunk-4LDFFARO.cjs.map → chunk-H3DHOME4.cjs.map} +1 -1
- package/dist/{chunk-QOFOOVPM.js → chunk-IM6BRUQI.js} +9 -9
- package/dist/{chunk-QOFOOVPM.js.map → chunk-IM6BRUQI.js.map} +1 -1
- package/dist/{chunk-ULPWI6DN.cjs → chunk-INENOZKZ.cjs} +9 -9
- package/dist/{chunk-ULPWI6DN.cjs.map → chunk-INENOZKZ.cjs.map} +1 -1
- package/dist/{chunk-SMWXSQXP.cjs → chunk-JVL4ANDA.cjs} +19 -19
- package/dist/{chunk-SMWXSQXP.cjs.map → chunk-JVL4ANDA.cjs.map} +1 -1
- package/dist/{chunk-IKYWIQB2.cjs → chunk-JWE3L5J2.cjs} +20 -20
- package/dist/{chunk-IKYWIQB2.cjs.map → chunk-JWE3L5J2.cjs.map} +1 -1
- package/dist/{chunk-DJ2RXLO3.js → chunk-K7AE4BHR.js} +4 -4
- package/dist/{chunk-DJ2RXLO3.js.map → chunk-K7AE4BHR.js.map} +1 -1
- package/dist/{chunk-2OZQLYLM.cjs → chunk-KCRQQDEF.cjs} +176 -173
- package/dist/chunk-KCRQQDEF.cjs.map +1 -0
- package/dist/{chunk-QE7OKYS3.js → chunk-KRFGPA2H.js} +174 -36
- package/dist/chunk-KRFGPA2H.js.map +1 -0
- package/dist/{chunk-OJQCLQK7.cjs → chunk-LKZQG2ZZ.cjs} +13 -13
- package/dist/{chunk-OJQCLQK7.cjs.map → chunk-LKZQG2ZZ.cjs.map} +1 -1
- package/dist/{chunk-ERAZTMF6.js → chunk-MJF7NZEF.js} +437 -8
- package/dist/chunk-MJF7NZEF.js.map +1 -0
- package/dist/{chunk-RHQHBU6R.js → chunk-PMWMEK4T.js} +3 -3
- package/dist/{chunk-RHQHBU6R.js.map → chunk-PMWMEK4T.js.map} +1 -1
- package/dist/{chunk-CGDV5YUS.cjs → chunk-V2NQOABM.cjs} +455 -26
- package/dist/chunk-V2NQOABM.cjs.map +1 -0
- package/dist/{chunk-F77BL7Z7.js → chunk-W4I7AX2S.js} +4 -4
- package/dist/{chunk-F77BL7Z7.js.map → chunk-W4I7AX2S.js.map} +1 -1
- package/dist/{chunk-HJVPOP5S.js → chunk-W6QY3O3X.js} +4 -4
- package/dist/{chunk-HJVPOP5S.js.map → chunk-W6QY3O3X.js.map} +1 -1
- package/dist/{chunk-WINCOFML.js → chunk-WNI6ACXE.js} +3 -3
- package/dist/{chunk-WINCOFML.js.map → chunk-WNI6ACXE.js.map} +1 -1
- package/dist/{chunk-2RGBP3A3.cjs → chunk-XC6ZFHUA.cjs} +68 -68
- package/dist/{chunk-2RGBP3A3.cjs.map → chunk-XC6ZFHUA.cjs.map} +1 -1
- package/dist/{chunk-RIUDLIP3.cjs → chunk-XNWKYVLQ.cjs} +3 -3
- package/dist/{chunk-RIUDLIP3.cjs.map → chunk-XNWKYVLQ.cjs.map} +1 -1
- package/dist/{chunk-ATKRXBCX.cjs → chunk-XQRTJIC7.cjs} +9 -9
- package/dist/{chunk-ATKRXBCX.cjs.map → chunk-XQRTJIC7.cjs.map} +1 -1
- package/dist/{chunk-4QLIPOI7.cjs → chunk-XRW4AYLH.cjs} +82 -82
- package/dist/{chunk-4QLIPOI7.cjs.map → chunk-XRW4AYLH.cjs.map} +1 -1
- package/dist/{chunk-GIBIKVUG.js → chunk-YIBYKN6M.js} +7 -7
- package/dist/{chunk-GIBIKVUG.js.map → chunk-YIBYKN6M.js.map} +1 -1
- package/dist/datasets/index.cjs +17 -17
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +560 -496
- 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 +7 -7
- package/dist/harness/index.js +5 -5
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/llm/index.cjs +16 -16
- package/dist/llm/index.js +5 -5
- 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-THY3NOPF.cjs.map → models-dev-5X6CFNIO.cjs.map} +1 -1
- package/dist/models-dev-NFYFNV6D.js +3 -0
- package/dist/{models-dev-JGKQCSEN.js.map → models-dev-NFYFNV6D.js.map} +1 -1
- package/dist/netlify-EYSCS3HJ.js +3 -0
- package/dist/{netlify-6TILQFDV.js.map → netlify-EYSCS3HJ.js.map} +1 -1
- package/dist/netlify-MZJ7FN5B.cjs +12 -0
- package/dist/{netlify-NL6O2R7M.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/types/tracing.d.ts +2 -0
- 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/provider-registry-ODJKK7NU.js +3 -0
- package/dist/{provider-registry-CRD5YYZY.js.map → provider-registry-ODJKK7NU.js.map} +1 -1
- package/dist/provider-registry-YGVNXVGE.cjs +40 -0
- package/dist/{provider-registry-KXOHTVQF.cjs.map → provider-registry-YGVNXVGE.cjs.map} +1 -1
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/storage/constants.cjs +56 -56
- package/dist/storage/constants.js +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/scores.d.ts +1 -1
- package/dist/storage/domains/observability/scores.d.ts.map +1 -1
- package/dist/storage/index.cjs +334 -270
- package/dist/storage/index.js +3 -3
- 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/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/package.json +4 -4
- package/dist/chunk-2OZQLYLM.cjs.map +0 -1
- package/dist/chunk-CGDV5YUS.cjs.map +0 -1
- package/dist/chunk-ERAZTMF6.js.map +0 -1
- package/dist/chunk-QE7OKYS3.js.map +0 -1
- package/dist/chunk-T3TFXXGP.js.map +0 -1
- package/dist/chunk-VYVPUH6H.cjs.map +0 -1
- package/dist/models-dev-JGKQCSEN.js +0 -3
- package/dist/models-dev-THY3NOPF.cjs +0 -12
- package/dist/netlify-6TILQFDV.js +0 -3
- package/dist/netlify-NL6O2R7M.cjs +0 -12
- package/dist/provider-registry-CRD5YYZY.js +0 -3
- package/dist/provider-registry-KXOHTVQF.cjs +0 -40
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
var chunkZC4FJVJZ_cjs = require('./chunk-ZC4FJVJZ.cjs');
|
|
4
4
|
var chunkZCBG4ZQT_cjs = require('./chunk-ZCBG4ZQT.cjs');
|
|
5
5
|
var chunkGXXNF6NF_cjs = require('./chunk-GXXNF6NF.cjs');
|
|
6
|
-
var
|
|
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
18
|
var chunkAV4YSAZL_cjs = require('./chunk-AV4YSAZL.cjs');
|
|
19
19
|
var chunkXB4FLS7A_cjs = require('./chunk-XB4FLS7A.cjs');
|
|
@@ -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,
|
|
@@ -1769,7 +1769,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1769
1769
|
const processorSpan = currentSpan?.createChildSpan({
|
|
1770
1770
|
type: "processor_run" /* PROCESSOR_RUN */,
|
|
1771
1771
|
name: `input step processor: ${processor.id}`,
|
|
1772
|
-
entityType:
|
|
1772
|
+
entityType: chunkBF7IH4JU_cjs.EntityType.INPUT_STEP_PROCESSOR,
|
|
1773
1773
|
entityId: processor.id,
|
|
1774
1774
|
entityName: processor.name,
|
|
1775
1775
|
attributes: {
|
|
@@ -1800,7 +1800,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1800
1800
|
return nextMessageId;
|
|
1801
1801
|
}
|
|
1802
1802
|
} : {},
|
|
1803
|
-
...
|
|
1803
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: processorSpan }),
|
|
1804
1804
|
retryCount: args.retryCount ?? 0,
|
|
1805
1805
|
writer,
|
|
1806
1806
|
abortSignal: args.abortSignal
|
|
@@ -1895,7 +1895,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1895
1895
|
retryCount = 0,
|
|
1896
1896
|
writer
|
|
1897
1897
|
} = args;
|
|
1898
|
-
const observabilityContext =
|
|
1898
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(args);
|
|
1899
1899
|
for (const [index, processorOrWorkflow] of this.outputProcessors.entries()) {
|
|
1900
1900
|
const processableMessages = messageList.get.all.db();
|
|
1901
1901
|
const idsBeforeProcessing = processableMessages.map((m) => m.id);
|
|
@@ -1935,7 +1935,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1935
1935
|
const processorSpan = parentSpan?.createChildSpan({
|
|
1936
1936
|
type: "processor_run" /* PROCESSOR_RUN */,
|
|
1937
1937
|
name: `output step processor: ${processor.id}`,
|
|
1938
|
-
entityType:
|
|
1938
|
+
entityType: chunkBF7IH4JU_cjs.EntityType.OUTPUT_STEP_PROCESSOR,
|
|
1939
1939
|
entityId: processor.id,
|
|
1940
1940
|
entityName: processor.name,
|
|
1941
1941
|
attributes: {
|
|
@@ -1959,7 +1959,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1959
1959
|
steps,
|
|
1960
1960
|
state: processorState.customState,
|
|
1961
1961
|
abort,
|
|
1962
|
-
...
|
|
1962
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: processorSpan }),
|
|
1963
1963
|
requestContext,
|
|
1964
1964
|
retryCount,
|
|
1965
1965
|
writer
|
|
@@ -2073,7 +2073,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
2073
2073
|
}
|
|
2074
2074
|
const { model: _model, ...rest } = result;
|
|
2075
2075
|
if (result.model) {
|
|
2076
|
-
const resolvedModel = await
|
|
2076
|
+
const resolvedModel = await chunkXRW4AYLH_cjs.resolveModelConfig(result.model);
|
|
2077
2077
|
const isSupported = isSupportedLanguageModel(resolvedModel);
|
|
2078
2078
|
if (!isSupported) {
|
|
2079
2079
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
@@ -2818,7 +2818,7 @@ var MastraModelOutput = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
2818
2818
|
this.#transportRef = options.transportRef;
|
|
2819
2819
|
this.#returnScorerData = !!options.returnScorerData;
|
|
2820
2820
|
this.runId = options.runId;
|
|
2821
|
-
const resultSpan =
|
|
2821
|
+
const resultSpan = chunkBF7IH4JU_cjs.getRootExportSpan(options.tracingContext?.currentSpan);
|
|
2822
2822
|
this.traceId = resultSpan?.externalTraceId;
|
|
2823
2823
|
this.spanId = resultSpan?.id;
|
|
2824
2824
|
this.#model = _model;
|
|
@@ -2880,7 +2880,7 @@ var MastraModelOutput = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
2880
2880
|
} = await processorRunner.processPart(
|
|
2881
2881
|
chunk,
|
|
2882
2882
|
processorStates,
|
|
2883
|
-
|
|
2883
|
+
chunkBF7IH4JU_cjs.resolveObservabilityContext(options),
|
|
2884
2884
|
options.requestContext,
|
|
2885
2885
|
self.messageList,
|
|
2886
2886
|
0,
|
|
@@ -3272,7 +3272,7 @@ var MastraModelOutput = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
3272
3272
|
};
|
|
3273
3273
|
self.messageList = await self.processorRunner.runOutputProcessors(
|
|
3274
3274
|
self.messageList,
|
|
3275
|
-
|
|
3275
|
+
chunkBF7IH4JU_cjs.resolveObservabilityContext(options),
|
|
3276
3276
|
self.#options.requestContext,
|
|
3277
3277
|
0,
|
|
3278
3278
|
outputResultWriter,
|
|
@@ -4847,7 +4847,7 @@ var getModelOutputForTripwire = async ({
|
|
|
4847
4847
|
messageList,
|
|
4848
4848
|
...rest
|
|
4849
4849
|
}) => {
|
|
4850
|
-
const observabilityContext =
|
|
4850
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
4851
4851
|
const tripwireStream = new web.ReadableStream({
|
|
4852
4852
|
start(controller) {
|
|
4853
4853
|
controller.enqueue({
|
|
@@ -5499,7 +5499,7 @@ var createTimeTravelExecutionParams = (params) => {
|
|
|
5499
5499
|
result = void 0;
|
|
5500
5500
|
}
|
|
5501
5501
|
if (result) {
|
|
5502
|
-
const formattedResult =
|
|
5502
|
+
const formattedResult = chunkXQRTJIC7_cjs.removeUndefinedValues(result);
|
|
5503
5503
|
stepResults[stepId] = formattedResult;
|
|
5504
5504
|
}
|
|
5505
5505
|
});
|
|
@@ -5591,7 +5591,7 @@ async function executeParallel(engine, params) {
|
|
|
5591
5591
|
perStep,
|
|
5592
5592
|
...rest
|
|
5593
5593
|
} = params;
|
|
5594
|
-
const observabilityContext =
|
|
5594
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
5595
5595
|
const parallelSpan = await engine.createChildSpan({
|
|
5596
5596
|
parentSpan: observabilityContext.tracingContext.currentSpan,
|
|
5597
5597
|
operationId: `workflow.${workflowId}.run.${runId}.parallel.${executionContext.executionPath.join("-")}.span.start`,
|
|
@@ -5669,7 +5669,7 @@ async function executeParallel(engine, params) {
|
|
|
5669
5669
|
state: executionContext.state,
|
|
5670
5670
|
tracingIds: executionContext.tracingIds
|
|
5671
5671
|
},
|
|
5672
|
-
...
|
|
5672
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: parallelSpan }),
|
|
5673
5673
|
pubsub,
|
|
5674
5674
|
abortController,
|
|
5675
5675
|
requestContext,
|
|
@@ -5745,7 +5745,7 @@ async function executeConditional(engine, params) {
|
|
|
5745
5745
|
perStep,
|
|
5746
5746
|
...rest
|
|
5747
5747
|
} = params;
|
|
5748
|
-
const observabilityContext =
|
|
5748
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
5749
5749
|
const conditionalSpan = await engine.createChildSpan({
|
|
5750
5750
|
parentSpan: observabilityContext.tracingContext.currentSpan,
|
|
5751
5751
|
operationId: `workflow.${workflowId}.run.${runId}.conditional.${executionContext.executionPath.join("-")}.span.start`,
|
|
@@ -5787,7 +5787,7 @@ async function executeConditional(engine, params) {
|
|
|
5787
5787
|
inputData: prevOutput,
|
|
5788
5788
|
state: executionContext.state,
|
|
5789
5789
|
retryCount: -1,
|
|
5790
|
-
...
|
|
5790
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: evalSpan }),
|
|
5791
5791
|
getInitData: () => stepResults?.input,
|
|
5792
5792
|
getStepResult: getStepResult.bind(null, stepResults),
|
|
5793
5793
|
bail: (() => {
|
|
@@ -5908,7 +5908,7 @@ async function executeConditional(engine, params) {
|
|
|
5908
5908
|
state: executionContext.state,
|
|
5909
5909
|
tracingIds: executionContext.tracingIds
|
|
5910
5910
|
},
|
|
5911
|
-
...
|
|
5911
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: conditionalSpan }),
|
|
5912
5912
|
pubsub,
|
|
5913
5913
|
abortController,
|
|
5914
5914
|
requestContext,
|
|
@@ -5985,7 +5985,7 @@ async function executeLoop(engine, params) {
|
|
|
5985
5985
|
perStep,
|
|
5986
5986
|
...rest
|
|
5987
5987
|
} = params;
|
|
5988
|
-
const observabilityContext =
|
|
5988
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
5989
5989
|
const { step, condition } = entry;
|
|
5990
5990
|
const loopSpan = await engine.createChildSpan({
|
|
5991
5991
|
parentSpan: observabilityContext.tracingContext.currentSpan,
|
|
@@ -6021,7 +6021,7 @@ async function executeLoop(engine, params) {
|
|
|
6021
6021
|
resume: currentResume,
|
|
6022
6022
|
timeTravel: currentTimeTravel,
|
|
6023
6023
|
prevOutput: result.output,
|
|
6024
|
-
...
|
|
6024
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: loopSpan }),
|
|
6025
6025
|
pubsub,
|
|
6026
6026
|
abortController,
|
|
6027
6027
|
requestContext,
|
|
@@ -6057,7 +6057,7 @@ async function executeLoop(engine, params) {
|
|
|
6057
6057
|
options: {
|
|
6058
6058
|
type: "workflow_conditional_eval" /* WORKFLOW_CONDITIONAL_EVAL */,
|
|
6059
6059
|
name: `condition: '${entry.loopType}'`,
|
|
6060
|
-
input:
|
|
6060
|
+
input: chunkXQRTJIC7_cjs.selectFields(result.output, ["stepResult", "output.text", "output.object", "messages"]),
|
|
6061
6061
|
attributes: {
|
|
6062
6062
|
conditionIndex: iteration
|
|
6063
6063
|
},
|
|
@@ -6075,7 +6075,7 @@ async function executeLoop(engine, params) {
|
|
|
6075
6075
|
inputData: result.output,
|
|
6076
6076
|
state: executionContext.state,
|
|
6077
6077
|
retryCount: -1,
|
|
6078
|
-
...
|
|
6078
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: evalSpan }),
|
|
6079
6079
|
iterationCount: iteration + 1,
|
|
6080
6080
|
getInitData: () => stepResults?.input,
|
|
6081
6081
|
getStepResult: getStepResult.bind(null, stepResults),
|
|
@@ -6147,7 +6147,7 @@ async function executeForeach(engine, params) {
|
|
|
6147
6147
|
perStep,
|
|
6148
6148
|
...rest
|
|
6149
6149
|
} = params;
|
|
6150
|
-
const observabilityContext =
|
|
6150
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
6151
6151
|
const { step, opts } = entry;
|
|
6152
6152
|
const results = [];
|
|
6153
6153
|
const concurrency = opts.concurrency;
|
|
@@ -6223,7 +6223,7 @@ async function executeForeach(engine, params) {
|
|
|
6223
6223
|
executionContext: { ...executionContext, foreachIndex: k },
|
|
6224
6224
|
resume: resumeToUse,
|
|
6225
6225
|
prevOutput: item,
|
|
6226
|
-
...
|
|
6226
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: loopSpan }),
|
|
6227
6227
|
pubsub,
|
|
6228
6228
|
abortController,
|
|
6229
6229
|
requestContext,
|
|
@@ -6510,7 +6510,7 @@ async function executeEntry(engine, params) {
|
|
|
6510
6510
|
perStep,
|
|
6511
6511
|
...rest
|
|
6512
6512
|
} = params;
|
|
6513
|
-
const observabilityContext =
|
|
6513
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
6514
6514
|
const prevOutput = engine.getStepOutput(stepResults, prevStep);
|
|
6515
6515
|
let execResults;
|
|
6516
6516
|
let entryRequestContext;
|
|
@@ -6979,7 +6979,7 @@ async function executeSleep(engine, params) {
|
|
|
6979
6979
|
outputWriter,
|
|
6980
6980
|
...rest
|
|
6981
6981
|
} = params;
|
|
6982
|
-
const observabilityContext =
|
|
6982
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
6983
6983
|
let { duration, fn } = entry;
|
|
6984
6984
|
const sleepSpan = await engine.createChildSpan({
|
|
6985
6985
|
parentSpan: observabilityContext.tracingContext.currentSpan,
|
|
@@ -7008,7 +7008,7 @@ async function executeSleep(engine, params) {
|
|
|
7008
7008
|
executionContext.state = state;
|
|
7009
7009
|
},
|
|
7010
7010
|
retryCount: -1,
|
|
7011
|
-
...
|
|
7011
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: sleepSpan }),
|
|
7012
7012
|
getInitData: () => stepResults?.input,
|
|
7013
7013
|
getStepResult: getStepResult.bind(null, stepResults),
|
|
7014
7014
|
// TODO: this function shouldn't have suspend probably?
|
|
@@ -7069,7 +7069,7 @@ async function executeSleepUntil(engine, params) {
|
|
|
7069
7069
|
outputWriter,
|
|
7070
7070
|
...rest
|
|
7071
7071
|
} = params;
|
|
7072
|
-
const observabilityContext =
|
|
7072
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
7073
7073
|
let { date, fn } = entry;
|
|
7074
7074
|
const sleepUntilSpan = await engine.createChildSpan({
|
|
7075
7075
|
parentSpan: observabilityContext.tracingContext.currentSpan,
|
|
@@ -7099,7 +7099,7 @@ async function executeSleepUntil(engine, params) {
|
|
|
7099
7099
|
executionContext.state = state;
|
|
7100
7100
|
},
|
|
7101
7101
|
retryCount: -1,
|
|
7102
|
-
...
|
|
7102
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: sleepUntilSpan }),
|
|
7103
7103
|
getInitData: () => stepResults?.input,
|
|
7104
7104
|
getStepResult: getStepResult.bind(null, stepResults),
|
|
7105
7105
|
// TODO: this function shouldn't have suspend probably?
|
|
@@ -7178,7 +7178,7 @@ async function executeStep(engine, params) {
|
|
|
7178
7178
|
perStep,
|
|
7179
7179
|
...rest
|
|
7180
7180
|
} = params;
|
|
7181
|
-
const observabilityContext =
|
|
7181
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
7182
7182
|
const stepCallId = crypto2.randomUUID();
|
|
7183
7183
|
const { inputData, validationError: inputValidationError } = await validateStepInput({
|
|
7184
7184
|
prevOutput,
|
|
@@ -7229,7 +7229,7 @@ async function executeStep(engine, params) {
|
|
|
7229
7229
|
options: {
|
|
7230
7230
|
name: `workflow step: '${step.id}'`,
|
|
7231
7231
|
type: "workflow_step" /* WORKFLOW_STEP */,
|
|
7232
|
-
entityType:
|
|
7232
|
+
entityType: chunkBF7IH4JU_cjs.EntityType.WORKFLOW_STEP,
|
|
7233
7233
|
entityId: step.id,
|
|
7234
7234
|
input: inputData,
|
|
7235
7235
|
tracingPolicy: engine.options?.tracingPolicy,
|
|
@@ -7317,7 +7317,7 @@ async function executeStep(engine, params) {
|
|
|
7317
7317
|
deprecationMessage: runCountDeprecationMessage,
|
|
7318
7318
|
logger: engine.getLogger()
|
|
7319
7319
|
});
|
|
7320
|
-
return
|
|
7320
|
+
return chunkBF7IH4JU_cjs.executeWithContext({ span: stepSpan, fn: () => step.execute(proxiedData) });
|
|
7321
7321
|
};
|
|
7322
7322
|
let execResults;
|
|
7323
7323
|
const retries = step.retries ?? executionContext.retryConfig.attempts ?? 0;
|
|
@@ -7342,7 +7342,7 @@ async function executeStep(engine, params) {
|
|
|
7342
7342
|
requestContextUpdate: null
|
|
7343
7343
|
};
|
|
7344
7344
|
const isNestedWorkflow = step.component === "WORKFLOW";
|
|
7345
|
-
const mastraForStep = engine.mastra ? isNestedWorkflow ? engine.mastra :
|
|
7345
|
+
const mastraForStep = engine.mastra ? isNestedWorkflow ? engine.mastra : chunkBF7IH4JU_cjs.wrapMastra(engine.mastra, { currentSpan: stepSpan }) : void 0;
|
|
7346
7346
|
const output = await runStep({
|
|
7347
7347
|
runId,
|
|
7348
7348
|
resourceId,
|
|
@@ -7365,7 +7365,7 @@ async function executeStep(engine, params) {
|
|
|
7365
7365
|
retryCount,
|
|
7366
7366
|
resumeData: resumeDataToUse,
|
|
7367
7367
|
suspendData: suspendDataToUse,
|
|
7368
|
-
...
|
|
7368
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: stepSpan }),
|
|
7369
7369
|
getInitData: () => stepResults?.input,
|
|
7370
7370
|
getStepResult: getStepResult.bind(null, stepResults),
|
|
7371
7371
|
suspend: async (suspendPayload, suspendOptions) => {
|
|
@@ -7467,7 +7467,7 @@ async function executeStep(engine, params) {
|
|
|
7467
7467
|
stepId: step.id,
|
|
7468
7468
|
requestContext,
|
|
7469
7469
|
disableScorers,
|
|
7470
|
-
...
|
|
7470
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: stepSpan })
|
|
7471
7471
|
});
|
|
7472
7472
|
}
|
|
7473
7473
|
if (durableResult.suspended) {
|
|
@@ -7523,7 +7523,7 @@ async function executeStep(engine, params) {
|
|
|
7523
7523
|
}
|
|
7524
7524
|
async function runScorersForStep(params) {
|
|
7525
7525
|
const { engine, scorers, runId, input, output, workflowId, stepId, requestContext, disableScorers, ...rest } = params;
|
|
7526
|
-
const observabilityContext =
|
|
7526
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
7527
7527
|
let scorersToUse = scorers;
|
|
7528
7528
|
if (typeof scorersToUse === "function") {
|
|
7529
7529
|
try {
|
|
@@ -8096,7 +8096,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
8096
8096
|
resume,
|
|
8097
8097
|
timeTravel,
|
|
8098
8098
|
restart,
|
|
8099
|
-
...
|
|
8099
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: workflowSpan }),
|
|
8100
8100
|
abortController: params.abortController,
|
|
8101
8101
|
pubsub: params.pubsub,
|
|
8102
8102
|
requestContext: currentRequestContext,
|
|
@@ -8392,7 +8392,7 @@ function createStepFromAgent(params, agentOrToolOptions) {
|
|
|
8392
8392
|
writer,
|
|
8393
8393
|
...rest
|
|
8394
8394
|
}) => {
|
|
8395
|
-
const observabilityContext =
|
|
8395
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
8396
8396
|
let streamPromise = {};
|
|
8397
8397
|
streamPromise.promise = new Promise((resolve2, reject) => {
|
|
8398
8398
|
streamPromise.resolve = resolve2;
|
|
@@ -8520,7 +8520,7 @@ function createStepFromTool(params, toolOpts) {
|
|
|
8520
8520
|
setState,
|
|
8521
8521
|
...rest
|
|
8522
8522
|
}) => {
|
|
8523
|
-
const observabilityContext =
|
|
8523
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
8524
8524
|
const toolContext = {
|
|
8525
8525
|
mastra,
|
|
8526
8526
|
requestContext,
|
|
@@ -8544,16 +8544,16 @@ function createStepFromProcessor(processor) {
|
|
|
8544
8544
|
const getProcessorEntityType = (phase) => {
|
|
8545
8545
|
switch (phase) {
|
|
8546
8546
|
case "input":
|
|
8547
|
-
return
|
|
8547
|
+
return chunkBF7IH4JU_cjs.EntityType.INPUT_PROCESSOR;
|
|
8548
8548
|
case "inputStep":
|
|
8549
|
-
return
|
|
8549
|
+
return chunkBF7IH4JU_cjs.EntityType.INPUT_STEP_PROCESSOR;
|
|
8550
8550
|
case "outputStream":
|
|
8551
8551
|
case "outputResult":
|
|
8552
|
-
return
|
|
8552
|
+
return chunkBF7IH4JU_cjs.EntityType.OUTPUT_PROCESSOR;
|
|
8553
8553
|
case "outputStep":
|
|
8554
|
-
return
|
|
8554
|
+
return chunkBF7IH4JU_cjs.EntityType.OUTPUT_STEP_PROCESSOR;
|
|
8555
8555
|
default:
|
|
8556
|
-
return
|
|
8556
|
+
return chunkBF7IH4JU_cjs.EntityType.OUTPUT_PROCESSOR;
|
|
8557
8557
|
}
|
|
8558
8558
|
};
|
|
8559
8559
|
const getSpanNamePrefix = (phase) => {
|
|
@@ -8651,7 +8651,7 @@ function createStepFromProcessor(processor) {
|
|
|
8651
8651
|
processorIndex: processor.processorIndex
|
|
8652
8652
|
}
|
|
8653
8653
|
}) : void 0;
|
|
8654
|
-
const processorObservabilityContext =
|
|
8654
|
+
const processorObservabilityContext = chunkBF7IH4JU_cjs.createObservabilityContext(
|
|
8655
8655
|
processorSpan ? { currentSpan: processorSpan } : tracingContext
|
|
8656
8656
|
);
|
|
8657
8657
|
const processorWriter = outputWriter ? {
|
|
@@ -8709,7 +8709,7 @@ function createStepFromProcessor(processor) {
|
|
|
8709
8709
|
};
|
|
8710
8710
|
const executePhaseWithSpan = async (fn) => {
|
|
8711
8711
|
try {
|
|
8712
|
-
const result = await
|
|
8712
|
+
const result = await chunkBF7IH4JU_cjs.executeWithContext({ span: processorSpan, fn });
|
|
8713
8713
|
processorSpan?.end({ output: result });
|
|
8714
8714
|
return result;
|
|
8715
8715
|
} catch (error) {
|
|
@@ -8853,7 +8853,7 @@ function createStepFromProcessor(processor) {
|
|
|
8853
8853
|
processorSpan2 = parentSpan.createChildSpan({
|
|
8854
8854
|
type: "processor_run" /* PROCESSOR_RUN */,
|
|
8855
8855
|
name: `output stream processor: ${processor.id}`,
|
|
8856
|
-
entityType:
|
|
8856
|
+
entityType: chunkBF7IH4JU_cjs.EntityType.OUTPUT_PROCESSOR,
|
|
8857
8857
|
entityId: processor.id,
|
|
8858
8858
|
entityName: processor.name ?? processor.id,
|
|
8859
8859
|
input: { phase, totalChunks: 0 },
|
|
@@ -8870,7 +8870,7 @@ function createStepFromProcessor(processor) {
|
|
|
8870
8870
|
totalChunks: (streamParts ?? []).length
|
|
8871
8871
|
};
|
|
8872
8872
|
}
|
|
8873
|
-
const processorObservabilityContext2 =
|
|
8873
|
+
const processorObservabilityContext2 = chunkBF7IH4JU_cjs.createObservabilityContext(
|
|
8874
8874
|
processorSpan2 ? { currentSpan: processorSpan2 } : baseContext.tracingContext
|
|
8875
8875
|
);
|
|
8876
8876
|
let result;
|
|
@@ -9616,7 +9616,7 @@ var Workflow = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
9616
9616
|
bail: _bail,
|
|
9617
9617
|
...rest
|
|
9618
9618
|
}) {
|
|
9619
|
-
const observabilityContext =
|
|
9619
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
9620
9620
|
this.__registerMastra(mastra);
|
|
9621
9621
|
const effectiveValidateInputs = validateInputs ?? this.#options.validateInputs ?? true;
|
|
9622
9622
|
this.#options = {
|
|
@@ -10114,11 +10114,11 @@ var Run = class {
|
|
|
10114
10114
|
perStep,
|
|
10115
10115
|
...rest
|
|
10116
10116
|
}) {
|
|
10117
|
-
const observabilityContext =
|
|
10118
|
-
const workflowSpan =
|
|
10117
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
10118
|
+
const workflowSpan = chunkBF7IH4JU_cjs.getOrCreateSpan({
|
|
10119
10119
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
10120
10120
|
name: `workflow run: '${this.workflowId}'`,
|
|
10121
|
-
entityType:
|
|
10121
|
+
entityType: chunkBF7IH4JU_cjs.EntityType.WORKFLOW_RUN,
|
|
10122
10122
|
entityId: this.workflowId,
|
|
10123
10123
|
input: inputData,
|
|
10124
10124
|
metadata: {
|
|
@@ -10195,7 +10195,7 @@ var Run = class {
|
|
|
10195
10195
|
tracingOptions,
|
|
10196
10196
|
...rest
|
|
10197
10197
|
} = {}) {
|
|
10198
|
-
const observabilityContext =
|
|
10198
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
10199
10199
|
if (this.closeStreamAction) {
|
|
10200
10200
|
return {
|
|
10201
10201
|
stream: this.observeStreamLegacy().stream,
|
|
@@ -10320,7 +10320,7 @@ var Run = class {
|
|
|
10320
10320
|
perStep,
|
|
10321
10321
|
...rest
|
|
10322
10322
|
}) {
|
|
10323
|
-
const observabilityContext =
|
|
10323
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
10324
10324
|
if (this.closeStreamAction && this.streamOutput) {
|
|
10325
10325
|
return this.streamOutput;
|
|
10326
10326
|
}
|
|
@@ -10421,7 +10421,7 @@ var Run = class {
|
|
|
10421
10421
|
perStep,
|
|
10422
10422
|
...rest
|
|
10423
10423
|
} = {}) {
|
|
10424
|
-
const observabilityContext =
|
|
10424
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
10425
10425
|
this.closeStreamAction = async () => {
|
|
10426
10426
|
};
|
|
10427
10427
|
const self = this;
|
|
@@ -10550,7 +10550,7 @@ var Run = class {
|
|
|
10550
10550
|
return this._restart(args);
|
|
10551
10551
|
}
|
|
10552
10552
|
async _resume(params) {
|
|
10553
|
-
const observabilityContext =
|
|
10553
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(params);
|
|
10554
10554
|
const workflowsStore = await this.#mastra?.getStorage()?.getStore("workflows");
|
|
10555
10555
|
const snapshot = await workflowsStore?.loadWorkflowSnapshot({
|
|
10556
10556
|
workflowName: this.workflowId,
|
|
@@ -10634,10 +10634,10 @@ var Run = class {
|
|
|
10634
10634
|
traceId: effectiveTraceId,
|
|
10635
10635
|
parentSpanId: shouldUsePersistedParentSpan ? persistedTracingContext?.spanId : params.tracingOptions?.parentSpanId
|
|
10636
10636
|
};
|
|
10637
|
-
const workflowSpan =
|
|
10637
|
+
const workflowSpan = chunkBF7IH4JU_cjs.getOrCreateSpan({
|
|
10638
10638
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
10639
10639
|
name: `workflow run: '${this.workflowId}' (resumed)`,
|
|
10640
|
-
entityType:
|
|
10640
|
+
entityType: chunkBF7IH4JU_cjs.EntityType.WORKFLOW_RUN,
|
|
10641
10641
|
entityId: this.workflowId,
|
|
10642
10642
|
input: resumeDataToUse,
|
|
10643
10643
|
metadata: {
|
|
@@ -10701,7 +10701,7 @@ var Run = class {
|
|
|
10701
10701
|
tracingOptions,
|
|
10702
10702
|
...rest
|
|
10703
10703
|
}) {
|
|
10704
|
-
const observabilityContext =
|
|
10704
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
10705
10705
|
if (this.workflowEngineType !== "default") {
|
|
10706
10706
|
throw new Error(`restart() is not supported on ${this.workflowEngineType} workflows`);
|
|
10707
10707
|
}
|
|
@@ -10753,10 +10753,10 @@ var Run = class {
|
|
|
10753
10753
|
requestContextToUse.set(key, value);
|
|
10754
10754
|
}
|
|
10755
10755
|
}
|
|
10756
|
-
const workflowSpan =
|
|
10756
|
+
const workflowSpan = chunkBF7IH4JU_cjs.getOrCreateSpan({
|
|
10757
10757
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
10758
10758
|
name: `workflow run: '${this.workflowId}'`,
|
|
10759
|
-
entityType:
|
|
10759
|
+
entityType: chunkBF7IH4JU_cjs.EntityType.WORKFLOW_RUN,
|
|
10760
10760
|
entityId: this.workflowId,
|
|
10761
10761
|
metadata: {
|
|
10762
10762
|
resourceId: this.resourceId,
|
|
@@ -10806,7 +10806,7 @@ var Run = class {
|
|
|
10806
10806
|
perStep,
|
|
10807
10807
|
...rest
|
|
10808
10808
|
}) {
|
|
10809
|
-
const observabilityContext =
|
|
10809
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
10810
10810
|
if (!stepParam || Array.isArray(stepParam) && stepParam.length === 0) {
|
|
10811
10811
|
throw new Error("Step is required and must be a valid step or array of steps");
|
|
10812
10812
|
}
|
|
@@ -10850,11 +10850,11 @@ var Run = class {
|
|
|
10850
10850
|
requestContextToUse.set(key, value);
|
|
10851
10851
|
}
|
|
10852
10852
|
}
|
|
10853
|
-
const workflowSpan =
|
|
10853
|
+
const workflowSpan = chunkBF7IH4JU_cjs.getOrCreateSpan({
|
|
10854
10854
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
10855
10855
|
name: `workflow run: '${this.workflowId}'`,
|
|
10856
10856
|
input: inputData,
|
|
10857
|
-
entityType:
|
|
10857
|
+
entityType: chunkBF7IH4JU_cjs.EntityType.WORKFLOW_RUN,
|
|
10858
10858
|
entityId: this.workflowId,
|
|
10859
10859
|
metadata: {
|
|
10860
10860
|
resourceId: this.resourceId,
|
|
@@ -10908,7 +10908,7 @@ var Run = class {
|
|
|
10908
10908
|
perStep,
|
|
10909
10909
|
...rest
|
|
10910
10910
|
}) {
|
|
10911
|
-
const observabilityContext =
|
|
10911
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
10912
10912
|
this.closeStreamAction = async () => {
|
|
10913
10913
|
};
|
|
10914
10914
|
const self = this;
|
|
@@ -11214,7 +11214,7 @@ var MastraScorer = class _MastraScorer {
|
|
|
11214
11214
|
}
|
|
11215
11215
|
});
|
|
11216
11216
|
}
|
|
11217
|
-
const observabilityContext =
|
|
11217
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(input);
|
|
11218
11218
|
let runId = input.runId;
|
|
11219
11219
|
if (!runId) {
|
|
11220
11220
|
runId = crypto2.randomUUID();
|
|
@@ -11267,7 +11267,7 @@ var MastraScorer = class _MastraScorer {
|
|
|
11267
11267
|
inputSchema: v4.z.any(),
|
|
11268
11268
|
outputSchema: v4.z.any(),
|
|
11269
11269
|
execute: async ({ inputData, getInitData, ...rest }) => {
|
|
11270
|
-
const observabilityContext =
|
|
11270
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
11271
11271
|
const { accumulatedResults = {}, generatedPrompts = {} } = inputData;
|
|
11272
11272
|
const { run } = getInitData();
|
|
11273
11273
|
const context = this.createScorerContext(scorerStep.name, run, accumulatedResults);
|
|
@@ -11358,7 +11358,7 @@ var MastraScorer = class _MastraScorer {
|
|
|
11358
11358
|
}
|
|
11359
11359
|
});
|
|
11360
11360
|
}
|
|
11361
|
-
const resolvedModel = await
|
|
11361
|
+
const resolvedModel = await chunkXRW4AYLH_cjs.resolveModelConfig(modelConfig, void 0, this.#mastra);
|
|
11362
11362
|
const judge = new Agent({
|
|
11363
11363
|
id: "judge",
|
|
11364
11364
|
name: "judge",
|
|
@@ -12786,7 +12786,7 @@ function createLLMExecutionStep({
|
|
|
12786
12786
|
const processInputStepResult = await processorRunner.runProcessInputStep({
|
|
12787
12787
|
messageList,
|
|
12788
12788
|
stepNumber: inputData.output?.steps?.length || 0,
|
|
12789
|
-
...
|
|
12789
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext(stepTracingContext),
|
|
12790
12790
|
requestContext,
|
|
12791
12791
|
model,
|
|
12792
12792
|
steps: inputData.output?.steps || [],
|
|
@@ -12840,7 +12840,7 @@ function createLLMExecutionStep({
|
|
|
12840
12840
|
const convertedTools = {};
|
|
12841
12841
|
for (const [name, tool2] of Object.entries(currentStep.tools)) {
|
|
12842
12842
|
if (chunkAV4YSAZL_cjs.isMastraTool(tool2)) {
|
|
12843
|
-
convertedTools[name] =
|
|
12843
|
+
convertedTools[name] = chunkXQRTJIC7_cjs.makeCoreTool(
|
|
12844
12844
|
tool2,
|
|
12845
12845
|
{
|
|
12846
12846
|
name,
|
|
@@ -12977,7 +12977,7 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
|
|
|
12977
12977
|
}
|
|
12978
12978
|
}
|
|
12979
12979
|
if (isSupportedLanguageModel(currentStep.model)) {
|
|
12980
|
-
modelResult =
|
|
12980
|
+
modelResult = chunkBF7IH4JU_cjs.executeWithContextSync({
|
|
12981
12981
|
span: modelSpanTracker?.getTracingContext()?.currentSpan,
|
|
12982
12982
|
fn: () => execute({
|
|
12983
12983
|
runId,
|
|
@@ -13047,7 +13047,7 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
|
|
|
13047
13047
|
}
|
|
13048
13048
|
});
|
|
13049
13049
|
let transportResolver;
|
|
13050
|
-
if (currentStep.model instanceof
|
|
13050
|
+
if (currentStep.model instanceof chunkXRW4AYLH_cjs.ModelRouterLanguageModel) {
|
|
13051
13051
|
const routerModel = currentStep.model;
|
|
13052
13052
|
transportResolver = () => routerModel._getStreamTransport();
|
|
13053
13053
|
}
|
|
@@ -13210,7 +13210,7 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
|
|
|
13210
13210
|
finishReason: immediateFinishReason,
|
|
13211
13211
|
toolCalls: toolCallInfos.length > 0 ? toolCallInfos : void 0,
|
|
13212
13212
|
text: immediateText,
|
|
13213
|
-
...
|
|
13213
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext(outputStepTracingContext),
|
|
13214
13214
|
requestContext,
|
|
13215
13215
|
retryCount: currentRetryCount,
|
|
13216
13216
|
writer: processorWriter
|
|
@@ -13325,7 +13325,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13325
13325
|
agentName: "LLMMappingStep",
|
|
13326
13326
|
processorStates: rest.processorStates
|
|
13327
13327
|
}) : void 0;
|
|
13328
|
-
const observabilityContext =
|
|
13328
|
+
const observabilityContext = chunkBF7IH4JU_cjs.createObservabilityContext(rest.modelSpanTracker?.getTracingContext());
|
|
13329
13329
|
const streamWriter = rest.outputWriter ? { custom: async (data) => rest.outputWriter(data) } : void 0;
|
|
13330
13330
|
async function processAndEnqueueChunk(chunk) {
|
|
13331
13331
|
if (processorRunner && rest.processorStates) {
|
|
@@ -14400,12 +14400,12 @@ function workflowLoopStream({
|
|
|
14400
14400
|
}
|
|
14401
14401
|
const executionResult = resumeContext ? await run.resume({
|
|
14402
14402
|
resumeData: resumeContext.resumeData,
|
|
14403
|
-
...
|
|
14403
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext(rest.modelSpanTracker?.getTracingContext()),
|
|
14404
14404
|
requestContext,
|
|
14405
14405
|
label: toolCallId
|
|
14406
14406
|
}) : await run.start({
|
|
14407
14407
|
inputData: initialData,
|
|
14408
|
-
...
|
|
14408
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext(rest.modelSpanTracker?.getTracingContext()),
|
|
14409
14409
|
requestContext
|
|
14410
14410
|
});
|
|
14411
14411
|
if (executionResult.status !== "success") {
|
|
@@ -14549,7 +14549,7 @@ function loop({
|
|
|
14549
14549
|
}
|
|
14550
14550
|
const baseStream = workflowLoopStream(workflowLoopProps);
|
|
14551
14551
|
const stream = rest.modelSpanTracker?.wrapStream(baseStream) ?? baseStream;
|
|
14552
|
-
const observabilityContext =
|
|
14552
|
+
const observabilityContext = chunkBF7IH4JU_cjs.createObservabilityContext(rest.modelSpanTracker?.getTracingContext());
|
|
14553
14553
|
modelOutput = new MastraModelOutput({
|
|
14554
14554
|
model: {
|
|
14555
14555
|
modelId: firstModel.model.modelId,
|
|
@@ -14682,7 +14682,7 @@ var MastraLLMVNext = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
14682
14682
|
workspace,
|
|
14683
14683
|
...rest
|
|
14684
14684
|
}) {
|
|
14685
|
-
const observabilityContext =
|
|
14685
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
14686
14686
|
let stopWhenToUse;
|
|
14687
14687
|
if (maxSteps && typeof maxSteps === "number") {
|
|
14688
14688
|
stopWhenToUse = chunkY3APFUXZ_cjs.stepCountIs(maxSteps);
|
|
@@ -14794,7 +14794,7 @@ var MastraLLMVNext = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
14794
14794
|
const remainingTokens = parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"] ?? "", 10);
|
|
14795
14795
|
if (!isNaN(remainingTokens) && remainingTokens > 0 && remainingTokens < 2e3) {
|
|
14796
14796
|
this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
|
|
14797
|
-
await
|
|
14797
|
+
await chunkXQRTJIC7_cjs.delay(10 * 1e3);
|
|
14798
14798
|
}
|
|
14799
14799
|
},
|
|
14800
14800
|
onFinish: async (props) => {
|
|
@@ -15032,7 +15032,7 @@ async function prepareMemoryStep({
|
|
|
15032
15032
|
memoryConfig,
|
|
15033
15033
|
...rest
|
|
15034
15034
|
}) {
|
|
15035
|
-
const observabilityContext =
|
|
15035
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
15036
15036
|
const memory = await routingAgent.getMemory({ requestContext });
|
|
15037
15037
|
let thread = await memory?.getThreadById({ threadId });
|
|
15038
15038
|
if (!thread) {
|
|
@@ -15134,7 +15134,7 @@ async function saveMessagesWithProcessors(memory, messages, processorRunner, con
|
|
|
15134
15134
|
const { requestContext, ...observabilityContext } = context ?? {};
|
|
15135
15135
|
await processorRunner.runOutputProcessors(
|
|
15136
15136
|
messageList,
|
|
15137
|
-
|
|
15137
|
+
chunkBF7IH4JU_cjs.resolveObservabilityContext(observabilityContext),
|
|
15138
15138
|
requestContext
|
|
15139
15139
|
);
|
|
15140
15140
|
const processedMessages = messageList.get.response.db();
|
|
@@ -16285,7 +16285,7 @@ async function createNetworkLoop({
|
|
|
16285
16285
|
memory,
|
|
16286
16286
|
context: inputDataToUse,
|
|
16287
16287
|
// TODO: Pass proper tracing context when network supports tracing
|
|
16288
|
-
...
|
|
16288
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: void 0 }),
|
|
16289
16289
|
writer
|
|
16290
16290
|
},
|
|
16291
16291
|
{ toolCallId, messages: [] }
|
|
@@ -16573,7 +16573,7 @@ async function networkLoop({
|
|
|
16573
16573
|
requestContext,
|
|
16574
16574
|
messageList,
|
|
16575
16575
|
agentId: routingAgent.id,
|
|
16576
|
-
...
|
|
16576
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(routingAgentOptions ?? {}),
|
|
16577
16577
|
structuredOutput: {
|
|
16578
16578
|
schema: v4.z.object({
|
|
16579
16579
|
resumeData: v4.z.string()
|
|
@@ -16951,7 +16951,7 @@ async function networkLoop({
|
|
|
16951
16951
|
messages,
|
|
16952
16952
|
routingAgent,
|
|
16953
16953
|
generateId: generateId2,
|
|
16954
|
-
...
|
|
16954
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(routingAgentOptions ?? {}),
|
|
16955
16955
|
memoryConfig: routingAgentMemoryOptions?.options
|
|
16956
16956
|
});
|
|
16957
16957
|
return new MastraAgentNetworkStream({
|
|
@@ -17160,16 +17160,16 @@ var AgentLegacyHandler = class {
|
|
|
17160
17160
|
tracingOptions,
|
|
17161
17161
|
...rest
|
|
17162
17162
|
}) {
|
|
17163
|
-
const observabilityContext =
|
|
17163
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
17164
17164
|
return {
|
|
17165
17165
|
before: async () => {
|
|
17166
17166
|
if (process.env.NODE_ENV !== "test") {
|
|
17167
17167
|
this.capabilities.logger.debug(`[Agents:${this.capabilities.name}] - Starting generation`, { runId });
|
|
17168
17168
|
}
|
|
17169
|
-
const agentSpan =
|
|
17169
|
+
const agentSpan = chunkBF7IH4JU_cjs.getOrCreateSpan({
|
|
17170
17170
|
type: "agent_run" /* AGENT_RUN */,
|
|
17171
17171
|
name: `agent run: '${this.capabilities.id}'`,
|
|
17172
|
-
entityType:
|
|
17172
|
+
entityType: chunkBF7IH4JU_cjs.EntityType.AGENT,
|
|
17173
17173
|
entityId: this.capabilities.id,
|
|
17174
17174
|
entityName: this.capabilities.name,
|
|
17175
17175
|
input: {
|
|
@@ -17180,7 +17180,8 @@ var AgentLegacyHandler = class {
|
|
|
17180
17180
|
availableTools: [
|
|
17181
17181
|
...toolsets ? Object.keys(toolsets) : [],
|
|
17182
17182
|
...clientTools ? Object.keys(clientTools) : []
|
|
17183
|
-
]
|
|
17183
|
+
],
|
|
17184
|
+
...this.capabilities.resolvedVersionId ? { resolvedVersionId: this.capabilities.resolvedVersionId } : {}
|
|
17184
17185
|
},
|
|
17185
17186
|
metadata: {
|
|
17186
17187
|
runId,
|
|
@@ -17193,7 +17194,7 @@ var AgentLegacyHandler = class {
|
|
|
17193
17194
|
requestContext,
|
|
17194
17195
|
mastra: this.capabilities.mastra
|
|
17195
17196
|
});
|
|
17196
|
-
const innerObservabilityContext =
|
|
17197
|
+
const innerObservabilityContext = chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan });
|
|
17197
17198
|
const memory = await this.capabilities.getMemory({ requestContext });
|
|
17198
17199
|
const toolEnhancements = [
|
|
17199
17200
|
// toolsets
|
|
@@ -17440,7 +17441,7 @@ var AgentLegacyHandler = class {
|
|
|
17440
17441
|
instructions: titleInstructions
|
|
17441
17442
|
} = this.capabilities.resolveTitleGenerationConfig(config?.generateTitle);
|
|
17442
17443
|
if (shouldGenerate && !thread2.title && userMessage) {
|
|
17443
|
-
const observabilityContext2 =
|
|
17444
|
+
const observabilityContext2 = chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan });
|
|
17444
17445
|
promises.push(
|
|
17445
17446
|
this.capabilities.genTitle(userMessage, requestContext, observabilityContext2, titleModel, titleInstructions).then((title) => {
|
|
17446
17447
|
if (title) {
|
|
@@ -17510,7 +17511,7 @@ var AgentLegacyHandler = class {
|
|
|
17510
17511
|
overrideScorers,
|
|
17511
17512
|
threadId,
|
|
17512
17513
|
resourceId,
|
|
17513
|
-
...
|
|
17514
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan })
|
|
17514
17515
|
});
|
|
17515
17516
|
const scoringData = {
|
|
17516
17517
|
input: {
|
|
@@ -17594,7 +17595,7 @@ var AgentLegacyHandler = class {
|
|
|
17594
17595
|
writableStream,
|
|
17595
17596
|
methodType,
|
|
17596
17597
|
tracingOptions,
|
|
17597
|
-
...
|
|
17598
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(args)
|
|
17598
17599
|
});
|
|
17599
17600
|
let messageList;
|
|
17600
17601
|
let thread;
|
|
@@ -17759,7 +17760,7 @@ var AgentLegacyHandler = class {
|
|
|
17759
17760
|
return tripwireResult;
|
|
17760
17761
|
}
|
|
17761
17762
|
const { experimental_output, output, agentSpan, ...llmOptions } = beforeResult;
|
|
17762
|
-
const observabilityContext =
|
|
17763
|
+
const observabilityContext = chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan });
|
|
17763
17764
|
let finalOutputProcessors = mergedGenerateOptions.outputProcessors;
|
|
17764
17765
|
if (!output || experimental_output) {
|
|
17765
17766
|
const result2 = await llmToUse.__text({
|
|
@@ -18047,7 +18048,7 @@ var AgentLegacyHandler = class {
|
|
|
18047
18048
|
}
|
|
18048
18049
|
const { onFinish, runId, output, experimental_output, agentSpan, messageList, requestContext, ...llmOptions } = beforeResult;
|
|
18049
18050
|
const overrideScorers = mergedStreamOptions.scorers;
|
|
18050
|
-
const observabilityContext =
|
|
18051
|
+
const observabilityContext = chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan });
|
|
18051
18052
|
if (!output || experimental_output) {
|
|
18052
18053
|
this.capabilities.logger.debug(`Starting agent ${this.capabilities.name} llm stream call`, {
|
|
18053
18054
|
runId
|
|
@@ -18373,7 +18374,7 @@ function createMapResultsStep({
|
|
|
18373
18374
|
const modelOutput = await getModelOutputForTripwire({
|
|
18374
18375
|
tripwire: memoryData.tripwire,
|
|
18375
18376
|
runId,
|
|
18376
|
-
...
|
|
18377
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan }),
|
|
18377
18378
|
options,
|
|
18378
18379
|
model: agentModel,
|
|
18379
18380
|
messageList: memoryData.messageList
|
|
@@ -18427,7 +18428,7 @@ function createMapResultsStep({
|
|
|
18427
18428
|
methodType: modelMethodType,
|
|
18428
18429
|
agentId,
|
|
18429
18430
|
requestContext: result.requestContext,
|
|
18430
|
-
...
|
|
18431
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan }),
|
|
18431
18432
|
runId,
|
|
18432
18433
|
toolChoice: result.toolChoice,
|
|
18433
18434
|
tools: result.tools,
|
|
@@ -18581,7 +18582,7 @@ function createPrepareMemoryStep({
|
|
|
18581
18582
|
inputSchema: v4.z.object({}),
|
|
18582
18583
|
outputSchema: prepareMemoryStepOutputSchema,
|
|
18583
18584
|
execute: async ({ ...rest }) => {
|
|
18584
|
-
const observabilityContext =
|
|
18585
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
18585
18586
|
const thread = threadFromArgs;
|
|
18586
18587
|
const messageList = new chunkANLO4VM2_cjs.MessageList({
|
|
18587
18588
|
threadId: thread?.id,
|
|
@@ -18723,7 +18724,7 @@ function createPrepareToolsStep({
|
|
|
18723
18724
|
resourceId,
|
|
18724
18725
|
runId,
|
|
18725
18726
|
requestContext,
|
|
18726
|
-
...
|
|
18727
|
+
...chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan }),
|
|
18727
18728
|
outputWriter: options.outputWriter,
|
|
18728
18729
|
methodType,
|
|
18729
18730
|
memoryConfig: options.memory?.options,
|
|
@@ -18780,7 +18781,7 @@ function createStreamStep({
|
|
|
18780
18781
|
...validatedInputData,
|
|
18781
18782
|
outputProcessors: processors,
|
|
18782
18783
|
returnScorerData,
|
|
18783
|
-
...
|
|
18784
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(observabilityContext),
|
|
18784
18785
|
requireToolApproval,
|
|
18785
18786
|
toolCallConcurrency,
|
|
18786
18787
|
resumeContext,
|
|
@@ -19685,6 +19686,7 @@ ${errorMessages}`,
|
|
|
19685
19686
|
saveStepMessages: this.saveStepMessages.bind(this),
|
|
19686
19687
|
convertInstructionsToString: this.#convertInstructionsToString.bind(this),
|
|
19687
19688
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
19689
|
+
resolvedVersionId: this.toRawConfig()?.resolvedVersionId,
|
|
19688
19690
|
_agentNetworkAppend: this._agentNetworkAppend,
|
|
19689
19691
|
listResolvedOutputProcessors: this.listResolvedOutputProcessors.bind(this),
|
|
19690
19692
|
__runOutputProcessors: this.__runOutputProcessors.bind(this),
|
|
@@ -19856,7 +19858,7 @@ ${errorMessages}`,
|
|
|
19856
19858
|
*/
|
|
19857
19859
|
listTools({ requestContext = new chunk5WBEMKE2_cjs.RequestContext() } = {}) {
|
|
19858
19860
|
if (typeof this.#tools !== "function") {
|
|
19859
|
-
return
|
|
19861
|
+
return chunkXQRTJIC7_cjs.ensureToolProperties(this.#tools);
|
|
19860
19862
|
}
|
|
19861
19863
|
const result = this.#tools({
|
|
19862
19864
|
requestContext,
|
|
@@ -19877,7 +19879,7 @@ ${errorMessages}`,
|
|
|
19877
19879
|
this.logger.error(mastraError.toString());
|
|
19878
19880
|
throw mastraError;
|
|
19879
19881
|
}
|
|
19880
|
-
return
|
|
19882
|
+
return chunkXQRTJIC7_cjs.ensureToolProperties(tools);
|
|
19881
19883
|
});
|
|
19882
19884
|
}
|
|
19883
19885
|
/**
|
|
@@ -19926,7 +19928,7 @@ ${errorMessages}`,
|
|
|
19926
19928
|
});
|
|
19927
19929
|
});
|
|
19928
19930
|
} else {
|
|
19929
|
-
llm = new
|
|
19931
|
+
llm = new chunkLKZQG2ZZ_cjs.MastraLLMV1({
|
|
19930
19932
|
model: modelInfo,
|
|
19931
19933
|
mastra: this.#mastra,
|
|
19932
19934
|
options: { tracingPolicy: this.#options?.tracingPolicy }
|
|
@@ -19952,7 +19954,7 @@ ${errorMessages}`,
|
|
|
19952
19954
|
*/
|
|
19953
19955
|
async resolveModelConfig(modelConfig, requestContext) {
|
|
19954
19956
|
try {
|
|
19955
|
-
return await
|
|
19957
|
+
return await chunkXRW4AYLH_cjs.resolveModelConfig(modelConfig, requestContext, this.#mastra);
|
|
19956
19958
|
} catch (error) {
|
|
19957
19959
|
const mastraError = new chunk4U7ZLI36_cjs.MastraError({
|
|
19958
19960
|
id: "AGENT_GET_MODEL_MISSING_MODEL_INSTANCE",
|
|
@@ -20281,7 +20283,7 @@ ${errorMessages}`,
|
|
|
20281
20283
|
instructions,
|
|
20282
20284
|
...rest
|
|
20283
20285
|
}) {
|
|
20284
|
-
const observabilityContext =
|
|
20286
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
20285
20287
|
const llm = await this.getLLM({ requestContext, model });
|
|
20286
20288
|
const normMessage = new chunkANLO4VM2_cjs.MessageList().add(message, "user").get.all.aiV5.ui().at(-1);
|
|
20287
20289
|
if (!normMessage) {
|
|
@@ -20404,7 +20406,7 @@ ${errorMessages}`,
|
|
|
20404
20406
|
autoResumeSuspendedTools,
|
|
20405
20407
|
...rest
|
|
20406
20408
|
}) {
|
|
20407
|
-
const observabilityContext =
|
|
20409
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
20408
20410
|
let convertedMemoryTools = {};
|
|
20409
20411
|
if (this._agentNetworkAppend) {
|
|
20410
20412
|
this.logger.debug(`[Agent:${this.name}] - Skipping memory tools (agent network context)`, { runId });
|
|
@@ -20441,7 +20443,7 @@ ${errorMessages}`,
|
|
|
20441
20443
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20442
20444
|
requireApproval: toolObj.requireApproval
|
|
20443
20445
|
};
|
|
20444
|
-
const convertedToCoreTool =
|
|
20446
|
+
const convertedToCoreTool = chunkXQRTJIC7_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20445
20447
|
convertedMemoryTools[toolName] = convertedToCoreTool;
|
|
20446
20448
|
}
|
|
20447
20449
|
}
|
|
@@ -20460,7 +20462,7 @@ ${errorMessages}`,
|
|
|
20460
20462
|
autoResumeSuspendedTools,
|
|
20461
20463
|
...rest
|
|
20462
20464
|
}) {
|
|
20463
|
-
const observabilityContext =
|
|
20465
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
20464
20466
|
let convertedWorkspaceTools = {};
|
|
20465
20467
|
if (this._agentNetworkAppend) {
|
|
20466
20468
|
this.logger.debug(`[Agent:${this.name}] - Skipping workspace tools (agent network context)`, { runId });
|
|
@@ -20493,7 +20495,7 @@ ${errorMessages}`,
|
|
|
20493
20495
|
requireApproval: toolObj.requireApproval,
|
|
20494
20496
|
workspace
|
|
20495
20497
|
};
|
|
20496
|
-
const convertedToCoreTool =
|
|
20498
|
+
const convertedToCoreTool = chunkXQRTJIC7_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20497
20499
|
convertedWorkspaceTools[toolName] = convertedToCoreTool;
|
|
20498
20500
|
}
|
|
20499
20501
|
}
|
|
@@ -20515,7 +20517,7 @@ ${errorMessages}`,
|
|
|
20515
20517
|
autoResumeSuspendedTools,
|
|
20516
20518
|
...rest
|
|
20517
20519
|
}) {
|
|
20518
|
-
const observabilityContext =
|
|
20520
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
20519
20521
|
let convertedSkillTools = {};
|
|
20520
20522
|
if (this._agentNetworkAppend) {
|
|
20521
20523
|
return convertedSkillTools;
|
|
@@ -20548,7 +20550,7 @@ ${errorMessages}`,
|
|
|
20548
20550
|
// Skill tools never require approval
|
|
20549
20551
|
workspace
|
|
20550
20552
|
};
|
|
20551
|
-
const convertedToCoreTool =
|
|
20553
|
+
const convertedToCoreTool = chunkXQRTJIC7_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20552
20554
|
convertedSkillTools[toolName] = convertedToCoreTool;
|
|
20553
20555
|
}
|
|
20554
20556
|
}
|
|
@@ -20608,7 +20610,7 @@ ${errorMessages}`,
|
|
|
20608
20610
|
*/
|
|
20609
20611
|
async __runProcessInputStep(args) {
|
|
20610
20612
|
const { requestContext, messageList, stepNumber = 0, processorStates, ...rest } = args;
|
|
20611
|
-
const observabilityContext =
|
|
20613
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
20612
20614
|
let tripwire;
|
|
20613
20615
|
if (this.#inputProcessors || this.#memory) {
|
|
20614
20616
|
const runner = await this.getProcessorRunner({
|
|
@@ -20737,7 +20739,7 @@ ${errorMessages}`,
|
|
|
20737
20739
|
autoResumeSuspendedTools,
|
|
20738
20740
|
...rest
|
|
20739
20741
|
}) {
|
|
20740
|
-
const observabilityContext =
|
|
20742
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
20741
20743
|
let toolsForRequest = {};
|
|
20742
20744
|
this.logger.debug(`[Agents:${this.name}] - Assembling assigned tools`, { runId, threadId, resourceId });
|
|
20743
20745
|
const memory = await this.getMemory({ requestContext });
|
|
@@ -20765,7 +20767,7 @@ ${errorMessages}`,
|
|
|
20765
20767
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20766
20768
|
requireApproval: tool2.requireApproval
|
|
20767
20769
|
};
|
|
20768
|
-
return [k,
|
|
20770
|
+
return [k, chunkXQRTJIC7_cjs.makeCoreTool(tool2, options, void 0, autoResumeSuspendedTools)];
|
|
20769
20771
|
})
|
|
20770
20772
|
);
|
|
20771
20773
|
const assignedToolEntriesConverted = Object.fromEntries(
|
|
@@ -20790,7 +20792,7 @@ ${errorMessages}`,
|
|
|
20790
20792
|
autoResumeSuspendedTools,
|
|
20791
20793
|
...rest
|
|
20792
20794
|
}) {
|
|
20793
|
-
const observabilityContext =
|
|
20795
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
20794
20796
|
let toolsForRequest = {};
|
|
20795
20797
|
const memory = await this.getMemory({ requestContext });
|
|
20796
20798
|
const toolsFromToolsets = Object.values(toolsets || {});
|
|
@@ -20817,7 +20819,7 @@ ${errorMessages}`,
|
|
|
20817
20819
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20818
20820
|
requireApproval: toolObj.requireApproval
|
|
20819
20821
|
};
|
|
20820
|
-
const convertedToCoreTool =
|
|
20822
|
+
const convertedToCoreTool = chunkXQRTJIC7_cjs.makeCoreTool(toolObj, options, "toolset", autoResumeSuspendedTools);
|
|
20821
20823
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
20822
20824
|
}
|
|
20823
20825
|
}
|
|
@@ -20838,7 +20840,7 @@ ${errorMessages}`,
|
|
|
20838
20840
|
autoResumeSuspendedTools,
|
|
20839
20841
|
...rest
|
|
20840
20842
|
}) {
|
|
20841
|
-
const observabilityContext =
|
|
20843
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
20842
20844
|
let toolsForRequest = {};
|
|
20843
20845
|
const memory = await this.getMemory({ requestContext });
|
|
20844
20846
|
const clientToolsForInput = Object.entries(clientTools || {});
|
|
@@ -20864,7 +20866,7 @@ ${errorMessages}`,
|
|
|
20864
20866
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20865
20867
|
requireApproval: tool2.requireApproval
|
|
20866
20868
|
};
|
|
20867
|
-
const convertedToCoreTool =
|
|
20869
|
+
const convertedToCoreTool = chunkXQRTJIC7_cjs.makeCoreTool(toolRest, options, "client-tool", autoResumeSuspendedTools);
|
|
20868
20870
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
20869
20871
|
}
|
|
20870
20872
|
}
|
|
@@ -20916,7 +20918,7 @@ ${errorMessages}`,
|
|
|
20916
20918
|
delegation,
|
|
20917
20919
|
...rest
|
|
20918
20920
|
}) {
|
|
20919
|
-
const observabilityContext =
|
|
20921
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
20920
20922
|
const convertedAgentTools = {};
|
|
20921
20923
|
const agents = await this.listAgents({ requestContext });
|
|
20922
20924
|
if (Object.keys(agents).length > 0) {
|
|
@@ -21146,7 +21148,7 @@ ${effectiveInstructions}`;
|
|
|
21146
21148
|
const generateResult = resumeData ? await agent.resumeGenerate(resumeData, {
|
|
21147
21149
|
runId: suspendedToolRunId,
|
|
21148
21150
|
requestContext,
|
|
21149
|
-
...
|
|
21151
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {}),
|
|
21150
21152
|
...effectiveInstructions && { instructions: effectiveInstructions },
|
|
21151
21153
|
...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
|
|
21152
21154
|
...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
|
|
@@ -21158,7 +21160,7 @@ ${effectiveInstructions}`;
|
|
|
21158
21160
|
} : {}
|
|
21159
21161
|
}) : await agent.generate(messagesForSubAgent, {
|
|
21160
21162
|
requestContext,
|
|
21161
|
-
...
|
|
21163
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {}),
|
|
21162
21164
|
...effectiveInstructions && { instructions: effectiveInstructions },
|
|
21163
21165
|
...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
|
|
21164
21166
|
...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
|
|
@@ -21222,14 +21224,14 @@ ${effectiveInstructions}`;
|
|
|
21222
21224
|
} else if (methodType === "generate" && modelVersion === "v1") {
|
|
21223
21225
|
const generateResult = await agent.generateLegacy(messagesForSubAgent, {
|
|
21224
21226
|
requestContext,
|
|
21225
|
-
...
|
|
21227
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {})
|
|
21226
21228
|
});
|
|
21227
21229
|
result = { text: generateResult.text };
|
|
21228
21230
|
} else if ((methodType === "stream" || methodType === "streamLegacy") && supportedLanguageModelSpecifications.includes(modelVersion)) {
|
|
21229
21231
|
const streamResult = resumeData ? await agent.resumeStream(resumeData, {
|
|
21230
21232
|
runId: suspendedToolRunId,
|
|
21231
21233
|
requestContext,
|
|
21232
|
-
...
|
|
21234
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {}),
|
|
21233
21235
|
...effectiveInstructions && { instructions: effectiveInstructions },
|
|
21234
21236
|
...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
|
|
21235
21237
|
...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
|
|
@@ -21243,7 +21245,7 @@ ${effectiveInstructions}`;
|
|
|
21243
21245
|
} : {}
|
|
21244
21246
|
}) : await agent.stream(messagesForSubAgent, {
|
|
21245
21247
|
requestContext,
|
|
21246
|
-
...
|
|
21248
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {}),
|
|
21247
21249
|
...effectiveInstructions && { instructions: effectiveInstructions },
|
|
21248
21250
|
...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
|
|
21249
21251
|
...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
|
|
@@ -21344,7 +21346,7 @@ ${effectiveInstructions}`;
|
|
|
21344
21346
|
} else {
|
|
21345
21347
|
const streamResult = await agent.streamLegacy(effectivePrompt, {
|
|
21346
21348
|
requestContext,
|
|
21347
|
-
...
|
|
21349
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {})
|
|
21348
21350
|
});
|
|
21349
21351
|
let fullText = "";
|
|
21350
21352
|
for await (const chunk of streamResult.fullStream) {
|
|
@@ -21527,7 +21529,7 @@ ${effectiveInstructions}`;
|
|
|
21527
21529
|
...observabilityContext,
|
|
21528
21530
|
tracingPolicy: this.#options?.tracingPolicy
|
|
21529
21531
|
};
|
|
21530
|
-
convertedAgentTools[`agent-${agentName}`] =
|
|
21532
|
+
convertedAgentTools[`agent-${agentName}`] = chunkXQRTJIC7_cjs.makeCoreTool(
|
|
21531
21533
|
toolObj,
|
|
21532
21534
|
options,
|
|
21533
21535
|
void 0,
|
|
@@ -21550,7 +21552,7 @@ ${effectiveInstructions}`;
|
|
|
21550
21552
|
autoResumeSuspendedTools,
|
|
21551
21553
|
...rest
|
|
21552
21554
|
}) {
|
|
21553
|
-
const observabilityContext =
|
|
21555
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
21554
21556
|
const convertedWorkflowTools = {};
|
|
21555
21557
|
const workflows = await this.listWorkflows({ requestContext });
|
|
21556
21558
|
if (Object.keys(workflows).length > 0) {
|
|
@@ -21621,13 +21623,13 @@ ${effectiveInstructions}`;
|
|
|
21621
21623
|
result = await run.resume({
|
|
21622
21624
|
resumeData,
|
|
21623
21625
|
requestContext,
|
|
21624
|
-
...
|
|
21626
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {})
|
|
21625
21627
|
});
|
|
21626
21628
|
} else {
|
|
21627
21629
|
result = await run.start({
|
|
21628
21630
|
inputData: workflowInputData,
|
|
21629
21631
|
requestContext,
|
|
21630
|
-
...
|
|
21632
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {}),
|
|
21631
21633
|
...initialState && { initialState }
|
|
21632
21634
|
});
|
|
21633
21635
|
}
|
|
@@ -21635,7 +21637,7 @@ ${effectiveInstructions}`;
|
|
|
21635
21637
|
const streamResult = run.streamLegacy({
|
|
21636
21638
|
inputData: workflowInputData,
|
|
21637
21639
|
requestContext,
|
|
21638
|
-
...
|
|
21640
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {})
|
|
21639
21641
|
});
|
|
21640
21642
|
if (context?.writer) {
|
|
21641
21643
|
await streamResult.stream.pipeTo(context.writer);
|
|
@@ -21648,11 +21650,11 @@ ${effectiveInstructions}`;
|
|
|
21648
21650
|
const streamResult = resumeData ? run.resumeStream({
|
|
21649
21651
|
resumeData,
|
|
21650
21652
|
requestContext,
|
|
21651
|
-
...
|
|
21653
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {})
|
|
21652
21654
|
}) : run.stream({
|
|
21653
21655
|
inputData: workflowInputData,
|
|
21654
21656
|
requestContext,
|
|
21655
|
-
...
|
|
21657
|
+
...chunkBF7IH4JU_cjs.resolveObservabilityContext(context ?? {}),
|
|
21656
21658
|
...initialState && { initialState }
|
|
21657
21659
|
});
|
|
21658
21660
|
if (context?.writer) {
|
|
@@ -21744,7 +21746,7 @@ ${effectiveInstructions}`;
|
|
|
21744
21746
|
...observabilityContext,
|
|
21745
21747
|
tracingPolicy: this.#options?.tracingPolicy
|
|
21746
21748
|
};
|
|
21747
|
-
convertedWorkflowTools[`workflow-${workflowName}`] =
|
|
21749
|
+
convertedWorkflowTools[`workflow-${workflowName}`] = chunkXQRTJIC7_cjs.makeCoreTool(
|
|
21748
21750
|
toolObj,
|
|
21749
21751
|
options,
|
|
21750
21752
|
void 0,
|
|
@@ -21772,11 +21774,11 @@ ${effectiveInstructions}`;
|
|
|
21772
21774
|
delegation,
|
|
21773
21775
|
...rest
|
|
21774
21776
|
}) {
|
|
21775
|
-
const observabilityContext =
|
|
21777
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
21776
21778
|
let mastraProxy = void 0;
|
|
21777
21779
|
const logger = this.logger;
|
|
21778
21780
|
if (this.#mastra) {
|
|
21779
|
-
mastraProxy =
|
|
21781
|
+
mastraProxy = chunkXQRTJIC7_cjs.createMastraProxy({ mastra: this.#mastra, logger });
|
|
21780
21782
|
}
|
|
21781
21783
|
const assignedTools = await this.listAssignedTools({
|
|
21782
21784
|
runId,
|
|
@@ -22028,7 +22030,7 @@ ${effectiveInstructions}`;
|
|
|
22028
22030
|
const resolvedModel = await this.resolveModelConfig(selection, requestContext);
|
|
22029
22031
|
this.assertSupportsPreparedModels(resolvedModel);
|
|
22030
22032
|
let headers;
|
|
22031
|
-
if (resolvedModel instanceof
|
|
22033
|
+
if (resolvedModel instanceof chunkXRW4AYLH_cjs.ModelRouterLanguageModel) {
|
|
22032
22034
|
headers = resolvedModel.config?.headers;
|
|
22033
22035
|
}
|
|
22034
22036
|
return [
|
|
@@ -22061,7 +22063,7 @@ ${effectiveInstructions}`;
|
|
|
22061
22063
|
throw mastraError;
|
|
22062
22064
|
}
|
|
22063
22065
|
let headers;
|
|
22064
|
-
if (model instanceof
|
|
22066
|
+
if (model instanceof chunkXRW4AYLH_cjs.ModelRouterLanguageModel) {
|
|
22065
22067
|
headers = model.config?.headers;
|
|
22066
22068
|
}
|
|
22067
22069
|
return {
|
|
@@ -22131,16 +22133,17 @@ ${effectiveInstructions}`;
|
|
|
22131
22133
|
resourceId
|
|
22132
22134
|
}) || crypto2.randomUUID();
|
|
22133
22135
|
const instructions = options.instructions || await this.getInstructions({ requestContext });
|
|
22134
|
-
const agentSpan =
|
|
22136
|
+
const agentSpan = chunkBF7IH4JU_cjs.getOrCreateSpan({
|
|
22135
22137
|
type: "agent_run" /* AGENT_RUN */,
|
|
22136
22138
|
name: `agent run: '${this.id}'`,
|
|
22137
|
-
entityType:
|
|
22139
|
+
entityType: chunkBF7IH4JU_cjs.EntityType.AGENT,
|
|
22138
22140
|
entityId: this.id,
|
|
22139
22141
|
entityName: this.name,
|
|
22140
22142
|
input: options.messages,
|
|
22141
22143
|
attributes: {
|
|
22142
22144
|
conversationId: threadFromArgs?.id,
|
|
22143
|
-
instructions: this.#convertInstructionsToString(instructions)
|
|
22145
|
+
instructions: this.#convertInstructionsToString(instructions),
|
|
22146
|
+
...this.toRawConfig()?.resolvedVersionId ? { resolvedVersionId: this.toRawConfig().resolvedVersionId } : {}
|
|
22144
22147
|
},
|
|
22145
22148
|
metadata: {
|
|
22146
22149
|
runId,
|
|
@@ -22207,7 +22210,7 @@ ${effectiveInstructions}`;
|
|
|
22207
22210
|
workspace
|
|
22208
22211
|
});
|
|
22209
22212
|
const run = await executionWorkflow.createRun();
|
|
22210
|
-
const observabilityContext =
|
|
22213
|
+
const observabilityContext = chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan });
|
|
22211
22214
|
const result = await run.start({ ...observabilityContext });
|
|
22212
22215
|
return result;
|
|
22213
22216
|
}
|
|
@@ -22231,7 +22234,7 @@ ${effectiveInstructions}`;
|
|
|
22231
22234
|
structuredOutput = false,
|
|
22232
22235
|
overrideScorers
|
|
22233
22236
|
}) {
|
|
22234
|
-
const observabilityContext =
|
|
22237
|
+
const observabilityContext = chunkBF7IH4JU_cjs.createObservabilityContext({ currentSpan: agentSpan });
|
|
22235
22238
|
const resToLog = {
|
|
22236
22239
|
text: result.text,
|
|
22237
22240
|
object: result.object,
|
|
@@ -22514,7 +22517,7 @@ ${effectiveInstructions}`;
|
|
|
22514
22517
|
const defaultOptions = await this.getDefaultOptions({
|
|
22515
22518
|
requestContext: options?.requestContext
|
|
22516
22519
|
});
|
|
22517
|
-
const mergedOptions =
|
|
22520
|
+
const mergedOptions = chunkXQRTJIC7_cjs.deepMerge(
|
|
22518
22521
|
defaultOptions,
|
|
22519
22522
|
options ?? {}
|
|
22520
22523
|
);
|
|
@@ -22584,7 +22587,7 @@ ${effectiveInstructions}`;
|
|
|
22584
22587
|
const defaultOptions = await this.getDefaultOptions({
|
|
22585
22588
|
requestContext: streamOptions?.requestContext
|
|
22586
22589
|
});
|
|
22587
|
-
const mergedOptions =
|
|
22590
|
+
const mergedOptions = chunkXQRTJIC7_cjs.deepMerge(
|
|
22588
22591
|
defaultOptions,
|
|
22589
22592
|
streamOptions ?? {}
|
|
22590
22593
|
);
|
|
@@ -22648,7 +22651,7 @@ ${effectiveInstructions}`;
|
|
|
22648
22651
|
const defaultOptions = await this.getDefaultOptions({
|
|
22649
22652
|
requestContext: streamOptions?.requestContext
|
|
22650
22653
|
});
|
|
22651
|
-
let mergedStreamOptions =
|
|
22654
|
+
let mergedStreamOptions = chunkXQRTJIC7_cjs.deepMerge(
|
|
22652
22655
|
defaultOptions,
|
|
22653
22656
|
streamOptions ?? {}
|
|
22654
22657
|
);
|
|
@@ -22713,7 +22716,7 @@ ${effectiveInstructions}`;
|
|
|
22713
22716
|
const defaultOptions = await this.getDefaultOptions({
|
|
22714
22717
|
requestContext: options?.requestContext
|
|
22715
22718
|
});
|
|
22716
|
-
const mergedOptions =
|
|
22719
|
+
const mergedOptions = chunkXQRTJIC7_cjs.deepMerge(
|
|
22717
22720
|
defaultOptions,
|
|
22718
22721
|
options ?? {}
|
|
22719
22722
|
);
|
|
@@ -22950,7 +22953,7 @@ var ModerationProcessor = class _ModerationProcessor {
|
|
|
22950
22953
|
async processInput(args) {
|
|
22951
22954
|
try {
|
|
22952
22955
|
const { messages, abort, ...rest } = args;
|
|
22953
|
-
const observabilityContext =
|
|
22956
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
22954
22957
|
if (messages.length === 0) {
|
|
22955
22958
|
return messages;
|
|
22956
22959
|
}
|
|
@@ -22984,7 +22987,7 @@ var ModerationProcessor = class _ModerationProcessor {
|
|
|
22984
22987
|
async processOutputStream(args) {
|
|
22985
22988
|
try {
|
|
22986
22989
|
const { part, streamParts, abort, ...rest } = args;
|
|
22987
|
-
const observabilityContext =
|
|
22990
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
22988
22991
|
if (part.type !== "text-delta") {
|
|
22989
22992
|
return part;
|
|
22990
22993
|
}
|
|
@@ -23192,7 +23195,7 @@ var PromptInjectionDetector = class _PromptInjectionDetector {
|
|
|
23192
23195
|
async processInput(args) {
|
|
23193
23196
|
try {
|
|
23194
23197
|
const { messages, abort, ...rest } = args;
|
|
23195
|
-
const observabilityContext =
|
|
23198
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
23196
23199
|
if (messages.length === 0) {
|
|
23197
23200
|
return messages;
|
|
23198
23201
|
}
|
|
@@ -23440,7 +23443,7 @@ var PIIDetector = class _PIIDetector {
|
|
|
23440
23443
|
async processInput(args) {
|
|
23441
23444
|
try {
|
|
23442
23445
|
const { messages, abort, ...rest } = args;
|
|
23443
|
-
const observabilityContext =
|
|
23446
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
23444
23447
|
if (messages.length === 0) {
|
|
23445
23448
|
return messages;
|
|
23446
23449
|
}
|
|
@@ -23723,7 +23726,7 @@ IMPORTANT: Only include PII types that are actually detected. If no PII is found
|
|
|
23723
23726
|
*/
|
|
23724
23727
|
async processOutputStream(args) {
|
|
23725
23728
|
const { part, abort, ...rest } = args;
|
|
23726
|
-
const observabilityContext =
|
|
23729
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
23727
23730
|
try {
|
|
23728
23731
|
if (part.type !== "text-delta") {
|
|
23729
23732
|
return part;
|
|
@@ -23786,7 +23789,7 @@ IMPORTANT: Only include PII types that are actually detected. If no PII is found
|
|
|
23786
23789
|
abort,
|
|
23787
23790
|
...rest
|
|
23788
23791
|
}) {
|
|
23789
|
-
const observabilityContext =
|
|
23792
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
23790
23793
|
try {
|
|
23791
23794
|
if (messages.length === 0) {
|
|
23792
23795
|
return messages;
|
|
@@ -23915,7 +23918,7 @@ var LanguageDetector = class _LanguageDetector {
|
|
|
23915
23918
|
async processInput(args) {
|
|
23916
23919
|
try {
|
|
23917
23920
|
const { messages, abort, ...rest } = args;
|
|
23918
|
-
const observabilityContext =
|
|
23921
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
23919
23922
|
if (messages.length === 0) {
|
|
23920
23923
|
return messages;
|
|
23921
23924
|
}
|
|
@@ -24580,7 +24583,7 @@ var SystemPromptScrubber = class {
|
|
|
24580
24583
|
*/
|
|
24581
24584
|
async processOutputStream(args) {
|
|
24582
24585
|
const { part, abort, ...rest } = args;
|
|
24583
|
-
const observabilityContext =
|
|
24586
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
24584
24587
|
if (part.type !== "text-delta") {
|
|
24585
24588
|
return part;
|
|
24586
24589
|
}
|
|
@@ -24635,7 +24638,7 @@ var SystemPromptScrubber = class {
|
|
|
24635
24638
|
abort,
|
|
24636
24639
|
...rest
|
|
24637
24640
|
}) {
|
|
24638
|
-
const observabilityContext =
|
|
24641
|
+
const observabilityContext = chunkBF7IH4JU_cjs.resolveObservabilityContext(rest);
|
|
24639
24642
|
const processedMessages = [];
|
|
24640
24643
|
for (const message of messages) {
|
|
24641
24644
|
if (message.role !== "assistant" || !message.content?.parts) {
|
|
@@ -25964,7 +25967,7 @@ var WorkingMemory = class {
|
|
|
25964
25967
|
return messageList;
|
|
25965
25968
|
}
|
|
25966
25969
|
generateEmptyFromSchemaInternal(schema) {
|
|
25967
|
-
const result =
|
|
25970
|
+
const result = chunkXQRTJIC7_cjs.generateEmptyFromSchema(schema);
|
|
25968
25971
|
return Object.keys(result).length > 0 ? result : null;
|
|
25969
25972
|
}
|
|
25970
25973
|
getWorkingMemoryToolInstruction({
|
|
@@ -26609,7 +26612,7 @@ https://mastra.ai/en/docs/memory/semantic-recall`
|
|
|
26609
26612
|
);
|
|
26610
26613
|
}
|
|
26611
26614
|
if (typeof config.embedder === "string") {
|
|
26612
|
-
this.embedder = new
|
|
26615
|
+
this.embedder = new chunkXRW4AYLH_cjs.ModelRouterEmbeddingModel(config.embedder);
|
|
26613
26616
|
} else {
|
|
26614
26617
|
this.embedder = config.embedder;
|
|
26615
26618
|
}
|
|
@@ -26622,7 +26625,7 @@ https://mastra.ai/en/docs/memory/semantic-recall`
|
|
|
26622
26625
|
}
|
|
26623
26626
|
if (config.embedder) {
|
|
26624
26627
|
if (typeof config.embedder === "string") {
|
|
26625
|
-
this.embedder = new
|
|
26628
|
+
this.embedder = new chunkXRW4AYLH_cjs.ModelRouterEmbeddingModel(config.embedder);
|
|
26626
26629
|
} else {
|
|
26627
26630
|
this.embedder = config.embedder;
|
|
26628
26631
|
}
|
|
@@ -26662,7 +26665,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
26662
26665
|
}
|
|
26663
26666
|
setEmbedder(embedder, embedderOptions) {
|
|
26664
26667
|
if (typeof embedder === "string") {
|
|
26665
|
-
this.embedder = new
|
|
26668
|
+
this.embedder = new chunkXRW4AYLH_cjs.ModelRouterEmbeddingModel(embedder);
|
|
26666
26669
|
} else {
|
|
26667
26670
|
this.embedder = embedder;
|
|
26668
26671
|
}
|
|
@@ -26759,7 +26762,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
26759
26762
|
"The threads.generateTitle option has been moved. Use the top-level generateTitle option instead."
|
|
26760
26763
|
);
|
|
26761
26764
|
}
|
|
26762
|
-
const mergedConfig =
|
|
26765
|
+
const mergedConfig = chunkXQRTJIC7_cjs.deepMerge(this.threadConfig, config || {});
|
|
26763
26766
|
if (typeof config?.workingMemory === "object" && config.workingMemory?.schema && typeof mergedConfig.workingMemory === "object") {
|
|
26764
26767
|
mergedConfig.workingMemory.schema = config.workingMemory.schema;
|
|
26765
26768
|
}
|
|
@@ -27111,7 +27114,7 @@ var MockMemory = class extends MastraMemory {
|
|
|
27111
27114
|
} = {}) {
|
|
27112
27115
|
super({
|
|
27113
27116
|
name: "mock",
|
|
27114
|
-
storage: storage || new
|
|
27117
|
+
storage: storage || new chunkV2NQOABM_cjs.InMemoryStore(),
|
|
27115
27118
|
options: {
|
|
27116
27119
|
...options,
|
|
27117
27120
|
workingMemory: enableWorkingMemory ? { enabled: true, template: workingMemoryTemplate } : options?.workingMemory,
|
|
@@ -27422,5 +27425,5 @@ exports.validateStepRequestContext = validateStepRequestContext;
|
|
|
27422
27425
|
exports.validateStepResumeData = validateStepResumeData;
|
|
27423
27426
|
exports.validateStepStateData = validateStepStateData;
|
|
27424
27427
|
exports.validateStepSuspendData = validateStepSuspendData;
|
|
27425
|
-
//# sourceMappingURL=chunk-
|
|
27426
|
-
//# sourceMappingURL=chunk-
|
|
27428
|
+
//# sourceMappingURL=chunk-KCRQQDEF.cjs.map
|
|
27429
|
+
//# sourceMappingURL=chunk-KCRQQDEF.cjs.map
|