@mastra/core 1.0.0-beta.11 → 1.0.0-beta.13
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 +173 -0
- package/dist/_types/@internal_ai-sdk-v4/dist/index.d.ts +7549 -0
- package/dist/_types/@internal_ai-sdk-v4/dist/test.d.ts +65 -0
- package/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +8396 -0
- package/dist/_types/@internal_ai-sdk-v5/dist/test.d.ts +1708 -0
- package/dist/_types/@internal_external-types/dist/index.d.ts +858 -0
- package/dist/agent/agent-legacy.d.ts +1 -1
- package/dist/agent/agent.d.ts +1 -1
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/agent.types.d.ts +5 -1
- package/dist/agent/agent.types.d.ts.map +1 -1
- package/dist/agent/index.cjs +9 -9
- package/dist/agent/index.js +2 -2
- package/dist/agent/message-list/index.cjs +3 -3
- package/dist/agent/message-list/index.d.ts +4 -3
- package/dist/agent/message-list/index.d.ts.map +1 -1
- package/dist/agent/message-list/index.js +1 -1
- package/dist/agent/message-list/prompt/attachments-to-parts.d.ts +1 -1
- package/dist/agent/message-list/prompt/invalid-content-error.d.ts +1 -1
- package/dist/agent/message-list/types.d.ts +3 -3
- package/dist/agent/message-list/types.d.ts.map +1 -1
- package/dist/agent/message-list/utils/ai-v4-v5/core-model-message.d.ts +1 -1
- package/dist/agent/message-list/utils/ai-v4-v5/ui-message.d.ts +1 -1
- package/dist/agent/message-list/utils/ai-v5/gemini-compatibility.d.ts +2 -2
- package/dist/agent/message-list/utils/ai-v5/gemini-compatibility.d.ts.map +1 -1
- package/dist/agent/message-list/utils/convert-messages.d.ts +2 -2
- package/dist/agent/message-list/utils/convert-messages.d.ts.map +1 -1
- package/dist/agent/types.d.ts +3 -3
- package/dist/agent/utils.d.ts +3 -3
- package/dist/agent/utils.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/index.d.ts +2 -1
- package/dist/agent/workflows/prepare-stream/index.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/stream-step.d.ts +3 -1
- package/dist/agent/workflows/prepare-stream/stream-step.d.ts.map +1 -1
- package/dist/bundler/types.d.ts +14 -1
- package/dist/bundler/types.d.ts.map +1 -1
- package/dist/{chunk-U3XOLEPX.js → chunk-2IU4RGU5.js} +6 -32
- package/dist/chunk-2IU4RGU5.js.map +1 -0
- package/dist/chunk-2SQB3WBT.js +4574 -0
- package/dist/chunk-2SQB3WBT.js.map +1 -0
- package/dist/{chunk-THZTRBFS.js → chunk-373OC54J.js} +8 -8
- package/dist/chunk-373OC54J.js.map +1 -0
- package/dist/{chunk-F2GAJSBI.js → chunk-4BC5FUAO.js} +8 -6
- package/dist/{chunk-F2GAJSBI.js.map → chunk-4BC5FUAO.js.map} +1 -1
- package/dist/chunk-55VPMN3N.js +250 -0
- package/dist/chunk-55VPMN3N.js.map +1 -0
- package/dist/{chunk-QM5SRDJX.js → chunk-5PTZG26U.js} +66 -84
- package/dist/chunk-5PTZG26U.js.map +1 -0
- package/dist/chunk-5VZGJTPR.js +4837 -0
- package/dist/chunk-5VZGJTPR.js.map +1 -0
- package/dist/{chunk-C36YRTZ6.js → chunk-62Q7K656.js} +6 -7
- package/dist/chunk-62Q7K656.js.map +1 -0
- package/dist/chunk-6PMMP3FR.js +7 -0
- package/dist/chunk-6PMMP3FR.js.map +1 -0
- package/dist/{chunk-DZUJEN5N.cjs → chunk-6SZKM6EC.cjs} +10 -3
- package/dist/{chunk-DZUJEN5N.cjs.map → chunk-6SZKM6EC.cjs.map} +1 -1
- package/dist/{chunk-5WRI5ZAA.js → chunk-7D4SUZUM.js} +10 -4
- package/dist/{chunk-5WRI5ZAA.js.map → chunk-7D4SUZUM.js.map} +1 -1
- package/dist/{chunk-YWMMBIOM.cjs → chunk-7HEAVZRS.cjs} +15 -15
- package/dist/{chunk-YWMMBIOM.cjs.map → chunk-7HEAVZRS.cjs.map} +1 -1
- package/dist/{chunk-BUKY6CTR.cjs → chunk-AGHLXC4I.cjs} +106 -36
- package/dist/chunk-AGHLXC4I.cjs.map +1 -0
- package/dist/{chunk-PK2A5WBG.js → chunk-ARAQIW6E.js} +222 -604
- package/dist/chunk-ARAQIW6E.js.map +1 -0
- package/dist/{chunk-US2U7ECW.js → chunk-BQDZIQ3G.js} +156 -90
- package/dist/chunk-BQDZIQ3G.js.map +1 -0
- package/dist/chunk-D22XABFZ.js +79 -0
- package/dist/chunk-D22XABFZ.js.map +1 -0
- package/dist/{chunk-2ULLRN4Y.js → chunk-E5BQRAJK.js} +943 -626
- package/dist/chunk-E5BQRAJK.js.map +1 -0
- package/dist/chunk-FST2G2FQ.cjs +84 -0
- package/dist/chunk-FST2G2FQ.cjs.map +1 -0
- package/dist/chunk-FVQTJUBD.cjs +2120 -0
- package/dist/chunk-FVQTJUBD.cjs.map +1 -0
- package/dist/chunk-G6E6V2Z4.js +2070 -0
- package/dist/chunk-G6E6V2Z4.js.map +1 -0
- package/dist/{chunk-7P6BNIJH.js → chunk-GIWC35YQ.js} +105 -35
- package/dist/chunk-GIWC35YQ.js.map +1 -0
- package/dist/{chunk-4JKEUSCC.cjs → chunk-H4VUIOWU.cjs} +22 -20
- package/dist/chunk-H4VUIOWU.cjs.map +1 -0
- package/dist/{chunk-TWH4PTDG.cjs → chunk-HWMMIRIF.cjs} +32 -27
- package/dist/chunk-HWMMIRIF.cjs.map +1 -0
- package/dist/chunk-IXZ2T2QX.cjs +448 -0
- package/dist/chunk-IXZ2T2QX.cjs.map +1 -0
- package/dist/chunk-L3NKIMF5.cjs +10 -0
- package/dist/chunk-L3NKIMF5.cjs.map +1 -0
- package/dist/chunk-L4JCRWDY.cjs +252 -0
- package/dist/chunk-L4JCRWDY.cjs.map +1 -0
- package/dist/{chunk-BJXKH4LG.cjs → chunk-LGB4VNZI.cjs} +43 -78
- package/dist/chunk-LGB4VNZI.cjs.map +1 -0
- package/dist/{chunk-PG5H6QIO.cjs → chunk-MLKE7HRS.cjs} +41 -21
- package/dist/chunk-MLKE7HRS.cjs.map +1 -0
- package/dist/{chunk-OEIVMCWX.js → chunk-MRRFTNF4.js} +2537 -84
- package/dist/chunk-MRRFTNF4.js.map +1 -0
- package/dist/chunk-MXBVP7HX.cjs +4842 -0
- package/dist/chunk-MXBVP7HX.cjs.map +1 -0
- package/dist/chunk-NESKUIRE.cjs +4586 -0
- package/dist/chunk-NESKUIRE.cjs.map +1 -0
- package/dist/{chunk-SVLMF4UZ.cjs → chunk-NIOEY3N3.cjs} +66 -85
- package/dist/chunk-NIOEY3N3.cjs.map +1 -0
- package/dist/{chunk-CZEJQSWB.cjs → chunk-OWIEOL55.cjs} +295 -677
- package/dist/chunk-OWIEOL55.cjs.map +1 -0
- package/dist/{chunk-WTSZBHIZ.cjs → chunk-PJAK4U6R.cjs} +24 -24
- package/dist/{chunk-WTSZBHIZ.cjs.map → chunk-PJAK4U6R.cjs.map} +1 -1
- package/dist/{chunk-52RSUALV.cjs → chunk-R5AJGM55.cjs} +1314 -995
- package/dist/chunk-R5AJGM55.cjs.map +1 -0
- package/dist/{chunk-IVV5TOMD.js → chunk-RCJLMMTO.js} +32 -12
- package/dist/chunk-RCJLMMTO.js.map +1 -0
- package/dist/{chunk-S73Z3PBJ.cjs → chunk-SZYSDJTN.cjs} +27 -28
- package/dist/chunk-SZYSDJTN.cjs.map +1 -0
- package/dist/{chunk-YC6PJEPH.cjs → chunk-U4CSOY6T.cjs} +188 -122
- package/dist/chunk-U4CSOY6T.cjs.map +1 -0
- package/dist/chunk-UBSPZTQX.js +434 -0
- package/dist/chunk-UBSPZTQX.js.map +1 -0
- package/dist/{chunk-SCUWP4II.cjs → chunk-VEPP75C4.cjs} +47 -74
- package/dist/chunk-VEPP75C4.cjs.map +1 -0
- package/dist/{chunk-JIGDJK2O.js → chunk-VETAQUW3.js} +4 -39
- package/dist/chunk-VETAQUW3.js.map +1 -0
- package/dist/{chunk-Z57R5WS4.js → chunk-WPTTKULS.js} +4 -4
- package/dist/{chunk-Z57R5WS4.js.map → chunk-WPTTKULS.js.map} +1 -1
- package/dist/{chunk-O2BJW7YA.js → chunk-WYGUWVTF.js} +5 -5
- package/dist/{chunk-O2BJW7YA.js.map → chunk-WYGUWVTF.js.map} +1 -1
- package/dist/{chunk-SXNQRJQD.js → chunk-WYWRMIQC.js} +127 -22
- package/dist/chunk-WYWRMIQC.js.map +1 -0
- package/dist/{chunk-5Q6WAYEY.cjs → chunk-X6IBA7FP.cjs} +137 -50
- package/dist/chunk-X6IBA7FP.cjs.map +1 -0
- package/dist/{chunk-MRFUISXC.cjs → chunk-Y7MZ5LJT.cjs} +2632 -179
- package/dist/chunk-Y7MZ5LJT.cjs.map +1 -0
- package/dist/{chunk-JJ5O45LH.js → chunk-YPLZDWG7.js} +32 -27
- package/dist/chunk-YPLZDWG7.js.map +1 -0
- package/dist/{chunk-MGCGWPQJ.cjs → chunk-Z55SJVEC.cjs} +8 -8
- package/dist/chunk-Z55SJVEC.cjs.map +1 -0
- package/dist/error/index.cjs +6 -6
- package/dist/error/index.d.ts +26 -20
- package/dist/error/index.d.ts.map +1 -1
- package/dist/error/index.js +1 -1
- package/dist/error/utils.d.ts +19 -5
- package/dist/error/utils.d.ts.map +1 -1
- package/dist/evals/index.cjs +4 -4
- package/dist/evals/index.js +1 -1
- package/dist/evals/run/index.d.ts +1 -1
- package/dist/evals/scoreTraces/index.cjs +8 -8
- package/dist/evals/scoreTraces/index.js +2 -2
- package/dist/evals/types.d.ts +1 -1
- package/dist/events/event-emitter.d.ts +6 -1
- package/dist/events/event-emitter.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/integration/index.cjs +2 -2
- package/dist/integration/index.js +1 -1
- package/dist/llm/index.cjs +15 -15
- package/dist/llm/index.d.ts +2 -2
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +5 -5
- package/dist/llm/model/aisdk/v5/model.d.ts +1 -1
- package/dist/llm/model/base.types.d.ts +2 -2
- package/dist/llm/model/model.d.ts +1 -1
- package/dist/llm/model/model.d.ts.map +1 -1
- package/dist/llm/model/model.loop.d.ts +2 -2
- package/dist/llm/model/model.loop.d.ts.map +1 -1
- package/dist/llm/model/model.loop.types.d.ts +1 -1
- package/dist/llm/model/model.loop.types.d.ts.map +1 -1
- package/dist/llm/model/provider-types.generated.d.ts +51 -11
- package/dist/llm/model/shared.types.d.ts +1 -1
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +1 -1
- package/dist/loop/loop.d.ts +2 -2
- package/dist/loop/loop.d.ts.map +1 -1
- package/dist/loop/test-utils/MastraLanguageModelV2Mock.d.ts +1 -1
- package/dist/loop/test-utils/MastraLanguageModelV2Mock.d.ts.map +1 -1
- package/dist/loop/test-utils/options.d.ts.map +1 -1
- package/dist/loop/test-utils/streamObject.d.ts +1 -1
- package/dist/loop/test-utils/streamObject.d.ts.map +1 -1
- package/dist/loop/test-utils/tools.d.ts.map +1 -1
- package/dist/loop/types.d.ts +3 -1
- package/dist/loop/types.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/index.d.ts +13 -13
- package/dist/loop/workflows/agentic-execution/index.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +10 -10
- 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 +5 -5
- 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 +22 -21
- package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-loop/index.d.ts +13 -13
- package/dist/loop/workflows/agentic-loop/index.d.ts.map +1 -1
- package/dist/loop/workflows/schema.d.ts +6 -6
- package/dist/loop/workflows/schema.d.ts.map +1 -1
- package/dist/loop/workflows/stream.d.ts +2 -2
- package/dist/loop/workflows/stream.d.ts.map +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.js +1 -1
- package/dist/mcp/index.cjs +4 -4
- package/dist/mcp/index.js +1 -1
- package/dist/memory/index.cjs +6 -6
- package/dist/memory/index.js +1 -1
- package/dist/memory/memory.d.ts +1 -1
- package/dist/memory/types.d.ts +3 -3
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/models-dev-D3EKFGAO.cjs +12 -0
- package/dist/{models-dev-EO3SUIY2.cjs.map → models-dev-D3EKFGAO.cjs.map} +1 -1
- package/dist/models-dev-EO22XOXQ.js +3 -0
- package/dist/{models-dev-23RN2WHG.js.map → models-dev-EO22XOXQ.js.map} +1 -1
- package/dist/netlify-AE4LNCAI.js +3 -0
- package/dist/{netlify-GXJ5D5DD.js.map → netlify-AE4LNCAI.js.map} +1 -1
- package/dist/netlify-WE42TZIT.cjs +12 -0
- package/dist/{netlify-KJLY3GFS.cjs.map → netlify-WE42TZIT.cjs.map} +1 -1
- package/dist/processors/index.cjs +37 -37
- package/dist/processors/index.d.ts +2 -2
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/index.js +1 -1
- package/dist/processors/step-schema.d.ts +1267 -1267
- package/dist/processors/step-schema.d.ts.map +1 -1
- package/dist/provider-registry-6LF3NGC5.js +3 -0
- package/dist/{provider-registry-F67Y6OF2.js.map → provider-registry-6LF3NGC5.js.map} +1 -1
- package/dist/provider-registry-73FKMXJV.cjs +40 -0
- package/dist/{provider-registry-3TG2KUD2.cjs.map → provider-registry-73FKMXJV.cjs.map} +1 -1
- package/dist/provider-registry.json +100 -30
- package/dist/{registry-generator-UMTNPBJX.js → registry-generator-AVQXI3GX.js} +2 -2
- package/dist/{registry-generator-UMTNPBJX.js.map → registry-generator-AVQXI3GX.js.map} +1 -1
- package/dist/{registry-generator-34SC4TAU.cjs → registry-generator-KOFNIIWJ.cjs} +2 -2
- package/dist/{registry-generator-34SC4TAU.cjs.map → registry-generator-KOFNIIWJ.cjs.map} +1 -1
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +1 -1
- package/dist/server/index.cjs +5 -5
- package/dist/server/index.js +1 -1
- package/dist/storage/base.d.ts +2 -10
- package/dist/storage/base.d.ts.map +1 -1
- package/dist/storage/domains/workflows/base.d.ts +2 -8
- package/dist/storage/domains/workflows/base.d.ts.map +1 -1
- package/dist/storage/domains/workflows/inmemory.d.ts +2 -8
- package/dist/storage/domains/workflows/inmemory.d.ts.map +1 -1
- package/dist/storage/index.cjs +38 -38
- package/dist/storage/index.js +1 -1
- package/dist/storage/mock.d.ts +2 -8
- package/dist/storage/mock.d.ts.map +1 -1
- package/dist/storage/types.d.ts +9 -1
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/stream/RunOutput.d.ts +1 -1
- package/dist/stream/aisdk/v4/input.d.ts +1 -1
- package/dist/stream/aisdk/v5/compat/content.d.ts +1 -1
- package/dist/stream/aisdk/v5/compat/content.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/compat/prepare-tools.d.ts +1 -1
- package/dist/stream/aisdk/v5/compat/prepare-tools.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/compat/ui-message.d.ts +1 -1
- package/dist/stream/aisdk/v5/compat/ui-message.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/compat/validation.d.ts +1 -1
- package/dist/stream/aisdk/v5/compat/validation.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/execute.d.ts +2 -2
- package/dist/stream/aisdk/v5/execute.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/input.d.ts +1 -1
- package/dist/stream/aisdk/v5/input.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/output-helpers.d.ts +12 -27
- package/dist/stream/aisdk/v5/output-helpers.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/output.d.ts +41 -91
- package/dist/stream/aisdk/v5/output.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/transform.d.ts +1 -1
- package/dist/stream/aisdk/v5/transform.d.ts.map +1 -1
- package/dist/stream/base/input.d.ts +1 -1
- package/dist/stream/base/output.d.ts +9 -31
- package/dist/stream/base/output.d.ts.map +1 -1
- package/dist/stream/base/schema.d.ts +2 -2
- package/dist/stream/base/schema.d.ts.map +1 -1
- package/dist/stream/index.cjs +12 -12
- package/dist/stream/index.js +2 -2
- package/dist/stream/types.d.ts +3 -2
- package/dist/stream/types.d.ts.map +1 -1
- package/dist/test-utils/llm-mock.cjs +14587 -14
- package/dist/test-utils/llm-mock.cjs.map +1 -1
- package/dist/test-utils/llm-mock.d.ts +3 -3
- package/dist/test-utils/llm-mock.d.ts.map +1 -1
- package/dist/test-utils/llm-mock.js +14577 -4
- package/dist/test-utils/llm-mock.js.map +1 -1
- package/dist/token-6GSAFR2W-SGVIXFCP.cjs +63 -0
- package/dist/token-6GSAFR2W-SGVIXFCP.cjs.map +1 -0
- package/dist/token-6GSAFR2W-SPYPLMBM.js +61 -0
- package/dist/token-6GSAFR2W-SPYPLMBM.js.map +1 -0
- package/dist/token-util-NEHG7TUY-7GMW5FXI.cjs +10 -0
- package/dist/token-util-NEHG7TUY-7GMW5FXI.cjs.map +1 -0
- package/dist/token-util-NEHG7TUY-JRJTGTAB.js +8 -0
- package/dist/token-util-NEHG7TUY-JRJTGTAB.js.map +1 -0
- package/dist/tools/index.cjs +4 -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 +2 -1
- package/dist/tools/tool-builder/builder.d.ts.map +1 -1
- package/dist/tools/tool.d.ts.map +1 -1
- package/dist/tools/types.d.ts +5 -5
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/utils.cjs +22 -22
- package/dist/utils.d.ts +3 -3
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/vector/embed.d.ts +2 -2
- package/dist/vector/embed.d.ts.map +1 -1
- package/dist/vector/index.cjs +11 -11
- package/dist/vector/index.js +3 -3
- package/dist/vector/vector.d.ts +1 -1
- package/dist/voice/aisdk/speech.d.ts +1 -1
- package/dist/voice/aisdk/speech.d.ts.map +1 -1
- package/dist/voice/aisdk/transcription.d.ts +1 -1
- package/dist/voice/aisdk/transcription.d.ts.map +1 -1
- package/dist/voice/composite-voice.d.ts +1 -1
- package/dist/voice/composite-voice.d.ts.map +1 -1
- package/dist/voice/index.cjs +6 -6
- package/dist/voice/index.js +1 -1
- package/dist/workflows/constants.cjs +4 -4
- package/dist/workflows/constants.d.ts +1 -1
- package/dist/workflows/constants.d.ts.map +1 -1
- package/dist/workflows/constants.js +1 -1
- package/dist/workflows/default.d.ts +9 -16
- package/dist/workflows/default.d.ts.map +1 -1
- package/dist/workflows/evented/execution-engine.d.ts +3 -2
- package/dist/workflows/evented/execution-engine.d.ts.map +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/evented/step-executor.d.ts +1 -1
- package/dist/workflows/evented/step-executor.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/index.d.ts +1 -1
- package/dist/workflows/evented/workflow-event-processor/index.d.ts.map +1 -1
- package/dist/workflows/evented/workflow.d.ts +15 -0
- package/dist/workflows/evented/workflow.d.ts.map +1 -1
- package/dist/workflows/execution-engine.d.ts +25 -2
- package/dist/workflows/execution-engine.d.ts.map +1 -1
- package/dist/workflows/handlers/control-flow.d.ts +6 -5
- package/dist/workflows/handlers/control-flow.d.ts.map +1 -1
- package/dist/workflows/handlers/entry.d.ts +5 -3
- package/dist/workflows/handlers/entry.d.ts.map +1 -1
- package/dist/workflows/handlers/sleep.d.ts +4 -3
- package/dist/workflows/handlers/sleep.d.ts.map +1 -1
- package/dist/workflows/handlers/step.d.ts +5 -3
- package/dist/workflows/handlers/step.d.ts.map +1 -1
- package/dist/workflows/index.cjs +26 -22
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/step.d.ts +5 -4
- package/dist/workflows/step.d.ts.map +1 -1
- package/dist/workflows/types.d.ts +66 -14
- package/dist/workflows/types.d.ts.map +1 -1
- package/dist/workflows/utils.d.ts +11 -0
- package/dist/workflows/utils.d.ts.map +1 -1
- package/dist/workflows/workflow.d.ts +26 -8
- package/dist/workflows/workflow.d.ts.map +1 -1
- package/package.json +12 -11
- package/src/llm/model/provider-types.generated.d.ts +51 -11
- package/dist/agent/__tests__/mock-model.d.ts +0 -8
- package/dist/agent/__tests__/mock-model.d.ts.map +0 -1
- package/dist/agent/agent-types.test-d.d.ts +0 -2
- package/dist/agent/agent-types.test-d.d.ts.map +0 -1
- package/dist/ai-sdk.types.d.ts +0 -4705
- package/dist/chunk-2ULLRN4Y.js.map +0 -1
- package/dist/chunk-3E3ILV6T.cjs +0 -518
- package/dist/chunk-3E3ILV6T.cjs.map +0 -1
- package/dist/chunk-4JKEUSCC.cjs.map +0 -1
- package/dist/chunk-52RSUALV.cjs.map +0 -1
- package/dist/chunk-5PAEYE3Q.js +0 -513
- package/dist/chunk-5PAEYE3Q.js.map +0 -1
- package/dist/chunk-5Q6WAYEY.cjs.map +0 -1
- package/dist/chunk-7P6BNIJH.js.map +0 -1
- package/dist/chunk-ABJOUEVA.cjs +0 -10
- package/dist/chunk-ABJOUEVA.cjs.map +0 -1
- package/dist/chunk-BJXKH4LG.cjs.map +0 -1
- package/dist/chunk-BUKY6CTR.cjs.map +0 -1
- package/dist/chunk-C36YRTZ6.js.map +0 -1
- package/dist/chunk-CZEJQSWB.cjs.map +0 -1
- package/dist/chunk-IVV5TOMD.js.map +0 -1
- package/dist/chunk-JIGDJK2O.js.map +0 -1
- package/dist/chunk-JJ5O45LH.js.map +0 -1
- package/dist/chunk-MGCGWPQJ.cjs.map +0 -1
- package/dist/chunk-MRFUISXC.cjs.map +0 -1
- package/dist/chunk-NLNKQD2T.js +0 -7
- package/dist/chunk-NLNKQD2T.js.map +0 -1
- package/dist/chunk-OEIVMCWX.js.map +0 -1
- package/dist/chunk-PG5H6QIO.cjs.map +0 -1
- package/dist/chunk-PK2A5WBG.js.map +0 -1
- package/dist/chunk-QM5SRDJX.js.map +0 -1
- package/dist/chunk-S73Z3PBJ.cjs.map +0 -1
- package/dist/chunk-SCUWP4II.cjs.map +0 -1
- package/dist/chunk-SVLMF4UZ.cjs.map +0 -1
- package/dist/chunk-SXNQRJQD.js.map +0 -1
- package/dist/chunk-THZTRBFS.js.map +0 -1
- package/dist/chunk-TWH4PTDG.cjs.map +0 -1
- package/dist/chunk-U3XOLEPX.js.map +0 -1
- package/dist/chunk-US2U7ECW.js.map +0 -1
- package/dist/chunk-YC6PJEPH.cjs.map +0 -1
- package/dist/models-dev-23RN2WHG.js +0 -3
- package/dist/models-dev-EO3SUIY2.cjs +0 -12
- package/dist/netlify-GXJ5D5DD.js +0 -3
- package/dist/netlify-KJLY3GFS.cjs +0 -12
- package/dist/provider-registry-3TG2KUD2.cjs +0 -40
- package/dist/provider-registry-F67Y6OF2.js +0 -3
- package/dist/tools/tool-stream-types.test-d.d.ts +0 -2
- package/dist/tools/tool-stream-types.test-d.d.ts.map +0 -1
|
@@ -0,0 +1,858 @@
|
|
|
1
|
+
import { JSONSchema7 } from '@ai-sdk/provider';
|
|
2
|
+
import { JSONValue } from '@ai-sdk/provider';
|
|
3
|
+
import { LanguageModelV1ProviderMetadata } from '@ai-sdk/provider';
|
|
4
|
+
import { LanguageModelV2ToolResultOutput } from '@ai-sdk/provider';
|
|
5
|
+
import { LanguageModelV2ToolResultPart } from '@ai-sdk/provider';
|
|
6
|
+
import { Schema } from '@ai-sdk/ui-utils';
|
|
7
|
+
import { SharedV2ProviderOptions } from '@ai-sdk/provider';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import * as z3 from 'zod/v3';
|
|
10
|
+
import * as z4 from 'zod/v4';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
Content of an assistant message.
|
|
14
|
+
It can be a string or an array of text, image, reasoning, redacted reasoning, and tool call parts.
|
|
15
|
+
*/
|
|
16
|
+
declare type AssistantContent = string | Array<TextPart | FilePart | ReasoningPart | RedactedReasoningPart | ToolCallPart>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
Content of an assistant message.
|
|
20
|
+
It can be a string or an array of text, image, reasoning, redacted reasoning, and tool call parts.
|
|
21
|
+
*/
|
|
22
|
+
declare type AssistantContent_2 = string | Array<TextPart_2 | FilePart_2 | ReasoningPart_2 | ToolCallPart_2 | ToolResultPart_2>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
An assistant message. It can contain text, tool calls, or a combination of text and tool calls.
|
|
26
|
+
*/
|
|
27
|
+
declare type AssistantModelMessage = {
|
|
28
|
+
role: 'assistant';
|
|
29
|
+
content: AssistantContent_2;
|
|
30
|
+
/**
|
|
31
|
+
Additional provider-specific metadata. They are passed through
|
|
32
|
+
to the provider from the AI SDK and enable provider-specific
|
|
33
|
+
functionality that can be fully encapsulated in the provider.
|
|
34
|
+
*/
|
|
35
|
+
providerOptions?: ProviderOptions_2;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
An assistant message. It can contain text, tool calls, or a combination of text and tool calls.
|
|
40
|
+
*/
|
|
41
|
+
declare type CoreAssistantMessage = {
|
|
42
|
+
role: 'assistant';
|
|
43
|
+
content: AssistantContent;
|
|
44
|
+
/**
|
|
45
|
+
Additional provider-specific metadata. They are passed through
|
|
46
|
+
to the provider from the AI SDK and enable provider-specific
|
|
47
|
+
functionality that can be fully encapsulated in the provider.
|
|
48
|
+
*/
|
|
49
|
+
providerOptions?: ProviderOptions;
|
|
50
|
+
/**
|
|
51
|
+
@deprecated Use `providerOptions` instead.
|
|
52
|
+
*/
|
|
53
|
+
experimental_providerMetadata?: ProviderMetadata;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
A message that can be used in the `messages` field of a prompt.
|
|
58
|
+
It can be a user message, an assistant message, or a tool message.
|
|
59
|
+
*/
|
|
60
|
+
declare type CoreMessage = CoreSystemMessage | CoreUserMessage | CoreAssistantMessage | CoreToolMessage;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
A system message. It can contain system information.
|
|
64
|
+
|
|
65
|
+
Note: using the "system" part of the prompt is strongly preferred
|
|
66
|
+
to increase the resilience against prompt injection attacks,
|
|
67
|
+
and because not all providers support several system messages.
|
|
68
|
+
*/
|
|
69
|
+
declare type CoreSystemMessage = {
|
|
70
|
+
role: 'system';
|
|
71
|
+
content: string;
|
|
72
|
+
/**
|
|
73
|
+
Additional provider-specific metadata. They are passed through
|
|
74
|
+
to the provider from the AI SDK and enable provider-specific
|
|
75
|
+
functionality that can be fully encapsulated in the provider.
|
|
76
|
+
*/
|
|
77
|
+
providerOptions?: ProviderOptions;
|
|
78
|
+
/**
|
|
79
|
+
@deprecated Use `providerOptions` instead.
|
|
80
|
+
*/
|
|
81
|
+
experimental_providerMetadata?: ProviderMetadata;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
A tool message. It contains the result of one or more tool calls.
|
|
86
|
+
*/
|
|
87
|
+
declare type CoreToolMessage = {
|
|
88
|
+
role: 'tool';
|
|
89
|
+
content: ToolContent;
|
|
90
|
+
/**
|
|
91
|
+
Additional provider-specific metadata. They are passed through
|
|
92
|
+
to the provider from the AI SDK and enable provider-specific
|
|
93
|
+
functionality that can be fully encapsulated in the provider.
|
|
94
|
+
*/
|
|
95
|
+
providerOptions?: ProviderOptions;
|
|
96
|
+
/**
|
|
97
|
+
@deprecated Use `providerOptions` instead.
|
|
98
|
+
*/
|
|
99
|
+
experimental_providerMetadata?: ProviderMetadata;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
A user message. It can contain text or a combination of text and images.
|
|
104
|
+
*/
|
|
105
|
+
declare type CoreUserMessage = {
|
|
106
|
+
role: 'user';
|
|
107
|
+
content: UserContent;
|
|
108
|
+
/**
|
|
109
|
+
Additional provider-specific metadata. They are passed through
|
|
110
|
+
to the provider from the AI SDK and enable provider-specific
|
|
111
|
+
functionality that can be fully encapsulated in the provider.
|
|
112
|
+
*/
|
|
113
|
+
providerOptions?: ProviderOptions;
|
|
114
|
+
/**
|
|
115
|
+
@deprecated Use `providerOptions` instead.
|
|
116
|
+
*/
|
|
117
|
+
experimental_providerMetadata?: ProviderMetadata;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
Data content. Can either be a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer.
|
|
122
|
+
*/
|
|
123
|
+
declare type DataContent = string | Uint8Array | ArrayBuffer | Buffer;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
Data content. Can either be a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer.
|
|
127
|
+
*/
|
|
128
|
+
declare type DataContent_2 = string | Uint8Array | ArrayBuffer | Buffer;
|
|
129
|
+
|
|
130
|
+
declare const _default: {};
|
|
131
|
+
export default _default;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
File content part of a prompt. It contains a file.
|
|
135
|
+
*/
|
|
136
|
+
declare interface FilePart {
|
|
137
|
+
type: 'file';
|
|
138
|
+
/**
|
|
139
|
+
File data. Can either be:
|
|
140
|
+
|
|
141
|
+
- data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
|
|
142
|
+
- URL: a URL that points to the image
|
|
143
|
+
*/
|
|
144
|
+
data: DataContent | URL;
|
|
145
|
+
/**
|
|
146
|
+
Optional filename of the file.
|
|
147
|
+
*/
|
|
148
|
+
filename?: string;
|
|
149
|
+
/**
|
|
150
|
+
Mime type of the file.
|
|
151
|
+
*/
|
|
152
|
+
mimeType: string;
|
|
153
|
+
/**
|
|
154
|
+
Additional provider-specific metadata. They are passed through
|
|
155
|
+
to the provider from the AI SDK and enable provider-specific
|
|
156
|
+
functionality that can be fully encapsulated in the provider.
|
|
157
|
+
*/
|
|
158
|
+
providerOptions?: ProviderOptions;
|
|
159
|
+
/**
|
|
160
|
+
@deprecated Use `providerOptions` instead.
|
|
161
|
+
*/
|
|
162
|
+
experimental_providerMetadata?: ProviderMetadata;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
File content part of a prompt. It contains a file.
|
|
167
|
+
*/
|
|
168
|
+
declare interface FilePart_2 {
|
|
169
|
+
type: 'file';
|
|
170
|
+
/**
|
|
171
|
+
File data. Can either be:
|
|
172
|
+
|
|
173
|
+
- data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
|
|
174
|
+
- URL: a URL that points to the image
|
|
175
|
+
*/
|
|
176
|
+
data: DataContent_2 | URL;
|
|
177
|
+
/**
|
|
178
|
+
Optional filename of the file.
|
|
179
|
+
*/
|
|
180
|
+
filename?: string;
|
|
181
|
+
/**
|
|
182
|
+
IANA media type of the file.
|
|
183
|
+
|
|
184
|
+
@see https://www.iana.org/assignments/media-types/media-types.xhtml
|
|
185
|
+
*/
|
|
186
|
+
mediaType: string;
|
|
187
|
+
/**
|
|
188
|
+
Additional provider-specific metadata. They are passed through
|
|
189
|
+
to the provider from the AI SDK and enable provider-specific
|
|
190
|
+
functionality that can be fully encapsulated in the provider.
|
|
191
|
+
*/
|
|
192
|
+
providerOptions?: ProviderOptions_2;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export declare type FlexibleSchema<SCHEMA> = z4.core.$ZodType<SCHEMA, any> | z3.Schema<SCHEMA, z3.ZodTypeDef, any> | Schema_2<SCHEMA> | LazySchema<SCHEMA>;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
Image content part of a prompt. It contains an image.
|
|
199
|
+
*/
|
|
200
|
+
declare interface ImagePart {
|
|
201
|
+
type: 'image';
|
|
202
|
+
/**
|
|
203
|
+
Image data. Can either be:
|
|
204
|
+
|
|
205
|
+
- data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
|
|
206
|
+
- URL: a URL that points to the image
|
|
207
|
+
*/
|
|
208
|
+
image: DataContent | URL;
|
|
209
|
+
/**
|
|
210
|
+
Optional mime type of the image.
|
|
211
|
+
*/
|
|
212
|
+
mimeType?: string;
|
|
213
|
+
/**
|
|
214
|
+
Additional provider-specific metadata. They are passed through
|
|
215
|
+
to the provider from the AI SDK and enable provider-specific
|
|
216
|
+
functionality that can be fully encapsulated in the provider.
|
|
217
|
+
*/
|
|
218
|
+
providerOptions?: ProviderOptions;
|
|
219
|
+
/**
|
|
220
|
+
@deprecated Use `providerOptions` instead.
|
|
221
|
+
*/
|
|
222
|
+
experimental_providerMetadata?: ProviderMetadata;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
Image content part of a prompt. It contains an image.
|
|
227
|
+
*/
|
|
228
|
+
declare interface ImagePart_2 {
|
|
229
|
+
type: 'image';
|
|
230
|
+
/**
|
|
231
|
+
Image data. Can either be:
|
|
232
|
+
|
|
233
|
+
- data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
|
|
234
|
+
- URL: a URL that points to the image
|
|
235
|
+
*/
|
|
236
|
+
image: DataContent_2 | URL;
|
|
237
|
+
/**
|
|
238
|
+
Optional IANA media type of the image.
|
|
239
|
+
|
|
240
|
+
@see https://www.iana.org/assignments/media-types/media-types.xhtml
|
|
241
|
+
*/
|
|
242
|
+
mediaType?: string;
|
|
243
|
+
/**
|
|
244
|
+
Additional provider-specific metadata. They are passed through
|
|
245
|
+
to the provider from the AI SDK and enable provider-specific
|
|
246
|
+
functionality that can be fully encapsulated in the provider.
|
|
247
|
+
*/
|
|
248
|
+
providerOptions?: ProviderOptions_2;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
declare type inferParameters<PARAMETERS extends ToolParameters> = PARAMETERS extends Schema<any> ? PARAMETERS['_type'] : PARAMETERS extends z.ZodTypeAny ? z.infer<PARAMETERS> : never;
|
|
252
|
+
|
|
253
|
+
declare type LazySchema<SCHEMA> = () => Schema_2<SCHEMA>;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
A message that can be used in the `messages` field of a prompt.
|
|
257
|
+
It can be a user message, an assistant message, or a tool message.
|
|
258
|
+
*/
|
|
259
|
+
declare type ModelMessage = SystemModelMessage | UserModelMessage | AssistantModelMessage | ToolModelMessage;
|
|
260
|
+
|
|
261
|
+
declare type NeverOptional<N, T> = 0 extends 1 & N ? Partial<T> : [N] extends [never] ? Partial<Record<keyof T, undefined>> : T;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Structural type to accept provider-defined tools from external packages.
|
|
265
|
+
*
|
|
266
|
+
* This is necessary due to TypeScript's module path discrimination combined with
|
|
267
|
+
* version mismatches. Provider SDKs like `@ai-sdk/google` or `@ai-sdk/anthropic`
|
|
268
|
+
* may depend on different versions of `@ai-sdk/provider-utils` than Mastra uses.
|
|
269
|
+
* Even if the versions are identical, npm may install separate instances in
|
|
270
|
+
* different node_modules paths, causing TypeScript to see them as different types
|
|
271
|
+
* despite being structurally identical.
|
|
272
|
+
*
|
|
273
|
+
* This structural type allows Mastra to accept any object that looks like a tool,
|
|
274
|
+
* regardless of which module path or version it came from.
|
|
275
|
+
*
|
|
276
|
+
* Uses union type to match both Tool (v4) and ToolV5 structures, with index
|
|
277
|
+
* signature to remain future-proof as the AI SDK evolves.
|
|
278
|
+
*/
|
|
279
|
+
export declare type ProviderDefinedTool = {
|
|
280
|
+
parameters: unknown;
|
|
281
|
+
description?: string;
|
|
282
|
+
type?: string;
|
|
283
|
+
id?: string;
|
|
284
|
+
args?: Record<string, unknown>;
|
|
285
|
+
execute?: (...args: any[]) => any;
|
|
286
|
+
[key: string]: any;
|
|
287
|
+
} | {
|
|
288
|
+
inputSchema: unknown;
|
|
289
|
+
description?: string;
|
|
290
|
+
type?: string;
|
|
291
|
+
id?: string;
|
|
292
|
+
name?: string;
|
|
293
|
+
providerOptions?: any;
|
|
294
|
+
execute?: (...args: any[]) => any;
|
|
295
|
+
outputSchema?: any;
|
|
296
|
+
[key: string]: any;
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
Additional provider-specific metadata that is returned from the provider.
|
|
301
|
+
|
|
302
|
+
This is needed to enable provider-specific functionality that can be
|
|
303
|
+
fully encapsulated in the provider.
|
|
304
|
+
*/
|
|
305
|
+
declare type ProviderMetadata = LanguageModelV1ProviderMetadata;
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
Additional provider-specific options.
|
|
309
|
+
|
|
310
|
+
They are passed through to the provider from the AI SDK and enable
|
|
311
|
+
provider-specific functionality that can be fully encapsulated in the provider.
|
|
312
|
+
*/
|
|
313
|
+
declare type ProviderOptions = LanguageModelV1ProviderMetadata;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
Additional provider-specific options.
|
|
317
|
+
|
|
318
|
+
They are passed through to the provider from the AI SDK and enable
|
|
319
|
+
provider-specific functionality that can be fully encapsulated in the provider.
|
|
320
|
+
*/
|
|
321
|
+
declare type ProviderOptions_2 = SharedV2ProviderOptions;
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Reasoning content part of a prompt. It contains a reasoning.
|
|
325
|
+
*/
|
|
326
|
+
declare interface ReasoningPart {
|
|
327
|
+
type: 'reasoning';
|
|
328
|
+
/**
|
|
329
|
+
The reasoning text.
|
|
330
|
+
*/
|
|
331
|
+
text: string;
|
|
332
|
+
/**
|
|
333
|
+
An optional signature for verifying that the reasoning originated from the model.
|
|
334
|
+
*/
|
|
335
|
+
signature?: string;
|
|
336
|
+
/**
|
|
337
|
+
Additional provider-specific metadata. They are passed through
|
|
338
|
+
to the provider from the AI SDK and enable provider-specific
|
|
339
|
+
functionality that can be fully encapsulated in the provider.
|
|
340
|
+
*/
|
|
341
|
+
providerOptions?: ProviderOptions;
|
|
342
|
+
/**
|
|
343
|
+
@deprecated Use `providerOptions` instead.
|
|
344
|
+
*/
|
|
345
|
+
experimental_providerMetadata?: ProviderMetadata;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Reasoning content part of a prompt. It contains a reasoning.
|
|
350
|
+
*/
|
|
351
|
+
declare interface ReasoningPart_2 {
|
|
352
|
+
type: 'reasoning';
|
|
353
|
+
/**
|
|
354
|
+
The reasoning text.
|
|
355
|
+
*/
|
|
356
|
+
text: string;
|
|
357
|
+
/**
|
|
358
|
+
Additional provider-specific metadata. They are passed through
|
|
359
|
+
to the provider from the AI SDK and enable provider-specific
|
|
360
|
+
functionality that can be fully encapsulated in the provider.
|
|
361
|
+
*/
|
|
362
|
+
providerOptions?: ProviderOptions_2;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
Redacted reasoning content part of a prompt.
|
|
367
|
+
*/
|
|
368
|
+
declare interface RedactedReasoningPart {
|
|
369
|
+
type: 'redacted-reasoning';
|
|
370
|
+
/**
|
|
371
|
+
Redacted reasoning data.
|
|
372
|
+
*/
|
|
373
|
+
data: string;
|
|
374
|
+
/**
|
|
375
|
+
Additional provider-specific metadata. They are passed through
|
|
376
|
+
to the provider from the AI SDK and enable provider-specific
|
|
377
|
+
functionality that can be fully encapsulated in the provider.
|
|
378
|
+
*/
|
|
379
|
+
providerOptions?: ProviderOptions;
|
|
380
|
+
/**
|
|
381
|
+
@deprecated Use `providerOptions` instead.
|
|
382
|
+
*/
|
|
383
|
+
experimental_providerMetadata?: ProviderMetadata;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export { Schema }
|
|
387
|
+
|
|
388
|
+
declare type Schema_2<OBJECT = unknown> = Validator<OBJECT> & {
|
|
389
|
+
/**
|
|
390
|
+
* Used to mark schemas so we can support both Zod and custom schemas.
|
|
391
|
+
*/
|
|
392
|
+
[schemaSymbol]: true;
|
|
393
|
+
/**
|
|
394
|
+
* Schema type for inference.
|
|
395
|
+
*/
|
|
396
|
+
_type: OBJECT;
|
|
397
|
+
/**
|
|
398
|
+
* The JSON Schema for the schema. It is passed to the providers.
|
|
399
|
+
*/
|
|
400
|
+
readonly jsonSchema: JSONSchema7;
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Used to mark schemas so we can support both Zod and custom schemas.
|
|
405
|
+
*/
|
|
406
|
+
declare const schemaSymbol: unique symbol;
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
A system message. It can contain system information.
|
|
410
|
+
|
|
411
|
+
Note: using the "system" part of the prompt is strongly preferred
|
|
412
|
+
to increase the resilience against prompt injection attacks,
|
|
413
|
+
and because not all providers support several system messages.
|
|
414
|
+
*/
|
|
415
|
+
declare type SystemModelMessage = {
|
|
416
|
+
role: 'system';
|
|
417
|
+
content: string;
|
|
418
|
+
/**
|
|
419
|
+
Additional provider-specific metadata. They are passed through
|
|
420
|
+
to the provider from the AI SDK and enable provider-specific
|
|
421
|
+
functionality that can be fully encapsulated in the provider.
|
|
422
|
+
*/
|
|
423
|
+
providerOptions?: ProviderOptions_2;
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
Text content part of a prompt. It contains a string of text.
|
|
428
|
+
*/
|
|
429
|
+
declare interface TextPart {
|
|
430
|
+
type: 'text';
|
|
431
|
+
/**
|
|
432
|
+
The text content.
|
|
433
|
+
*/
|
|
434
|
+
text: string;
|
|
435
|
+
/**
|
|
436
|
+
Additional provider-specific metadata. They are passed through
|
|
437
|
+
to the provider from the AI SDK and enable provider-specific
|
|
438
|
+
functionality that can be fully encapsulated in the provider.
|
|
439
|
+
*/
|
|
440
|
+
providerOptions?: ProviderOptions;
|
|
441
|
+
/**
|
|
442
|
+
@deprecated Use `providerOptions` instead.
|
|
443
|
+
*/
|
|
444
|
+
experimental_providerMetadata?: ProviderMetadata;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
Text content part of a prompt. It contains a string of text.
|
|
449
|
+
*/
|
|
450
|
+
declare interface TextPart_2 {
|
|
451
|
+
type: 'text';
|
|
452
|
+
/**
|
|
453
|
+
The text content.
|
|
454
|
+
*/
|
|
455
|
+
text: string;
|
|
456
|
+
/**
|
|
457
|
+
Additional provider-specific metadata. They are passed through
|
|
458
|
+
to the provider from the AI SDK and enable provider-specific
|
|
459
|
+
functionality that can be fully encapsulated in the provider.
|
|
460
|
+
*/
|
|
461
|
+
providerOptions?: ProviderOptions_2;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
A tool contains the description and the schema of the input that the tool expects.
|
|
466
|
+
This enables the language model to generate the input.
|
|
467
|
+
|
|
468
|
+
The tool can also contain an optional execute function for the actual execution function of the tool.
|
|
469
|
+
*/
|
|
470
|
+
export declare type Tool<PARAMETERS extends ToolParameters = any, RESULT = any> = {
|
|
471
|
+
/**
|
|
472
|
+
The schema of the input that the tool expects. The language model will use this to generate the input.
|
|
473
|
+
It is also used to validate the output of the language model.
|
|
474
|
+
Use descriptions to make the input understandable for the language model.
|
|
475
|
+
*/
|
|
476
|
+
parameters: PARAMETERS;
|
|
477
|
+
/**
|
|
478
|
+
An optional description of what the tool does.
|
|
479
|
+
Will be used by the language model to decide whether to use the tool.
|
|
480
|
+
Not used for provider-defined tools.
|
|
481
|
+
*/
|
|
482
|
+
description?: string;
|
|
483
|
+
/**
|
|
484
|
+
Optional conversion function that maps the tool result to multi-part tool content for LLMs.
|
|
485
|
+
*/
|
|
486
|
+
experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
|
|
487
|
+
/**
|
|
488
|
+
An async function that is called with the arguments from the tool call and produces a result.
|
|
489
|
+
If not provided, the tool will not be executed automatically.
|
|
490
|
+
|
|
491
|
+
@args is the input of the tool call.
|
|
492
|
+
@options.abortSignal is a signal that can be used to abort the tool call.
|
|
493
|
+
*/
|
|
494
|
+
execute?: (args: inferParameters<PARAMETERS>, options: ToolExecutionOptions) => PromiseLike<RESULT>;
|
|
495
|
+
} & ({
|
|
496
|
+
/**
|
|
497
|
+
Function tool.
|
|
498
|
+
*/
|
|
499
|
+
type?: undefined | 'function';
|
|
500
|
+
} | {
|
|
501
|
+
/**
|
|
502
|
+
Provider-defined tool.
|
|
503
|
+
*/
|
|
504
|
+
type: 'provider-defined';
|
|
505
|
+
/**
|
|
506
|
+
The ID of the tool. Should follow the format `<provider-name>.<tool-name>`.
|
|
507
|
+
*/
|
|
508
|
+
id: `${string}.${string}`;
|
|
509
|
+
/**
|
|
510
|
+
The arguments for configuring the tool. Must match the expected arguments defined by the provider for this tool.
|
|
511
|
+
*/
|
|
512
|
+
args: Record<string, unknown>;
|
|
513
|
+
});
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Additional options that are sent into each tool call.
|
|
517
|
+
*/
|
|
518
|
+
export declare interface ToolCallOptions {
|
|
519
|
+
/**
|
|
520
|
+
* The ID of the tool call. You can use it e.g. when sending tool-call related information with stream data.
|
|
521
|
+
*/
|
|
522
|
+
toolCallId: string;
|
|
523
|
+
/**
|
|
524
|
+
* Messages that were sent to the language model to initiate the response that contained the tool call.
|
|
525
|
+
* The messages **do not** include the system prompt nor the assistant response that contained the tool call.
|
|
526
|
+
*/
|
|
527
|
+
messages: ModelMessage[];
|
|
528
|
+
/**
|
|
529
|
+
* An optional abort signal that indicates that the overall operation should be aborted.
|
|
530
|
+
*/
|
|
531
|
+
abortSignal?: AbortSignal;
|
|
532
|
+
/**
|
|
533
|
+
* Additional context.
|
|
534
|
+
*
|
|
535
|
+
* Experimental (can break in patch releases).
|
|
536
|
+
*/
|
|
537
|
+
experimental_context?: unknown;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
Tool call content part of a prompt. It contains a tool call (usually generated by the AI model).
|
|
542
|
+
*/
|
|
543
|
+
declare interface ToolCallPart {
|
|
544
|
+
type: 'tool-call';
|
|
545
|
+
/**
|
|
546
|
+
ID of the tool call. This ID is used to match the tool call with the tool result.
|
|
547
|
+
*/
|
|
548
|
+
toolCallId: string;
|
|
549
|
+
/**
|
|
550
|
+
Name of the tool that is being called.
|
|
551
|
+
*/
|
|
552
|
+
toolName: string;
|
|
553
|
+
/**
|
|
554
|
+
Arguments of the tool call. This is a JSON-serializable object that matches the tool's input schema.
|
|
555
|
+
*/
|
|
556
|
+
args: unknown;
|
|
557
|
+
/**
|
|
558
|
+
Additional provider-specific metadata. They are passed through
|
|
559
|
+
to the provider from the AI SDK and enable provider-specific
|
|
560
|
+
functionality that can be fully encapsulated in the provider.
|
|
561
|
+
*/
|
|
562
|
+
providerOptions?: ProviderOptions;
|
|
563
|
+
/**
|
|
564
|
+
@deprecated Use `providerOptions` instead.
|
|
565
|
+
*/
|
|
566
|
+
experimental_providerMetadata?: ProviderMetadata;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
Tool call content part of a prompt. It contains a tool call (usually generated by the AI model).
|
|
571
|
+
*/
|
|
572
|
+
declare interface ToolCallPart_2 {
|
|
573
|
+
type: 'tool-call';
|
|
574
|
+
/**
|
|
575
|
+
ID of the tool call. This ID is used to match the tool call with the tool result.
|
|
576
|
+
*/
|
|
577
|
+
toolCallId: string;
|
|
578
|
+
/**
|
|
579
|
+
Name of the tool that is being called.
|
|
580
|
+
*/
|
|
581
|
+
toolName: string;
|
|
582
|
+
/**
|
|
583
|
+
Arguments of the tool call. This is a JSON-serializable object that matches the tool's input schema.
|
|
584
|
+
*/
|
|
585
|
+
input: unknown;
|
|
586
|
+
/**
|
|
587
|
+
Additional provider-specific metadata. They are passed through
|
|
588
|
+
to the provider from the AI SDK and enable provider-specific
|
|
589
|
+
functionality that can be fully encapsulated in the provider.
|
|
590
|
+
*/
|
|
591
|
+
providerOptions?: ProviderOptions_2;
|
|
592
|
+
/**
|
|
593
|
+
Whether the tool call was executed by the provider.
|
|
594
|
+
*/
|
|
595
|
+
providerExecuted?: boolean;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
Content of a tool message. It is an array of tool result parts.
|
|
600
|
+
*/
|
|
601
|
+
declare type ToolContent = Array<ToolResultPart>;
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
Content of a tool message. It is an array of tool result parts.
|
|
605
|
+
*/
|
|
606
|
+
declare type ToolContent_2 = Array<ToolResultPart_2>;
|
|
607
|
+
|
|
608
|
+
declare type ToolExecuteFunction<INPUT, OUTPUT> = (input: INPUT, options: ToolCallOptions) => AsyncIterable<OUTPUT> | PromiseLike<OUTPUT> | OUTPUT;
|
|
609
|
+
|
|
610
|
+
export declare interface ToolExecutionOptions {
|
|
611
|
+
/**
|
|
612
|
+
* The ID of the tool call. You can use it e.g. when sending tool-call related information with stream data.
|
|
613
|
+
*/
|
|
614
|
+
toolCallId: string;
|
|
615
|
+
/**
|
|
616
|
+
* Messages that were sent to the language model to initiate the response that contained the tool call.
|
|
617
|
+
* The messages **do not** include the system prompt nor the assistant response that contained the tool call.
|
|
618
|
+
*/
|
|
619
|
+
messages: CoreMessage[];
|
|
620
|
+
/**
|
|
621
|
+
* An optional abort signal that indicates that the overall operation should be aborted.
|
|
622
|
+
*/
|
|
623
|
+
abortSignal?: AbortSignal;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
A tool message. It contains the result of one or more tool calls.
|
|
628
|
+
*/
|
|
629
|
+
declare type ToolModelMessage = {
|
|
630
|
+
role: 'tool';
|
|
631
|
+
content: ToolContent_2;
|
|
632
|
+
/**
|
|
633
|
+
Additional provider-specific metadata. They are passed through
|
|
634
|
+
to the provider from the AI SDK and enable provider-specific
|
|
635
|
+
functionality that can be fully encapsulated in the provider.
|
|
636
|
+
*/
|
|
637
|
+
providerOptions?: ProviderOptions_2;
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
declare type ToolOutputProperties<INPUT, OUTPUT> = NeverOptional<OUTPUT, {
|
|
641
|
+
/**
|
|
642
|
+
An async function that is called with the arguments from the tool call and produces a result.
|
|
643
|
+
If not provided, the tool will not be executed automatically.
|
|
644
|
+
|
|
645
|
+
@args is the input of the tool call.
|
|
646
|
+
@options.abortSignal is a signal that can be used to abort the tool call.
|
|
647
|
+
*/
|
|
648
|
+
execute: ToolExecuteFunction<INPUT, OUTPUT>;
|
|
649
|
+
outputSchema?: FlexibleSchema<OUTPUT>;
|
|
650
|
+
} | {
|
|
651
|
+
outputSchema: FlexibleSchema<OUTPUT>;
|
|
652
|
+
execute?: never;
|
|
653
|
+
}>;
|
|
654
|
+
|
|
655
|
+
declare type ToolParameters = z.ZodTypeAny | Schema<any>;
|
|
656
|
+
|
|
657
|
+
declare type ToolResultContent = Array<{
|
|
658
|
+
type: 'text';
|
|
659
|
+
text: string;
|
|
660
|
+
} | {
|
|
661
|
+
type: 'image';
|
|
662
|
+
data: string;
|
|
663
|
+
mimeType?: string;
|
|
664
|
+
}>;
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
Tool result content part of a prompt. It contains the result of the tool call with the matching ID.
|
|
668
|
+
*/
|
|
669
|
+
declare interface ToolResultPart {
|
|
670
|
+
type: 'tool-result';
|
|
671
|
+
/**
|
|
672
|
+
ID of the tool call that this result is associated with.
|
|
673
|
+
*/
|
|
674
|
+
toolCallId: string;
|
|
675
|
+
/**
|
|
676
|
+
Name of the tool that generated this result.
|
|
677
|
+
*/
|
|
678
|
+
toolName: string;
|
|
679
|
+
/**
|
|
680
|
+
Result of the tool call. This is a JSON-serializable object.
|
|
681
|
+
*/
|
|
682
|
+
result: unknown;
|
|
683
|
+
/**
|
|
684
|
+
Multi-part content of the tool result. Only for tools that support multipart results.
|
|
685
|
+
*/
|
|
686
|
+
experimental_content?: ToolResultContent;
|
|
687
|
+
/**
|
|
688
|
+
Optional flag if the result is an error or an error message.
|
|
689
|
+
*/
|
|
690
|
+
isError?: boolean;
|
|
691
|
+
/**
|
|
692
|
+
Additional provider-specific metadata. They are passed through
|
|
693
|
+
to the provider from the AI SDK and enable provider-specific
|
|
694
|
+
functionality that can be fully encapsulated in the provider.
|
|
695
|
+
*/
|
|
696
|
+
providerOptions?: ProviderOptions;
|
|
697
|
+
/**
|
|
698
|
+
@deprecated Use `providerOptions` instead.
|
|
699
|
+
*/
|
|
700
|
+
experimental_providerMetadata?: ProviderMetadata;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
Tool result content part of a prompt. It contains the result of the tool call with the matching ID.
|
|
705
|
+
*/
|
|
706
|
+
declare interface ToolResultPart_2 {
|
|
707
|
+
type: 'tool-result';
|
|
708
|
+
/**
|
|
709
|
+
ID of the tool call that this result is associated with.
|
|
710
|
+
*/
|
|
711
|
+
toolCallId: string;
|
|
712
|
+
/**
|
|
713
|
+
Name of the tool that generated this result.
|
|
714
|
+
*/
|
|
715
|
+
toolName: string;
|
|
716
|
+
/**
|
|
717
|
+
Result of the tool call. This is a JSON-serializable object.
|
|
718
|
+
*/
|
|
719
|
+
output: LanguageModelV2ToolResultOutput;
|
|
720
|
+
/**
|
|
721
|
+
Additional provider-specific metadata. They are passed through
|
|
722
|
+
to the provider from the AI SDK and enable provider-specific
|
|
723
|
+
functionality that can be fully encapsulated in the provider.
|
|
724
|
+
*/
|
|
725
|
+
providerOptions?: ProviderOptions_2;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
A tool contains the description and the schema of the input that the tool expects.
|
|
730
|
+
This enables the language model to generate the input.
|
|
731
|
+
|
|
732
|
+
The tool can also contain an optional execute function for the actual execution function of the tool.
|
|
733
|
+
*/
|
|
734
|
+
export declare type ToolV5<INPUT extends JSONValue | unknown | never = any, OUTPUT extends JSONValue | unknown | never = any> = {
|
|
735
|
+
/**
|
|
736
|
+
An optional description of what the tool does.
|
|
737
|
+
Will be used by the language model to decide whether to use the tool.
|
|
738
|
+
Not used for provider-defined tools.
|
|
739
|
+
*/
|
|
740
|
+
description?: string;
|
|
741
|
+
/**
|
|
742
|
+
Additional provider-specific metadata. They are passed through
|
|
743
|
+
to the provider from the AI SDK and enable provider-specific
|
|
744
|
+
functionality that can be fully encapsulated in the provider.
|
|
745
|
+
*/
|
|
746
|
+
providerOptions?: ProviderOptions_2;
|
|
747
|
+
/**
|
|
748
|
+
The schema of the input that the tool expects. The language model will use this to generate the input.
|
|
749
|
+
It is also used to validate the output of the language model.
|
|
750
|
+
Use descriptions to make the input understandable for the language model.
|
|
751
|
+
*/
|
|
752
|
+
inputSchema: FlexibleSchema<INPUT>;
|
|
753
|
+
/**
|
|
754
|
+
* Optional function that is called when the argument streaming starts.
|
|
755
|
+
* Only called when the tool is used in a streaming context.
|
|
756
|
+
*/
|
|
757
|
+
onInputStart?: (options: ToolCallOptions) => void | PromiseLike<void>;
|
|
758
|
+
/**
|
|
759
|
+
* Optional function that is called when an argument streaming delta is available.
|
|
760
|
+
* Only called when the tool is used in a streaming context.
|
|
761
|
+
*/
|
|
762
|
+
onInputDelta?: (options: {
|
|
763
|
+
inputTextDelta: string;
|
|
764
|
+
} & ToolCallOptions) => void | PromiseLike<void>;
|
|
765
|
+
/**
|
|
766
|
+
* Optional function that is called when a tool call can be started,
|
|
767
|
+
* even if the execute function is not provided.
|
|
768
|
+
*/
|
|
769
|
+
onInputAvailable?: (options: {
|
|
770
|
+
input: [INPUT] extends [never] ? undefined : INPUT;
|
|
771
|
+
} & ToolCallOptions) => void | PromiseLike<void>;
|
|
772
|
+
} & ToolOutputProperties<INPUT, OUTPUT> & {
|
|
773
|
+
/**
|
|
774
|
+
Optional conversion function that maps the tool result to an output that can be used by the language model.
|
|
775
|
+
|
|
776
|
+
If not provided, the tool result will be sent as a JSON object.
|
|
777
|
+
*/
|
|
778
|
+
toModelOutput?: (output: 0 extends 1 & OUTPUT ? any : [OUTPUT] extends [never] ? any : NoInfer<OUTPUT>) => LanguageModelV2ToolResultPart['output'];
|
|
779
|
+
} & ({
|
|
780
|
+
/**
|
|
781
|
+
Tool with user-defined input and output schemas.
|
|
782
|
+
*/
|
|
783
|
+
type?: undefined | 'function';
|
|
784
|
+
} | {
|
|
785
|
+
/**
|
|
786
|
+
Tool that is defined at runtime (e.g. an MCP tool).
|
|
787
|
+
The types of input and output are not known at development time.
|
|
788
|
+
*/
|
|
789
|
+
type: 'dynamic';
|
|
790
|
+
} | {
|
|
791
|
+
/**
|
|
792
|
+
Tool with provider-defined input and output schemas.
|
|
793
|
+
*/
|
|
794
|
+
type: 'provider-defined';
|
|
795
|
+
/**
|
|
796
|
+
The ID of the tool. Should follow the format `<provider-name>.<unique-tool-name>`.
|
|
797
|
+
*/
|
|
798
|
+
id: `${string}.${string}`;
|
|
799
|
+
/**
|
|
800
|
+
The name of the tool that the user must use in the tool set.
|
|
801
|
+
*/
|
|
802
|
+
name: string;
|
|
803
|
+
/**
|
|
804
|
+
The arguments for configuring the tool. Must match the expected arguments defined by the provider for this tool.
|
|
805
|
+
*/
|
|
806
|
+
args: Record<string, unknown>;
|
|
807
|
+
});
|
|
808
|
+
|
|
809
|
+
/**
|
|
810
|
+
Content of a user message. It can be a string or an array of text and image parts.
|
|
811
|
+
*/
|
|
812
|
+
declare type UserContent = string | Array<TextPart | ImagePart | FilePart>;
|
|
813
|
+
|
|
814
|
+
/**
|
|
815
|
+
Content of a user message. It can be a string or an array of text and image parts.
|
|
816
|
+
*/
|
|
817
|
+
declare type UserContent_2 = string | Array<TextPart_2 | ImagePart_2 | FilePart_2>;
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
A user message. It can contain text or a combination of text and images.
|
|
821
|
+
*/
|
|
822
|
+
declare type UserModelMessage = {
|
|
823
|
+
role: 'user';
|
|
824
|
+
content: UserContent_2;
|
|
825
|
+
/**
|
|
826
|
+
Additional provider-specific metadata. They are passed through
|
|
827
|
+
to the provider from the AI SDK and enable provider-specific
|
|
828
|
+
functionality that can be fully encapsulated in the provider.
|
|
829
|
+
*/
|
|
830
|
+
providerOptions?: ProviderOptions_2;
|
|
831
|
+
};
|
|
832
|
+
|
|
833
|
+
declare type ValidationResult<OBJECT> = {
|
|
834
|
+
success: true;
|
|
835
|
+
value: OBJECT;
|
|
836
|
+
} | {
|
|
837
|
+
success: false;
|
|
838
|
+
error: Error;
|
|
839
|
+
};
|
|
840
|
+
|
|
841
|
+
declare type Validator<OBJECT = unknown> = {
|
|
842
|
+
/**
|
|
843
|
+
* Used to mark validator functions so we can support both Zod and custom schemas.
|
|
844
|
+
*/
|
|
845
|
+
[validatorSymbol]: true;
|
|
846
|
+
/**
|
|
847
|
+
* Optional. Validates that the structure of a value matches this schema,
|
|
848
|
+
* and returns a typed version of the value if it does.
|
|
849
|
+
*/
|
|
850
|
+
readonly validate?: (value: unknown) => ValidationResult<OBJECT> | PromiseLike<ValidationResult<OBJECT>>;
|
|
851
|
+
};
|
|
852
|
+
|
|
853
|
+
/**
|
|
854
|
+
* Used to mark validator functions so we can support both Zod and custom schemas.
|
|
855
|
+
*/
|
|
856
|
+
declare const validatorSymbol: unique symbol;
|
|
857
|
+
|
|
858
|
+
export { }
|