@mastra/core 1.4.0 → 1.5.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +368 -0
- package/dist/agent/agent.d.ts +3 -2
- package/dist/agent/agent.d.ts.map +1 -1
- 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/merge/MessageMerger.d.ts.map +1 -1
- package/dist/agent/message-list/message-list.d.ts.map +1 -1
- package/dist/agent/types.d.ts +2 -2
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/index.d.ts +1 -0
- package/dist/agent/workflows/prepare-stream/index.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts +1 -0
- package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/schema.d.ts +8 -0
- package/dist/agent/workflows/prepare-stream/schema.d.ts.map +1 -1
- package/dist/{chunk-Y3TQ52UE.js → chunk-33TGTTTS.js} +4 -3
- package/dist/chunk-33TGTTTS.js.map +1 -0
- package/dist/{chunk-3X3CZUXI.js → chunk-3KJW4EMO.js} +660 -206
- package/dist/chunk-3KJW4EMO.js.map +1 -0
- package/dist/{chunk-YNNJLLFN.cjs → chunk-3YMDR4OL.cjs} +661 -207
- package/dist/chunk-3YMDR4OL.cjs.map +1 -0
- package/dist/{chunk-NJ7TL3LQ.js → chunk-5EOLBHHS.js} +26 -15
- package/dist/chunk-5EOLBHHS.js.map +1 -0
- package/dist/{chunk-RZ4CIIZR.js → chunk-6DUTLERJ.js} +4 -4
- package/dist/{chunk-RZ4CIIZR.js.map → chunk-6DUTLERJ.js.map} +1 -1
- package/dist/{chunk-VTE2OBKS.cjs → chunk-A6EWCOGA.cjs} +417 -77
- package/dist/chunk-A6EWCOGA.cjs.map +1 -0
- package/dist/{chunk-4XSAZPPS.js → chunk-A7V2NSY3.js} +313 -137
- package/dist/chunk-A7V2NSY3.js.map +1 -0
- package/dist/{chunk-FLPEGTEK.js → chunk-AIRMLZ43.js} +5 -5
- package/dist/{chunk-FLPEGTEK.js.map → chunk-AIRMLZ43.js.map} +1 -1
- package/dist/{chunk-DBSVT6AR.cjs → chunk-BKQAP27M.cjs} +9 -9
- package/dist/{chunk-DBSVT6AR.cjs.map → chunk-BKQAP27M.cjs.map} +1 -1
- package/dist/{chunk-RS6CZXGA.js → chunk-BQHWJLXU.js} +15 -4
- package/dist/chunk-BQHWJLXU.js.map +1 -0
- package/dist/{chunk-V2MLGA7T.js → chunk-CXVMDV2B.js} +417 -78
- package/dist/chunk-CXVMDV2B.js.map +1 -0
- package/dist/{chunk-NKYWDNCI.cjs → chunk-E2FHTXAI.cjs} +7 -7
- package/dist/{chunk-NKYWDNCI.cjs.map → chunk-E2FHTXAI.cjs.map} +1 -1
- package/dist/{chunk-7UWHFWST.cjs → chunk-EAZ6YDCQ.cjs} +15 -3
- package/dist/chunk-EAZ6YDCQ.cjs.map +1 -0
- package/dist/{chunk-64WGYTQK.cjs → chunk-FTBLAVTF.cjs} +55 -55
- package/dist/{chunk-64WGYTQK.cjs.map → chunk-FTBLAVTF.cjs.map} +1 -1
- package/dist/{chunk-4EHGOATH.js → chunk-FZ5DRHKE.js} +1337 -547
- package/dist/chunk-FZ5DRHKE.js.map +1 -0
- package/dist/{chunk-4TQ4EBYX.js → chunk-GEDGDKQ6.js} +9 -9
- package/dist/chunk-GEDGDKQ6.js.map +1 -0
- package/dist/{chunk-QTTWRCB5.js → chunk-I3AWF54W.js} +5 -5
- package/dist/{chunk-QTTWRCB5.js.map → chunk-I3AWF54W.js.map} +1 -1
- package/dist/{chunk-U2HKJZCI.js → chunk-IBNCZTNQ.js} +6 -6
- package/dist/{chunk-U2HKJZCI.js.map → chunk-IBNCZTNQ.js.map} +1 -1
- package/dist/{chunk-3JVFFAJX.cjs → chunk-IJIE3ZID.cjs} +27 -16
- package/dist/chunk-IJIE3ZID.cjs.map +1 -0
- package/dist/{chunk-NZG2JAKS.cjs → chunk-JWG272ZZ.cjs} +19 -19
- package/dist/chunk-JWG272ZZ.cjs.map +1 -0
- package/dist/{chunk-BP7VYTOP.cjs → chunk-JZ6TH4HQ.cjs} +954 -401
- package/dist/chunk-JZ6TH4HQ.cjs.map +1 -0
- package/dist/{chunk-SU5APAM6.cjs → chunk-KNXZ7KYL.cjs} +94 -6
- package/dist/chunk-KNXZ7KYL.cjs.map +1 -0
- package/dist/{chunk-CYUP7QWT.cjs → chunk-KRAGJ433.cjs} +4 -3
- package/dist/chunk-KRAGJ433.cjs.map +1 -0
- package/dist/{chunk-XDD5V446.cjs → chunk-MDC6VYA6.cjs} +6 -2
- package/dist/{chunk-XDD5V446.cjs.map → chunk-MDC6VYA6.cjs.map} +1 -1
- package/dist/{chunk-AXHBJ4GX.js → chunk-NN26FSKL.js} +10 -8
- package/dist/chunk-NN26FSKL.js.map +1 -0
- package/dist/{chunk-AY6DBRS3.js → chunk-OHLVZVIK.js} +36 -2
- package/dist/chunk-OHLVZVIK.js.map +1 -0
- package/dist/{chunk-5Q5Y34SS.js → chunk-PECKKR4C.js} +4 -4
- package/dist/{chunk-5Q5Y34SS.js.map → chunk-PECKKR4C.js.map} +1 -1
- package/dist/{chunk-HYRYTTMT.cjs → chunk-PHHJLGZU.cjs} +9 -9
- package/dist/{chunk-HYRYTTMT.cjs.map → chunk-PHHJLGZU.cjs.map} +1 -1
- package/dist/{chunk-65PHUUMF.cjs → chunk-QDH6MVJ7.cjs} +24 -22
- package/dist/chunk-QDH6MVJ7.cjs.map +1 -0
- package/dist/{chunk-VD5YA6RH.cjs → chunk-QSN5KQXZ.cjs} +18 -18
- package/dist/{chunk-VD5YA6RH.cjs.map → chunk-QSN5KQXZ.cjs.map} +1 -1
- package/dist/{chunk-4IJ4UDZX.cjs → chunk-RH2K66O2.cjs} +399 -223
- package/dist/chunk-RH2K66O2.cjs.map +1 -0
- package/dist/{chunk-4KFEMXTV.cjs → chunk-S4VVZI4E.cjs} +1361 -546
- package/dist/chunk-S4VVZI4E.cjs.map +1 -0
- package/dist/{chunk-ZATLLPIH.js → chunk-TPDMP7OD.js} +6 -2
- package/dist/chunk-TPDMP7OD.js.map +1 -0
- package/dist/{chunk-PS5ONCXY.js → chunk-UZFGMMKU.js} +82 -4
- package/dist/chunk-UZFGMMKU.js.map +1 -0
- package/dist/{chunk-7NKUSQEV.js → chunk-YIN5F7VO.js} +936 -389
- package/dist/chunk-YIN5F7VO.js.map +1 -0
- package/dist/{chunk-CZ4NQANZ.cjs → chunk-YW54RH77.cjs} +36 -2
- package/dist/chunk-YW54RH77.cjs.map +1 -0
- package/dist/datasets/experiment/executor.d.ts.map +1 -1
- package/dist/datasets/index.cjs +17 -17
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +27 -1
- package/dist/docs/assets/SOURCE_MAP.json +463 -389
- package/dist/docs/references/docs-agents-processors.md +52 -0
- package/dist/docs/references/docs-observability-datasets-overview.md +188 -0
- package/dist/docs/references/docs-observability-datasets-running-experiments.md +266 -0
- package/dist/docs/references/docs-observability-tracing-exporters-cloud.md +7 -4
- package/dist/docs/references/reference-agents-generate.md +1 -1
- package/dist/docs/references/reference-configuration.md +3 -4
- package/dist/docs/references/reference-datasets-addItem.md +35 -0
- package/dist/docs/references/reference-datasets-addItems.md +33 -0
- package/dist/docs/references/reference-datasets-compareExperiments.md +48 -0
- package/dist/docs/references/reference-datasets-create.md +49 -0
- package/dist/docs/references/reference-datasets-dataset.md +78 -0
- package/dist/docs/references/reference-datasets-datasets-manager.md +84 -0
- package/dist/docs/references/reference-datasets-delete.md +23 -0
- package/dist/docs/references/reference-datasets-deleteExperiment.md +25 -0
- package/dist/docs/references/reference-datasets-deleteItem.md +25 -0
- package/dist/docs/references/reference-datasets-deleteItems.md +27 -0
- package/dist/docs/references/reference-datasets-get.md +29 -0
- package/dist/docs/references/reference-datasets-getDetails.md +45 -0
- package/dist/docs/references/reference-datasets-getExperiment.md +28 -0
- package/dist/docs/references/reference-datasets-getItem.md +31 -0
- package/dist/docs/references/reference-datasets-getItemHistory.md +29 -0
- package/dist/docs/references/reference-datasets-list.md +29 -0
- package/dist/docs/references/reference-datasets-listExperimentResults.md +37 -0
- package/dist/docs/references/reference-datasets-listExperiments.md +31 -0
- package/dist/docs/references/reference-datasets-listItems.md +44 -0
- package/dist/docs/references/reference-datasets-listVersions.md +31 -0
- package/dist/docs/references/reference-datasets-startExperiment.md +60 -0
- package/dist/docs/references/reference-datasets-startExperimentAsync.md +41 -0
- package/dist/docs/references/reference-datasets-update.md +46 -0
- package/dist/docs/references/reference-datasets-updateItem.md +36 -0
- package/dist/docs/references/reference-memory-observational-memory.md +36 -0
- package/dist/docs/references/reference-processors-processor-interface.md +4 -0
- package/dist/docs/references/reference-tools-create-tool.md +1 -1
- package/dist/docs/references/reference.md +24 -0
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/index.d.ts.map +1 -1
- package/dist/editor/types.d.ts +108 -2
- package/dist/editor/types.d.ts.map +1 -1
- package/dist/evals/index.cjs +20 -20
- package/dist/evals/index.js +3 -3
- package/dist/evals/scoreTraces/index.cjs +5 -5
- package/dist/evals/scoreTraces/index.js +2 -2
- package/dist/harness/harness.d.ts +281 -0
- package/dist/harness/harness.d.ts.map +1 -0
- package/dist/harness/index.cjs +1728 -0
- package/dist/harness/index.cjs.map +1 -0
- package/dist/harness/index.d.ts +4 -0
- package/dist/harness/index.d.ts.map +1 -0
- package/dist/harness/index.js +1723 -0
- package/dist/harness/index.js.map +1 -0
- package/dist/harness/tools.d.ts +65 -0
- package/dist/harness/tools.d.ts.map +1 -0
- package/dist/harness/types.d.ts +561 -0
- package/dist/harness/types.d.ts.map +1 -0
- 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 +20 -20
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/gateways/constants.d.ts.map +1 -1
- package/dist/llm/model/gateways/models-dev.d.ts +2 -3
- package/dist/llm/model/gateways/models-dev.d.ts.map +1 -1
- package/dist/llm/model/provider-types.generated.d.ts +312 -93
- package/dist/loop/index.cjs +12 -12
- package/dist/loop/index.js +1 -1
- package/dist/loop/network/index.d.ts.map +1 -1
- package/dist/loop/test-utils/options.d.ts.map +1 -1
- package/dist/loop/test-utils/tools.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/loop/workflows/stream.d.ts.map +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.d.ts +3 -3
- package/dist/mastra/index.d.ts.map +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +14 -14
- package/dist/memory/index.js +1 -1
- package/dist/memory/memory.d.ts +10 -0
- package/dist/memory/memory.d.ts.map +1 -1
- package/dist/memory/types.d.ts +24 -0
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/models-dev-BW2GAM3K.cjs +12 -0
- package/dist/{models-dev-PPIXUUCU.cjs.map → models-dev-BW2GAM3K.cjs.map} +1 -1
- package/dist/models-dev-MDI5E2YA.js +3 -0
- package/dist/{models-dev-FQVUTQ7L.js.map → models-dev-MDI5E2YA.js.map} +1 -1
- package/dist/observability/index.cjs +11 -11
- package/dist/observability/index.js +1 -1
- package/dist/observability/utils.d.ts.map +1 -1
- package/dist/processors/index.cjs +41 -41
- package/dist/processors/index.js +1 -1
- package/dist/processors/processors/skills.d.ts +5 -0
- package/dist/processors/processors/skills.d.ts.map +1 -1
- package/dist/processors/runner.d.ts +2 -2
- package/dist/processors/runner.d.ts.map +1 -1
- package/dist/processors/step-schema.d.ts +218 -49453
- package/dist/processors/step-schema.d.ts.map +1 -1
- package/dist/provider-registry-4PH2JPIA.cjs +40 -0
- package/dist/{provider-registry-6LZAGQET.cjs.map → provider-registry-4PH2JPIA.cjs.map} +1 -1
- package/dist/provider-registry-VEJ3PN4S.js +3 -0
- package/dist/{provider-registry-QUNT7S55.js.map → provider-registry-VEJ3PN4S.js.map} +1 -1
- package/dist/provider-registry.json +657 -203
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/server/composite-auth.d.ts.map +1 -1
- package/dist/server/index.cjs +6 -1
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +6 -1
- package/dist/server/index.js.map +1 -1
- package/dist/storage/base.d.ts +4 -1
- package/dist/storage/base.d.ts.map +1 -1
- package/dist/storage/constants.cjs +82 -42
- package/dist/storage/constants.d.ts +11 -1
- package/dist/storage/constants.d.ts.map +1 -1
- package/dist/storage/constants.js +1 -1
- package/dist/storage/domains/agents/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/blobs/base.d.ts +47 -0
- package/dist/storage/domains/blobs/base.d.ts.map +1 -0
- package/dist/storage/domains/blobs/index.d.ts +3 -0
- package/dist/storage/domains/blobs/index.d.ts.map +1 -0
- package/dist/storage/domains/blobs/inmemory.d.ts +17 -0
- package/dist/storage/domains/blobs/inmemory.d.ts.map +1 -0
- package/dist/storage/domains/datasets/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/index.d.ts +3 -0
- package/dist/storage/domains/index.d.ts.map +1 -1
- package/dist/storage/domains/inmemory-db.d.ts +7 -1
- package/dist/storage/domains/inmemory-db.d.ts.map +1 -1
- package/dist/storage/domains/mcp-clients/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/operations/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/prompt-blocks/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/scorer-definitions/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/skills/base.d.ts +47 -0
- package/dist/storage/domains/skills/base.d.ts.map +1 -0
- package/dist/storage/domains/skills/index.d.ts +3 -0
- package/dist/storage/domains/skills/index.d.ts.map +1 -0
- package/dist/storage/domains/skills/inmemory.d.ts +31 -0
- package/dist/storage/domains/skills/inmemory.d.ts.map +1 -0
- package/dist/storage/domains/versioned.d.ts +12 -3
- package/dist/storage/domains/versioned.d.ts.map +1 -1
- package/dist/storage/domains/workspaces/base.d.ts +47 -0
- package/dist/storage/domains/workspaces/base.d.ts.map +1 -0
- package/dist/storage/domains/workspaces/index.d.ts +3 -0
- package/dist/storage/domains/workspaces/index.d.ts.map +1 -0
- package/dist/storage/domains/workspaces/inmemory.d.ts +31 -0
- package/dist/storage/domains/workspaces/inmemory.d.ts.map +1 -0
- package/dist/storage/index.cjs +202 -138
- package/dist/storage/index.js +2 -2
- package/dist/storage/mock.d.ts.map +1 -1
- package/dist/storage/types.d.ts +422 -12
- package/dist/storage/types.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/test-utils/llm-mock.cjs +4 -4
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/tool-loop-agent/index.cjs +4 -4
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/tools/index.cjs +8 -4
- package/dist/tools/index.js +1 -1
- package/dist/tools/is-vercel-tool.cjs +2 -2
- package/dist/tools/is-vercel-tool.js +1 -1
- package/dist/tools/tool-builder/builder.d.ts.map +1 -1
- package/dist/tools/tool.d.ts +13 -0
- package/dist/tools/tool.d.ts.map +1 -1
- package/dist/tools/toolchecks.d.ts.map +1 -1
- package/dist/tools/types.d.ts +24 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/types/zod-compat.d.ts +27 -6
- package/dist/types/zod-compat.d.ts.map +1 -1
- package/dist/utils.cjs +23 -23
- package/dist/utils.js +1 -1
- package/dist/vector/index.cjs +12 -12
- package/dist/vector/index.js +2 -2
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/handlers/entry.d.ts.map +1 -1
- package/dist/workflows/index.cjs +25 -25
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/workflow.d.ts +2 -2
- package/dist/workflows/workflow.d.ts.map +1 -1
- package/dist/workspace/constants/index.d.ts +1 -0
- package/dist/workspace/constants/index.d.ts.map +1 -1
- package/dist/workspace/errors.d.ts +3 -0
- package/dist/workspace/errors.d.ts.map +1 -1
- package/dist/workspace/filesystem/composite-filesystem.d.ts +75 -6
- package/dist/workspace/filesystem/composite-filesystem.d.ts.map +1 -1
- package/dist/workspace/filesystem/local-filesystem.d.ts +42 -0
- package/dist/workspace/filesystem/local-filesystem.d.ts.map +1 -1
- package/dist/workspace/glob.d.ts +61 -0
- package/dist/workspace/glob.d.ts.map +1 -0
- package/dist/workspace/index.cjs +133 -41
- package/dist/workspace/index.d.ts +8 -1
- package/dist/workspace/index.d.ts.map +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/sandbox/local-sandbox.d.ts.map +1 -1
- package/dist/workspace/skills/composite-versioned-skill-source.d.ts +44 -0
- package/dist/workspace/skills/composite-versioned-skill-source.d.ts.map +1 -0
- package/dist/workspace/skills/index.d.ts +3 -0
- package/dist/workspace/skills/index.d.ts.map +1 -1
- package/dist/workspace/skills/local-skill-source.d.ts.map +1 -1
- package/dist/workspace/skills/publish.d.ts +34 -0
- package/dist/workspace/skills/publish.d.ts.map +1 -0
- package/dist/workspace/skills/skill-source.d.ts +2 -0
- package/dist/workspace/skills/skill-source.d.ts.map +1 -1
- package/dist/workspace/skills/types.d.ts +16 -0
- package/dist/workspace/skills/types.d.ts.map +1 -1
- package/dist/workspace/skills/versioned-skill-source.d.ts +20 -0
- package/dist/workspace/skills/versioned-skill-source.d.ts.map +1 -0
- package/dist/workspace/skills/workspace-skills.d.ts +5 -0
- package/dist/workspace/skills/workspace-skills.d.ts.map +1 -1
- package/dist/workspace/tools/delete-file.d.ts +5 -0
- package/dist/workspace/tools/delete-file.d.ts.map +1 -0
- package/dist/workspace/tools/edit-file.d.ts +7 -0
- package/dist/workspace/tools/edit-file.d.ts.map +1 -0
- package/dist/workspace/tools/execute-command.d.ts +7 -0
- package/dist/workspace/tools/execute-command.d.ts.map +1 -0
- package/dist/workspace/tools/file-stat.d.ts +4 -0
- package/dist/workspace/tools/file-stat.d.ts.map +1 -0
- package/dist/workspace/tools/grep.d.ts +9 -0
- package/dist/workspace/tools/grep.d.ts.map +1 -0
- package/dist/workspace/tools/helpers.d.ts +36 -0
- package/dist/workspace/tools/helpers.d.ts.map +1 -0
- package/dist/workspace/tools/index-content.d.ts +6 -0
- package/dist/workspace/tools/index-content.d.ts.map +1 -0
- package/dist/workspace/tools/index.d.ts +13 -1
- package/dist/workspace/tools/index.d.ts.map +1 -1
- package/dist/workspace/tools/list-files.d.ts +10 -0
- package/dist/workspace/tools/list-files.d.ts.map +1 -0
- package/dist/workspace/tools/mkdir.d.ts +5 -0
- package/dist/workspace/tools/mkdir.d.ts.map +1 -0
- package/dist/workspace/tools/read-file.d.ts +8 -0
- package/dist/workspace/tools/read-file.d.ts.map +1 -0
- package/dist/workspace/tools/search.d.ts +7 -0
- package/dist/workspace/tools/search.d.ts.map +1 -0
- package/dist/workspace/tools/tools.d.ts +5 -7
- package/dist/workspace/tools/tools.d.ts.map +1 -1
- package/dist/workspace/tools/tree-formatter.d.ts +2 -0
- package/dist/workspace/tools/tree-formatter.d.ts.map +1 -1
- package/dist/workspace/tools/write-file.d.ts +6 -0
- package/dist/workspace/tools/write-file.d.ts.map +1 -0
- package/dist/workspace/workspace.d.ts +56 -10
- package/dist/workspace/workspace.d.ts.map +1 -1
- package/harness.d.ts +1 -0
- package/package.json +8 -6
- package/src/llm/model/provider-types.generated.d.ts +312 -93
- package/dist/chunk-3JVFFAJX.cjs.map +0 -1
- package/dist/chunk-3X3CZUXI.js.map +0 -1
- package/dist/chunk-4EHGOATH.js.map +0 -1
- package/dist/chunk-4IJ4UDZX.cjs.map +0 -1
- package/dist/chunk-4KFEMXTV.cjs.map +0 -1
- package/dist/chunk-4TQ4EBYX.js.map +0 -1
- package/dist/chunk-4XSAZPPS.js.map +0 -1
- package/dist/chunk-65PHUUMF.cjs.map +0 -1
- package/dist/chunk-7NKUSQEV.js.map +0 -1
- package/dist/chunk-7UWHFWST.cjs.map +0 -1
- package/dist/chunk-AXHBJ4GX.js.map +0 -1
- package/dist/chunk-AY6DBRS3.js.map +0 -1
- package/dist/chunk-BP7VYTOP.cjs.map +0 -1
- package/dist/chunk-CYUP7QWT.cjs.map +0 -1
- package/dist/chunk-CZ4NQANZ.cjs.map +0 -1
- package/dist/chunk-NJ7TL3LQ.js.map +0 -1
- package/dist/chunk-NZG2JAKS.cjs.map +0 -1
- package/dist/chunk-PS5ONCXY.js.map +0 -1
- package/dist/chunk-RS6CZXGA.js.map +0 -1
- package/dist/chunk-SU5APAM6.cjs.map +0 -1
- package/dist/chunk-V2MLGA7T.js.map +0 -1
- package/dist/chunk-VTE2OBKS.cjs.map +0 -1
- package/dist/chunk-Y3TQ52UE.js.map +0 -1
- package/dist/chunk-YNNJLLFN.cjs.map +0 -1
- package/dist/chunk-ZATLLPIH.js.map +0 -1
- package/dist/models-dev-FQVUTQ7L.js +0 -3
- package/dist/models-dev-PPIXUUCU.cjs +0 -12
- package/dist/provider-registry-6LZAGQET.cjs +0 -40
- package/dist/provider-registry-QUNT7S55.js +0 -3
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { extractLines, createWorkspaceTools, BM25Index } from './chunk-4EHGOATH.js';
|
|
2
1
|
import { DefaultVoice } from './chunk-LHRHOPUC.js';
|
|
3
2
|
import { PUBSUB_SYMBOL, STREAM_FORMAT_SYMBOL } from './chunk-2QXNHEDL.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { extractLines, createWorkspaceTools, BM25Index } from './chunk-FZ5DRHKE.js';
|
|
4
|
+
import { InMemoryStore } from './chunk-YIN5F7VO.js';
|
|
5
|
+
import { MessageList, coreContentToString, DefaultGeneratedFile, DefaultGeneratedFileWithType } from './chunk-OHLVZVIK.js';
|
|
6
6
|
import { parsePartialJson, isDeepEqualData, stepCountIs } from './chunk-UTLWS5LV.js';
|
|
7
7
|
import { generateId, asSchema, jsonSchema, APICallError, tool } from './chunk-CPLRD2VP.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-AIRMLZ43.js';
|
|
10
|
+
import { MastraLLMV1 } from './chunk-6DUTLERJ.js';
|
|
11
11
|
import { noopLogger } from './chunk-PSCMWPLC.js';
|
|
12
12
|
import { PubSub } from './chunk-BVUMKER5.js';
|
|
13
|
-
import { isZodType, removeUndefinedValues, ensureToolProperties, makeCoreTool, createMastraProxy, deepMerge, selectFields, delay } from './chunk-
|
|
14
|
-
import { getOrCreateSpan, wrapMastra, executeWithContextSync } from './chunk-
|
|
13
|
+
import { isZodType, removeUndefinedValues, ensureToolProperties, makeCoreTool, createMastraProxy, deepMerge, selectFields, delay } from './chunk-NN26FSKL.js';
|
|
14
|
+
import { getOrCreateSpan, wrapMastra, executeWithContextSync } from './chunk-33TGTTTS.js';
|
|
15
15
|
import { ToolStream } from './chunk-DD2VNRQM.js';
|
|
16
|
-
import { Tool, createTool } from './chunk-
|
|
16
|
+
import { Tool, createTool } from './chunk-BQHWJLXU.js';
|
|
17
17
|
import { RequestContext, MASTRA_RESOURCE_ID_KEY, MASTRA_THREAD_ID_KEY } from './chunk-CCLV5CAA.js';
|
|
18
18
|
import { MastraError, getErrorFromUnknown } from './chunk-FJEVLHJT.js';
|
|
19
19
|
import { zodToJsonSchema } from './chunk-PJKCPRYF.js';
|
|
@@ -1282,7 +1282,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1282
1282
|
/**
|
|
1283
1283
|
* Process a stream part through all output processors with state management
|
|
1284
1284
|
*/
|
|
1285
|
-
async processPart(part, processorStates, tracingContext, requestContext, messageList, retryCount = 0) {
|
|
1285
|
+
async processPart(part, processorStates, tracingContext, requestContext, messageList, retryCount = 0, writer) {
|
|
1286
1286
|
if (!this.outputProcessors.length) {
|
|
1287
1287
|
return { part, blocked: false };
|
|
1288
1288
|
}
|
|
@@ -1355,7 +1355,8 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1355
1355
|
tracingContext: { currentSpan: state.span },
|
|
1356
1356
|
requestContext,
|
|
1357
1357
|
messageList,
|
|
1358
|
-
retryCount
|
|
1358
|
+
retryCount,
|
|
1359
|
+
writer
|
|
1359
1360
|
});
|
|
1360
1361
|
processedPart = result;
|
|
1361
1362
|
state.addOutputPart(processedPart);
|
|
@@ -1395,11 +1396,14 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1395
1396
|
return { part, blocked: false };
|
|
1396
1397
|
}
|
|
1397
1398
|
}
|
|
1398
|
-
async runOutputProcessorsForStream(streamResult, tracingContext) {
|
|
1399
|
+
async runOutputProcessorsForStream(streamResult, tracingContext, writer) {
|
|
1399
1400
|
return new ReadableStream({
|
|
1400
1401
|
start: async (controller) => {
|
|
1401
1402
|
const reader = streamResult.fullStream.getReader();
|
|
1402
1403
|
const processorStates = /* @__PURE__ */ new Map();
|
|
1404
|
+
const streamWriter = writer ?? {
|
|
1405
|
+
custom: async (data) => controller.enqueue(data)
|
|
1406
|
+
};
|
|
1403
1407
|
try {
|
|
1404
1408
|
while (true) {
|
|
1405
1409
|
const { done, value } = await reader.read();
|
|
@@ -1413,7 +1417,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
1413
1417
|
reason,
|
|
1414
1418
|
tripwireOptions,
|
|
1415
1419
|
processorId
|
|
1416
|
-
} = await this.processPart(value, processorStates, tracingContext);
|
|
1420
|
+
} = await this.processPart(value, processorStates, tracingContext, void 0, void 0, 0, streamWriter);
|
|
1417
1421
|
if (blocked) {
|
|
1418
1422
|
void this.logger.debug(`[Agent:${this.agentName}] - Stream part blocked by output processor`, {
|
|
1419
1423
|
reason,
|
|
@@ -2668,6 +2672,9 @@ var MastraModelOutput = class extends MastraBase {
|
|
|
2668
2672
|
structuredOutputProcessorState.customState.controller = controller;
|
|
2669
2673
|
}
|
|
2670
2674
|
}
|
|
2675
|
+
const streamWriter = {
|
|
2676
|
+
custom: async (data) => controller.enqueue(data)
|
|
2677
|
+
};
|
|
2671
2678
|
const {
|
|
2672
2679
|
part: processed,
|
|
2673
2680
|
blocked,
|
|
@@ -2679,7 +2686,9 @@ var MastraModelOutput = class extends MastraBase {
|
|
|
2679
2686
|
processorStates,
|
|
2680
2687
|
options.tracingContext,
|
|
2681
2688
|
options.requestContext,
|
|
2682
|
-
self.messageList
|
|
2689
|
+
self.messageList,
|
|
2690
|
+
0,
|
|
2691
|
+
streamWriter
|
|
2683
2692
|
);
|
|
2684
2693
|
if (blocked) {
|
|
2685
2694
|
controller.enqueue({
|
|
@@ -5554,7 +5563,7 @@ async function executeConditional(engine, params) {
|
|
|
5554
5563
|
}
|
|
5555
5564
|
});
|
|
5556
5565
|
const results = await Promise.all(
|
|
5557
|
-
stepsToRun.map(async (step
|
|
5566
|
+
stepsToRun.map(async (step) => {
|
|
5558
5567
|
const currStepResult = stepResults[step.step.id];
|
|
5559
5568
|
const isRestartStep = restart ? !!restart.activeStepsPath[step.step.id] : void 0;
|
|
5560
5569
|
if (currStepResult && timeTravel && timeTravel.executionPath.length > 0) {
|
|
@@ -5579,7 +5588,7 @@ async function executeConditional(engine, params) {
|
|
|
5579
5588
|
executionContext: {
|
|
5580
5589
|
workflowId,
|
|
5581
5590
|
runId,
|
|
5582
|
-
executionPath: [...executionContext.executionPath,
|
|
5591
|
+
executionPath: [...executionContext.executionPath, entry.steps.indexOf(step)],
|
|
5583
5592
|
activeStepsPath: executionContext.activeStepsPath,
|
|
5584
5593
|
suspendedPaths: executionContext.suspendedPaths,
|
|
5585
5594
|
resumeLabels: executionContext.resumeLabels,
|
|
@@ -6081,6 +6090,48 @@ async function executeForeach(engine, params) {
|
|
|
6081
6090
|
}
|
|
6082
6091
|
|
|
6083
6092
|
// src/workflows/handlers/entry.ts
|
|
6093
|
+
function buildResumedBlockResult(entrySteps, stepResults, executionContext, opts) {
|
|
6094
|
+
const stepsToCheck = opts?.onlyExecutedSteps ? entrySteps.filter((s) => s.type === "step" && stepResults[s.step.id] !== void 0) : entrySteps;
|
|
6095
|
+
const allComplete = stepsToCheck.every((s) => {
|
|
6096
|
+
if (s.type === "step") {
|
|
6097
|
+
const r = stepResults[s.step.id];
|
|
6098
|
+
return r && r.status === "success";
|
|
6099
|
+
}
|
|
6100
|
+
return true;
|
|
6101
|
+
});
|
|
6102
|
+
let result;
|
|
6103
|
+
if (allComplete) {
|
|
6104
|
+
result = {
|
|
6105
|
+
status: "success",
|
|
6106
|
+
output: entrySteps.reduce((acc, s) => {
|
|
6107
|
+
if (s.type === "step") {
|
|
6108
|
+
const r = stepResults[s.step.id];
|
|
6109
|
+
if (r && r.status === "success") {
|
|
6110
|
+
acc[s.step.id] = r.output;
|
|
6111
|
+
}
|
|
6112
|
+
}
|
|
6113
|
+
return acc;
|
|
6114
|
+
}, {})
|
|
6115
|
+
};
|
|
6116
|
+
} else {
|
|
6117
|
+
const stillSuspended = entrySteps.find((s) => s.type === "step" && stepResults[s.step.id]?.status === "suspended");
|
|
6118
|
+
const suspendData = stillSuspended && stillSuspended.type === "step" ? stepResults[stillSuspended.step.id]?.suspendPayload : {};
|
|
6119
|
+
result = {
|
|
6120
|
+
status: "suspended",
|
|
6121
|
+
payload: suspendData,
|
|
6122
|
+
suspendPayload: suspendData,
|
|
6123
|
+
suspendedAt: Date.now()
|
|
6124
|
+
};
|
|
6125
|
+
}
|
|
6126
|
+
if (result.status === "suspended") {
|
|
6127
|
+
entrySteps.forEach((s, stepIndex) => {
|
|
6128
|
+
if (s.type === "step" && stepResults[s.step.id]?.status === "suspended") {
|
|
6129
|
+
executionContext.suspendedPaths[s.step.id] = [...executionContext.executionPath, stepIndex];
|
|
6130
|
+
}
|
|
6131
|
+
});
|
|
6132
|
+
}
|
|
6133
|
+
return result;
|
|
6134
|
+
}
|
|
6084
6135
|
async function persistStepUpdate(engine, params) {
|
|
6085
6136
|
const {
|
|
6086
6137
|
workflowId,
|
|
@@ -6209,49 +6260,7 @@ async function executeEntry(engine, params) {
|
|
|
6209
6260
|
});
|
|
6210
6261
|
engine.applyMutableContext(executionContext, resumedStepResult.mutableContext);
|
|
6211
6262
|
Object.assign(stepResults, resumedStepResult.stepResults);
|
|
6212
|
-
|
|
6213
|
-
if (parallelStep.type === "step") {
|
|
6214
|
-
const stepResult = stepResults[parallelStep.step.id];
|
|
6215
|
-
return stepResult && stepResult.status === "success";
|
|
6216
|
-
}
|
|
6217
|
-
return true;
|
|
6218
|
-
});
|
|
6219
|
-
if (allParallelStepsComplete) {
|
|
6220
|
-
execResults = {
|
|
6221
|
-
status: "success",
|
|
6222
|
-
output: entry.steps.reduce((acc, parallelStep) => {
|
|
6223
|
-
if (parallelStep.type === "step") {
|
|
6224
|
-
const stepResult = stepResults[parallelStep.step.id];
|
|
6225
|
-
if (stepResult && stepResult.status === "success") {
|
|
6226
|
-
acc[parallelStep.step.id] = stepResult.output;
|
|
6227
|
-
}
|
|
6228
|
-
}
|
|
6229
|
-
return acc;
|
|
6230
|
-
}, {})
|
|
6231
|
-
};
|
|
6232
|
-
} else {
|
|
6233
|
-
const stillSuspended = entry.steps.find((parallelStep) => {
|
|
6234
|
-
if (parallelStep.type === "step") {
|
|
6235
|
-
const stepResult = stepResults[parallelStep.step.id];
|
|
6236
|
-
return stepResult && stepResult.status === "suspended";
|
|
6237
|
-
}
|
|
6238
|
-
return false;
|
|
6239
|
-
});
|
|
6240
|
-
execResults = {
|
|
6241
|
-
status: "suspended",
|
|
6242
|
-
payload: stillSuspended && stillSuspended.type === "step" ? stepResults[stillSuspended.step.id]?.suspendPayload : {}
|
|
6243
|
-
};
|
|
6244
|
-
}
|
|
6245
|
-
if (execResults.status === "suspended") {
|
|
6246
|
-
entry.steps.forEach((parallelStep, stepIndex) => {
|
|
6247
|
-
if (parallelStep.type === "step") {
|
|
6248
|
-
const stepResult = stepResults[parallelStep.step.id];
|
|
6249
|
-
if (stepResult && stepResult.status === "suspended") {
|
|
6250
|
-
executionContext.suspendedPaths[parallelStep.step.id] = [...executionContext.executionPath, stepIndex];
|
|
6251
|
-
}
|
|
6252
|
-
}
|
|
6253
|
-
});
|
|
6254
|
-
}
|
|
6263
|
+
execResults = buildResumedBlockResult(entry.steps, stepResults, executionContext);
|
|
6255
6264
|
return {
|
|
6256
6265
|
result: execResults,
|
|
6257
6266
|
stepResults,
|
|
@@ -6278,6 +6287,79 @@ async function executeEntry(engine, params) {
|
|
|
6278
6287
|
disableScorers,
|
|
6279
6288
|
perStep
|
|
6280
6289
|
});
|
|
6290
|
+
} else if (resume?.resumePath?.length && entry.type === "conditional") {
|
|
6291
|
+
const idx = resume.resumePath.shift();
|
|
6292
|
+
const branchStep = entry.steps[idx];
|
|
6293
|
+
let branchResult;
|
|
6294
|
+
if (branchStep.type !== "step") {
|
|
6295
|
+
branchResult = await executeEntry(engine, {
|
|
6296
|
+
workflowId,
|
|
6297
|
+
runId,
|
|
6298
|
+
resourceId,
|
|
6299
|
+
entry: branchStep,
|
|
6300
|
+
prevStep,
|
|
6301
|
+
serializedStepGraph,
|
|
6302
|
+
stepResults,
|
|
6303
|
+
resume,
|
|
6304
|
+
executionContext: {
|
|
6305
|
+
workflowId,
|
|
6306
|
+
runId,
|
|
6307
|
+
executionPath: [...executionContext.executionPath, idx],
|
|
6308
|
+
suspendedPaths: executionContext.suspendedPaths,
|
|
6309
|
+
resumeLabels: executionContext.resumeLabels,
|
|
6310
|
+
retryConfig: executionContext.retryConfig,
|
|
6311
|
+
activeStepsPath: executionContext.activeStepsPath,
|
|
6312
|
+
state: executionContext.state
|
|
6313
|
+
},
|
|
6314
|
+
tracingContext,
|
|
6315
|
+
pubsub,
|
|
6316
|
+
abortController,
|
|
6317
|
+
requestContext,
|
|
6318
|
+
outputWriter,
|
|
6319
|
+
disableScorers,
|
|
6320
|
+
perStep
|
|
6321
|
+
});
|
|
6322
|
+
} else {
|
|
6323
|
+
const resumePrevOutput = stepResults[branchStep.step.id]?.payload ?? prevOutput;
|
|
6324
|
+
branchResult = await engine.executeStep({
|
|
6325
|
+
workflowId,
|
|
6326
|
+
runId,
|
|
6327
|
+
resourceId,
|
|
6328
|
+
step: branchStep.step,
|
|
6329
|
+
prevOutput: resumePrevOutput,
|
|
6330
|
+
stepResults,
|
|
6331
|
+
serializedStepGraph,
|
|
6332
|
+
resume,
|
|
6333
|
+
restart,
|
|
6334
|
+
timeTravel,
|
|
6335
|
+
executionContext: {
|
|
6336
|
+
workflowId,
|
|
6337
|
+
runId,
|
|
6338
|
+
executionPath: [...executionContext.executionPath, idx],
|
|
6339
|
+
suspendedPaths: executionContext.suspendedPaths,
|
|
6340
|
+
resumeLabels: executionContext.resumeLabels,
|
|
6341
|
+
retryConfig: executionContext.retryConfig,
|
|
6342
|
+
activeStepsPath: executionContext.activeStepsPath,
|
|
6343
|
+
state: executionContext.state
|
|
6344
|
+
},
|
|
6345
|
+
tracingContext,
|
|
6346
|
+
pubsub,
|
|
6347
|
+
abortController,
|
|
6348
|
+
requestContext,
|
|
6349
|
+
outputWriter,
|
|
6350
|
+
disableScorers,
|
|
6351
|
+
perStep
|
|
6352
|
+
});
|
|
6353
|
+
}
|
|
6354
|
+
engine.applyMutableContext(executionContext, branchResult.mutableContext);
|
|
6355
|
+
Object.assign(stepResults, branchResult.stepResults);
|
|
6356
|
+
execResults = buildResumedBlockResult(entry.steps, stepResults, executionContext, { onlyExecutedSteps: true });
|
|
6357
|
+
return {
|
|
6358
|
+
result: execResults,
|
|
6359
|
+
stepResults,
|
|
6360
|
+
mutableContext: engine.buildMutableContext(executionContext),
|
|
6361
|
+
requestContext: branchResult.requestContext
|
|
6362
|
+
};
|
|
6281
6363
|
} else if (entry.type === "conditional") {
|
|
6282
6364
|
execResults = await engine.executeConditional({
|
|
6283
6365
|
workflowId,
|
|
@@ -11750,16 +11832,6 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
|
|
|
11750
11832
|
}
|
|
11751
11833
|
});
|
|
11752
11834
|
}
|
|
11753
|
-
|
|
11754
|
-
// src/loop/workflows/errors.ts
|
|
11755
|
-
var ToolNotFoundError = class extends Error {
|
|
11756
|
-
constructor(message) {
|
|
11757
|
-
super(message);
|
|
11758
|
-
this.name = "ToolNotFoundError";
|
|
11759
|
-
}
|
|
11760
|
-
};
|
|
11761
|
-
|
|
11762
|
-
// src/loop/workflows/agentic-execution/llm-mapping-step.ts
|
|
11763
11835
|
function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep) {
|
|
11764
11836
|
const processorRunner = rest.outputProcessors?.length && rest.logger ? new ProcessorRunner({
|
|
11765
11837
|
inputProcessors: [],
|
|
@@ -11769,6 +11841,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
11769
11841
|
processorStates: rest.processorStates
|
|
11770
11842
|
}) : void 0;
|
|
11771
11843
|
const tracingContext = rest.modelSpanTracker?.getTracingContext();
|
|
11844
|
+
const streamWriter = rest.outputWriter ? { custom: async (data) => rest.outputWriter(data) } : void 0;
|
|
11772
11845
|
async function processAndEnqueueChunk(chunk) {
|
|
11773
11846
|
if (processorRunner && rest.processorStates) {
|
|
11774
11847
|
const {
|
|
@@ -11782,7 +11855,9 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
11782
11855
|
rest.processorStates,
|
|
11783
11856
|
tracingContext,
|
|
11784
11857
|
rest.requestContext,
|
|
11785
|
-
rest.messageList
|
|
11858
|
+
rest.messageList,
|
|
11859
|
+
0,
|
|
11860
|
+
streamWriter
|
|
11786
11861
|
);
|
|
11787
11862
|
if (blocked) {
|
|
11788
11863
|
rest.controller.enqueue({
|
|
@@ -11794,13 +11869,16 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
11794
11869
|
processorId
|
|
11795
11870
|
}
|
|
11796
11871
|
});
|
|
11797
|
-
return;
|
|
11872
|
+
return null;
|
|
11798
11873
|
}
|
|
11799
11874
|
if (processed) {
|
|
11800
11875
|
rest.controller.enqueue(processed);
|
|
11876
|
+
return processed;
|
|
11801
11877
|
}
|
|
11878
|
+
return null;
|
|
11802
11879
|
} else {
|
|
11803
11880
|
rest.controller.enqueue(chunk);
|
|
11881
|
+
return chunk;
|
|
11804
11882
|
}
|
|
11805
11883
|
}
|
|
11806
11884
|
return createStep({
|
|
@@ -11809,6 +11887,20 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
11809
11887
|
outputSchema: llmIterationOutputSchema,
|
|
11810
11888
|
execute: async ({ inputData, getStepResult: getStepResult2, bail }) => {
|
|
11811
11889
|
const initialResult = getStepResult2(llmExecutionStep);
|
|
11890
|
+
async function getProviderMetadataWithModelOutput(toolCall) {
|
|
11891
|
+
const tool2 = rest.tools?.[toolCall.toolName];
|
|
11892
|
+
let modelOutput;
|
|
11893
|
+
if (tool2?.toModelOutput && toolCall.result != null) {
|
|
11894
|
+
modelOutput = await tool2.toModelOutput(toolCall.result);
|
|
11895
|
+
}
|
|
11896
|
+
const existingMastra = toolCall.providerMetadata?.mastra;
|
|
11897
|
+
const providerMetadata = {
|
|
11898
|
+
...toolCall.providerMetadata,
|
|
11899
|
+
...modelOutput != null ? { mastra: { ...existingMastra, modelOutput } } : {}
|
|
11900
|
+
};
|
|
11901
|
+
const hasMetadata = Object.keys(providerMetadata).length > 0;
|
|
11902
|
+
return hasMetadata ? providerMetadata : void 0;
|
|
11903
|
+
}
|
|
11812
11904
|
if (inputData?.some((toolCall) => toolCall?.result === void 0)) {
|
|
11813
11905
|
const errorResults = inputData.filter((toolCall) => toolCall?.error);
|
|
11814
11906
|
const toolResultMessageId = rest.experimental_generateMessageId?.() || _internal?.generateId?.();
|
|
@@ -11826,7 +11918,8 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
11826
11918
|
providerMetadata: toolCall.providerMetadata
|
|
11827
11919
|
}
|
|
11828
11920
|
};
|
|
11829
|
-
await processAndEnqueueChunk(chunk);
|
|
11921
|
+
const processed = await processAndEnqueueChunk(chunk);
|
|
11922
|
+
if (processed) await rest.options?.onChunk?.(processed);
|
|
11830
11923
|
}
|
|
11831
11924
|
const msg = {
|
|
11832
11925
|
id: toolResultMessageId || "",
|
|
@@ -11851,9 +11944,8 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
11851
11944
|
};
|
|
11852
11945
|
rest.messageList.add(msg, "response");
|
|
11853
11946
|
}
|
|
11854
|
-
const allErrorsAreToolNotFound = errorResults?.length > 0 && errorResults.every((tc) => tc.error instanceof ToolNotFoundError);
|
|
11855
11947
|
const hasPendingHITL = inputData.some((tc) => tc.result === void 0 && !tc.error);
|
|
11856
|
-
if (
|
|
11948
|
+
if (errorResults?.length > 0 && !hasPendingHITL) {
|
|
11857
11949
|
const successfulResults = inputData.filter((tc) => tc.result !== void 0);
|
|
11858
11950
|
if (successfulResults.length) {
|
|
11859
11951
|
for (const toolCall of successfulResults) {
|
|
@@ -11870,7 +11962,8 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
11870
11962
|
providerExecuted: toolCall.providerExecuted
|
|
11871
11963
|
}
|
|
11872
11964
|
};
|
|
11873
|
-
await processAndEnqueueChunk(chunk);
|
|
11965
|
+
const processed = await processAndEnqueueChunk(chunk);
|
|
11966
|
+
if (processed) await rest.options?.onChunk?.(processed);
|
|
11874
11967
|
}
|
|
11875
11968
|
const successMessageId = rest.experimental_generateMessageId?.() || _internal?.generateId?.();
|
|
11876
11969
|
const successMessage = {
|
|
@@ -11878,17 +11971,22 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
11878
11971
|
role: "assistant",
|
|
11879
11972
|
content: {
|
|
11880
11973
|
format: 2,
|
|
11881
|
-
parts:
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
|
|
11888
|
-
|
|
11889
|
-
|
|
11890
|
-
|
|
11891
|
-
|
|
11974
|
+
parts: await Promise.all(
|
|
11975
|
+
successfulResults.map(async (toolCall) => {
|
|
11976
|
+
const providerMetadata = await getProviderMetadataWithModelOutput(toolCall);
|
|
11977
|
+
return {
|
|
11978
|
+
type: "tool-invocation",
|
|
11979
|
+
toolInvocation: {
|
|
11980
|
+
state: "result",
|
|
11981
|
+
toolCallId: toolCall.toolCallId,
|
|
11982
|
+
toolName: toolCall.toolName,
|
|
11983
|
+
args: toolCall.args,
|
|
11984
|
+
result: toolCall.result
|
|
11985
|
+
},
|
|
11986
|
+
...providerMetadata ? { providerMetadata } : {}
|
|
11987
|
+
};
|
|
11988
|
+
})
|
|
11989
|
+
)
|
|
11892
11990
|
},
|
|
11893
11991
|
createdAt: /* @__PURE__ */ new Date()
|
|
11894
11992
|
};
|
|
@@ -11932,14 +12030,8 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
11932
12030
|
providerExecuted: toolCall.providerExecuted
|
|
11933
12031
|
}
|
|
11934
12032
|
};
|
|
11935
|
-
await processAndEnqueueChunk(chunk);
|
|
11936
|
-
if (
|
|
11937
|
-
await rest.options?.onChunk?.({
|
|
11938
|
-
chunk: convertMastraChunkToAISDKv5({
|
|
11939
|
-
chunk
|
|
11940
|
-
})
|
|
11941
|
-
});
|
|
11942
|
-
}
|
|
12033
|
+
const processed = await processAndEnqueueChunk(chunk);
|
|
12034
|
+
if (processed) await rest.options?.onChunk?.(processed);
|
|
11943
12035
|
}
|
|
11944
12036
|
const toolResultMessageId = rest.experimental_generateMessageId?.() || _internal?.generateId?.();
|
|
11945
12037
|
const toolResultMessage = {
|
|
@@ -11947,19 +12039,22 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
11947
12039
|
role: "assistant",
|
|
11948
12040
|
content: {
|
|
11949
12041
|
format: 2,
|
|
11950
|
-
parts:
|
|
11951
|
-
|
|
11952
|
-
|
|
11953
|
-
|
|
11954
|
-
|
|
11955
|
-
|
|
11956
|
-
|
|
11957
|
-
|
|
11958
|
-
|
|
11959
|
-
|
|
11960
|
-
|
|
11961
|
-
|
|
11962
|
-
|
|
12042
|
+
parts: await Promise.all(
|
|
12043
|
+
inputData.map(async (toolCall) => {
|
|
12044
|
+
const providerMetadata = await getProviderMetadataWithModelOutput(toolCall);
|
|
12045
|
+
return {
|
|
12046
|
+
type: "tool-invocation",
|
|
12047
|
+
toolInvocation: {
|
|
12048
|
+
state: "result",
|
|
12049
|
+
toolCallId: toolCall.toolCallId,
|
|
12050
|
+
toolName: toolCall.toolName,
|
|
12051
|
+
args: toolCall.args,
|
|
12052
|
+
result: toolCall.result
|
|
12053
|
+
},
|
|
12054
|
+
...providerMetadata ? { providerMetadata } : {}
|
|
12055
|
+
};
|
|
12056
|
+
})
|
|
12057
|
+
)
|
|
11963
12058
|
},
|
|
11964
12059
|
createdAt: /* @__PURE__ */ new Date()
|
|
11965
12060
|
};
|
|
@@ -11977,6 +12072,16 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
|
|
|
11977
12072
|
}
|
|
11978
12073
|
});
|
|
11979
12074
|
}
|
|
12075
|
+
|
|
12076
|
+
// src/loop/workflows/errors.ts
|
|
12077
|
+
var ToolNotFoundError = class extends Error {
|
|
12078
|
+
constructor(message) {
|
|
12079
|
+
super(message);
|
|
12080
|
+
this.name = "ToolNotFoundError";
|
|
12081
|
+
}
|
|
12082
|
+
};
|
|
12083
|
+
|
|
12084
|
+
// src/loop/workflows/agentic-execution/tool-call-step.ts
|
|
11980
12085
|
function createToolCallStep({
|
|
11981
12086
|
tools,
|
|
11982
12087
|
messageList,
|
|
@@ -12237,7 +12342,8 @@ function createToolCallStep({
|
|
|
12237
12342
|
} else if (isResumeToolCall) {
|
|
12238
12343
|
await removeToolMetadata(inputData.toolName, "suspension");
|
|
12239
12344
|
}
|
|
12240
|
-
const
|
|
12345
|
+
const isAgentTool = inputData.toolName?.startsWith("agent-");
|
|
12346
|
+
const resumeDataToPassToToolOptions = !isAgentTool && toolRequiresApproval && Object.keys(resumeData).length === 1 && "approved" in resumeData ? void 0 : resumeData;
|
|
12241
12347
|
const toolOptions = {
|
|
12242
12348
|
abortSignal: options?.abortSignal,
|
|
12243
12349
|
toolCallId: inputData.toolCallId,
|
|
@@ -12247,6 +12353,8 @@ function createToolCallStep({
|
|
|
12247
12353
|
tracingContext: modelSpanTracker?.getTracingContext(),
|
|
12248
12354
|
// Pass workspace from _internal (set by llmExecutionStep via prepareStep/processInputStep)
|
|
12249
12355
|
workspace: _internal?.stepWorkspace,
|
|
12356
|
+
// Forward requestContext so tools receive values set by the workflow step
|
|
12357
|
+
requestContext,
|
|
12250
12358
|
suspend: async (suspendPayload, options2) => {
|
|
12251
12359
|
if (options2?.requireToolApproval) {
|
|
12252
12360
|
controller.enqueue({
|
|
@@ -12336,7 +12444,7 @@ function createToolCallStep({
|
|
|
12336
12444
|
},
|
|
12337
12445
|
resumeData: resumeDataToPassToToolOptions
|
|
12338
12446
|
};
|
|
12339
|
-
if (resumeDataToPassToToolOptions &&
|
|
12447
|
+
if (resumeDataToPassToToolOptions && isAgentTool && !isResumeToolCall) {
|
|
12340
12448
|
let suspendedToolRunId = "";
|
|
12341
12449
|
const messages = messageList.get.all.db();
|
|
12342
12450
|
const assistantMessages = [...messages].reverse().filter((message) => message.role === "assistant");
|
|
@@ -12668,13 +12776,14 @@ function workflowLoopStream({
|
|
|
12668
12776
|
const run = await agenticLoopWorkflow.createRun({
|
|
12669
12777
|
runId
|
|
12670
12778
|
});
|
|
12671
|
-
const requestContext = new RequestContext();
|
|
12779
|
+
const requestContext = rest.requestContext ?? new RequestContext();
|
|
12672
12780
|
if (requireToolApproval) {
|
|
12673
12781
|
requestContext.set("__mastra_requireToolApproval", true);
|
|
12674
12782
|
}
|
|
12675
12783
|
const executionResult = resumeContext ? await run.resume({
|
|
12676
12784
|
resumeData: resumeContext.resumeData,
|
|
12677
12785
|
tracingContext: rest.modelSpanTracker?.getTracingContext(),
|
|
12786
|
+
requestContext,
|
|
12678
12787
|
label: toolCallId
|
|
12679
12788
|
}) : await run.start({
|
|
12680
12789
|
inputData: initialData,
|
|
@@ -14548,12 +14657,11 @@ async function createNetworkLoop({
|
|
|
14548
14657
|
}
|
|
14549
14658
|
],
|
|
14550
14659
|
format: 2,
|
|
14551
|
-
|
|
14552
|
-
|
|
14553
|
-
|
|
14554
|
-
|
|
14555
|
-
|
|
14556
|
-
} : {}
|
|
14660
|
+
metadata: {
|
|
14661
|
+
mode: "network",
|
|
14662
|
+
...requireApprovalMetadata ? { requireApprovalMetadata } : {},
|
|
14663
|
+
...suspendedTools ? { suspendedTools } : {}
|
|
14664
|
+
}
|
|
14557
14665
|
},
|
|
14558
14666
|
createdAt: /* @__PURE__ */ new Date(),
|
|
14559
14667
|
threadId: initData?.threadId || runId,
|
|
@@ -14832,8 +14940,9 @@ async function createNetworkLoop({
|
|
|
14832
14940
|
content: {
|
|
14833
14941
|
parts: [{ type: "text", text: finalResult }],
|
|
14834
14942
|
format: 2,
|
|
14835
|
-
|
|
14836
|
-
|
|
14943
|
+
metadata: {
|
|
14944
|
+
mode: "network",
|
|
14945
|
+
...suspendPayload ? {
|
|
14837
14946
|
suspendedTools: {
|
|
14838
14947
|
[inputData.primitiveId]: {
|
|
14839
14948
|
args: input,
|
|
@@ -14848,8 +14957,8 @@ async function createNetworkLoop({
|
|
|
14848
14957
|
toolCallId: inputData.primitiveId
|
|
14849
14958
|
}
|
|
14850
14959
|
}
|
|
14851
|
-
}
|
|
14852
|
-
}
|
|
14960
|
+
} : {}
|
|
14961
|
+
}
|
|
14853
14962
|
},
|
|
14854
14963
|
createdAt: /* @__PURE__ */ new Date(),
|
|
14855
14964
|
threadId: initData?.threadId || runId,
|
|
@@ -15141,7 +15250,10 @@ async function createNetworkLoop({
|
|
|
15141
15250
|
})
|
|
15142
15251
|
}
|
|
15143
15252
|
],
|
|
15144
|
-
format: 2
|
|
15253
|
+
format: 2,
|
|
15254
|
+
metadata: {
|
|
15255
|
+
mode: "network"
|
|
15256
|
+
}
|
|
15145
15257
|
},
|
|
15146
15258
|
createdAt: /* @__PURE__ */ new Date(),
|
|
15147
15259
|
threadId: initData.threadId || runId,
|
|
@@ -15306,7 +15418,10 @@ async function createNetworkLoop({
|
|
|
15306
15418
|
})
|
|
15307
15419
|
}
|
|
15308
15420
|
],
|
|
15309
|
-
format: 2
|
|
15421
|
+
format: 2,
|
|
15422
|
+
metadata: {
|
|
15423
|
+
mode: "network"
|
|
15424
|
+
}
|
|
15310
15425
|
},
|
|
15311
15426
|
createdAt: /* @__PURE__ */ new Date(),
|
|
15312
15427
|
threadId: initData.threadId || runId,
|
|
@@ -15353,7 +15468,10 @@ async function createNetworkLoop({
|
|
|
15353
15468
|
})
|
|
15354
15469
|
}
|
|
15355
15470
|
],
|
|
15356
|
-
format: 2
|
|
15471
|
+
format: 2,
|
|
15472
|
+
metadata: {
|
|
15473
|
+
mode: "network"
|
|
15474
|
+
}
|
|
15357
15475
|
},
|
|
15358
15476
|
createdAt: /* @__PURE__ */ new Date(),
|
|
15359
15477
|
threadId: initData.threadId || runId,
|
|
@@ -16366,6 +16484,17 @@ ${skillInstructions}`;
|
|
|
16366
16484
|
});
|
|
16367
16485
|
}
|
|
16368
16486
|
// ===========================================================================
|
|
16487
|
+
// Helpers
|
|
16488
|
+
// ===========================================================================
|
|
16489
|
+
/**
|
|
16490
|
+
* Mark a tool as never requiring approval.
|
|
16491
|
+
* Skill tools are internal plumbing and should bypass requireToolApproval.
|
|
16492
|
+
*/
|
|
16493
|
+
withNoApproval(tool2) {
|
|
16494
|
+
tool2.needsApprovalFn = () => false;
|
|
16495
|
+
return tool2;
|
|
16496
|
+
}
|
|
16497
|
+
// ===========================================================================
|
|
16369
16498
|
// Processor Interface
|
|
16370
16499
|
// ===========================================================================
|
|
16371
16500
|
/**
|
|
@@ -16401,13 +16530,13 @@ ${skillInstructions}`;
|
|
|
16401
16530
|
}
|
|
16402
16531
|
const skillTools = {};
|
|
16403
16532
|
if (hasSkills) {
|
|
16404
|
-
skillTools["skill-activate"] = this.createSkillActivateTool();
|
|
16405
|
-
skillTools["skill-search"] = this.createSkillSearchTool();
|
|
16533
|
+
skillTools["skill-activate"] = this.withNoApproval(this.createSkillActivateTool());
|
|
16534
|
+
skillTools["skill-search"] = this.withNoApproval(this.createSkillSearchTool());
|
|
16406
16535
|
}
|
|
16407
16536
|
if (this._activatedSkills.size > 0) {
|
|
16408
|
-
skillTools["skill-read-reference"] = this.createSkillReadReferenceTool();
|
|
16409
|
-
skillTools["skill-read-script"] = this.createSkillReadScriptTool();
|
|
16410
|
-
skillTools["skill-read-asset"] = this.createSkillReadAssetTool();
|
|
16537
|
+
skillTools["skill-read-reference"] = this.withNoApproval(this.createSkillReadReferenceTool());
|
|
16538
|
+
skillTools["skill-read-script"] = this.withNoApproval(this.createSkillReadScriptTool());
|
|
16539
|
+
skillTools["skill-read-asset"] = this.withNoApproval(this.createSkillReadAssetTool());
|
|
16411
16540
|
}
|
|
16412
16541
|
return {
|
|
16413
16542
|
messageList,
|
|
@@ -16686,7 +16815,7 @@ var AgentLegacyHandler = class {
|
|
|
16686
16815
|
model: titleModel,
|
|
16687
16816
|
instructions: titleInstructions
|
|
16688
16817
|
} = this.capabilities.resolveTitleGenerationConfig(config?.generateTitle);
|
|
16689
|
-
if (shouldGenerate && !
|
|
16818
|
+
if (shouldGenerate && !thread2.title && userMessage) {
|
|
16690
16819
|
promises.push(
|
|
16691
16820
|
this.capabilities.genTitle(userMessage, requestContext, { currentSpan: agentSpan }, titleModel, titleInstructions).then((title) => {
|
|
16692
16821
|
if (title) {
|
|
@@ -17658,6 +17787,7 @@ var coreToolSchema = z.object({
|
|
|
17658
17787
|
]),
|
|
17659
17788
|
outputSchema: z.union([z.record(z.string(), z.any()), z.any()]).optional(),
|
|
17660
17789
|
execute: z.optional(z.function(z.tuple([z.any(), z.any()]), z.promise(z.any()))),
|
|
17790
|
+
toModelOutput: z.optional(z.function(z.tuple([z.any()]), z.any())),
|
|
17661
17791
|
type: z.union([z.literal("function"), z.literal("provider-defined"), z.undefined()]).optional(),
|
|
17662
17792
|
args: z.record(z.string(), z.any()).optional()
|
|
17663
17793
|
});
|
|
@@ -19291,7 +19421,7 @@ ${errorMessages}`,
|
|
|
19291
19421
|
});
|
|
19292
19422
|
}
|
|
19293
19423
|
}
|
|
19294
|
-
return
|
|
19424
|
+
return void 0;
|
|
19295
19425
|
} catch (e) {
|
|
19296
19426
|
this.logger.error("Error generating title:", e);
|
|
19297
19427
|
return void 0;
|
|
@@ -19300,6 +19430,13 @@ ${errorMessages}`,
|
|
|
19300
19430
|
__setMemory(memory) {
|
|
19301
19431
|
this.#memory = memory;
|
|
19302
19432
|
}
|
|
19433
|
+
__setWorkspace(workspace) {
|
|
19434
|
+
this.#workspace = workspace;
|
|
19435
|
+
if (this.#mastra && workspace && typeof workspace !== "function") {
|
|
19436
|
+
workspace.__setLogger(this.logger);
|
|
19437
|
+
this.#mastra.addWorkspace(workspace);
|
|
19438
|
+
}
|
|
19439
|
+
}
|
|
19303
19440
|
/**
|
|
19304
19441
|
* Retrieves and converts memory tools to CoreTool format.
|
|
19305
19442
|
* @internal
|
|
@@ -19698,6 +19835,7 @@ ${errorMessages}`,
|
|
|
19698
19835
|
// manually wrap agent tools with tracing, so that we can pass the
|
|
19699
19836
|
// current tool span onto the agent to maintain continuity of the trace
|
|
19700
19837
|
execute: async (inputData, context) => {
|
|
19838
|
+
const savedMastraMemory = requestContext.get("MastraMemory");
|
|
19701
19839
|
try {
|
|
19702
19840
|
this.logger.debug(`[Agent:${this.name}] - Executing agent as tool ${agentName}`, {
|
|
19703
19841
|
name: agentName,
|
|
@@ -19846,8 +19984,14 @@ ${errorMessages}`,
|
|
|
19846
19984
|
}
|
|
19847
19985
|
result = { text: fullText };
|
|
19848
19986
|
}
|
|
19987
|
+
if (savedMastraMemory !== void 0) {
|
|
19988
|
+
requestContext.set("MastraMemory", savedMastraMemory);
|
|
19989
|
+
}
|
|
19849
19990
|
return result;
|
|
19850
19991
|
} catch (err) {
|
|
19992
|
+
if (savedMastraMemory !== void 0) {
|
|
19993
|
+
requestContext.set("MastraMemory", savedMastraMemory);
|
|
19994
|
+
}
|
|
19851
19995
|
const mastraError = new MastraError(
|
|
19852
19996
|
{
|
|
19853
19997
|
id: "AGENT_AGENT_TOOL_EXECUTION_FAILED",
|
|
@@ -20168,7 +20312,7 @@ ${errorMessages}`,
|
|
|
20168
20312
|
mastraProxy,
|
|
20169
20313
|
autoResumeSuspendedTools
|
|
20170
20314
|
});
|
|
20171
|
-
|
|
20315
|
+
const allTools = {
|
|
20172
20316
|
...assignedTools,
|
|
20173
20317
|
...memoryTools,
|
|
20174
20318
|
...toolsetTools,
|
|
@@ -20176,7 +20320,8 @@ ${errorMessages}`,
|
|
|
20176
20320
|
...agentTools,
|
|
20177
20321
|
...workflowTools,
|
|
20178
20322
|
...workspaceTools
|
|
20179
|
-
}
|
|
20323
|
+
};
|
|
20324
|
+
return this.formatTools(allTools);
|
|
20180
20325
|
}
|
|
20181
20326
|
/**
|
|
20182
20327
|
* Formats and validates tool names to comply with naming restrictions.
|
|
@@ -20639,7 +20784,7 @@ ${errorMessages}`,
|
|
|
20639
20784
|
model: titleModel,
|
|
20640
20785
|
instructions: titleInstructions
|
|
20641
20786
|
} = this.resolveTitleGenerationConfig(config.generateTitle);
|
|
20642
|
-
if (shouldGenerate && !
|
|
20787
|
+
if (shouldGenerate && !thread.title) {
|
|
20643
20788
|
const userMessage = this.getMostRecentUserMessage(messageList.get.all.ui());
|
|
20644
20789
|
if (userMessage) {
|
|
20645
20790
|
const title = await this.genTitle(
|
|
@@ -24513,6 +24658,35 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
24513
24658
|
listTools(_config) {
|
|
24514
24659
|
return {};
|
|
24515
24660
|
}
|
|
24661
|
+
/**
|
|
24662
|
+
* Cached promise for the embedding dimension probe.
|
|
24663
|
+
* Stored as a promise to deduplicate concurrent calls.
|
|
24664
|
+
*/
|
|
24665
|
+
_embeddingDimensionPromise;
|
|
24666
|
+
/**
|
|
24667
|
+
* Probe the embedder to determine its actual output dimension.
|
|
24668
|
+
* The result is cached so subsequent calls are free.
|
|
24669
|
+
*/
|
|
24670
|
+
async getEmbeddingDimension() {
|
|
24671
|
+
if (!this.embedder) return void 0;
|
|
24672
|
+
if (!this._embeddingDimensionPromise) {
|
|
24673
|
+
this._embeddingDimensionPromise = (async () => {
|
|
24674
|
+
try {
|
|
24675
|
+
const result = await this.embedder.doEmbed({
|
|
24676
|
+
values: ["a"],
|
|
24677
|
+
...this.embedderOptions || {}
|
|
24678
|
+
});
|
|
24679
|
+
return result.embeddings[0]?.length;
|
|
24680
|
+
} catch (e) {
|
|
24681
|
+
console.warn(
|
|
24682
|
+
`[Mastra Memory] Failed to probe embedder for dimension, falling back to default. This may cause index name mismatches if the embedder uses non-default dimensions. Error: ${e}`
|
|
24683
|
+
);
|
|
24684
|
+
return void 0;
|
|
24685
|
+
}
|
|
24686
|
+
})();
|
|
24687
|
+
}
|
|
24688
|
+
return this._embeddingDimensionPromise;
|
|
24689
|
+
}
|
|
24516
24690
|
/**
|
|
24517
24691
|
* Get the index name for semantic recall embeddings.
|
|
24518
24692
|
* This is used to ensure consistency between the Memory class and SemanticRecall processor.
|
|
@@ -24585,7 +24759,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
24585
24759
|
source: "memory",
|
|
24586
24760
|
resourceId
|
|
24587
24761
|
}),
|
|
24588
|
-
title: title ||
|
|
24762
|
+
title: title || "",
|
|
24589
24763
|
resourceId,
|
|
24590
24764
|
createdAt: /* @__PURE__ */ new Date(),
|
|
24591
24765
|
updatedAt: /* @__PURE__ */ new Date(),
|
|
@@ -24702,7 +24876,8 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
24702
24876
|
const hasSemanticRecall = configuredProcessors.some((p) => !isProcessorWorkflow(p) && p.id === "semantic-recall");
|
|
24703
24877
|
if (!hasSemanticRecall) {
|
|
24704
24878
|
const semanticConfig = typeof effectiveConfig.semanticRecall === "object" ? effectiveConfig.semanticRecall : {};
|
|
24705
|
-
const
|
|
24879
|
+
const embeddingDimension = await this.getEmbeddingDimension();
|
|
24880
|
+
const indexName = this.getEmbeddingIndexName(embeddingDimension);
|
|
24706
24881
|
processors.push(
|
|
24707
24882
|
new SemanticRecall({
|
|
24708
24883
|
storage: memoryStore,
|
|
@@ -24760,7 +24935,8 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
24760
24935
|
const hasSemanticRecall = configuredProcessors.some((p) => !isProcessorWorkflow(p) && p.id === "semantic-recall");
|
|
24761
24936
|
if (!hasSemanticRecall) {
|
|
24762
24937
|
const semanticRecallConfig = typeof effectiveConfig.semanticRecall === "object" ? effectiveConfig.semanticRecall : {};
|
|
24763
|
-
const
|
|
24938
|
+
const embeddingDimension = await this.getEmbeddingDimension();
|
|
24939
|
+
const indexName = this.getEmbeddingIndexName(embeddingDimension);
|
|
24764
24940
|
processors.push(
|
|
24765
24941
|
new SemanticRecall({
|
|
24766
24942
|
storage: memoryStore,
|
|
@@ -25109,5 +25285,5 @@ var MockMemory = class extends MastraMemory {
|
|
|
25109
25285
|
};
|
|
25110
25286
|
|
|
25111
25287
|
export { Agent, BaseProcessor, BatchPartsProcessor, ChunkFrom, DefaultExecutionEngine, EventEmitterPubSub, 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, augmentWithInit, cleanStepResult, cloneStep, cloneWorkflow, convertFullStreamChunkToMastra, convertFullStreamChunkToUIMessageStream, convertMastraChunkToAISDKv5, createDeprecationProxy, createScorer, createStep, createTimeTravelExecutionParams, createWorkflow, extractWorkingMemoryContent, extractWorkingMemoryTags, formatCheckFeedback, formatCompletionFeedback, formatValidationFeedback, generateFinalResult, generateStructuredFinalResult, getResumeLabelsByStepId, getStepIds, getStepResult, getThreadOMMetadata, getZodErrors, globalEmbeddingCache, hydrateSerializedStepErrors, isObservationalMemoryEnabled, isProcessor, isProcessorWorkflow, isSupportedLanguageModel, loop, mapVariable, memoryDefaultOptions, parseMemoryRequestContext, removeWorkingMemoryTags, resolveThreadIdFromArgs, runChecks, runCompletionScorers, runCountDeprecationMessage, runDefaultCompletionCheck, runValidation, setThreadOMMetadata, supportedLanguageModelSpecifications, tryGenerateWithJsonFallback, tryStreamWithJsonFallback, validateStepInput, validateStepRequestContext, validateStepResumeData, validateStepStateData, validateStepSuspendData };
|
|
25112
|
-
//# sourceMappingURL=chunk-
|
|
25113
|
-
//# sourceMappingURL=chunk-
|
|
25288
|
+
//# sourceMappingURL=chunk-A7V2NSY3.js.map
|
|
25289
|
+
//# sourceMappingURL=chunk-A7V2NSY3.js.map
|