@mastra/core 1.13.3-alpha.1 → 1.14.0-alpha.2
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 +10 -0
- package/dist/_types/@internal_core/dist/index.d.ts +1333 -0
- package/dist/agent/index.cjs +13 -13
- package/dist/agent/index.js +2 -2
- package/dist/agent/message-list/conversion/output-converter.d.ts.map +1 -1
- package/dist/agent/message-list/index.cjs +18 -18
- package/dist/agent/message-list/index.js +1 -1
- package/dist/agent/message-list/message-list.d.ts +12 -1
- package/dist/agent/message-list/message-list.d.ts.map +1 -1
- package/dist/agent/message-list/types.d.ts +3 -3
- package/dist/agent/types.d.ts +1 -1
- package/dist/{chunk-3B6BQEKK.cjs → chunk-2FDGDAJQ.cjs} +3 -3
- package/dist/{chunk-3B6BQEKK.cjs.map → chunk-2FDGDAJQ.cjs.map} +1 -1
- package/dist/{chunk-GYSKVDYD.js → chunk-3TECGW34.js} +5 -5
- package/dist/{chunk-GYSKVDYD.js.map → chunk-3TECGW34.js.map} +1 -1
- package/dist/{chunk-Q4W5XQK2.cjs → chunk-445B4SO3.cjs} +292 -403
- package/dist/chunk-445B4SO3.cjs.map +1 -0
- package/dist/{chunk-WO2CP4Z2.cjs → chunk-4X35LO4W.cjs} +32 -156
- package/dist/chunk-4X35LO4W.cjs.map +1 -0
- package/dist/{chunk-GC7AHOXK.js → chunk-5LHPEIQQ.js} +12 -12
- package/dist/chunk-5LHPEIQQ.js.map +1 -0
- package/dist/{chunk-CMTNYR6E.js → chunk-5UAF67E3.js} +9 -9
- package/dist/{chunk-CMTNYR6E.js.map → chunk-5UAF67E3.js.map} +1 -1
- package/dist/{chunk-SBHYPYXD.js → chunk-5WKCTOYN.js} +13 -13
- package/dist/chunk-5WKCTOYN.js.map +1 -0
- package/dist/{chunk-WKZEZJKQ.js → chunk-7V4HN5NK.js} +5 -5
- package/dist/{chunk-WKZEZJKQ.js.map → chunk-7V4HN5NK.js.map} +1 -1
- package/dist/{chunk-F3SHGIQA.cjs → chunk-B3KIJAOJ.cjs} +185 -185
- package/dist/{chunk-F3SHGIQA.cjs.map → chunk-B3KIJAOJ.cjs.map} +1 -1
- package/dist/{chunk-TAXQJ5ZP.js → chunk-BOUXMXZQ.js} +4 -94
- package/dist/chunk-BOUXMXZQ.js.map +1 -0
- package/dist/{chunk-MIILNUS4.cjs → chunk-DDIY3CRP.cjs} +10 -10
- package/dist/chunk-DDIY3CRP.cjs.map +1 -0
- package/dist/{chunk-4RWTWZET.cjs → chunk-EAKNCJKL.cjs} +31 -433
- package/dist/chunk-EAKNCJKL.cjs.map +1 -0
- package/dist/{chunk-RE3YFYVQ.cjs → chunk-EH5D56XV.cjs} +7 -7
- package/dist/{chunk-RE3YFYVQ.cjs.map → chunk-EH5D56XV.cjs.map} +1 -1
- package/dist/{chunk-A2B3L753.js → chunk-FZNKE4DK.js} +4 -4
- package/dist/{chunk-A2B3L753.js.map → chunk-FZNKE4DK.js.map} +1 -1
- package/dist/chunk-GVQJCS5O.js +812 -0
- package/dist/chunk-GVQJCS5O.js.map +1 -0
- package/dist/{chunk-NUZYNU4M.cjs → chunk-J7Q3CZI5.cjs} +14 -14
- package/dist/{chunk-NUZYNU4M.cjs.map → chunk-J7Q3CZI5.cjs.map} +1 -1
- package/dist/{chunk-CJYTDH5Q.js → chunk-KJUHI5QK.js} +5 -5
- package/dist/chunk-KJUHI5QK.js.map +1 -0
- package/dist/{chunk-B44JEQHW.js → chunk-KKNT7W4Q.js} +4 -4
- package/dist/{chunk-B44JEQHW.js.map → chunk-KKNT7W4Q.js.map} +1 -1
- package/dist/{chunk-FDC6E3MJ.cjs → chunk-LAFTYVLN.cjs} +72 -72
- package/dist/chunk-LAFTYVLN.cjs.map +1 -0
- package/dist/chunk-LIRWMGGI.cjs +931 -0
- package/dist/chunk-LIRWMGGI.cjs.map +1 -0
- package/dist/{chunk-6JM4RID6.js → chunk-MCAE3D3S.js} +41 -7
- package/dist/chunk-MCAE3D3S.js.map +1 -0
- package/dist/{chunk-T5M2TGCD.js → chunk-OGR427FH.js} +14 -350
- package/dist/chunk-OGR427FH.js.map +1 -0
- package/dist/{chunk-AZZGCVBY.js → chunk-PV2DBPYF.js} +3 -3
- package/dist/{chunk-AZZGCVBY.js.map → chunk-PV2DBPYF.js.map} +1 -1
- package/dist/{chunk-Z7JQTINS.js → chunk-QROAUTDP.js} +3 -3
- package/dist/{chunk-Z7JQTINS.js.map → chunk-QROAUTDP.js.map} +1 -1
- package/dist/{chunk-DRZWU4MQ.cjs → chunk-RQFAL5VW.cjs} +13 -13
- package/dist/chunk-RQFAL5VW.cjs.map +1 -0
- package/dist/{chunk-YTSTLTQ5.cjs → chunk-SRNRUDZ2.cjs} +21 -21
- package/dist/{chunk-YTSTLTQ5.cjs.map → chunk-SRNRUDZ2.cjs.map} +1 -1
- package/dist/{chunk-L2YA2HHZ.js → chunk-SRVR5Z2F.js} +5 -5
- package/dist/{chunk-L2YA2HHZ.js.map → chunk-SRVR5Z2F.js.map} +1 -1
- package/dist/{chunk-KMG525KB.js → chunk-TFV75T4H.js} +10 -10
- package/dist/{chunk-KMG525KB.js.map → chunk-TFV75T4H.js.map} +1 -1
- package/dist/{chunk-26JVEE76.cjs → chunk-UHO57W6H.cjs} +7 -7
- package/dist/{chunk-26JVEE76.cjs.map → chunk-UHO57W6H.cjs.map} +1 -1
- package/dist/{chunk-QXNHZJRV.js → chunk-UWTB4U2X.js} +127 -238
- package/dist/chunk-UWTB4U2X.js.map +1 -0
- package/dist/{chunk-E2Y2HLCU.cjs → chunk-W2LUCUUP.cjs} +41 -7
- package/dist/chunk-W2LUCUUP.cjs.map +1 -0
- package/dist/{chunk-X7IX2H7I.cjs → chunk-XVH7SCZN.cjs} +13 -13
- package/dist/{chunk-X7IX2H7I.cjs.map → chunk-XVH7SCZN.cjs.map} +1 -1
- package/dist/{chunk-CXYQJVHK.cjs → chunk-YSQC2LEG.cjs} +10 -10
- package/dist/{chunk-CXYQJVHK.cjs.map → chunk-YSQC2LEG.cjs.map} +1 -1
- package/dist/{chunk-XNHOUTCP.cjs → chunk-ZSFSSMFT.cjs} +84 -84
- package/dist/{chunk-XNHOUTCP.cjs.map → chunk-ZSFSSMFT.cjs.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 +721 -708
- package/dist/docs/references/docs-agents-adding-voice.md +6 -6
- package/dist/docs/references/docs-agents-agent-approval.md +4 -4
- package/dist/docs/references/docs-agents-guardrails.md +1 -1
- package/dist/docs/references/docs-agents-network-approval.md +1 -1
- package/dist/docs/references/docs-agents-networks.md +1 -1
- package/dist/docs/references/docs-agents-overview.md +2 -2
- package/dist/docs/references/docs-agents-processors.md +11 -11
- package/dist/docs/references/docs-agents-structured-output.md +4 -4
- package/dist/docs/references/docs-agents-supervisor-agents.md +3 -3
- package/dist/docs/references/docs-agents-using-tools.md +4 -4
- package/dist/docs/references/docs-evals-custom-scorers.md +4 -4
- package/dist/docs/references/docs-evals-overview.md +2 -2
- package/dist/docs/references/docs-memory-memory-processors.md +6 -6
- package/dist/docs/references/docs-memory-semantic-recall.md +1 -1
- package/dist/docs/references/docs-memory-storage.md +1 -1
- package/dist/docs/references/docs-memory-working-memory.md +1 -1
- package/dist/docs/references/docs-observability-datasets-running-experiments.md +1 -1
- package/dist/docs/references/docs-observability-tracing-exporters-langfuse.md +1 -1
- package/dist/docs/references/docs-observability-tracing-exporters-langsmith.md +2 -2
- package/dist/docs/references/docs-rag-graph-rag.md +2 -2
- package/dist/docs/references/docs-rag-retrieval.md +12 -12
- package/dist/docs/references/docs-server-mastra-client.md +1 -1
- package/dist/docs/references/docs-server-request-context.md +3 -3
- package/dist/docs/references/docs-streaming-tool-streaming.md +1 -1
- package/dist/docs/references/docs-voice-overview.md +21 -21
- package/dist/docs/references/docs-voice-speech-to-speech.md +2 -2
- package/dist/docs/references/docs-voice-speech-to-text.md +1 -1
- package/dist/docs/references/docs-voice-text-to-speech.md +1 -1
- package/dist/docs/references/docs-workspace-filesystem.md +1 -1
- package/dist/docs/references/docs-workspace-overview.md +1 -1
- package/dist/docs/references/docs-workspace-sandbox.md +1 -1
- package/dist/docs/references/reference-agents-agent.md +5 -5
- package/dist/docs/references/reference-agents-generateLegacy.md +2 -2
- package/dist/docs/references/reference-agents-getLLM.md +1 -1
- package/dist/docs/references/reference-agents-network.md +1 -1
- package/dist/docs/references/reference-configuration.md +3 -3
- package/dist/docs/references/reference-evals-answer-relevancy.md +1 -1
- package/dist/docs/references/reference-evals-answer-similarity.md +1 -1
- package/dist/docs/references/reference-evals-bias.md +1 -1
- package/dist/docs/references/reference-evals-context-precision.md +3 -3
- package/dist/docs/references/reference-evals-faithfulness.md +1 -1
- package/dist/docs/references/reference-evals-hallucination.md +5 -5
- package/dist/docs/references/reference-evals-toxicity.md +1 -1
- package/dist/docs/references/reference-harness-harness-class.md +4 -4
- package/dist/docs/references/reference-memory-memory-class.md +3 -3
- package/dist/docs/references/reference-memory-observational-memory.md +5 -5
- package/dist/docs/references/reference-processors-batch-parts-processor.md +1 -1
- package/dist/docs/references/reference-processors-language-detector.md +1 -1
- package/dist/docs/references/reference-processors-moderation-processor.md +2 -2
- package/dist/docs/references/reference-processors-pii-detector.md +2 -2
- package/dist/docs/references/reference-processors-processor-interface.md +3 -3
- package/dist/docs/references/reference-processors-prompt-injection-detector.md +1 -1
- package/dist/docs/references/reference-processors-system-prompt-scrubber.md +1 -1
- package/dist/docs/references/reference-processors-token-limiter-processor.md +3 -3
- package/dist/docs/references/reference-processors-tool-search-processor.md +2 -2
- package/dist/docs/references/reference-processors-unicode-normalizer.md +1 -1
- package/dist/docs/references/reference-storage-mongodb.md +1 -1
- package/dist/docs/references/reference-storage-postgresql.md +1 -1
- package/dist/docs/references/reference-storage-upstash.md +1 -1
- package/dist/docs/references/reference-templates-overview.md +1 -1
- package/dist/docs/references/reference-tools-mcp-client.md +2 -2
- package/dist/docs/references/reference-tools-mcp-server.md +1 -1
- package/dist/docs/references/reference-tools-vector-query-tool.md +1 -1
- package/dist/docs/references/reference-vectors-libsql.md +1 -1
- package/dist/docs/references/reference-vectors-mongodb.md +1 -1
- package/dist/docs/references/reference-vectors-pg.md +1 -1
- package/dist/docs/references/reference-vectors-upstash.md +1 -1
- package/dist/docs/references/reference-voice-voice.addInstructions.md +1 -1
- package/dist/docs/references/reference-workspace-local-filesystem.md +1 -1
- package/dist/docs/references/reference-workspace-local-sandbox.md +1 -1
- package/dist/evals/index.cjs +20 -20
- 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/features/index.cjs +2 -1
- package/dist/features/index.cjs.map +1 -1
- package/dist/features/index.d.ts.map +1 -1
- package/dist/features/index.js +2 -1
- package/dist/features/index.js.map +1 -1
- 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/llm/model/base.types.d.ts +1 -1
- package/dist/llm/model/provider-types.generated.d.ts +4 -4
- package/dist/loop/index.cjs +14 -14
- package/dist/loop/index.js +1 -1
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/llm-mapping-step.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/memory/types.d.ts +1 -1
- package/dist/models-dev-E24MAXL2.cjs +12 -0
- package/dist/{models-dev-SOEEI4UR.cjs.map → models-dev-E24MAXL2.cjs.map} +1 -1
- package/dist/models-dev-F65PLXGJ.js +3 -0
- package/dist/{models-dev-EKZCLX7Y.js.map → models-dev-F65PLXGJ.js.map} +1 -1
- package/dist/netlify-FT3VYX27.cjs +12 -0
- package/dist/{netlify-SSPGBXOO.cjs.map → netlify-FT3VYX27.cjs.map} +1 -1
- package/dist/netlify-NYUZ5ZTO.js +3 -0
- package/dist/{netlify-ALYV7577.js.map → netlify-NYUZ5ZTO.js.map} +1 -1
- package/dist/observability/index.cjs +17 -17
- package/dist/observability/index.js +1 -1
- package/dist/observability/types/tracing.d.ts +2 -22
- 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 +42 -42
- package/dist/processors/index.js +1 -1
- package/dist/provider-registry-5R2TUINW.js +3 -0
- package/dist/{provider-registry-AZ4SPASK.js.map → provider-registry-5R2TUINW.js.map} +1 -1
- package/dist/provider-registry-TVYED7F2.cjs +40 -0
- package/dist/{provider-registry-35V252GM.cjs.map → provider-registry-TVYED7F2.cjs.map} +1 -1
- package/dist/provider-registry.json +8 -8
- 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.d.ts +1 -1
- package/dist/storage/constants.js +1 -1
- package/dist/storage/domains/memory/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/observability/discovery.d.ts +1 -63
- package/dist/storage/domains/observability/discovery.d.ts.map +1 -1
- package/dist/storage/domains/observability/feedback.d.ts +1 -185
- package/dist/storage/domains/observability/feedback.d.ts.map +1 -1
- package/dist/storage/domains/observability/logs.d.ts +1 -321
- package/dist/storage/domains/observability/logs.d.ts.map +1 -1
- package/dist/storage/domains/observability/metrics.d.ts +1 -394
- package/dist/storage/domains/observability/metrics.d.ts.map +1 -1
- package/dist/storage/domains/observability/scores.d.ts +1 -192
- package/dist/storage/domains/observability/scores.d.ts.map +1 -1
- package/dist/storage/domains/observability/tracing.d.ts +50 -52
- package/dist/storage/domains/observability/tracing.d.ts.map +1 -1
- package/dist/storage/domains/shared.d.ts +1 -118
- package/dist/storage/domains/shared.d.ts.map +1 -1
- package/dist/storage/index.cjs +479 -466
- package/dist/storage/index.js +3 -2
- package/dist/stream/index.cjs +11 -11
- package/dist/stream/index.js +2 -2
- 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/embed.d.ts +2 -2
- 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 +6 -5
- package/src/llm/model/provider-types.generated.d.ts +4 -4
- package/dist/chunk-4RWTWZET.cjs.map +0 -1
- package/dist/chunk-6JM4RID6.js.map +0 -1
- package/dist/chunk-CJYTDH5Q.js.map +0 -1
- package/dist/chunk-DJCCDPZQ.js +0 -376
- package/dist/chunk-DJCCDPZQ.js.map +0 -1
- package/dist/chunk-DRZWU4MQ.cjs.map +0 -1
- package/dist/chunk-E2Y2HLCU.cjs.map +0 -1
- package/dist/chunk-FDC6E3MJ.cjs.map +0 -1
- package/dist/chunk-GC7AHOXK.js.map +0 -1
- package/dist/chunk-MIILNUS4.cjs.map +0 -1
- package/dist/chunk-PBDJR7QN.cjs +0 -393
- package/dist/chunk-PBDJR7QN.cjs.map +0 -1
- package/dist/chunk-Q4W5XQK2.cjs.map +0 -1
- package/dist/chunk-QXNHZJRV.js.map +0 -1
- package/dist/chunk-SBHYPYXD.js.map +0 -1
- package/dist/chunk-T5M2TGCD.js.map +0 -1
- package/dist/chunk-TAXQJ5ZP.js.map +0 -1
- package/dist/chunk-WO2CP4Z2.cjs.map +0 -1
- package/dist/models-dev-EKZCLX7Y.js +0 -3
- package/dist/models-dev-SOEEI4UR.cjs +0 -12
- package/dist/netlify-ALYV7577.js +0 -3
- package/dist/netlify-SSPGBXOO.cjs +0 -12
- package/dist/provider-registry-35V252GM.cjs +0 -40
- package/dist/provider-registry-AZ4SPASK.js +0 -3
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { DefaultVoice } from './chunk-ZU7M6YE4.js';
|
|
2
2
|
import { PUBSUB_SYMBOL, STREAM_FORMAT_SYMBOL } from './chunk-2QXNHEDL.js';
|
|
3
3
|
import { createWorkspaceTools, createSkillTools, getTiktoken, BM25Index } from './chunk-II3LKO2G.js';
|
|
4
|
-
import { InMemoryStore } from './chunk-
|
|
5
|
-
import { MessageList, coreContentToString, DefaultGeneratedFile, DefaultGeneratedFileWithType, sanitizeToolName } from './chunk-
|
|
4
|
+
import { InMemoryStore } from './chunk-OGR427FH.js';
|
|
5
|
+
import { MessageList, coreContentToString, DefaultGeneratedFile, DefaultGeneratedFileWithType, sanitizeToolName } from './chunk-MCAE3D3S.js';
|
|
6
6
|
import { parsePartialJson, isDeepEqualData, stepCountIs } from './chunk-MMLX7TES.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-5UAF67E3.js';
|
|
10
|
+
import { MastraLLMV1 } from './chunk-7V4HN5NK.js';
|
|
11
11
|
import { noopLogger } from './chunk-PSCMWPLC.js';
|
|
12
12
|
import { EventEmitterPubSub } from './chunk-X2HAI3OX.js';
|
|
13
|
-
import { removeUndefinedValues, isZodType, ensureToolProperties, makeCoreTool, createMastraProxy, deepMerge, generateEmptyFromSchema, selectFields, delay } from './chunk-
|
|
14
|
-
import { resolveObservabilityContext, createObservabilityContext, getOrCreateSpan, wrapMastra, executeWithContextSync } from './chunk-
|
|
15
|
-
import { MastraError, getErrorFromUnknown } from './chunk-FJEVLHJT.js';
|
|
13
|
+
import { removeUndefinedValues, isZodType, ensureToolProperties, makeCoreTool, createMastraProxy, deepMerge, generateEmptyFromSchema, selectFields, delay } from './chunk-KJUHI5QK.js';
|
|
14
|
+
import { resolveObservabilityContext, EntityType, createObservabilityContext, getOrCreateSpan, wrapMastra, executeWithContextSync } from './chunk-GVQJCS5O.js';
|
|
16
15
|
import { ToolStream } from './chunk-DD2VNRQM.js';
|
|
17
16
|
import { Tool, createTool, isMastraTool, isProviderTool, getProviderToolName, isProviderDefinedTool } from './chunk-UPXPPD5L.js';
|
|
18
17
|
import { toStandardSchema, standardSchemaToJSONSchema, isStandardSchemaWithJSON } from './chunk-6VAVASZ5.js';
|
|
19
18
|
import { RequestContext, MASTRA_RESOURCE_ID_KEY, MASTRA_THREAD_ID_KEY } from './chunk-JGOH7RWL.js';
|
|
19
|
+
import { MastraError, getErrorFromUnknown } from './chunk-FJEVLHJT.js';
|
|
20
20
|
import { MastraBase } from './chunk-WCAFTXGK.js';
|
|
21
21
|
import { RegisteredLogger, ConsoleLogger } from './chunk-X2WMFSPB.js';
|
|
22
22
|
import { __commonJS, __toESM } from './chunk-TM6AOUSD.js';
|
|
@@ -1064,7 +1064,7 @@ var ProcessorState = class {
|
|
|
1064
1064
|
this.span = parentSpan?.createChildSpan({
|
|
1065
1065
|
type: "processor_run" /* PROCESSOR_RUN */,
|
|
1066
1066
|
name: `output stream processor: ${options.processorName}`,
|
|
1067
|
-
entityType:
|
|
1067
|
+
entityType: EntityType.OUTPUT_PROCESSOR,
|
|
1068
1068
|
entityName: options.processorName,
|
|
1069
1069
|
attributes: {
|
|
1070
1070
|
processorExecutor: "legacy",
|
|
@@ -1241,7 +1241,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1241
1241
|
const processorSpan = parentSpan?.createChildSpan({
|
|
1242
1242
|
type: "processor_run" /* PROCESSOR_RUN */,
|
|
1243
1243
|
name: `output processor: ${processor.id}`,
|
|
1244
|
-
entityType:
|
|
1244
|
+
entityType: EntityType.OUTPUT_PROCESSOR,
|
|
1245
1245
|
entityId: processor.id,
|
|
1246
1246
|
entityName: processor.name,
|
|
1247
1247
|
attributes: {
|
|
@@ -1541,7 +1541,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1541
1541
|
const processorSpan = parentSpan?.createChildSpan({
|
|
1542
1542
|
type: "processor_run" /* PROCESSOR_RUN */,
|
|
1543
1543
|
name: `input processor: ${processor.id}`,
|
|
1544
|
-
entityType:
|
|
1544
|
+
entityType: EntityType.INPUT_PROCESSOR,
|
|
1545
1545
|
entityId: processor.id,
|
|
1546
1546
|
entityName: processor.name,
|
|
1547
1547
|
attributes: {
|
|
@@ -1740,7 +1740,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1740
1740
|
const processorSpan = currentSpan?.createChildSpan({
|
|
1741
1741
|
type: "processor_run" /* PROCESSOR_RUN */,
|
|
1742
1742
|
name: `input step processor: ${processor.id}`,
|
|
1743
|
-
entityType:
|
|
1743
|
+
entityType: EntityType.INPUT_STEP_PROCESSOR,
|
|
1744
1744
|
entityId: processor.id,
|
|
1745
1745
|
entityName: processor.name,
|
|
1746
1746
|
attributes: {
|
|
@@ -1906,7 +1906,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1906
1906
|
const processorSpan = parentSpan?.createChildSpan({
|
|
1907
1907
|
type: "processor_run" /* PROCESSOR_RUN */,
|
|
1908
1908
|
name: `output step processor: ${processor.id}`,
|
|
1909
|
-
entityType:
|
|
1909
|
+
entityType: EntityType.OUTPUT_STEP_PROCESSOR,
|
|
1910
1910
|
entityId: processor.id,
|
|
1911
1911
|
entityName: processor.name,
|
|
1912
1912
|
attributes: {
|
|
@@ -7199,7 +7199,7 @@ async function executeStep(engine, params) {
|
|
|
7199
7199
|
options: {
|
|
7200
7200
|
name: `workflow step: '${step.id}'`,
|
|
7201
7201
|
type: "workflow_step" /* WORKFLOW_STEP */,
|
|
7202
|
-
entityType:
|
|
7202
|
+
entityType: EntityType.WORKFLOW_STEP,
|
|
7203
7203
|
entityId: step.id,
|
|
7204
7204
|
input: inputData,
|
|
7205
7205
|
tracingPolicy: engine.options?.tracingPolicy,
|
|
@@ -8510,16 +8510,16 @@ function createStepFromProcessor(processor) {
|
|
|
8510
8510
|
const getProcessorEntityType = (phase) => {
|
|
8511
8511
|
switch (phase) {
|
|
8512
8512
|
case "input":
|
|
8513
|
-
return
|
|
8513
|
+
return EntityType.INPUT_PROCESSOR;
|
|
8514
8514
|
case "inputStep":
|
|
8515
|
-
return
|
|
8515
|
+
return EntityType.INPUT_STEP_PROCESSOR;
|
|
8516
8516
|
case "outputStream":
|
|
8517
8517
|
case "outputResult":
|
|
8518
|
-
return
|
|
8518
|
+
return EntityType.OUTPUT_PROCESSOR;
|
|
8519
8519
|
case "outputStep":
|
|
8520
|
-
return
|
|
8520
|
+
return EntityType.OUTPUT_STEP_PROCESSOR;
|
|
8521
8521
|
default:
|
|
8522
|
-
return
|
|
8522
|
+
return EntityType.OUTPUT_PROCESSOR;
|
|
8523
8523
|
}
|
|
8524
8524
|
};
|
|
8525
8525
|
const getSpanNamePrefix = (phase) => {
|
|
@@ -8819,7 +8819,7 @@ function createStepFromProcessor(processor) {
|
|
|
8819
8819
|
processorSpan2 = parentSpan.createChildSpan({
|
|
8820
8820
|
type: "processor_run" /* PROCESSOR_RUN */,
|
|
8821
8821
|
name: `output stream processor: ${processor.id}`,
|
|
8822
|
-
entityType:
|
|
8822
|
+
entityType: EntityType.OUTPUT_PROCESSOR,
|
|
8823
8823
|
entityId: processor.id,
|
|
8824
8824
|
entityName: processor.name ?? processor.id,
|
|
8825
8825
|
input: { phase, totalChunks: 0 },
|
|
@@ -10084,7 +10084,7 @@ var Run = class {
|
|
|
10084
10084
|
const workflowSpan = getOrCreateSpan({
|
|
10085
10085
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
10086
10086
|
name: `workflow run: '${this.workflowId}'`,
|
|
10087
|
-
entityType:
|
|
10087
|
+
entityType: EntityType.WORKFLOW_RUN,
|
|
10088
10088
|
entityId: this.workflowId,
|
|
10089
10089
|
input: inputData,
|
|
10090
10090
|
metadata: {
|
|
@@ -10603,7 +10603,7 @@ var Run = class {
|
|
|
10603
10603
|
const workflowSpan = getOrCreateSpan({
|
|
10604
10604
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
10605
10605
|
name: `workflow run: '${this.workflowId}' (resumed)`,
|
|
10606
|
-
entityType:
|
|
10606
|
+
entityType: EntityType.WORKFLOW_RUN,
|
|
10607
10607
|
entityId: this.workflowId,
|
|
10608
10608
|
input: resumeDataToUse,
|
|
10609
10609
|
metadata: {
|
|
@@ -10722,7 +10722,7 @@ var Run = class {
|
|
|
10722
10722
|
const workflowSpan = getOrCreateSpan({
|
|
10723
10723
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
10724
10724
|
name: `workflow run: '${this.workflowId}'`,
|
|
10725
|
-
entityType:
|
|
10725
|
+
entityType: EntityType.WORKFLOW_RUN,
|
|
10726
10726
|
entityId: this.workflowId,
|
|
10727
10727
|
metadata: {
|
|
10728
10728
|
resourceId: this.resourceId,
|
|
@@ -10820,7 +10820,7 @@ var Run = class {
|
|
|
10820
10820
|
type: "workflow_run" /* WORKFLOW_RUN */,
|
|
10821
10821
|
name: `workflow run: '${this.workflowId}'`,
|
|
10822
10822
|
input: inputData,
|
|
10823
|
-
entityType:
|
|
10823
|
+
entityType: EntityType.WORKFLOW_RUN,
|
|
10824
10824
|
entityId: this.workflowId,
|
|
10825
10825
|
metadata: {
|
|
10826
10826
|
resourceId: this.resourceId,
|
|
@@ -12242,8 +12242,7 @@ async function processOutputStream({
|
|
|
12242
12242
|
includeRawChunks,
|
|
12243
12243
|
logger,
|
|
12244
12244
|
transportRef,
|
|
12245
|
-
transportResolver
|
|
12246
|
-
persistedToolCallIds
|
|
12245
|
+
transportResolver
|
|
12247
12246
|
}) {
|
|
12248
12247
|
let transportSet = false;
|
|
12249
12248
|
for await (const chunk of outputStream._getBaseStream()) {
|
|
@@ -12395,34 +12394,6 @@ async function processOutputStream({
|
|
|
12395
12394
|
safeEnqueue(controller, chunk);
|
|
12396
12395
|
break;
|
|
12397
12396
|
}
|
|
12398
|
-
case "tool-call": {
|
|
12399
|
-
const message = {
|
|
12400
|
-
id: messageId,
|
|
12401
|
-
role: "assistant",
|
|
12402
|
-
content: {
|
|
12403
|
-
format: 2,
|
|
12404
|
-
parts: [
|
|
12405
|
-
{
|
|
12406
|
-
type: "tool-invocation",
|
|
12407
|
-
toolInvocation: {
|
|
12408
|
-
state: "call",
|
|
12409
|
-
toolCallId: chunk.payload.toolCallId,
|
|
12410
|
-
toolName: chunk.payload.toolName,
|
|
12411
|
-
args: chunk.payload.args ?? {}
|
|
12412
|
-
},
|
|
12413
|
-
providerMetadata: chunk.payload.providerMetadata,
|
|
12414
|
-
...{ providerExecuted: chunk.payload.providerExecuted }
|
|
12415
|
-
}
|
|
12416
|
-
],
|
|
12417
|
-
...buildResponseModelMetadata(runState)
|
|
12418
|
-
},
|
|
12419
|
-
createdAt: /* @__PURE__ */ new Date()
|
|
12420
|
-
};
|
|
12421
|
-
messageList.add(message, "response");
|
|
12422
|
-
persistedToolCallIds?.add(chunk.payload.toolCallId);
|
|
12423
|
-
safeEnqueue(controller, chunk);
|
|
12424
|
-
break;
|
|
12425
|
-
}
|
|
12426
12397
|
case "tool-call-input-streaming-end": {
|
|
12427
12398
|
safeEnqueue(controller, chunk);
|
|
12428
12399
|
break;
|
|
@@ -12585,6 +12556,57 @@ async function processOutputStream({
|
|
|
12585
12556
|
safeEnqueue(controller, { ...chunk, payload: { ...chunk.payload, error } });
|
|
12586
12557
|
await options?.onError?.({ error });
|
|
12587
12558
|
break;
|
|
12559
|
+
// Provider-executed tool results (e.g. web_search). Client tool results
|
|
12560
|
+
// are handled by llm-mapping-step after execution.
|
|
12561
|
+
case "tool-result": {
|
|
12562
|
+
if (chunk.payload.result != null) {
|
|
12563
|
+
const resultToolDef = tools?.[chunk.payload.toolName] || findProviderToolByName(tools, chunk.payload.toolName);
|
|
12564
|
+
messageList.updateToolInvocation({
|
|
12565
|
+
type: "tool-invocation",
|
|
12566
|
+
toolInvocation: {
|
|
12567
|
+
state: "result",
|
|
12568
|
+
toolCallId: chunk.payload.toolCallId,
|
|
12569
|
+
toolName: chunk.payload.toolName,
|
|
12570
|
+
args: chunk.payload.args,
|
|
12571
|
+
result: chunk.payload.result
|
|
12572
|
+
},
|
|
12573
|
+
providerMetadata: chunk.payload.providerMetadata,
|
|
12574
|
+
// @ts-expect-error - providerExecuted is not in the type but is read by output-converter.ts (to keep deferred provider calls) and tool-call-step.ts (to skip client execution)
|
|
12575
|
+
providerExecuted: inferProviderExecuted(chunk.payload.providerExecuted, resultToolDef)
|
|
12576
|
+
});
|
|
12577
|
+
}
|
|
12578
|
+
safeEnqueue(controller, chunk);
|
|
12579
|
+
break;
|
|
12580
|
+
}
|
|
12581
|
+
case "tool-call": {
|
|
12582
|
+
const toolDef = tools?.[chunk.payload.toolName] || findProviderToolByName(tools, chunk.payload.toolName);
|
|
12583
|
+
const inferredProviderExecuted = inferProviderExecuted(chunk.payload.providerExecuted, toolDef);
|
|
12584
|
+
const toolCallPart = {
|
|
12585
|
+
type: "tool-invocation",
|
|
12586
|
+
toolInvocation: {
|
|
12587
|
+
state: "call",
|
|
12588
|
+
toolCallId: chunk.payload.toolCallId,
|
|
12589
|
+
toolName: chunk.payload.toolName,
|
|
12590
|
+
args: chunk.payload.args
|
|
12591
|
+
},
|
|
12592
|
+
providerMetadata: chunk.payload.providerMetadata,
|
|
12593
|
+
// @ts-expect-error - providerExecuted is not in the type but is read by output-converter.ts (to keep deferred provider calls) and tool-call-step.ts (to skip client execution)
|
|
12594
|
+
providerExecuted: inferredProviderExecuted
|
|
12595
|
+
};
|
|
12596
|
+
const message = {
|
|
12597
|
+
id: messageId,
|
|
12598
|
+
role: "assistant",
|
|
12599
|
+
content: {
|
|
12600
|
+
format: 2,
|
|
12601
|
+
parts: [toolCallPart],
|
|
12602
|
+
...buildResponseModelMetadata(runState)
|
|
12603
|
+
},
|
|
12604
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
12605
|
+
};
|
|
12606
|
+
messageList.add(message, "response");
|
|
12607
|
+
safeEnqueue(controller, chunk);
|
|
12608
|
+
break;
|
|
12609
|
+
}
|
|
12588
12610
|
default:
|
|
12589
12611
|
safeEnqueue(controller, chunk);
|
|
12590
12612
|
}
|
|
@@ -12686,7 +12708,6 @@ function createLLMExecutionStep({
|
|
|
12686
12708
|
let warnings;
|
|
12687
12709
|
let request;
|
|
12688
12710
|
let rawResponse;
|
|
12689
|
-
const persistedToolCallIds = /* @__PURE__ */ new Set();
|
|
12690
12711
|
const { outputStream, callBail, runState, stepTools, stepWorkspace } = await executeStreamWithFallbackModels(
|
|
12691
12712
|
models,
|
|
12692
12713
|
logger
|
|
@@ -12981,8 +13002,7 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
|
|
|
12981
13002
|
},
|
|
12982
13003
|
logger,
|
|
12983
13004
|
transportRef: _internal?.transportRef,
|
|
12984
|
-
transportResolver
|
|
12985
|
-
persistedToolCallIds
|
|
13005
|
+
transportResolver
|
|
12986
13006
|
});
|
|
12987
13007
|
} catch (error) {
|
|
12988
13008
|
const provider = model?.provider;
|
|
@@ -13088,50 +13108,13 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
|
|
|
13088
13108
|
}
|
|
13089
13109
|
});
|
|
13090
13110
|
}
|
|
13091
|
-
const
|
|
13092
|
-
|
|
13093
|
-
const toolCalls = outputStream._getImmediateToolCalls()?.map((chunk) => {
|
|
13094
|
-
const toolResult = toolResultById.get(chunk.payload.toolCallId);
|
|
13095
|
-
const output = chunk.payload.output ?? toolResult?.result;
|
|
13096
|
-
const tool2 = findProviderToolByName(stepTools, chunk.payload.toolName);
|
|
13097
|
-
const providerExecuted = inferProviderExecuted(
|
|
13098
|
-
chunk.payload.providerExecuted ?? toolResult?.providerExecuted,
|
|
13099
|
-
tool2
|
|
13100
|
-
);
|
|
13111
|
+
const toolCalls = (outputStream._getImmediateToolCalls() ?? []).map((chunk) => {
|
|
13112
|
+
const tool2 = stepTools?.[chunk.payload.toolName] || findProviderToolByName(stepTools, chunk.payload.toolName);
|
|
13101
13113
|
return {
|
|
13102
13114
|
...chunk.payload,
|
|
13103
|
-
|
|
13104
|
-
...output !== void 0 ? { output } : {},
|
|
13105
|
-
providerExecuted,
|
|
13106
|
-
providerMetadata: chunk.payload.providerMetadata ?? toolResult?.providerMetadata
|
|
13107
|
-
};
|
|
13108
|
-
}) ?? [];
|
|
13109
|
-
const toolCallsToPersist = toolCalls.filter((toolCall) => !persistedToolCallIds.has(toolCall.toolCallId));
|
|
13110
|
-
if (toolCallsToPersist.length > 0) {
|
|
13111
|
-
const message = {
|
|
13112
|
-
id: outputStream.messageId,
|
|
13113
|
-
role: "assistant",
|
|
13114
|
-
content: {
|
|
13115
|
-
format: 2,
|
|
13116
|
-
parts: toolCallsToPersist.map((toolCall) => {
|
|
13117
|
-
return {
|
|
13118
|
-
type: "tool-invocation",
|
|
13119
|
-
toolInvocation: {
|
|
13120
|
-
state: "call",
|
|
13121
|
-
toolCallId: toolCall.toolCallId,
|
|
13122
|
-
toolName: toolCall.toolName,
|
|
13123
|
-
args: toolCall.args
|
|
13124
|
-
},
|
|
13125
|
-
providerMetadata: toolCall.providerMetadata,
|
|
13126
|
-
providerExecuted: toolCall.providerExecuted
|
|
13127
|
-
};
|
|
13128
|
-
}),
|
|
13129
|
-
...buildResponseModelMetadata(runState)
|
|
13130
|
-
},
|
|
13131
|
-
createdAt: /* @__PURE__ */ new Date()
|
|
13115
|
+
providerExecuted: inferProviderExecuted(chunk.payload.providerExecuted, tool2)
|
|
13132
13116
|
};
|
|
13133
|
-
|
|
13134
|
-
}
|
|
13117
|
+
});
|
|
13135
13118
|
let processOutputStepTripwire = null;
|
|
13136
13119
|
if (outputProcessors && outputProcessors.length > 0) {
|
|
13137
13120
|
const processorRunner = new ProcessorRunner({
|
|
@@ -13337,9 +13320,8 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13337
13320
|
const hasMetadata = Object.keys(providerMetadata).length > 0;
|
|
13338
13321
|
return hasMetadata ? providerMetadata : void 0;
|
|
13339
13322
|
}
|
|
13340
|
-
if (inputData?.some((toolCall) => toolCall?.result === void 0)) {
|
|
13341
|
-
const errorResults = inputData.filter((toolCall) => toolCall?.error);
|
|
13342
|
-
const toolResultMessageId = rest.experimental_generateMessageId?.() || _internal?.generateId?.();
|
|
13323
|
+
if (inputData?.some((toolCall) => toolCall?.result === void 0 && !toolCall.providerExecuted)) {
|
|
13324
|
+
const errorResults = inputData.filter((toolCall) => toolCall?.error && !toolCall.providerExecuted);
|
|
13343
13325
|
if (errorResults?.length) {
|
|
13344
13326
|
for (const toolCall of errorResults) {
|
|
13345
13327
|
const chunk = {
|
|
@@ -13356,29 +13338,18 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13356
13338
|
};
|
|
13357
13339
|
const processed = await processAndEnqueueChunk(chunk);
|
|
13358
13340
|
if (processed) await rest.options?.onChunk?.(processed);
|
|
13341
|
+
rest.messageList.updateToolInvocation({
|
|
13342
|
+
type: "tool-invocation",
|
|
13343
|
+
toolInvocation: {
|
|
13344
|
+
state: "result",
|
|
13345
|
+
toolCallId: toolCall.toolCallId,
|
|
13346
|
+
toolName: sanitizeToolName(toolCall.toolName),
|
|
13347
|
+
args: toolCall.args,
|
|
13348
|
+
result: toolCall.error?.message ?? toolCall.error
|
|
13349
|
+
},
|
|
13350
|
+
...toolCall.providerMetadata ? { providerMetadata: toolCall.providerMetadata } : {}
|
|
13351
|
+
});
|
|
13359
13352
|
}
|
|
13360
|
-
const msg = {
|
|
13361
|
-
id: toolResultMessageId || "",
|
|
13362
|
-
role: "assistant",
|
|
13363
|
-
content: {
|
|
13364
|
-
format: 2,
|
|
13365
|
-
parts: errorResults.map((toolCallErrorResult) => {
|
|
13366
|
-
return {
|
|
13367
|
-
type: "tool-invocation",
|
|
13368
|
-
toolInvocation: {
|
|
13369
|
-
state: "result",
|
|
13370
|
-
toolCallId: toolCallErrorResult.toolCallId,
|
|
13371
|
-
toolName: sanitizeToolName(toolCallErrorResult.toolName),
|
|
13372
|
-
args: toolCallErrorResult.args,
|
|
13373
|
-
result: toolCallErrorResult.error?.message ?? toolCallErrorResult.error
|
|
13374
|
-
},
|
|
13375
|
-
...toolCallErrorResult.providerMetadata ? { providerMetadata: toolCallErrorResult.providerMetadata } : {}
|
|
13376
|
-
};
|
|
13377
|
-
})
|
|
13378
|
-
},
|
|
13379
|
-
createdAt: /* @__PURE__ */ new Date()
|
|
13380
|
-
};
|
|
13381
|
-
rest.messageList.add(msg, "response");
|
|
13382
13353
|
}
|
|
13383
13354
|
const hasPendingHITL = inputData.some((tc) => tc.result === void 0 && !tc.error && !tc.providerExecuted);
|
|
13384
13355
|
if (errorResults?.length > 0 && !hasPendingHITL) {
|
|
@@ -13400,60 +13371,20 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13400
13371
|
};
|
|
13401
13372
|
const processed = await processAndEnqueueChunk(chunk);
|
|
13402
13373
|
if (processed) await rest.options?.onChunk?.(processed);
|
|
13403
|
-
|
|
13404
|
-
|
|
13405
|
-
|
|
13406
|
-
|
|
13407
|
-
|
|
13408
|
-
|
|
13409
|
-
|
|
13410
|
-
|
|
13411
|
-
|
|
13412
|
-
|
|
13413
|
-
|
|
13414
|
-
|
|
13415
|
-
|
|
13416
|
-
|
|
13417
|
-
toolInvocation: {
|
|
13418
|
-
state: "result",
|
|
13419
|
-
toolCallId: toolCall.toolCallId,
|
|
13420
|
-
toolName: sanitizeToolName(toolCall.toolName),
|
|
13421
|
-
args: toolCall.args,
|
|
13422
|
-
result: toolCall.result
|
|
13423
|
-
},
|
|
13424
|
-
...providerMetadata ? { providerMetadata } : {}
|
|
13425
|
-
};
|
|
13426
|
-
})
|
|
13427
|
-
)
|
|
13428
|
-
},
|
|
13429
|
-
createdAt: /* @__PURE__ */ new Date()
|
|
13430
|
-
};
|
|
13431
|
-
rest.messageList.add(successMessage, "response");
|
|
13432
|
-
}
|
|
13433
|
-
if (successfulResults.some((tc) => tc.providerExecuted)) {
|
|
13434
|
-
const providerResults = successfulResults.filter((tc) => tc.providerExecuted);
|
|
13435
|
-
const providerMessageId = rest.experimental_generateMessageId?.() || _internal?.generateId?.();
|
|
13436
|
-
const providerMessage = {
|
|
13437
|
-
id: providerMessageId || "",
|
|
13438
|
-
role: "assistant",
|
|
13439
|
-
content: {
|
|
13440
|
-
format: 2,
|
|
13441
|
-
parts: providerResults.map((toolCall) => ({
|
|
13442
|
-
type: "tool-invocation",
|
|
13443
|
-
toolInvocation: {
|
|
13444
|
-
state: "result",
|
|
13445
|
-
toolCallId: toolCall.toolCallId,
|
|
13446
|
-
toolName: sanitizeToolName(toolCall.toolName),
|
|
13447
|
-
args: toolCall.args,
|
|
13448
|
-
result: toolCall.result
|
|
13449
|
-
},
|
|
13450
|
-
...toolCall.providerMetadata ? { providerMetadata: toolCall.providerMetadata } : {},
|
|
13451
|
-
providerExecuted: true
|
|
13452
|
-
}))
|
|
13453
|
-
},
|
|
13454
|
-
createdAt: /* @__PURE__ */ new Date()
|
|
13455
|
-
};
|
|
13456
|
-
rest.messageList.add(providerMessage, "response");
|
|
13374
|
+
if (!toolCall.providerExecuted) {
|
|
13375
|
+
const providerMetadata = await getProviderMetadataWithModelOutput(toolCall);
|
|
13376
|
+
rest.messageList.updateToolInvocation({
|
|
13377
|
+
type: "tool-invocation",
|
|
13378
|
+
toolInvocation: {
|
|
13379
|
+
state: "result",
|
|
13380
|
+
toolCallId: toolCall.toolCallId,
|
|
13381
|
+
toolName: sanitizeToolName(toolCall.toolName),
|
|
13382
|
+
args: toolCall.args,
|
|
13383
|
+
result: toolCall.result
|
|
13384
|
+
},
|
|
13385
|
+
...providerMetadata ? { providerMetadata } : {}
|
|
13386
|
+
});
|
|
13387
|
+
}
|
|
13457
13388
|
}
|
|
13458
13389
|
}
|
|
13459
13390
|
initialResult.stepResult.isContinued = true;
|
|
@@ -13481,6 +13412,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13481
13412
|
}
|
|
13482
13413
|
if (inputData?.length) {
|
|
13483
13414
|
for (const toolCall of inputData) {
|
|
13415
|
+
if (toolCall.result === void 0) continue;
|
|
13484
13416
|
const chunk = {
|
|
13485
13417
|
type: "tool-result",
|
|
13486
13418
|
runId: rest.runId,
|
|
@@ -13496,60 +13428,20 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
13496
13428
|
};
|
|
13497
13429
|
const processed = await processAndEnqueueChunk(chunk);
|
|
13498
13430
|
if (processed) await rest.options?.onChunk?.(processed);
|
|
13499
|
-
|
|
13500
|
-
|
|
13501
|
-
|
|
13502
|
-
|
|
13503
|
-
|
|
13504
|
-
|
|
13505
|
-
|
|
13506
|
-
|
|
13507
|
-
|
|
13508
|
-
|
|
13509
|
-
|
|
13510
|
-
|
|
13511
|
-
|
|
13512
|
-
|
|
13513
|
-
toolInvocation: {
|
|
13514
|
-
state: "result",
|
|
13515
|
-
toolCallId: toolCall.toolCallId,
|
|
13516
|
-
toolName: sanitizeToolName(toolCall.toolName),
|
|
13517
|
-
args: toolCall.args,
|
|
13518
|
-
result: toolCall.result
|
|
13519
|
-
},
|
|
13520
|
-
...providerMetadata ? { providerMetadata } : {}
|
|
13521
|
-
};
|
|
13522
|
-
})
|
|
13523
|
-
)
|
|
13524
|
-
},
|
|
13525
|
-
createdAt: /* @__PURE__ */ new Date()
|
|
13526
|
-
};
|
|
13527
|
-
rest.messageList.add(toolResultMessage, "response");
|
|
13528
|
-
}
|
|
13529
|
-
const providerExecutedToolCalls = inputData.filter((toolCall) => toolCall.providerExecuted);
|
|
13530
|
-
if (providerExecutedToolCalls.length > 0) {
|
|
13531
|
-
const providerResultMessageId = rest.experimental_generateMessageId?.() || _internal?.generateId?.();
|
|
13532
|
-
const providerResultMessage = {
|
|
13533
|
-
id: providerResultMessageId || "",
|
|
13534
|
-
role: "assistant",
|
|
13535
|
-
content: {
|
|
13536
|
-
format: 2,
|
|
13537
|
-
parts: providerExecutedToolCalls.map((toolCall) => ({
|
|
13538
|
-
type: "tool-invocation",
|
|
13539
|
-
toolInvocation: {
|
|
13540
|
-
state: "result",
|
|
13541
|
-
toolCallId: toolCall.toolCallId,
|
|
13542
|
-
toolName: sanitizeToolName(toolCall.toolName),
|
|
13543
|
-
args: toolCall.args,
|
|
13544
|
-
result: toolCall.result
|
|
13545
|
-
},
|
|
13546
|
-
...toolCall.providerMetadata ? { providerMetadata: toolCall.providerMetadata } : {},
|
|
13547
|
-
providerExecuted: true
|
|
13548
|
-
}))
|
|
13549
|
-
},
|
|
13550
|
-
createdAt: /* @__PURE__ */ new Date()
|
|
13551
|
-
};
|
|
13552
|
-
rest.messageList.add(providerResultMessage, "response");
|
|
13431
|
+
if (!toolCall.providerExecuted) {
|
|
13432
|
+
const providerMetadata = await getProviderMetadataWithModelOutput(toolCall);
|
|
13433
|
+
rest.messageList.updateToolInvocation({
|
|
13434
|
+
type: "tool-invocation",
|
|
13435
|
+
toolInvocation: {
|
|
13436
|
+
state: "result",
|
|
13437
|
+
toolCallId: toolCall.toolCallId,
|
|
13438
|
+
toolName: sanitizeToolName(toolCall.toolName),
|
|
13439
|
+
args: toolCall.args,
|
|
13440
|
+
result: toolCall.result
|
|
13441
|
+
},
|
|
13442
|
+
...providerMetadata ? { providerMetadata } : {}
|
|
13443
|
+
});
|
|
13444
|
+
}
|
|
13553
13445
|
}
|
|
13554
13446
|
if (rest.requestContext?.get("__mastra_delegationBailed") && _internal) {
|
|
13555
13447
|
_internal._delegationBailed = true;
|
|
@@ -13726,10 +13618,7 @@ function createToolCallStep({
|
|
|
13726
13618
|
}
|
|
13727
13619
|
};
|
|
13728
13620
|
if (inputData.providerExecuted) {
|
|
13729
|
-
return
|
|
13730
|
-
...inputData,
|
|
13731
|
-
result: inputData.output ?? { providerExecuted: true, toolName: inputData.toolName }
|
|
13732
|
-
};
|
|
13621
|
+
return inputData;
|
|
13733
13622
|
}
|
|
13734
13623
|
const toolKey = stepTools?.[inputData.toolName] ? inputData.toolName : Object.entries(stepTools || {}).find(([_, t]) => t === tool2)?.[0];
|
|
13735
13624
|
const isHiddenByActiveTools = stepActiveTools && toolKey && !stepActiveTools.includes(toolKey);
|
|
@@ -17213,7 +17102,7 @@ var AgentLegacyHandler = class {
|
|
|
17213
17102
|
const agentSpan = getOrCreateSpan({
|
|
17214
17103
|
type: "agent_run" /* AGENT_RUN */,
|
|
17215
17104
|
name: `agent run: '${this.capabilities.id}'`,
|
|
17216
|
-
entityType:
|
|
17105
|
+
entityType: EntityType.AGENT,
|
|
17217
17106
|
entityId: this.capabilities.id,
|
|
17218
17107
|
entityName: this.capabilities.name,
|
|
17219
17108
|
input: {
|
|
@@ -22111,7 +22000,7 @@ ${effectiveInstructions}`;
|
|
|
22111
22000
|
const agentSpan = getOrCreateSpan({
|
|
22112
22001
|
type: "agent_run" /* AGENT_RUN */,
|
|
22113
22002
|
name: `agent run: '${this.id}'`,
|
|
22114
|
-
entityType:
|
|
22003
|
+
entityType: EntityType.AGENT,
|
|
22115
22004
|
entityId: this.id,
|
|
22116
22005
|
entityName: this.name,
|
|
22117
22006
|
input: options.messages,
|
|
@@ -26810,5 +26699,5 @@ var MockMemory = class extends MastraMemory {
|
|
|
26810
26699
|
};
|
|
26811
26700
|
|
|
26812
26701
|
export { Agent, 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, 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 };
|
|
26813
|
-
//# sourceMappingURL=chunk-
|
|
26814
|
-
//# sourceMappingURL=chunk-
|
|
26702
|
+
//# sourceMappingURL=chunk-UWTB4U2X.js.map
|
|
26703
|
+
//# sourceMappingURL=chunk-UWTB4U2X.js.map
|