@mastra/core 1.0.0-beta.4 → 1.0.0-beta.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 +325 -0
- package/dist/agent/agent.d.ts +2 -2
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/agent.types.d.ts +2 -0
- package/dist/agent/agent.types.d.ts.map +1 -1
- package/dist/agent/index.cjs +9 -9
- package/dist/agent/index.js +2 -2
- package/dist/agent/message-list/index.cjs +3 -3
- package/dist/agent/message-list/index.d.ts.map +1 -1
- package/dist/agent/message-list/index.js +1 -1
- package/dist/agent/message-list/prompt/attachments-to-parts.d.ts.map +1 -1
- package/dist/agent/types.d.ts +2 -3
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/utils.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/index.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/map-results-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/stream-step.d.ts +8 -1
- package/dist/agent/workflows/prepare-stream/stream-step.d.ts.map +1 -1
- package/dist/{chunk-3RW5EMSB.js → chunk-3B2OPLGG.js} +13 -6
- package/dist/chunk-3B2OPLGG.js.map +1 -0
- package/dist/{chunk-RXDJL5QT.js → chunk-3ZQ7LX73.js} +13 -13
- package/dist/chunk-3ZQ7LX73.js.map +1 -0
- package/dist/{chunk-5WXEYDFI.cjs → chunk-556MJ7CL.cjs} +33 -26
- package/dist/chunk-556MJ7CL.cjs.map +1 -0
- package/dist/{chunk-HGNRQ3OG.js → chunk-5O52O25J.js} +15 -8
- package/dist/chunk-5O52O25J.js.map +1 -0
- package/dist/{chunk-WTYNK7Q4.js → chunk-5SA2EZ33.js} +421 -29
- package/dist/chunk-5SA2EZ33.js.map +1 -0
- package/dist/chunk-6XCINXZ7.cjs +194 -0
- package/dist/chunk-6XCINXZ7.cjs.map +1 -0
- package/dist/{chunk-MDKPL2R2.js → chunk-7ZADRRDW.js} +5 -4
- package/dist/chunk-7ZADRRDW.js.map +1 -0
- package/dist/{chunk-JXESKY4A.js → chunk-B5J5HYDN.js} +7 -5
- package/dist/chunk-B5J5HYDN.js.map +1 -0
- package/dist/chunk-BWYU7D33.js +192 -0
- package/dist/chunk-BWYU7D33.js.map +1 -0
- package/dist/{chunk-FVNT7VTO.js → chunk-D7CJ4HIQ.js} +240 -17
- package/dist/chunk-D7CJ4HIQ.js.map +1 -0
- package/dist/{chunk-VSM3NLUX.cjs → chunk-DQIZ5FFX.cjs} +163 -129
- package/dist/chunk-DQIZ5FFX.cjs.map +1 -0
- package/dist/{chunk-ZCVTH3CH.cjs → chunk-HNHZGFZY.cjs} +5 -4
- package/dist/chunk-HNHZGFZY.cjs.map +1 -0
- package/dist/{chunk-VZC4BWWH.cjs → chunk-IITXXVYI.cjs} +17 -17
- package/dist/chunk-IITXXVYI.cjs.map +1 -0
- package/dist/{chunk-2OTDXX73.js → chunk-KJIQGPQR.js} +4 -4
- package/dist/{chunk-2OTDXX73.js.map → chunk-KJIQGPQR.js.map} +1 -1
- package/dist/{chunk-2NVBZKZI.cjs → chunk-KP42JLXE.cjs} +370 -132
- package/dist/chunk-KP42JLXE.cjs.map +1 -0
- package/dist/{chunk-IWB65P37.cjs → chunk-KWWD3U7G.cjs} +5 -5
- package/dist/chunk-KWWD3U7G.cjs.map +1 -0
- package/dist/{chunk-3W5RQCCY.cjs → chunk-NHP6ZIDG.cjs} +248 -24
- package/dist/chunk-NHP6ZIDG.cjs.map +1 -0
- package/dist/{chunk-O6NA3Z43.cjs → chunk-OUUPUAGA.cjs} +10 -8
- package/dist/chunk-OUUPUAGA.cjs.map +1 -0
- package/dist/{chunk-D6EDHNGV.js → chunk-PC6EKOWK.js} +64 -11
- package/dist/chunk-PC6EKOWK.js.map +1 -0
- package/dist/{chunk-S6OEQHEI.cjs → chunk-QGWNF2QJ.cjs} +59 -50
- package/dist/chunk-QGWNF2QJ.cjs.map +1 -0
- package/dist/{chunk-HBJPYQRN.cjs → chunk-RROQ46B6.cjs} +69 -16
- package/dist/chunk-RROQ46B6.cjs.map +1 -0
- package/dist/{chunk-U7VECK2G.js → chunk-T2CJRA6E.js} +4 -4
- package/dist/chunk-T2CJRA6E.js.map +1 -0
- package/dist/{chunk-IHJDOC3A.js → chunk-T2UNO766.js} +16 -7
- package/dist/chunk-T2UNO766.js.map +1 -0
- package/dist/{chunk-CYVNOIXS.cjs → chunk-U3VE2EVB.cjs} +11 -11
- package/dist/{chunk-CYVNOIXS.cjs.map → chunk-U3VE2EVB.cjs.map} +1 -1
- package/dist/{chunk-4IKJAKCD.cjs → chunk-V537VSV4.cjs} +74 -16
- package/dist/chunk-V537VSV4.cjs.map +1 -0
- package/dist/{chunk-4RXG622P.cjs → chunk-VYJXTHII.cjs} +422 -30
- package/dist/chunk-VYJXTHII.cjs.map +1 -0
- package/dist/{chunk-LRSB62Z6.cjs → chunk-X7F4CSGR.cjs} +15 -8
- package/dist/chunk-X7F4CSGR.cjs.map +1 -0
- package/dist/{chunk-XXBWX7DT.js → chunk-XBO6W7LZ.js} +328 -91
- package/dist/chunk-XBO6W7LZ.js.map +1 -0
- package/dist/{chunk-KEURQGCQ.js → chunk-XIDKHXNR.js} +74 -17
- package/dist/chunk-XIDKHXNR.js.map +1 -0
- package/dist/{chunk-WQSGX6XA.cjs → chunk-XJQX54QP.cjs} +5 -5
- package/dist/{chunk-WQSGX6XA.cjs.map → chunk-XJQX54QP.cjs.map} +1 -1
- package/dist/{chunk-W3DD3XP5.js → chunk-YDFX3JR2.js} +163 -129
- package/dist/chunk-YDFX3JR2.js.map +1 -0
- package/dist/{chunk-IWQDBVJK.js → chunk-ZTTMSCLU.js} +3 -3
- package/dist/{chunk-IWQDBVJK.js.map → chunk-ZTTMSCLU.js.map} +1 -1
- package/dist/evals/base.d.ts +1 -1
- package/dist/evals/base.d.ts.map +1 -1
- package/dist/evals/base.test-utils.d.ts +25 -25
- package/dist/evals/index.cjs +4 -4
- package/dist/evals/index.js +1 -1
- package/dist/evals/scoreTraces/index.cjs +3 -3
- package/dist/evals/scoreTraces/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/integration/index.cjs +2 -2
- package/dist/integration/index.js +1 -1
- package/dist/llm/index.cjs +18 -14
- package/dist/llm/index.d.ts +2 -1
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +5 -5
- package/dist/llm/model/gateway-resolver.d.ts.map +1 -1
- package/dist/llm/model/gateways/azure.d.ts +36 -0
- package/dist/llm/model/gateways/azure.d.ts.map +1 -0
- package/dist/llm/model/gateways/base.d.ts +3 -6
- package/dist/llm/model/gateways/base.d.ts.map +1 -1
- package/dist/llm/model/gateways/index.d.ts +4 -1
- package/dist/llm/model/gateways/index.d.ts.map +1 -1
- package/dist/llm/model/gateways/models-dev.d.ts +2 -2
- package/dist/llm/model/gateways/models-dev.d.ts.map +1 -1
- package/dist/llm/model/gateways/netlify.d.ts +2 -2
- package/dist/llm/model/gateways/netlify.d.ts.map +1 -1
- package/dist/llm/model/model.d.ts.map +1 -1
- package/dist/llm/model/model.loop.d.ts +1 -1
- package/dist/llm/model/model.loop.d.ts.map +1 -1
- package/dist/llm/model/provider-registry.d.ts.map +1 -1
- package/dist/llm/model/provider-types.generated.d.ts +192 -11
- package/dist/llm/model/registry-generator.d.ts +12 -0
- package/dist/llm/model/registry-generator.d.ts.map +1 -1
- package/dist/llm/model/router.d.ts.map +1 -1
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +1 -1
- package/dist/loop/loop.d.ts.map +1 -1
- package/dist/loop/network/index.d.ts.map +1 -1
- package/dist/loop/test-utils/generateText.d.ts.map +1 -1
- package/dist/loop/test-utils/resultObject.d.ts.map +1 -1
- package/dist/loop/test-utils/streamObject.d.ts.map +1 -1
- package/dist/loop/types.d.ts +8 -0
- package/dist/loop/types.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/index.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts +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.d.ts +9 -9
- package/dist/mastra/index.d.ts.map +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.d.ts +4 -4
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/types.d.ts +2 -2
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/memory/index.cjs +89 -34
- package/dist/memory/index.cjs.map +1 -1
- package/dist/memory/index.js +85 -30
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/mock.d.ts +9 -13
- package/dist/memory/mock.d.ts.map +1 -1
- package/dist/models-dev-F6MTIYTO.js +3 -0
- package/dist/{models-dev-6PRLJKVZ.js.map → models-dev-F6MTIYTO.js.map} +1 -1
- package/dist/models-dev-XIVR5EJV.cjs +12 -0
- package/dist/{models-dev-WHMI5G6Y.cjs.map → models-dev-XIVR5EJV.cjs.map} +1 -1
- package/dist/netlify-MXBOGAJR.cjs +12 -0
- package/dist/{netlify-46I3SNNV.cjs.map → netlify-MXBOGAJR.cjs.map} +1 -1
- package/dist/netlify-RX3JXCFQ.js +3 -0
- package/dist/{netlify-EBQ6YUC6.js.map → netlify-RX3JXCFQ.js.map} +1 -1
- package/dist/processors/index.cjs +11 -11
- package/dist/processors/index.d.ts +2 -2
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/index.js +1 -1
- package/dist/processors/processors/batch-parts.d.ts +1 -1
- package/dist/processors/processors/batch-parts.d.ts.map +1 -1
- package/dist/processors/processors/language-detector.d.ts +1 -1
- package/dist/processors/processors/language-detector.d.ts.map +1 -1
- package/dist/processors/processors/moderation.d.ts +1 -1
- package/dist/processors/processors/moderation.d.ts.map +1 -1
- package/dist/processors/processors/pii-detector.d.ts +1 -1
- package/dist/processors/processors/pii-detector.d.ts.map +1 -1
- package/dist/processors/processors/prompt-injection-detector.d.ts +1 -1
- package/dist/processors/processors/prompt-injection-detector.d.ts.map +1 -1
- package/dist/processors/processors/structured-output.d.ts +1 -1
- package/dist/processors/processors/structured-output.d.ts.map +1 -1
- package/dist/processors/processors/system-prompt-scrubber.d.ts +1 -1
- package/dist/processors/processors/system-prompt-scrubber.d.ts.map +1 -1
- package/dist/processors/processors/token-limiter.d.ts +1 -1
- package/dist/processors/processors/token-limiter.d.ts.map +1 -1
- package/dist/processors/processors/unicode-normalizer.d.ts +1 -1
- package/dist/processors/processors/unicode-normalizer.d.ts.map +1 -1
- package/dist/provider-registry-3LUCE7FT.js +3 -0
- package/dist/{provider-registry-HDG6UMUC.js.map → provider-registry-3LUCE7FT.js.map} +1 -1
- package/dist/provider-registry-NBRXBOQT.cjs +40 -0
- package/dist/{provider-registry-RP2W4B24.cjs.map → provider-registry-NBRXBOQT.cjs.map} +1 -1
- package/dist/provider-registry.json +400 -22
- package/dist/{registry-generator-JPCV47SC.cjs → registry-generator-DEPPRYYJ.cjs} +21 -6
- package/dist/registry-generator-DEPPRYYJ.cjs.map +1 -0
- package/dist/{registry-generator-XD4FPZTU.js → registry-generator-FLW6NV42.js} +21 -7
- package/dist/registry-generator-FLW6NV42.js.map +1 -0
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +1 -1
- package/dist/server/composite-auth.d.ts +9 -0
- package/dist/server/composite-auth.d.ts.map +1 -0
- package/dist/server/index.cjs +31 -0
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +31 -1
- package/dist/server/index.js.map +1 -1
- package/dist/storage/index.cjs +29 -29
- package/dist/storage/index.js +1 -1
- package/dist/stream/aisdk/v5/output.d.ts.map +1 -1
- package/dist/stream/base/output.d.ts.map +1 -1
- package/dist/stream/index.cjs +11 -11
- package/dist/stream/index.js +2 -2
- package/dist/stream/types.d.ts +7 -2
- package/dist/stream/types.d.ts.map +1 -1
- package/dist/test-utils/llm-mock.cjs +2 -2
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/tools/index.cjs +6 -6
- package/dist/tools/index.js +2 -2
- package/dist/tools/is-vercel-tool.cjs +2 -2
- package/dist/tools/is-vercel-tool.js +1 -1
- package/dist/tools/stream.d.ts +1 -0
- package/dist/tools/stream.d.ts.map +1 -1
- package/dist/tools/tool-builder/builder.d.ts +2 -0
- package/dist/tools/tool-builder/builder.d.ts.map +1 -1
- package/dist/tools/tool.d.ts +6 -6
- package/dist/tools/tool.d.ts.map +1 -1
- package/dist/tools/types.d.ts +6 -2
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/validation.d.ts +13 -1
- package/dist/tools/validation.d.ts.map +1 -1
- package/dist/utils.cjs +22 -22
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/vector/filter/index.cjs +7 -189
- package/dist/vector/filter/index.cjs.map +1 -1
- package/dist/vector/filter/index.js +1 -190
- package/dist/vector/filter/index.js.map +1 -1
- package/dist/vector/index.cjs +5 -0
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.ts +1 -0
- package/dist/vector/index.d.ts.map +1 -1
- package/dist/vector/index.js +1 -0
- package/dist/vector/index.js.map +1 -1
- package/dist/vector/types.d.ts +86 -3
- package/dist/vector/types.d.ts.map +1 -1
- package/dist/vector/vector.d.ts +39 -2
- package/dist/vector/vector.d.ts.map +1 -1
- package/dist/workflows/default.d.ts.map +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/evented/step-executor.d.ts.map +1 -1
- package/dist/workflows/index.cjs +23 -19
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/types.d.ts +2 -2
- package/dist/workflows/types.d.ts.map +1 -1
- package/dist/workflows/utils.d.ts +7 -0
- package/dist/workflows/utils.d.ts.map +1 -1
- package/dist/workflows/workflow.d.ts +4 -2
- package/dist/workflows/workflow.d.ts.map +1 -1
- package/package.json +9 -8
- package/src/llm/model/provider-types.generated.d.ts +192 -11
- package/dist/chunk-2NVBZKZI.cjs.map +0 -1
- package/dist/chunk-3RW5EMSB.js.map +0 -1
- package/dist/chunk-3W5RQCCY.cjs.map +0 -1
- package/dist/chunk-4IKJAKCD.cjs.map +0 -1
- package/dist/chunk-4RXG622P.cjs.map +0 -1
- package/dist/chunk-5WXEYDFI.cjs.map +0 -1
- package/dist/chunk-D6EDHNGV.js.map +0 -1
- package/dist/chunk-FVNT7VTO.js.map +0 -1
- package/dist/chunk-HBJPYQRN.cjs.map +0 -1
- package/dist/chunk-HGNRQ3OG.js.map +0 -1
- package/dist/chunk-IHJDOC3A.js.map +0 -1
- package/dist/chunk-IWB65P37.cjs.map +0 -1
- package/dist/chunk-JXESKY4A.js.map +0 -1
- package/dist/chunk-KEURQGCQ.js.map +0 -1
- package/dist/chunk-LRSB62Z6.cjs.map +0 -1
- package/dist/chunk-MDKPL2R2.js.map +0 -1
- package/dist/chunk-O6NA3Z43.cjs.map +0 -1
- package/dist/chunk-RXDJL5QT.js.map +0 -1
- package/dist/chunk-S6OEQHEI.cjs.map +0 -1
- package/dist/chunk-U7VECK2G.js.map +0 -1
- package/dist/chunk-VSM3NLUX.cjs.map +0 -1
- package/dist/chunk-VZC4BWWH.cjs.map +0 -1
- package/dist/chunk-W3DD3XP5.js.map +0 -1
- package/dist/chunk-WTYNK7Q4.js.map +0 -1
- package/dist/chunk-XXBWX7DT.js.map +0 -1
- package/dist/chunk-ZCVTH3CH.cjs.map +0 -1
- package/dist/models-dev-6PRLJKVZ.js +0 -3
- package/dist/models-dev-WHMI5G6Y.cjs +0 -12
- package/dist/netlify-46I3SNNV.cjs +0 -12
- package/dist/netlify-EBQ6YUC6.js +0 -3
- package/dist/provider-registry-HDG6UMUC.js +0 -3
- package/dist/provider-registry-RP2W4B24.cjs +0 -40
- package/dist/registry-generator-JPCV47SC.cjs.map +0 -1
- package/dist/registry-generator-XD4FPZTU.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { DefaultVoice } from './chunk-NZAXAFI3.js';
|
|
2
2
|
import { STREAM_FORMAT_SYMBOL, EMITTER_SYMBOL } from './chunk-NLNKQD2T.js';
|
|
3
|
-
import { MessageList, DefaultGeneratedFile, DefaultGeneratedFileWithType } from './chunk-
|
|
4
|
-
import { resolveModelConfig } from './chunk-
|
|
5
|
-
import { MastraLLMV1 } from './chunk-
|
|
3
|
+
import { MessageList, DefaultGeneratedFile, DefaultGeneratedFileWithType } from './chunk-YDFX3JR2.js';
|
|
4
|
+
import { resolveModelConfig } from './chunk-D7CJ4HIQ.js';
|
|
5
|
+
import { MastraLLMV1 } from './chunk-B5J5HYDN.js';
|
|
6
6
|
import { executeHook } from './chunk-L54GIUCB.js';
|
|
7
|
-
import { removeUndefinedValues, selectFields, ensureToolProperties, makeCoreTool, createMastraProxy, delay } from './chunk-
|
|
7
|
+
import { removeUndefinedValues, selectFields, ensureToolProperties, makeCoreTool, createMastraProxy, isZodType, delay } from './chunk-PC6EKOWK.js';
|
|
8
8
|
import { wrapMastra, getOrCreateSpan } from './chunk-KIZIOFZC.js';
|
|
9
9
|
import { MastraError, getErrorFromUnknown } from './chunk-JJ5O45LH.js';
|
|
10
|
-
import { ToolStream } from './chunk-
|
|
11
|
-
import { Tool, createTool } from './chunk-
|
|
10
|
+
import { ToolStream } from './chunk-5O52O25J.js';
|
|
11
|
+
import { Tool, createTool } from './chunk-XIDKHXNR.js';
|
|
12
12
|
import { RequestContext } from './chunk-GRBGQ2GE.js';
|
|
13
13
|
import { zodToJsonSchema } from './chunk-PJKCPRYF.js';
|
|
14
14
|
import { MastraBase } from './chunk-S6URFGCZ.js';
|
|
@@ -20,8 +20,8 @@ import * as crypto2 from 'crypto';
|
|
|
20
20
|
import { randomUUID } from 'crypto';
|
|
21
21
|
import { getErrorMessage, TypeValidationError } from '@ai-sdk/provider-v5';
|
|
22
22
|
import { generateId, createTextStreamResponse, createUIMessageStreamResponse, createUIMessageStream, asSchema, parsePartialJson, isDeepEqualData, jsonSchema, APICallError, tool, stepCountIs } from 'ai-v5';
|
|
23
|
-
import z5, { z } from 'zod';
|
|
24
23
|
import { OpenAIReasoningSchemaCompatLayer, OpenAISchemaCompatLayer, GoogleSchemaCompatLayer, AnthropicSchemaCompatLayer, DeepSeekSchemaCompatLayer, MetaSchemaCompatLayer, applyCompatLayer } from '@mastra/schema-compat';
|
|
24
|
+
import z5, { z } from 'zod';
|
|
25
25
|
import { isEmpty } from 'radash';
|
|
26
26
|
import { isAbortError, injectJsonInstructionIntoMessages } from '@ai-sdk/provider-utils-v5';
|
|
27
27
|
import { Tiktoken } from 'js-tiktoken/lite';
|
|
@@ -943,7 +943,8 @@ async function validateStepInput({
|
|
|
943
943
|
const errorMessages = errors.map((e) => `- ${e.path?.join(".")}: ${e.message}`).join("\n");
|
|
944
944
|
validationError = new Error("Step input validation failed: \n" + errorMessages);
|
|
945
945
|
} else {
|
|
946
|
-
|
|
946
|
+
const isEmptyData = isEmpty(validatedInput.data);
|
|
947
|
+
inputData = isEmptyData ? prevOutput : validatedInput.data;
|
|
947
948
|
}
|
|
948
949
|
}
|
|
949
950
|
return { inputData, validationError };
|
|
@@ -966,6 +967,27 @@ async function validateStepResumeData({ resumeData, step }) {
|
|
|
966
967
|
}
|
|
967
968
|
return { resumeData, validationError };
|
|
968
969
|
}
|
|
970
|
+
async function validateStepSuspendData({
|
|
971
|
+
suspendData,
|
|
972
|
+
step
|
|
973
|
+
}) {
|
|
974
|
+
if (!suspendData) {
|
|
975
|
+
return { suspendData: void 0, validationError: void 0 };
|
|
976
|
+
}
|
|
977
|
+
let validationError;
|
|
978
|
+
const suspendSchema = step.suspendSchema;
|
|
979
|
+
if (suspendSchema) {
|
|
980
|
+
const validatedSuspendData = await suspendSchema.safeParseAsync(suspendData);
|
|
981
|
+
if (!validatedSuspendData.success) {
|
|
982
|
+
const errors = getZodErrors(validatedSuspendData.error);
|
|
983
|
+
const errorMessages = errors.map((e) => `- ${e.path?.join(".")}: ${e.message}`).join("\n");
|
|
984
|
+
validationError = new Error("Step suspend data validation failed: \n" + errorMessages);
|
|
985
|
+
} else {
|
|
986
|
+
suspendData = validatedSuspendData.data;
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
return { suspendData, validationError };
|
|
990
|
+
}
|
|
969
991
|
function getResumeLabelsByStepId(resumeLabels, stepId) {
|
|
970
992
|
return Object.entries(resumeLabels).filter(([_, value]) => value.stepId === stepId).reduce(
|
|
971
993
|
(acc, [key, value]) => {
|
|
@@ -1654,6 +1676,13 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
1654
1676
|
getInitData: () => stepResults?.input,
|
|
1655
1677
|
getStepResult: getStepResult.bind(this, stepResults),
|
|
1656
1678
|
suspend: async (suspendPayload, suspendOptions) => {
|
|
1679
|
+
const { suspendData, validationError: validationError2 } = await validateStepSuspendData({
|
|
1680
|
+
suspendData: suspendPayload,
|
|
1681
|
+
step
|
|
1682
|
+
});
|
|
1683
|
+
if (validationError2) {
|
|
1684
|
+
throw validationError2;
|
|
1685
|
+
}
|
|
1657
1686
|
executionContext.suspendedPaths[step.id] = executionContext.executionPath;
|
|
1658
1687
|
if (suspendOptions?.resumeLabel) {
|
|
1659
1688
|
const resumeLabel = Array.isArray(suspendOptions.resumeLabel) ? suspendOptions.resumeLabel : [suspendOptions.resumeLabel];
|
|
@@ -1664,7 +1693,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
1664
1693
|
};
|
|
1665
1694
|
}
|
|
1666
1695
|
}
|
|
1667
|
-
suspended = { payload:
|
|
1696
|
+
suspended = { payload: suspendData };
|
|
1668
1697
|
},
|
|
1669
1698
|
bail: (result2) => {
|
|
1670
1699
|
bailed = { payload: result2 };
|
|
@@ -2960,7 +2989,7 @@ function mapVariable(config) {
|
|
|
2960
2989
|
function createStep(params, agentOptions) {
|
|
2961
2990
|
if (params instanceof Agent) {
|
|
2962
2991
|
return {
|
|
2963
|
-
id: params.
|
|
2992
|
+
id: params.id,
|
|
2964
2993
|
description: params.getDescription(),
|
|
2965
2994
|
// @ts-ignore
|
|
2966
2995
|
inputSchema: z.object({
|
|
@@ -3063,6 +3092,8 @@ function createStep(params, agentOptions) {
|
|
|
3063
3092
|
description: params.description,
|
|
3064
3093
|
inputSchema: params.inputSchema,
|
|
3065
3094
|
outputSchema: params.outputSchema,
|
|
3095
|
+
resumeSchema: params.resumeSchema,
|
|
3096
|
+
suspendSchema: params.suspendSchema,
|
|
3066
3097
|
execute: async ({
|
|
3067
3098
|
inputData,
|
|
3068
3099
|
mastra,
|
|
@@ -3079,10 +3110,11 @@ function createStep(params, agentOptions) {
|
|
|
3079
3110
|
mastra,
|
|
3080
3111
|
requestContext,
|
|
3081
3112
|
tracingContext,
|
|
3082
|
-
suspend,
|
|
3083
3113
|
resumeData,
|
|
3084
3114
|
workflow: {
|
|
3085
3115
|
runId,
|
|
3116
|
+
suspend,
|
|
3117
|
+
resumeData,
|
|
3086
3118
|
workflowId,
|
|
3087
3119
|
state,
|
|
3088
3120
|
setState
|
|
@@ -3543,6 +3575,7 @@ var Workflow = class extends MastraBase {
|
|
|
3543
3575
|
const run = this.#runs.get(runIdToUse) ?? new Run({
|
|
3544
3576
|
workflowId: this.id,
|
|
3545
3577
|
stateSchema: this.stateSchema,
|
|
3578
|
+
inputSchema: this.inputSchema,
|
|
3546
3579
|
runId: runIdToUse,
|
|
3547
3580
|
resourceId: options?.resourceId,
|
|
3548
3581
|
executionEngine: this.executionEngine,
|
|
@@ -3902,6 +3935,7 @@ var Run = class {
|
|
|
3902
3935
|
closeStreamAction;
|
|
3903
3936
|
executionResults;
|
|
3904
3937
|
stateSchema;
|
|
3938
|
+
inputSchema;
|
|
3905
3939
|
cleanup;
|
|
3906
3940
|
retryConfig;
|
|
3907
3941
|
constructor(params) {
|
|
@@ -3920,6 +3954,7 @@ var Run = class {
|
|
|
3920
3954
|
this.workflowSteps = params.workflowSteps;
|
|
3921
3955
|
this.validateInputs = params.validateInputs;
|
|
3922
3956
|
this.stateSchema = params.stateSchema;
|
|
3957
|
+
this.inputSchema = params.inputSchema;
|
|
3923
3958
|
this.workflowRunStatus = "pending";
|
|
3924
3959
|
this.workflowEngineType = params.workflowEngineType;
|
|
3925
3960
|
}
|
|
@@ -3936,29 +3971,16 @@ var Run = class {
|
|
|
3936
3971
|
this.abortController?.abort();
|
|
3937
3972
|
}
|
|
3938
3973
|
async _validateInput(inputData) {
|
|
3939
|
-
const firstEntry = this.executionGraph.steps[0];
|
|
3940
3974
|
let inputDataToUse = inputData;
|
|
3941
|
-
if (
|
|
3942
|
-
|
|
3943
|
-
if (
|
|
3944
|
-
const
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
if (firstStep && firstStep.type === "step") {
|
|
3949
|
-
inputSchema = firstStep.step.inputSchema;
|
|
3950
|
-
}
|
|
3951
|
-
}
|
|
3952
|
-
if (inputSchema) {
|
|
3953
|
-
const validatedInputData = await inputSchema.safeParseAsync(inputData);
|
|
3954
|
-
if (!validatedInputData.success) {
|
|
3955
|
-
const errors = getZodErrors(validatedInputData.error);
|
|
3956
|
-
throw new Error(
|
|
3957
|
-
"Invalid input data: \n" + errors.map((e) => `- ${e.path?.join(".")}: ${e.message}`).join("\n")
|
|
3958
|
-
);
|
|
3959
|
-
}
|
|
3960
|
-
inputDataToUse = validatedInputData.data;
|
|
3975
|
+
if (this.validateInputs && this.inputSchema) {
|
|
3976
|
+
const validatedInputData = await this.inputSchema.safeParseAsync(inputData);
|
|
3977
|
+
if (!validatedInputData.success) {
|
|
3978
|
+
const errors = getZodErrors(validatedInputData.error);
|
|
3979
|
+
throw new Error(
|
|
3980
|
+
"Invalid input data: \n" + errors.map((e) => `- ${e.path?.join(".")}: ${e.message}`).join("\n")
|
|
3981
|
+
);
|
|
3961
3982
|
}
|
|
3983
|
+
inputDataToUse = validatedInputData.data;
|
|
3962
3984
|
}
|
|
3963
3985
|
return inputDataToUse;
|
|
3964
3986
|
}
|
|
@@ -6476,13 +6498,87 @@ function createToolCallStep({
|
|
|
6476
6498
|
controller,
|
|
6477
6499
|
runId,
|
|
6478
6500
|
streamState,
|
|
6479
|
-
modelSpanTracker
|
|
6501
|
+
modelSpanTracker,
|
|
6502
|
+
_internal
|
|
6480
6503
|
}) {
|
|
6481
6504
|
return createStep({
|
|
6482
6505
|
id: "toolCallStep",
|
|
6483
6506
|
inputSchema: toolCallInputSchema,
|
|
6484
6507
|
outputSchema: toolCallOutputSchema,
|
|
6485
6508
|
execute: async ({ inputData, suspend, resumeData, requestContext }) => {
|
|
6509
|
+
const addToolApprovalMetadata = (toolCallId, toolName, args) => {
|
|
6510
|
+
const responseMessages = messageList.get.response.db();
|
|
6511
|
+
const lastAssistantMessage = [...responseMessages].reverse().find((msg) => msg.role === "assistant");
|
|
6512
|
+
if (lastAssistantMessage) {
|
|
6513
|
+
const content = lastAssistantMessage.content;
|
|
6514
|
+
if (!content) return;
|
|
6515
|
+
const metadata = typeof lastAssistantMessage.content.metadata === "object" && lastAssistantMessage.content.metadata !== null ? lastAssistantMessage.content.metadata : {};
|
|
6516
|
+
metadata.pendingToolApprovals = metadata.pendingToolApprovals || {};
|
|
6517
|
+
metadata.pendingToolApprovals[toolCallId] = {
|
|
6518
|
+
toolName,
|
|
6519
|
+
args,
|
|
6520
|
+
type: "approval",
|
|
6521
|
+
runId
|
|
6522
|
+
// Store the runId so we can resume after page refresh
|
|
6523
|
+
};
|
|
6524
|
+
lastAssistantMessage.content.metadata = metadata;
|
|
6525
|
+
}
|
|
6526
|
+
};
|
|
6527
|
+
const removeToolApprovalMetadata = async (toolCallId) => {
|
|
6528
|
+
const { saveQueueManager, memoryConfig, threadId } = _internal || {};
|
|
6529
|
+
if (!saveQueueManager || !threadId) {
|
|
6530
|
+
return;
|
|
6531
|
+
}
|
|
6532
|
+
const getMetadata = (message) => {
|
|
6533
|
+
const content = message.content;
|
|
6534
|
+
if (!content) return void 0;
|
|
6535
|
+
const metadata = typeof content.metadata === "object" && content.metadata !== null ? content.metadata : void 0;
|
|
6536
|
+
return metadata;
|
|
6537
|
+
};
|
|
6538
|
+
const allMessages = messageList.get.all.db();
|
|
6539
|
+
const lastAssistantMessage = [...allMessages].reverse().find((msg) => {
|
|
6540
|
+
const metadata = getMetadata(msg);
|
|
6541
|
+
const pendingToolApprovals = metadata?.pendingToolApprovals;
|
|
6542
|
+
return !!pendingToolApprovals?.[toolCallId];
|
|
6543
|
+
});
|
|
6544
|
+
if (lastAssistantMessage) {
|
|
6545
|
+
const metadata = getMetadata(lastAssistantMessage);
|
|
6546
|
+
const pendingToolApprovals = metadata?.pendingToolApprovals;
|
|
6547
|
+
if (pendingToolApprovals && typeof pendingToolApprovals === "object") {
|
|
6548
|
+
delete pendingToolApprovals[toolCallId];
|
|
6549
|
+
if (metadata && Object.keys(pendingToolApprovals).length === 0) {
|
|
6550
|
+
delete metadata.pendingToolApprovals;
|
|
6551
|
+
}
|
|
6552
|
+
try {
|
|
6553
|
+
await saveQueueManager.flushMessages(messageList, threadId, memoryConfig);
|
|
6554
|
+
} catch (error) {
|
|
6555
|
+
console.error("Error removing tool approval metadata:", error);
|
|
6556
|
+
}
|
|
6557
|
+
}
|
|
6558
|
+
}
|
|
6559
|
+
};
|
|
6560
|
+
const flushMessagesBeforeSuspension = async () => {
|
|
6561
|
+
const { saveQueueManager, memoryConfig, threadId, resourceId, memory } = _internal || {};
|
|
6562
|
+
if (!saveQueueManager || !threadId) {
|
|
6563
|
+
return;
|
|
6564
|
+
}
|
|
6565
|
+
try {
|
|
6566
|
+
if (memory && !_internal.threadExists && resourceId) {
|
|
6567
|
+
const thread = await memory.getThreadById?.({ threadId });
|
|
6568
|
+
if (!thread) {
|
|
6569
|
+
await memory.createThread?.({
|
|
6570
|
+
threadId,
|
|
6571
|
+
resourceId,
|
|
6572
|
+
memoryConfig
|
|
6573
|
+
});
|
|
6574
|
+
}
|
|
6575
|
+
_internal.threadExists = true;
|
|
6576
|
+
}
|
|
6577
|
+
await saveQueueManager.flushMessages(messageList, threadId, memoryConfig);
|
|
6578
|
+
} catch (error) {
|
|
6579
|
+
console.error("Error flushing messages before suspension:", error);
|
|
6580
|
+
}
|
|
6581
|
+
};
|
|
6486
6582
|
if (inputData.providerExecuted) {
|
|
6487
6583
|
return {
|
|
6488
6584
|
...inputData,
|
|
@@ -6522,6 +6618,8 @@ function createToolCallStep({
|
|
|
6522
6618
|
args: inputData.args
|
|
6523
6619
|
}
|
|
6524
6620
|
});
|
|
6621
|
+
addToolApprovalMetadata(inputData.toolCallId, inputData.toolName, inputData.args);
|
|
6622
|
+
await flushMessagesBeforeSuspension();
|
|
6525
6623
|
return suspend(
|
|
6526
6624
|
{
|
|
6527
6625
|
requireToolApproval: {
|
|
@@ -6536,6 +6634,7 @@ function createToolCallStep({
|
|
|
6536
6634
|
}
|
|
6537
6635
|
);
|
|
6538
6636
|
} else {
|
|
6637
|
+
await removeToolApprovalMetadata(inputData.toolCallId);
|
|
6539
6638
|
if (!resumeData.approved) {
|
|
6540
6639
|
return {
|
|
6541
6640
|
result: "Tool call was not approved by the user",
|
|
@@ -6558,6 +6657,7 @@ function createToolCallStep({
|
|
|
6558
6657
|
from: "AGENT" /* AGENT */,
|
|
6559
6658
|
payload: { toolCallId: inputData.toolCallId, toolName: inputData.toolName, suspendPayload }
|
|
6560
6659
|
});
|
|
6660
|
+
await flushMessagesBeforeSuspension();
|
|
6561
6661
|
return await suspend(
|
|
6562
6662
|
{
|
|
6563
6663
|
toolCallSuspended: suspendPayload,
|
|
@@ -6571,6 +6671,18 @@ function createToolCallStep({
|
|
|
6571
6671
|
resumeData
|
|
6572
6672
|
};
|
|
6573
6673
|
const result = await tool.execute(inputData.args, toolOptions);
|
|
6674
|
+
if (tool && "onOutput" in tool && typeof tool.onOutput === "function") {
|
|
6675
|
+
try {
|
|
6676
|
+
await tool.onOutput({
|
|
6677
|
+
toolCallId: inputData.toolCallId,
|
|
6678
|
+
toolName: inputData.toolName,
|
|
6679
|
+
output: result,
|
|
6680
|
+
abortSignal: options?.abortSignal
|
|
6681
|
+
});
|
|
6682
|
+
} catch (error) {
|
|
6683
|
+
console.error("Error calling onOutput", error);
|
|
6684
|
+
}
|
|
6685
|
+
}
|
|
6574
6686
|
return { result, ...inputData };
|
|
6575
6687
|
} catch (error) {
|
|
6576
6688
|
return {
|
|
@@ -6590,6 +6702,7 @@ function createAgenticExecutionWorkflow({ models, _internal, ...rest }) {
|
|
|
6590
6702
|
...rest
|
|
6591
6703
|
});
|
|
6592
6704
|
const toolCallStep = createToolCallStep({
|
|
6705
|
+
_internal,
|
|
6593
6706
|
...rest
|
|
6594
6707
|
});
|
|
6595
6708
|
const llmMappingStep = createLLMMappingStep(
|
|
@@ -6614,6 +6727,16 @@ function createAgenticExecutionWorkflow({ models, _internal, ...rest }) {
|
|
|
6614
6727
|
validateInputs: false
|
|
6615
6728
|
}
|
|
6616
6729
|
}).then(llmExecutionStep).map(
|
|
6730
|
+
async ({ inputData }) => {
|
|
6731
|
+
const typedInputData = inputData;
|
|
6732
|
+
const responseMessages = typedInputData.messages.nonUser;
|
|
6733
|
+
if (responseMessages && responseMessages.length > 0) {
|
|
6734
|
+
rest.messageList.add(responseMessages, "response");
|
|
6735
|
+
}
|
|
6736
|
+
return typedInputData;
|
|
6737
|
+
},
|
|
6738
|
+
{ id: "add-response-to-messagelist" }
|
|
6739
|
+
).map(
|
|
6617
6740
|
async ({ inputData }) => {
|
|
6618
6741
|
const typedInputData = inputData;
|
|
6619
6742
|
return typedInputData.output.toolCalls || [];
|
|
@@ -6877,7 +7000,13 @@ function loop({
|
|
|
6877
7000
|
const internalToUse = {
|
|
6878
7001
|
now: _internal?.now || (() => Date.now()),
|
|
6879
7002
|
generateId: _internal?.generateId || (() => generateId()),
|
|
6880
|
-
currentDate: _internal?.currentDate || (() => /* @__PURE__ */ new Date())
|
|
7003
|
+
currentDate: _internal?.currentDate || (() => /* @__PURE__ */ new Date()),
|
|
7004
|
+
saveQueueManager: _internal?.saveQueueManager,
|
|
7005
|
+
memoryConfig: _internal?.memoryConfig,
|
|
7006
|
+
threadId: _internal?.threadId,
|
|
7007
|
+
resourceId: _internal?.resourceId,
|
|
7008
|
+
memory: _internal?.memory,
|
|
7009
|
+
threadExists: _internal?.threadExists
|
|
6881
7010
|
};
|
|
6882
7011
|
let startTimestamp = internalToUse.now?.();
|
|
6883
7012
|
const messageId = rest.experimental_generateMessageId?.() || internalToUse.generateId?.();
|
|
@@ -7063,7 +7192,8 @@ var MastraLLMVNext = class extends MastraBase {
|
|
|
7063
7192
|
_internal,
|
|
7064
7193
|
agentId,
|
|
7065
7194
|
toolCallId,
|
|
7066
|
-
methodType
|
|
7195
|
+
methodType,
|
|
7196
|
+
includeRawChunks
|
|
7067
7197
|
}) {
|
|
7068
7198
|
let stopWhenToUse;
|
|
7069
7199
|
if (maxSteps && typeof maxSteps === "number") {
|
|
@@ -7121,6 +7251,7 @@ var MastraLLMVNext = class extends MastraBase {
|
|
|
7121
7251
|
requireToolApproval,
|
|
7122
7252
|
agentId,
|
|
7123
7253
|
methodType,
|
|
7254
|
+
includeRawChunks,
|
|
7124
7255
|
options: {
|
|
7125
7256
|
...options,
|
|
7126
7257
|
onStepFinish: async (props) => {
|
|
@@ -7158,7 +7289,8 @@ var MastraLLMVNext = class extends MastraBase {
|
|
|
7158
7289
|
usage: props?.usage,
|
|
7159
7290
|
runId
|
|
7160
7291
|
});
|
|
7161
|
-
|
|
7292
|
+
const remainingTokens = parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"] ?? "", 10);
|
|
7293
|
+
if (!isNaN(remainingTokens) && remainingTokens > 0 && remainingTokens < 2e3) {
|
|
7162
7294
|
this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
|
|
7163
7295
|
await delay(10 * 1e3);
|
|
7164
7296
|
}
|
|
@@ -7554,11 +7686,13 @@ async function createNetworkLoop({
|
|
|
7554
7686
|
const routingAgent = await getRoutingAgent({ requestContext, agent });
|
|
7555
7687
|
let completionResult;
|
|
7556
7688
|
const iterationCount = (inputData.iteration ?? -1) + 1;
|
|
7689
|
+
const stepId = generateId3();
|
|
7557
7690
|
await writer.write({
|
|
7558
7691
|
type: "routing-agent-start",
|
|
7559
7692
|
payload: {
|
|
7693
|
+
networkId: agent.id,
|
|
7560
7694
|
agentId: routingAgent.id,
|
|
7561
|
-
runId,
|
|
7695
|
+
runId: stepId,
|
|
7562
7696
|
inputData: {
|
|
7563
7697
|
...inputData,
|
|
7564
7698
|
iteration: iterationCount
|
|
@@ -7604,7 +7738,7 @@ async function createNetworkLoop({
|
|
|
7604
7738
|
await writer.write({
|
|
7605
7739
|
type: "routing-agent-text-start",
|
|
7606
7740
|
payload: {
|
|
7607
|
-
runId
|
|
7741
|
+
runId: stepId
|
|
7608
7742
|
},
|
|
7609
7743
|
from: "NETWORK" /* NETWORK */,
|
|
7610
7744
|
runId
|
|
@@ -7618,6 +7752,7 @@ async function createNetworkLoop({
|
|
|
7618
7752
|
await writer.write({
|
|
7619
7753
|
type: "routing-agent-text-delta",
|
|
7620
7754
|
payload: {
|
|
7755
|
+
runId: stepId,
|
|
7621
7756
|
text: currentSlice
|
|
7622
7757
|
},
|
|
7623
7758
|
from: "NETWORK" /* NETWORK */,
|
|
@@ -7646,6 +7781,7 @@ async function createNetworkLoop({
|
|
|
7646
7781
|
await writer.write({
|
|
7647
7782
|
type: "routing-agent-text-delta",
|
|
7648
7783
|
payload: {
|
|
7784
|
+
runId: stepId,
|
|
7649
7785
|
text: currentSlice
|
|
7650
7786
|
},
|
|
7651
7787
|
from: "NETWORK" /* NETWORK */,
|
|
@@ -7666,7 +7802,7 @@ async function createNetworkLoop({
|
|
|
7666
7802
|
isComplete: true,
|
|
7667
7803
|
selectionReason: completionResult.object.completionReason || "",
|
|
7668
7804
|
iteration: iterationCount,
|
|
7669
|
-
runId
|
|
7805
|
+
runId: stepId
|
|
7670
7806
|
};
|
|
7671
7807
|
await writer.write({
|
|
7672
7808
|
type: "routing-agent-end",
|
|
@@ -7768,7 +7904,7 @@ ${completionResult?.object?.finalResult}` : ""}
|
|
|
7768
7904
|
isComplete: object.primitiveId === "none" && object.primitiveType === "none",
|
|
7769
7905
|
selectionReason: object.selectionReason,
|
|
7770
7906
|
iteration: iterationCount,
|
|
7771
|
-
runId
|
|
7907
|
+
runId: stepId
|
|
7772
7908
|
};
|
|
7773
7909
|
await writer.write({
|
|
7774
7910
|
type: "routing-agent-end",
|
|
@@ -7804,23 +7940,24 @@ ${completionResult?.object?.finalResult}` : ""}
|
|
|
7804
7940
|
}),
|
|
7805
7941
|
execute: async ({ inputData, writer, getInitData }) => {
|
|
7806
7942
|
const agentsMap = await agent.listAgents({ requestContext });
|
|
7807
|
-
const
|
|
7808
|
-
const agentForStep = agentsMap[agentId];
|
|
7943
|
+
const agentForStep = agentsMap[inputData.primitiveId];
|
|
7809
7944
|
if (!agentForStep) {
|
|
7810
7945
|
const mastraError = new MastraError({
|
|
7811
7946
|
id: "AGENT_NETWORK_AGENT_EXECUTION_STEP_INVALID_TASK_INPUT",
|
|
7812
7947
|
domain: "AGENT_NETWORK" /* AGENT_NETWORK */,
|
|
7813
7948
|
category: "USER" /* USER */,
|
|
7814
|
-
text: `Agent ${
|
|
7949
|
+
text: `Agent ${inputData.primitiveId} not found`
|
|
7815
7950
|
});
|
|
7816
7951
|
throw mastraError;
|
|
7817
7952
|
}
|
|
7953
|
+
const agentId = agentForStep.id;
|
|
7954
|
+
const stepId = generateId3();
|
|
7818
7955
|
await writer.write({
|
|
7819
7956
|
type: "agent-execution-start",
|
|
7820
7957
|
payload: {
|
|
7821
|
-
agentId
|
|
7958
|
+
agentId,
|
|
7822
7959
|
args: inputData,
|
|
7823
|
-
runId
|
|
7960
|
+
runId: stepId
|
|
7824
7961
|
},
|
|
7825
7962
|
from: "NETWORK" /* NETWORK */,
|
|
7826
7963
|
runId
|
|
@@ -7832,9 +7969,12 @@ ${completionResult?.object?.finalResult}` : ""}
|
|
|
7832
7969
|
for await (const chunk of result.fullStream) {
|
|
7833
7970
|
await writer.write({
|
|
7834
7971
|
type: `agent-execution-event-${chunk.type}`,
|
|
7835
|
-
payload:
|
|
7836
|
-
|
|
7837
|
-
|
|
7972
|
+
payload: {
|
|
7973
|
+
...chunk,
|
|
7974
|
+
runId: stepId
|
|
7975
|
+
},
|
|
7976
|
+
from: "NETWORK" /* NETWORK */,
|
|
7977
|
+
runId
|
|
7838
7978
|
});
|
|
7839
7979
|
}
|
|
7840
7980
|
const memory = await agent.getMemory({ requestContext });
|
|
@@ -7870,10 +8010,11 @@ ${completionResult?.object?.finalResult}` : ""}
|
|
|
7870
8010
|
});
|
|
7871
8011
|
const endPayload = {
|
|
7872
8012
|
task: inputData.task,
|
|
7873
|
-
agentId
|
|
8013
|
+
agentId,
|
|
7874
8014
|
result: await result.text,
|
|
7875
8015
|
isComplete: false,
|
|
7876
|
-
iteration: inputData.iteration
|
|
8016
|
+
iteration: inputData.iteration,
|
|
8017
|
+
runId: stepId
|
|
7877
8018
|
};
|
|
7878
8019
|
await writer.write({
|
|
7879
8020
|
type: "agent-execution-end",
|
|
@@ -7942,11 +8083,12 @@ ${completionResult?.object?.finalResult}` : ""}
|
|
|
7942
8083
|
);
|
|
7943
8084
|
throw mastraError;
|
|
7944
8085
|
}
|
|
8086
|
+
const stepId = generateId3();
|
|
7945
8087
|
const run = await wf.createRun({ runId });
|
|
7946
8088
|
const toolData = {
|
|
7947
|
-
|
|
8089
|
+
workflowId: wf.id,
|
|
7948
8090
|
args: inputData,
|
|
7949
|
-
runId
|
|
8091
|
+
runId: stepId
|
|
7950
8092
|
};
|
|
7951
8093
|
await writer?.write({
|
|
7952
8094
|
type: "workflow-execution-start",
|
|
@@ -7963,9 +8105,12 @@ ${completionResult?.object?.finalResult}` : ""}
|
|
|
7963
8105
|
chunks.push(chunk);
|
|
7964
8106
|
await writer?.write({
|
|
7965
8107
|
type: `workflow-execution-event-${chunk.type}`,
|
|
7966
|
-
payload:
|
|
7967
|
-
|
|
7968
|
-
|
|
8108
|
+
payload: {
|
|
8109
|
+
...chunk,
|
|
8110
|
+
runId: stepId
|
|
8111
|
+
},
|
|
8112
|
+
from: "NETWORK" /* NETWORK */,
|
|
8113
|
+
runId
|
|
7969
8114
|
});
|
|
7970
8115
|
}
|
|
7971
8116
|
let runSuccess = true;
|
|
@@ -8007,13 +8152,15 @@ ${completionResult?.object?.finalResult}` : ""}
|
|
|
8007
8152
|
primitiveType: inputData.primitiveType,
|
|
8008
8153
|
result: finalResult,
|
|
8009
8154
|
isComplete: false,
|
|
8010
|
-
iteration: inputData.iteration
|
|
8011
|
-
name: wf.name
|
|
8155
|
+
iteration: inputData.iteration
|
|
8012
8156
|
};
|
|
8013
8157
|
await writer?.write({
|
|
8014
8158
|
type: "workflow-execution-end",
|
|
8015
8159
|
payload: {
|
|
8016
8160
|
...endPayload,
|
|
8161
|
+
result: workflowState,
|
|
8162
|
+
name: wf.name,
|
|
8163
|
+
runId: stepId,
|
|
8017
8164
|
usage: await stream.usage
|
|
8018
8165
|
},
|
|
8019
8166
|
from: "NETWORK" /* NETWORK */,
|
|
@@ -8048,14 +8195,13 @@ ${completionResult?.object?.finalResult}` : ""}
|
|
|
8048
8195
|
const memory = await agent.getMemory({ requestContext });
|
|
8049
8196
|
const memoryTools = await memory?.listTools?.();
|
|
8050
8197
|
const toolsMap = { ...agentTools, ...memoryTools };
|
|
8051
|
-
|
|
8052
|
-
let tool = toolsMap[toolId];
|
|
8198
|
+
let tool = toolsMap[inputData.primitiveId];
|
|
8053
8199
|
if (!tool) {
|
|
8054
8200
|
const mastraError = new MastraError({
|
|
8055
8201
|
id: "AGENT_NETWORK_TOOL_EXECUTION_STEP_INVALID_TASK_INPUT",
|
|
8056
8202
|
domain: "AGENT_NETWORK" /* AGENT_NETWORK */,
|
|
8057
8203
|
category: "USER" /* USER */,
|
|
8058
|
-
text: `Tool ${
|
|
8204
|
+
text: `Tool ${inputData.primitiveId} not found`
|
|
8059
8205
|
});
|
|
8060
8206
|
throw mastraError;
|
|
8061
8207
|
}
|
|
@@ -8064,10 +8210,11 @@ ${completionResult?.object?.finalResult}` : ""}
|
|
|
8064
8210
|
id: "AGENT_NETWORK_TOOL_EXECUTION_STEP_INVALID_TASK_INPUT",
|
|
8065
8211
|
domain: "AGENT_NETWORK" /* AGENT_NETWORK */,
|
|
8066
8212
|
category: "USER" /* USER */,
|
|
8067
|
-
text: `Tool ${
|
|
8213
|
+
text: `Tool ${inputData.primitiveId} does not have an execute function`
|
|
8068
8214
|
});
|
|
8069
8215
|
throw mastraError;
|
|
8070
8216
|
}
|
|
8217
|
+
const toolId = tool.id;
|
|
8071
8218
|
let inputDataToUse;
|
|
8072
8219
|
try {
|
|
8073
8220
|
inputDataToUse = JSON.parse(inputData.prompt);
|
|
@@ -11879,6 +12026,7 @@ function createMapResultsStep({
|
|
|
11879
12026
|
stopWhen: result.stopWhen,
|
|
11880
12027
|
maxSteps: result.maxSteps,
|
|
11881
12028
|
providerOptions: result.providerOptions,
|
|
12029
|
+
includeRawChunks: options.includeRawChunks,
|
|
11882
12030
|
options: {
|
|
11883
12031
|
...options.prepareStep && { prepareStep: options.prepareStep },
|
|
11884
12032
|
onFinish: async (payload) => {
|
|
@@ -12234,7 +12382,11 @@ function createStreamStep({
|
|
|
12234
12382
|
resumeContext,
|
|
12235
12383
|
agentId,
|
|
12236
12384
|
toolCallId,
|
|
12237
|
-
methodType
|
|
12385
|
+
methodType,
|
|
12386
|
+
saveQueueManager,
|
|
12387
|
+
memoryConfig,
|
|
12388
|
+
memory,
|
|
12389
|
+
resourceId
|
|
12238
12390
|
}) {
|
|
12239
12391
|
return createStep({
|
|
12240
12392
|
id: "stream-text-step",
|
|
@@ -12261,7 +12413,12 @@ function createStreamStep({
|
|
|
12261
12413
|
requireToolApproval,
|
|
12262
12414
|
resumeContext,
|
|
12263
12415
|
_internal: {
|
|
12264
|
-
generateId: capabilities.generateMessageId
|
|
12416
|
+
generateId: capabilities.generateMessageId,
|
|
12417
|
+
saveQueueManager,
|
|
12418
|
+
memoryConfig,
|
|
12419
|
+
threadId: validatedInputData.threadId,
|
|
12420
|
+
resourceId,
|
|
12421
|
+
memory
|
|
12265
12422
|
},
|
|
12266
12423
|
agentId,
|
|
12267
12424
|
toolCallId,
|
|
@@ -12322,7 +12479,11 @@ function createPrepareStreamWorkflow({
|
|
|
12322
12479
|
resumeContext,
|
|
12323
12480
|
agentId,
|
|
12324
12481
|
toolCallId,
|
|
12325
|
-
methodType
|
|
12482
|
+
methodType,
|
|
12483
|
+
saveQueueManager,
|
|
12484
|
+
memoryConfig,
|
|
12485
|
+
memory,
|
|
12486
|
+
resourceId
|
|
12326
12487
|
});
|
|
12327
12488
|
const mapResultsStep = createMapResultsStep({
|
|
12328
12489
|
capabilities,
|
|
@@ -13363,7 +13524,8 @@ var Agent = class extends MastraBase {
|
|
|
13363
13524
|
requestContext,
|
|
13364
13525
|
tracingContext,
|
|
13365
13526
|
model: await this.getModel({ requestContext }),
|
|
13366
|
-
tracingPolicy: this.#options?.tracingPolicy
|
|
13527
|
+
tracingPolicy: this.#options?.tracingPolicy,
|
|
13528
|
+
requireApproval: toolObj.requireApproval
|
|
13367
13529
|
};
|
|
13368
13530
|
const convertedToCoreTool = makeCoreTool(toolObj, options);
|
|
13369
13531
|
convertedMemoryTools[toolName] = convertedToCoreTool;
|
|
@@ -13561,7 +13723,8 @@ var Agent = class extends MastraBase {
|
|
|
13561
13723
|
requestContext,
|
|
13562
13724
|
tracingContext,
|
|
13563
13725
|
model: await this.getModel({ requestContext }),
|
|
13564
|
-
tracingPolicy: this.#options?.tracingPolicy
|
|
13726
|
+
tracingPolicy: this.#options?.tracingPolicy,
|
|
13727
|
+
requireApproval: toolObj.requireApproval
|
|
13565
13728
|
};
|
|
13566
13729
|
const convertedToCoreTool = makeCoreTool(toolObj, options, "toolset");
|
|
13567
13730
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
@@ -13604,7 +13767,8 @@ var Agent = class extends MastraBase {
|
|
|
13604
13767
|
requestContext,
|
|
13605
13768
|
tracingContext,
|
|
13606
13769
|
model: await this.getModel({ requestContext }),
|
|
13607
|
-
tracingPolicy: this.#options?.tracingPolicy
|
|
13770
|
+
tracingPolicy: this.#options?.tracingPolicy,
|
|
13771
|
+
requireApproval: tool.requireApproval
|
|
13608
13772
|
};
|
|
13609
13773
|
const convertedToCoreTool = makeCoreTool(rest, options, "client-tool");
|
|
13610
13774
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
@@ -13629,7 +13793,11 @@ var Agent = class extends MastraBase {
|
|
|
13629
13793
|
if (Object.keys(agents).length > 0) {
|
|
13630
13794
|
for (const [agentName, agent] of Object.entries(agents)) {
|
|
13631
13795
|
const agentInputSchema = z.object({
|
|
13632
|
-
prompt: z.string().describe("The prompt to send to the agent")
|
|
13796
|
+
prompt: z.string().describe("The prompt to send to the agent"),
|
|
13797
|
+
threadId: z.string().optional().describe("Thread ID for conversation continuity for memory messages"),
|
|
13798
|
+
resourceId: z.string().optional().describe("Resource/user identifier for memory messages"),
|
|
13799
|
+
instructions: z.string().optional().describe("Custom instructions to override agent defaults"),
|
|
13800
|
+
maxSteps: z.number().optional().describe("Maximum number of execution steps for the sub-agent")
|
|
13633
13801
|
});
|
|
13634
13802
|
const agentOutputSchema = z.object({
|
|
13635
13803
|
text: z.string().describe("The response from the agent"),
|
|
@@ -13643,7 +13811,6 @@ var Agent = class extends MastraBase {
|
|
|
13643
13811
|
inputSchema: agentInputSchema,
|
|
13644
13812
|
outputSchema: agentOutputSchema,
|
|
13645
13813
|
mastra: this.#mastra,
|
|
13646
|
-
// BREAKING CHANGE v1.0: New tool signature - first param is inputData, second is context
|
|
13647
13814
|
// manually wrap agent tools with tracing, so that we can pass the
|
|
13648
13815
|
// current tool span onto the agent to maintain continuity of the trace
|
|
13649
13816
|
execute: async (inputData, context) => {
|
|
@@ -13656,16 +13823,18 @@ var Agent = class extends MastraBase {
|
|
|
13656
13823
|
resourceId
|
|
13657
13824
|
});
|
|
13658
13825
|
let result;
|
|
13826
|
+
const slugify = await import('@sindresorhus/slugify');
|
|
13827
|
+
const subAgentThreadId = inputData.threadId || context?.mastra?.generateId() || randomUUID();
|
|
13828
|
+
const subAgentResourceId = inputData.resourceId || context?.mastra?.generateId() || `${slugify.default(this.id)}-${agentName}`;
|
|
13659
13829
|
if ((methodType === "generate" || methodType === "generateLegacy") && modelVersion === "v2") {
|
|
13660
13830
|
if (!agent.hasOwnMemory() && this.#memory) {
|
|
13661
13831
|
agent.__setMemory(this.#memory);
|
|
13662
13832
|
}
|
|
13663
|
-
const subAgentThreadId = randomUUID();
|
|
13664
|
-
const slugify = await import('@sindresorhus/slugify');
|
|
13665
|
-
const subAgentResourceId = `${slugify.default(this.id)}-${agentName}`;
|
|
13666
13833
|
const generateResult = await agent.generate(inputData.prompt, {
|
|
13667
13834
|
requestContext,
|
|
13668
13835
|
tracingContext: context?.tracingContext,
|
|
13836
|
+
...inputData.instructions && { instructions: inputData.instructions },
|
|
13837
|
+
...inputData.maxSteps && { maxSteps: inputData.maxSteps },
|
|
13669
13838
|
...resourceId && threadId ? {
|
|
13670
13839
|
memory: {
|
|
13671
13840
|
resource: subAgentResourceId,
|
|
@@ -13684,12 +13853,11 @@ var Agent = class extends MastraBase {
|
|
|
13684
13853
|
if (!agent.hasOwnMemory() && this.#memory) {
|
|
13685
13854
|
agent.__setMemory(this.#memory);
|
|
13686
13855
|
}
|
|
13687
|
-
const subAgentThreadId = randomUUID();
|
|
13688
|
-
const slugify = await import('@sindresorhus/slugify');
|
|
13689
|
-
const subAgentResourceId = `${slugify.default(this.id)}-${agentName}`;
|
|
13690
13856
|
const streamResult = await agent.stream(inputData.prompt, {
|
|
13691
13857
|
requestContext,
|
|
13692
13858
|
tracingContext: context?.tracingContext,
|
|
13859
|
+
...inputData.instructions && { instructions: inputData.instructions },
|
|
13860
|
+
...inputData.maxSteps && { maxSteps: inputData.maxSteps },
|
|
13693
13861
|
...resourceId && threadId ? {
|
|
13694
13862
|
memory: {
|
|
13695
13863
|
resource: subAgentResourceId,
|
|
@@ -13700,7 +13868,11 @@ var Agent = class extends MastraBase {
|
|
|
13700
13868
|
let fullText = "";
|
|
13701
13869
|
for await (const chunk of streamResult.fullStream) {
|
|
13702
13870
|
if (context?.writer) {
|
|
13703
|
-
|
|
13871
|
+
if (chunk.type.startsWith("data-")) {
|
|
13872
|
+
await context.writer.custom(chunk);
|
|
13873
|
+
} else {
|
|
13874
|
+
await context.writer.write(chunk);
|
|
13875
|
+
}
|
|
13704
13876
|
}
|
|
13705
13877
|
if (chunk.type === "text-delta") {
|
|
13706
13878
|
fullText += chunk.payload.text;
|
|
@@ -13715,7 +13887,11 @@ var Agent = class extends MastraBase {
|
|
|
13715
13887
|
let fullText = "";
|
|
13716
13888
|
for await (const chunk of streamResult.fullStream) {
|
|
13717
13889
|
if (context?.writer) {
|
|
13718
|
-
|
|
13890
|
+
if (chunk.type.startsWith("data-")) {
|
|
13891
|
+
await context.writer.custom(chunk);
|
|
13892
|
+
} else {
|
|
13893
|
+
await context.writer.write(chunk);
|
|
13894
|
+
}
|
|
13719
13895
|
}
|
|
13720
13896
|
if (chunk.type === "text-delta") {
|
|
13721
13897
|
fullText += chunk.textDelta;
|
|
@@ -13782,13 +13958,25 @@ var Agent = class extends MastraBase {
|
|
|
13782
13958
|
const workflows = await this.listWorkflows({ requestContext });
|
|
13783
13959
|
if (Object.keys(workflows).length > 0) {
|
|
13784
13960
|
for (const [workflowName, workflow] of Object.entries(workflows)) {
|
|
13961
|
+
const extendedInputSchema = z.object({
|
|
13962
|
+
inputData: workflow.inputSchema,
|
|
13963
|
+
...workflow.stateSchema ? { initialState: workflow.stateSchema } : {}
|
|
13964
|
+
});
|
|
13785
13965
|
const toolObj = createTool({
|
|
13786
13966
|
id: `workflow-${workflowName}`,
|
|
13787
13967
|
description: workflow.description || `Workflow: ${workflowName}`,
|
|
13788
|
-
inputSchema:
|
|
13789
|
-
outputSchema: z.
|
|
13968
|
+
inputSchema: extendedInputSchema,
|
|
13969
|
+
outputSchema: z.union([
|
|
13970
|
+
z.object({
|
|
13971
|
+
result: workflow.outputSchema,
|
|
13972
|
+
runId: z.string().describe("Unique identifier for the workflow run")
|
|
13973
|
+
}),
|
|
13974
|
+
z.object({
|
|
13975
|
+
runId: z.string().describe("Unique identifier for the workflow run"),
|
|
13976
|
+
error: z.string().describe("Error message if workflow execution failed")
|
|
13977
|
+
})
|
|
13978
|
+
]),
|
|
13790
13979
|
mastra: this.#mastra,
|
|
13791
|
-
// BREAKING CHANGE v1.0: New tool signature - first param is inputData, second is context
|
|
13792
13980
|
// manually wrap workflow tools with tracing, so that we can pass the
|
|
13793
13981
|
// current tool span onto the workflow to maintain continuity of the trace
|
|
13794
13982
|
execute: async (inputData, context) => {
|
|
@@ -13802,16 +13990,18 @@ var Agent = class extends MastraBase {
|
|
|
13802
13990
|
resourceId
|
|
13803
13991
|
});
|
|
13804
13992
|
const run = await workflow.createRun();
|
|
13805
|
-
|
|
13993
|
+
const { initialState, inputData: workflowInputData } = inputData;
|
|
13994
|
+
let result = void 0;
|
|
13806
13995
|
if (methodType === "generate" || methodType === "generateLegacy") {
|
|
13807
13996
|
result = await run.start({
|
|
13808
|
-
inputData,
|
|
13997
|
+
inputData: workflowInputData,
|
|
13809
13998
|
requestContext,
|
|
13810
|
-
tracingContext: context?.tracingContext
|
|
13999
|
+
tracingContext: context?.tracingContext,
|
|
14000
|
+
...initialState && { initialState }
|
|
13811
14001
|
});
|
|
13812
14002
|
} else if (methodType === "streamLegacy") {
|
|
13813
14003
|
const streamResult = run.streamLegacy({
|
|
13814
|
-
inputData,
|
|
14004
|
+
inputData: workflowInputData,
|
|
13815
14005
|
requestContext,
|
|
13816
14006
|
tracingContext: context?.tracingContext
|
|
13817
14007
|
});
|
|
@@ -13824,17 +14014,36 @@ var Agent = class extends MastraBase {
|
|
|
13824
14014
|
result = await streamResult.getWorkflowState();
|
|
13825
14015
|
} else if (methodType === "stream") {
|
|
13826
14016
|
const streamResult = run.stream({
|
|
13827
|
-
inputData,
|
|
14017
|
+
inputData: workflowInputData,
|
|
13828
14018
|
requestContext,
|
|
13829
|
-
tracingContext: context?.tracingContext
|
|
14019
|
+
tracingContext: context?.tracingContext,
|
|
14020
|
+
...initialState && { initialState }
|
|
13830
14021
|
});
|
|
13831
14022
|
if (context?.writer) {
|
|
13832
14023
|
await streamResult.fullStream.pipeTo(context.writer);
|
|
13833
14024
|
}
|
|
13834
14025
|
result = await streamResult.result;
|
|
13835
14026
|
}
|
|
13836
|
-
|
|
13837
|
-
|
|
14027
|
+
if (result?.status === "success") {
|
|
14028
|
+
const workflowOutput = result?.result || result;
|
|
14029
|
+
return { result: workflowOutput, runId: run.runId };
|
|
14030
|
+
} else if (result?.status === "failed") {
|
|
14031
|
+
const workflowOutputError = result?.error;
|
|
14032
|
+
return {
|
|
14033
|
+
error: workflowOutputError?.message || String(workflowOutputError) || "Workflow execution failed",
|
|
14034
|
+
runId: run.runId
|
|
14035
|
+
};
|
|
14036
|
+
} else if (result?.status === "suspended") {
|
|
14037
|
+
return {
|
|
14038
|
+
error: `Workflow ended with status: "suspended". This is not currently handled in the basic agent workflow tool transformation. To achieve this you'll need to write your own tool that uses a workflow internally.`,
|
|
14039
|
+
runId: run.runId
|
|
14040
|
+
};
|
|
14041
|
+
} else {
|
|
14042
|
+
return {
|
|
14043
|
+
error: `Workflow should never reach this path, workflow returned no status`,
|
|
14044
|
+
runId: run.runId
|
|
14045
|
+
};
|
|
14046
|
+
}
|
|
13838
14047
|
} catch (err) {
|
|
13839
14048
|
const mastraError = new MastraError(
|
|
13840
14049
|
{
|
|
@@ -14209,6 +14418,34 @@ var Agent = class extends MastraBase {
|
|
|
14209
14418
|
);
|
|
14210
14419
|
}
|
|
14211
14420
|
const llm = await this.getLLM({ requestContext, model: options.model });
|
|
14421
|
+
if ("structuredOutput" in options && options.structuredOutput && options.structuredOutput.schema) {
|
|
14422
|
+
let structuredOutputModel = llm.getModel();
|
|
14423
|
+
if (options.structuredOutput?.model) {
|
|
14424
|
+
structuredOutputModel = await this.resolveModelConfig(
|
|
14425
|
+
options.structuredOutput?.model,
|
|
14426
|
+
requestContext
|
|
14427
|
+
);
|
|
14428
|
+
}
|
|
14429
|
+
const targetProvider = structuredOutputModel.provider;
|
|
14430
|
+
const targetModelId = structuredOutputModel.modelId;
|
|
14431
|
+
if (targetProvider.includes("openai") || targetModelId.includes("openai")) {
|
|
14432
|
+
if (isZodType(options.structuredOutput.schema) && targetModelId) {
|
|
14433
|
+
const modelInfo = {
|
|
14434
|
+
provider: targetProvider,
|
|
14435
|
+
modelId: targetModelId,
|
|
14436
|
+
supportsStructuredOutputs: false
|
|
14437
|
+
// Set to false to enable transform
|
|
14438
|
+
};
|
|
14439
|
+
const isReasoningModel = /^o[1-5]/.test(targetModelId);
|
|
14440
|
+
const compatLayer = isReasoningModel ? new OpenAIReasoningSchemaCompatLayer(modelInfo) : new OpenAISchemaCompatLayer(modelInfo);
|
|
14441
|
+
if (compatLayer.shouldApply() && options.structuredOutput.schema) {
|
|
14442
|
+
options.structuredOutput.schema = compatLayer.processZodType(
|
|
14443
|
+
options.structuredOutput.schema
|
|
14444
|
+
);
|
|
14445
|
+
}
|
|
14446
|
+
}
|
|
14447
|
+
}
|
|
14448
|
+
}
|
|
14212
14449
|
const runId = options.runId || this.#mastra?.generateId() || randomUUID();
|
|
14213
14450
|
const instructions = options.instructions || await this.getInstructions({ requestContext });
|
|
14214
14451
|
const agentSpan = getOrCreateSpan({
|
|
@@ -16525,6 +16762,6 @@ var MastraModelOutput = class extends MastraBase {
|
|
|
16525
16762
|
}
|
|
16526
16763
|
};
|
|
16527
16764
|
|
|
16528
|
-
export { AISDKV5OutputStream, Agent, BatchPartsProcessor, ChunkFrom, DefaultExecutionEngine, ExecutionEngine, LanguageDetector, MastraAgentNetworkStream, MastraModelOutput, ModerationProcessor, PIIDetector, ProcessorState, PromptInjectionDetector, Run, StructuredOutputProcessor, SystemPromptScrubber, TokenLimiterProcessor, TripWire, UnicodeNormalizer, Workflow, WorkflowRunOutput, cloneStep, cloneWorkflow, convertFullStreamChunkToUIMessageStream, convertMastraChunkToAISDKv5, createDeprecationProxy, createStep, createTimeTravelExecutionParams, createWorkflow, getResumeLabelsByStepId, getStepIds, getStepResult, getZodErrors, loop, mapVariable, resolveThreadIdFromArgs, runCountDeprecationMessage, tryGenerateWithJsonFallback, tryStreamWithJsonFallback, validateStepInput, validateStepResumeData };
|
|
16529
|
-
//# sourceMappingURL=chunk-
|
|
16530
|
-
//# sourceMappingURL=chunk-
|
|
16765
|
+
export { AISDKV5OutputStream, Agent, BatchPartsProcessor, ChunkFrom, DefaultExecutionEngine, ExecutionEngine, LanguageDetector, MastraAgentNetworkStream, MastraModelOutput, ModerationProcessor, PIIDetector, ProcessorState, PromptInjectionDetector, Run, StructuredOutputProcessor, SystemPromptScrubber, TokenLimiterProcessor, TripWire, UnicodeNormalizer, Workflow, WorkflowRunOutput, cloneStep, cloneWorkflow, convertFullStreamChunkToUIMessageStream, convertMastraChunkToAISDKv5, createDeprecationProxy, createStep, createTimeTravelExecutionParams, createWorkflow, getResumeLabelsByStepId, getStepIds, getStepResult, getZodErrors, loop, mapVariable, resolveThreadIdFromArgs, runCountDeprecationMessage, tryGenerateWithJsonFallback, tryStreamWithJsonFallback, validateStepInput, validateStepResumeData, validateStepSuspendData };
|
|
16766
|
+
//# sourceMappingURL=chunk-XBO6W7LZ.js.map
|
|
16767
|
+
//# sourceMappingURL=chunk-XBO6W7LZ.js.map
|