@mastra/core 1.18.0 → 1.18.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- 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-KLVNQDUR.cjs → chunk-2W7R236U.cjs} +3 -3
- package/dist/chunk-2W7R236U.cjs.map +1 -0
- package/dist/{chunk-V2NQOABM.cjs → chunk-5ANYSU2W.cjs} +9 -9
- package/dist/{chunk-V2NQOABM.cjs.map → chunk-5ANYSU2W.cjs.map} +1 -1
- package/dist/{chunk-KOTSKPTF.cjs → chunk-6R5PT6ZP.cjs} +5 -5
- package/dist/{chunk-KOTSKPTF.cjs.map → chunk-6R5PT6ZP.cjs.map} +1 -1
- package/dist/{chunk-LKZQG2ZZ.cjs → chunk-6VRSFFQ4.cjs} +7 -6
- package/dist/chunk-6VRSFFQ4.cjs.map +1 -0
- package/dist/{chunk-2M3HWTRI.js → chunk-7IE4K74P.js} +4 -4
- package/dist/{chunk-2M3HWTRI.js.map → chunk-7IE4K74P.js.map} +1 -1
- package/dist/{chunk-I4ZSA3XJ.js → chunk-7V3UNILV.js} +4 -4
- package/dist/{chunk-I4ZSA3XJ.js.map → chunk-7V3UNILV.js.map} +1 -1
- package/dist/{chunk-ZRLAR66M.js → chunk-AJZQPWAV.js} +59 -19
- package/dist/chunk-AJZQPWAV.js.map +1 -0
- package/dist/{chunk-XOBRMYFA.js → chunk-BZ2MSXOF.js} +3 -3
- package/dist/chunk-BZ2MSXOF.js.map +1 -0
- package/dist/{chunk-HRT662B6.js → chunk-EAJDF6UV.js} +12 -7
- package/dist/chunk-EAJDF6UV.js.map +1 -0
- package/dist/{chunk-PWFPYJGG.cjs → chunk-EXDBQKH4.cjs} +15 -15
- package/dist/{chunk-PWFPYJGG.cjs.map → chunk-EXDBQKH4.cjs.map} +1 -1
- package/dist/{chunk-GJ62FP5X.js → chunk-HQCBFWL2.js} +18 -35
- package/dist/chunk-HQCBFWL2.js.map +1 -0
- package/dist/{chunk-UPBMT3QM.js → chunk-JTJCFEIY.js} +8 -8
- package/dist/{chunk-UPBMT3QM.js.map → chunk-JTJCFEIY.js.map} +1 -1
- package/dist/{chunk-GJIN53S6.cjs → chunk-L2GYXPJJ.cjs} +9 -9
- package/dist/{chunk-GJIN53S6.cjs.map → chunk-L2GYXPJJ.cjs.map} +1 -1
- package/dist/{chunk-2H53MD2U.cjs → chunk-LVZKPNQO.cjs} +50 -50
- package/dist/{chunk-2H53MD2U.cjs.map → chunk-LVZKPNQO.cjs.map} +1 -1
- package/dist/{chunk-MJF7NZEF.js → chunk-OLHODPXN.js} +3 -3
- package/dist/{chunk-MJF7NZEF.js.map → chunk-OLHODPXN.js.map} +1 -1
- package/dist/{chunk-6Z4GSLLO.js → chunk-OTJAMDX5.js} +3 -3
- package/dist/{chunk-6Z4GSLLO.js.map → chunk-OTJAMDX5.js.map} +1 -1
- package/dist/{chunk-EKFG6JWW.js → chunk-PB3KXPNE.js} +8 -7
- package/dist/chunk-PB3KXPNE.js.map +1 -0
- package/dist/{chunk-TVZCMQTV.cjs → chunk-QADPCUBX.cjs} +83 -82
- package/dist/chunk-QADPCUBX.cjs.map +1 -0
- package/dist/{chunk-RTBZOGTO.js → chunk-QNNFMCSE.js} +3 -3
- package/dist/{chunk-RTBZOGTO.js.map → chunk-QNNFMCSE.js.map} +1 -1
- package/dist/{chunk-7GLVV6CZ.js → chunk-RF4TETYQ.js} +4 -4
- package/dist/{chunk-7GLVV6CZ.js.map → chunk-RF4TETYQ.js.map} +1 -1
- package/dist/{chunk-XQN3BKCI.js → chunk-UJX2TJIF.js} +3 -3
- package/dist/{chunk-XQN3BKCI.js.map → chunk-UJX2TJIF.js.map} +1 -1
- package/dist/{chunk-XQRTJIC7.cjs → chunk-VEP4CV7E.cjs} +32 -3
- package/dist/chunk-VEP4CV7E.cjs.map +1 -0
- package/dist/{chunk-K7AE4BHR.js → chunk-VMBWVH4B.js} +4 -3
- package/dist/chunk-VMBWVH4B.js.map +1 -0
- package/dist/{chunk-J47RNLSY.cjs → chunk-WLNT3YJ7.cjs} +95 -55
- package/dist/chunk-WLNT3YJ7.cjs.map +1 -0
- package/dist/{chunk-L3X22YTN.cjs → chunk-WMF4CWAL.cjs} +185 -185
- package/dist/{chunk-L3X22YTN.cjs.map → chunk-WMF4CWAL.cjs.map} +1 -1
- package/dist/{chunk-4FMKWOPC.js → chunk-X4Q4KB6C.js} +31 -4
- package/dist/chunk-X4Q4KB6C.js.map +1 -0
- package/dist/{chunk-RTXCZT3M.cjs → chunk-XDZOEUNU.cjs} +19 -36
- package/dist/chunk-XDZOEUNU.cjs.map +1 -0
- package/dist/{chunk-GXXNF6NF.cjs → chunk-XNBGNCVV.cjs} +15 -10
- package/dist/chunk-XNBGNCVV.cjs.map +1 -0
- package/dist/{chunk-ZVGS2O2W.cjs → chunk-YCT2YQDL.cjs} +6 -6
- package/dist/{chunk-ZVGS2O2W.cjs.map → chunk-YCT2YQDL.cjs.map} +1 -1
- package/dist/{chunk-ZQE2VUYD.cjs → chunk-YMPV2RMB.cjs} +7 -7
- package/dist/{chunk-ZQE2VUYD.cjs.map → chunk-YMPV2RMB.cjs.map} +1 -1
- package/dist/datasets/index.cjs +17 -17
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +8 -18
- package/dist/docs/assets/SOURCE_MAP.json +254 -254
- package/dist/docs/references/docs-agents-overview.md +4 -4
- package/dist/docs/references/docs-agents-processors.md +1 -1
- package/dist/docs/references/{docs-observability-datasets-overview.md → docs-evals-datasets-overview.md} +12 -12
- package/dist/docs/references/{docs-observability-datasets-running-experiments.md → docs-evals-datasets-running-experiments.md} +9 -9
- package/dist/docs/references/docs-evals-overview.md +8 -9
- package/dist/docs/references/docs-memory-observational-memory.md +20 -11
- package/dist/docs/references/docs-memory-overview.md +4 -4
- package/dist/docs/references/docs-memory-semantic-recall.md +28 -19
- package/dist/docs/references/docs-memory-storage.md +4 -4
- package/dist/docs/references/docs-rag-chunking-and-embedding.md +2 -2
- package/dist/docs/references/docs-server-auth-composite-auth.md +1 -7
- package/dist/docs/references/docs-server-auth-custom-auth-provider.md +2 -4
- package/dist/docs/references/docs-server-auth-jwt.md +1 -1
- package/dist/docs/references/docs-server-auth-simple-auth.md +1 -7
- package/dist/docs/references/docs-server-custom-adapters.md +3 -1
- package/dist/docs/references/docs-server-custom-api-routes.md +1 -1
- package/dist/docs/references/docs-server-mastra-client.md +1 -3
- package/dist/docs/references/docs-server-mastra-server.md +8 -0
- package/dist/docs/references/docs-server-request-context.md +17 -17
- package/dist/docs/references/docs-streaming-events.md +1 -90
- package/dist/docs/references/docs-studio-auth.md +142 -0
- package/dist/docs/references/docs-studio-deployment.md +260 -0
- package/dist/docs/references/docs-studio-observability.md +98 -0
- package/dist/docs/references/docs-studio-overview.md +127 -0
- package/dist/docs/references/docs-workflows-agents-and-tools.md +7 -10
- package/dist/docs/references/docs-workflows-control-flow.md +1 -1
- package/dist/docs/references/docs-workflows-overview.md +12 -7
- package/dist/docs/references/docs-workflows-suspend-and-resume.md +1 -1
- package/dist/docs/references/guides-concepts-multi-agent-systems.md +4 -4
- package/dist/docs/references/reference-agents-agent.md +1 -1
- package/dist/docs/references/reference-configuration.md +4 -4
- package/dist/docs/references/reference-memory-observational-memory.md +1 -1
- package/dist/docs/references/reference-storage-cloudflare-d1.md +1 -1
- package/dist/docs/references/reference-storage-lance.md +1 -1
- package/dist/docs/references/reference-storage-upstash.md +1 -1
- package/dist/docs/references/reference.md +16 -14
- package/dist/evals/index.cjs +5 -5
- package/dist/evals/index.js +2 -2
- package/dist/evals/scoreTraces/index.cjs +3 -3
- package/dist/evals/scoreTraces/index.js +1 -1
- package/dist/harness/harness.d.ts.map +1 -1
- package/dist/harness/index.cjs +13 -12
- package/dist/harness/index.cjs.map +1 -1
- package/dist/harness/index.js +8 -7
- package/dist/harness/index.js.map +1 -1
- 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/llm/model/aisdk/v5/model.d.ts +5 -0
- package/dist/llm/model/aisdk/v5/model.d.ts.map +1 -1
- package/dist/llm/model/aisdk/v6/model.d.ts +5 -0
- package/dist/llm/model/aisdk/v6/model.d.ts.map +1 -1
- package/dist/llm/model/provider-types.generated.d.ts +5 -13
- package/dist/loop/index.cjs +14 -14
- package/dist/loop/index.js +1 -1
- package/dist/loop/network/validation.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts.map +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-WD6XLSFC.cjs +12 -0
- package/dist/{models-dev-5WY37RVC.cjs.map → models-dev-WD6XLSFC.cjs.map} +1 -1
- package/dist/models-dev-XG4KIUFT.js +3 -0
- package/dist/{models-dev-Y2UFJEOO.js.map → models-dev-XG4KIUFT.js.map} +1 -1
- package/dist/netlify-FMBBUFKT.cjs +12 -0
- package/dist/{netlify-ADZQ5ZNY.cjs.map → netlify-FMBBUFKT.cjs.map} +1 -1
- package/dist/netlify-NDOVF45T.js +3 -0
- package/dist/{netlify-I4AUVRO2.js.map → netlify-NDOVF45T.js.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-KHXFOGCK.js +3 -0
- package/dist/{provider-registry-C7SZ5ZT4.js.map → provider-registry-KHXFOGCK.js.map} +1 -1
- package/dist/provider-registry-VUG7E4SG.cjs +40 -0
- package/dist/{provider-registry-I5RW3MEE.cjs.map → provider-registry-VUG7E4SG.cjs.map} +1 -1
- package/dist/provider-registry.json +14 -31
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/storage/index.cjs +74 -74
- package/dist/storage/index.js +1 -1
- package/dist/stream/aisdk/v5/compat/prepare-tools.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/tool-builder/builder.d.ts.map +1 -1
- package/dist/utils.cjs +31 -23
- package/dist/utils.d.ts +10 -0
- package/dist/utils.d.ts.map +1 -1
- 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/workflows/workflow.d.ts.map +1 -1
- package/dist/workspace/index.cjs +68 -68
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/workspace.d.ts +1 -0
- package/dist/workspace/workspace.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/llm/model/provider-types.generated.d.ts +5 -13
- package/dist/chunk-4FMKWOPC.js.map +0 -1
- package/dist/chunk-EKFG6JWW.js.map +0 -1
- package/dist/chunk-GJ62FP5X.js.map +0 -1
- package/dist/chunk-GXXNF6NF.cjs.map +0 -1
- package/dist/chunk-HRT662B6.js.map +0 -1
- package/dist/chunk-J47RNLSY.cjs.map +0 -1
- package/dist/chunk-K7AE4BHR.js.map +0 -1
- package/dist/chunk-KLVNQDUR.cjs.map +0 -1
- package/dist/chunk-LKZQG2ZZ.cjs.map +0 -1
- package/dist/chunk-RTXCZT3M.cjs.map +0 -1
- package/dist/chunk-TVZCMQTV.cjs.map +0 -1
- package/dist/chunk-XOBRMYFA.js.map +0 -1
- package/dist/chunk-XQRTJIC7.cjs.map +0 -1
- package/dist/chunk-ZRLAR66M.js.map +0 -1
- package/dist/docs/references/docs-observability-logging.md +0 -99
- package/dist/docs/references/docs-observability-overview.md +0 -70
- package/dist/docs/references/docs-observability-tracing-bridges-otel.md +0 -209
- package/dist/docs/references/docs-observability-tracing-exporters-arize.md +0 -272
- package/dist/docs/references/docs-observability-tracing-exporters-braintrust.md +0 -126
- package/dist/docs/references/docs-observability-tracing-exporters-cloud.md +0 -127
- package/dist/docs/references/docs-observability-tracing-exporters-datadog.md +0 -317
- package/dist/docs/references/docs-observability-tracing-exporters-default.md +0 -209
- package/dist/docs/references/docs-observability-tracing-exporters-laminar.md +0 -100
- package/dist/docs/references/docs-observability-tracing-exporters-langfuse.md +0 -213
- package/dist/docs/references/docs-observability-tracing-exporters-langsmith.md +0 -198
- package/dist/docs/references/docs-observability-tracing-exporters-otel.md +0 -476
- package/dist/docs/references/docs-observability-tracing-exporters-posthog.md +0 -148
- package/dist/docs/references/docs-observability-tracing-overview.md +0 -1112
- package/dist/models-dev-5WY37RVC.cjs +0 -12
- package/dist/models-dev-Y2UFJEOO.js +0 -3
- package/dist/netlify-ADZQ5ZNY.cjs +0 -12
- package/dist/netlify-I4AUVRO2.js +0 -3
- package/dist/provider-registry-C7SZ5ZT4.js +0 -3
- package/dist/provider-registry-I5RW3MEE.cjs +0 -40
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { DefaultVoice } from './chunk-YDLGEJ7W.js';
|
|
2
2
|
import { PUBSUB_SYMBOL, STREAM_FORMAT_SYMBOL } from './chunk-2QXNHEDL.js';
|
|
3
|
-
import { createWorkspaceTools, createSkillTools, getTiktoken, BM25Index } from './chunk-
|
|
4
|
-
import { InMemoryStore } from './chunk-
|
|
3
|
+
import { createWorkspaceTools, createSkillTools, getTiktoken, BM25Index } from './chunk-EAJDF6UV.js';
|
|
4
|
+
import { InMemoryStore } from './chunk-OLHODPXN.js';
|
|
5
5
|
import { MessageList, coreContentToString, DefaultGeneratedFile, DefaultGeneratedFileWithType, sanitizeToolName } from './chunk-SLZ3WO42.js';
|
|
6
6
|
import { parsePartialJson, isDeepEqualData, stepCountIs } from './chunk-2PHG443D.js';
|
|
7
7
|
import { generateId, APICallError, tool, asSchema } from './chunk-6PALJNKG.js';
|
|
8
8
|
import { executeHook } from './chunk-L54GIUCB.js';
|
|
9
|
-
import { resolveModelConfig, ModelRouterEmbeddingModel, ModelRouterLanguageModel } from './chunk-
|
|
10
|
-
import { MastraLLMV1 } from './chunk-
|
|
9
|
+
import { resolveModelConfig, ModelRouterEmbeddingModel, ModelRouterLanguageModel } from './chunk-PB3KXPNE.js';
|
|
10
|
+
import { MastraLLMV1 } from './chunk-VMBWVH4B.js';
|
|
11
11
|
import { noopLogger } from './chunk-PSCMWPLC.js';
|
|
12
12
|
import { EventEmitterPubSub } from './chunk-X2HAI3OX.js';
|
|
13
|
-
import { removeUndefinedValues, ensureToolProperties, makeCoreTool, createMastraProxy, deepMerge, generateEmptyFromSchema, selectFields, delay } from './chunk-
|
|
13
|
+
import { removeUndefinedValues, safeStringify, ensureToolProperties, makeCoreTool, createMastraProxy, deepMerge, generateEmptyFromSchema, selectFields, ensureSerializable, delay } from './chunk-X4Q4KB6C.js';
|
|
14
14
|
import { resolveObservabilityContext, EntityType, createObservabilityContext, getRootExportSpan, getOrCreateSpan, wrapMastra, executeWithContext, executeWithContextSync } from './chunk-KRFGPA2H.js';
|
|
15
15
|
import { ToolStream } from './chunk-DD2VNRQM.js';
|
|
16
16
|
import { Tool, createTool, isMastraTool, isProviderTool, getProviderToolName, isProviderDefinedTool } from './chunk-FA4PTEBK.js';
|
|
@@ -618,10 +618,16 @@ function prepareToolsAndToolChoice({
|
|
|
618
618
|
activeTools,
|
|
619
619
|
targetVersion = "v2"
|
|
620
620
|
}) {
|
|
621
|
+
if (toolChoice === "none") {
|
|
622
|
+
return {
|
|
623
|
+
tools: void 0,
|
|
624
|
+
toolChoice: { type: "none" }
|
|
625
|
+
};
|
|
626
|
+
}
|
|
621
627
|
if (Object.keys(tools || {}).length === 0) {
|
|
622
628
|
return {
|
|
623
629
|
tools: void 0,
|
|
624
|
-
toolChoice:
|
|
630
|
+
toolChoice: void 0
|
|
625
631
|
};
|
|
626
632
|
}
|
|
627
633
|
const filteredTools = activeTools != null ? Object.entries(tools || {}).filter(([name]) => activeTools.includes(name)) : Object.entries(tools || {});
|
|
@@ -8307,6 +8313,16 @@ function isToolStep(input) {
|
|
|
8307
8313
|
function isStepParams(input) {
|
|
8308
8314
|
return input !== null && typeof input === "object" && "id" in input && "execute" in input && !(input instanceof Agent) && !(input instanceof Tool);
|
|
8309
8315
|
}
|
|
8316
|
+
function findStepInGraph(graph, stepId) {
|
|
8317
|
+
for (const entry of graph) {
|
|
8318
|
+
if ("step" in entry && entry.step?.id === stepId) return entry;
|
|
8319
|
+
if ((entry.type === "conditional" || entry.type === "parallel") && "steps" in entry) {
|
|
8320
|
+
const found = findStepInGraph(entry.steps, stepId);
|
|
8321
|
+
if (found) return found;
|
|
8322
|
+
}
|
|
8323
|
+
}
|
|
8324
|
+
return void 0;
|
|
8325
|
+
}
|
|
8310
8326
|
function createStep(params, agentOrToolOptions) {
|
|
8311
8327
|
if (isAgent(params)) {
|
|
8312
8328
|
return createStepFromAgent(params, agentOrToolOptions);
|
|
@@ -9787,7 +9803,7 @@ var Workflow = class extends MastraBase {
|
|
|
9787
9803
|
const { input, ...steps } = context;
|
|
9788
9804
|
let finalSteps = {};
|
|
9789
9805
|
for (const step of Object.keys(steps)) {
|
|
9790
|
-
const stepGraph = serializedStepGraph
|
|
9806
|
+
const stepGraph = findStepInGraph(serializedStepGraph, step);
|
|
9791
9807
|
finalSteps[step] = steps[step];
|
|
9792
9808
|
if (stepGraph && stepGraph?.step?.component === "WORKFLOW") {
|
|
9793
9809
|
const stepResult = steps[step];
|
|
@@ -11564,7 +11580,7 @@ async function runDefaultCompletionCheck(agent, context, streamContext, abortSig
|
|
|
11564
11580
|
Primitives already executed: ${completedPrimitives.join(", ")}` : "";
|
|
11565
11581
|
const completionPrompt = `
|
|
11566
11582
|
The ${context.selectedPrimitive.type} ${context.selectedPrimitive.id} has contributed to the task.
|
|
11567
|
-
This is the result: ${
|
|
11583
|
+
This is the result: ${safeStringify(context.primitiveResult)}
|
|
11568
11584
|
|
|
11569
11585
|
${completedSection}
|
|
11570
11586
|
|
|
@@ -11660,7 +11676,7 @@ async function generateFinalResult(agent, context, streamContext, abortSignal, o
|
|
|
11660
11676
|
Original task: ${context.originalTask}
|
|
11661
11677
|
|
|
11662
11678
|
The ${context.selectedPrimitive.type} ${context.selectedPrimitive.id} produced this result:
|
|
11663
|
-
${
|
|
11679
|
+
${safeStringify(context.primitiveResult)}
|
|
11664
11680
|
|
|
11665
11681
|
IMPORTANT: If the above result is from an AGENT PRIMITIVE and it is a suitable final result itself considering the original task, then finalResult should be an empty string or undefined.
|
|
11666
11682
|
You should evaluate if the above result is comprehensive enough to accomplish the user's original task.
|
|
@@ -11718,7 +11734,7 @@ async function generateStructuredFinalResult(agent, context, structuredOutputOpt
|
|
|
11718
11734
|
Original task: ${context.originalTask}
|
|
11719
11735
|
|
|
11720
11736
|
The ${context.selectedPrimitive.type} ${context.selectedPrimitive.id} produced this result:
|
|
11721
|
-
${
|
|
11737
|
+
${safeStringify(context.primitiveResult)}
|
|
11722
11738
|
|
|
11723
11739
|
Based on the task and result above, generate a structured response according to the provided schema.
|
|
11724
11740
|
Use the conversation history and primitive results to craft the response.
|
|
@@ -13912,7 +13928,8 @@ function createToolCallStep({
|
|
|
13912
13928
|
args.resourceId = _internal?.resourceId;
|
|
13913
13929
|
}
|
|
13914
13930
|
}
|
|
13915
|
-
const
|
|
13931
|
+
const rawResult = await tool2.execute(args, toolOptions);
|
|
13932
|
+
const result = ensureSerializable(rawResult);
|
|
13916
13933
|
if (tool2 && "onOutput" in tool2 && typeof tool2.onOutput === "function") {
|
|
13917
13934
|
try {
|
|
13918
13935
|
await tool2.onOutput({
|
|
@@ -18437,7 +18454,16 @@ function createMapResultsStep({
|
|
|
18437
18454
|
...modelId && { modelId }
|
|
18438
18455
|
});
|
|
18439
18456
|
}
|
|
18440
|
-
|
|
18457
|
+
const error = payload.error instanceof Error ? payload.error : new MastraError(
|
|
18458
|
+
{
|
|
18459
|
+
id: "AGENT_STREAM_ERROR",
|
|
18460
|
+
domain: "AGENT" /* AGENT */,
|
|
18461
|
+
category: "SYSTEM" /* SYSTEM */,
|
|
18462
|
+
details: { runId }
|
|
18463
|
+
},
|
|
18464
|
+
payload.error
|
|
18465
|
+
);
|
|
18466
|
+
agentSpan?.error({ error, endSpan: true });
|
|
18441
18467
|
return;
|
|
18442
18468
|
}
|
|
18443
18469
|
const aborted = options.abortSignal?.aborted;
|
|
@@ -18465,7 +18491,19 @@ function createMapResultsStep({
|
|
|
18465
18491
|
error: e,
|
|
18466
18492
|
runId
|
|
18467
18493
|
});
|
|
18494
|
+
const spanError = e instanceof Error ? e : new MastraError(
|
|
18495
|
+
{
|
|
18496
|
+
id: "AGENT_ON_FINISH_ERROR",
|
|
18497
|
+
domain: "AGENT" /* AGENT */,
|
|
18498
|
+
category: "SYSTEM" /* SYSTEM */,
|
|
18499
|
+
details: { runId }
|
|
18500
|
+
},
|
|
18501
|
+
e
|
|
18502
|
+
);
|
|
18503
|
+
agentSpan?.error({ error: spanError, endSpan: true });
|
|
18468
18504
|
}
|
|
18505
|
+
} else {
|
|
18506
|
+
agentSpan?.end();
|
|
18469
18507
|
}
|
|
18470
18508
|
await options?.onFinish?.({
|
|
18471
18509
|
...payload,
|
|
@@ -21114,10 +21152,7 @@ ${effectiveInstructions}`;
|
|
|
21114
21152
|
this.logger.error(`[Agent:${this.name}] - messageFilter error: ${filterError}`);
|
|
21115
21153
|
}
|
|
21116
21154
|
}
|
|
21117
|
-
const messagesForSubAgent = [
|
|
21118
|
-
...filteredContextMessages,
|
|
21119
|
-
{ role: "user", content: effectivePrompt }
|
|
21120
|
-
];
|
|
21155
|
+
const messagesForSubAgent = [{ role: "user", content: effectivePrompt }];
|
|
21121
21156
|
const subAgentPromptCreatedAt = /* @__PURE__ */ new Date();
|
|
21122
21157
|
if ((methodType === "generate" || methodType === "generateLegacy") && supportedLanguageModelSpecifications.includes(modelVersion)) {
|
|
21123
21158
|
const generateResult = resumeData ? await agent.resumeGenerate(resumeData, {
|
|
@@ -21126,6 +21161,7 @@ ${effectiveInstructions}`;
|
|
|
21126
21161
|
...resolveObservabilityContext(context ?? {}),
|
|
21127
21162
|
...effectiveInstructions && { instructions: effectiveInstructions },
|
|
21128
21163
|
...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
|
|
21164
|
+
context: filteredContextMessages,
|
|
21129
21165
|
...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
|
|
21130
21166
|
memory: {
|
|
21131
21167
|
resource: subAgentResourceId,
|
|
@@ -21138,6 +21174,7 @@ ${effectiveInstructions}`;
|
|
|
21138
21174
|
...resolveObservabilityContext(context ?? {}),
|
|
21139
21175
|
...effectiveInstructions && { instructions: effectiveInstructions },
|
|
21140
21176
|
...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
|
|
21177
|
+
context: filteredContextMessages,
|
|
21141
21178
|
...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
|
|
21142
21179
|
memory: {
|
|
21143
21180
|
resource: subAgentResourceId,
|
|
@@ -21199,7 +21236,8 @@ ${effectiveInstructions}`;
|
|
|
21199
21236
|
} else if (methodType === "generate" && modelVersion === "v1") {
|
|
21200
21237
|
const generateResult = await agent.generateLegacy(messagesForSubAgent, {
|
|
21201
21238
|
requestContext,
|
|
21202
|
-
...resolveObservabilityContext(context ?? {})
|
|
21239
|
+
...resolveObservabilityContext(context ?? {}),
|
|
21240
|
+
context: filteredContextMessages
|
|
21203
21241
|
});
|
|
21204
21242
|
result = { text: generateResult.text };
|
|
21205
21243
|
} else if ((methodType === "stream" || methodType === "streamLegacy") && supportedLanguageModelSpecifications.includes(modelVersion)) {
|
|
@@ -21209,6 +21247,7 @@ ${effectiveInstructions}`;
|
|
|
21209
21247
|
...resolveObservabilityContext(context ?? {}),
|
|
21210
21248
|
...effectiveInstructions && { instructions: effectiveInstructions },
|
|
21211
21249
|
...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
|
|
21250
|
+
context: filteredContextMessages,
|
|
21212
21251
|
...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
|
|
21213
21252
|
memory: {
|
|
21214
21253
|
resource: subAgentResourceId,
|
|
@@ -21223,6 +21262,7 @@ ${effectiveInstructions}`;
|
|
|
21223
21262
|
...resolveObservabilityContext(context ?? {}),
|
|
21224
21263
|
...effectiveInstructions && { instructions: effectiveInstructions },
|
|
21225
21264
|
...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
|
|
21265
|
+
context: filteredContextMessages,
|
|
21226
21266
|
...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
|
|
21227
21267
|
memory: {
|
|
21228
21268
|
resource: subAgentResourceId,
|
|
@@ -27293,5 +27333,5 @@ var MockMemory = class extends MastraMemory {
|
|
|
27293
27333
|
};
|
|
27294
27334
|
|
|
27295
27335
|
export { Agent, AgentsMDInjector, BaseProcessor, BatchPartsProcessor, ChunkFrom, DefaultExecutionEngine, ExecutionEngine, FilePartSchema, ImagePartSchema, LanguageDetector, MastraAgentNetworkStream, MastraMemory, MastraModelOutput, MastraScorer, MemoryProcessor, MessageContentSchema, MessageHistory, MessagePartSchema, MockMemory, ModerationProcessor, PIIDetector, ProcessorInputPhaseSchema, ProcessorInputStepPhaseSchema, ProcessorMessageContentSchema, ProcessorMessageSchema, ProcessorOutputResultPhaseSchema, ProcessorOutputStepPhaseSchema, ProcessorOutputStreamPhaseSchema, ProcessorRunner, ProcessorState, ProcessorStepInputSchema, ProcessorStepOutputSchema, ProcessorStepSchema, PromptInjectionDetector, ReasoningPartSchema, Run, SemanticRecall, SkillSearchProcessor, SkillsProcessor, SourcePartSchema, StepStartPartSchema, StructuredOutputProcessor, SystemPromptScrubber, TextPartSchema, TokenLimiterProcessor, ToolCallFilter, ToolInvocationPartSchema, ToolSearchProcessor, TripWire, UnicodeNormalizer, WORKING_MEMORY_END_TAG, WORKING_MEMORY_START_TAG, Workflow, WorkflowRunOutput, WorkingMemory, WorkspaceInstructionsProcessor, augmentWithInit, cleanStepResult, cloneStep, cloneWorkflow, convertFullStreamChunkToMastra, convertFullStreamChunkToUIMessageStream, convertMastraChunkToAISDKv5, createDeprecationProxy, createScorer, createStep, createTimeTravelExecutionParams, createWorkflow, extractWorkingMemoryContent, extractWorkingMemoryTags, formatCheckFeedback, formatCompletionFeedback, formatStreamCompletionFeedback, formatValidationFeedback, forwardAgentStreamChunk, generateFinalResult, generateStructuredFinalResult, getResumeLabelsByStepId, getStepIds, getStepResult, getThreadOMMetadata, globalEmbeddingCache, hydrateSerializedStepErrors, isObservationalMemoryEnabled, isProcessor, isProcessorWorkflow, isSupportedLanguageModel, loop, mapVariable, memoryDefaultOptions, parseMemoryRequestContext, removeWorkingMemoryTags, resolveThreadIdFromArgs, runChecks, runCompletionScorers, runCountDeprecationMessage, runDefaultCompletionCheck, runStreamCompletionScorers, runValidation, setThreadOMMetadata, supportedLanguageModelSpecifications, tryGenerateWithJsonFallback, tryStreamWithJsonFallback, validateStepInput, validateStepRequestContext, validateStepResumeData, validateStepStateData, validateStepSuspendData };
|
|
27296
|
-
//# sourceMappingURL=chunk-
|
|
27297
|
-
//# sourceMappingURL=chunk-
|
|
27336
|
+
//# sourceMappingURL=chunk-AJZQPWAV.js.map
|
|
27337
|
+
//# sourceMappingURL=chunk-AJZQPWAV.js.map
|