@mastra/core 1.0.0-beta.13 → 1.0.0-beta.15
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 +477 -0
- package/dist/agent/agent-legacy.d.ts.map +1 -1
- package/dist/agent/agent.d.ts +2 -2
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/agent.types.d.ts +6 -7
- package/dist/agent/agent.types.d.ts.map +1 -1
- package/dist/agent/index.cjs +17 -9
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +2 -2
- package/dist/agent/message-list/index.cjs +3 -3
- package/dist/agent/message-list/index.d.ts +1 -1
- package/dist/agent/message-list/index.d.ts.map +1 -1
- package/dist/agent/message-list/index.js +1 -1
- package/dist/agent/message-list/prompt/attachments-to-parts.d.ts.map +1 -1
- package/dist/agent/trip-wire.d.ts +2 -2
- package/dist/agent/trip-wire.d.ts.map +1 -1
- package/dist/agent/utils.d.ts +4 -1
- package/dist/agent/utils.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/index.d.ts +3 -3
- package/dist/agent/workflows/prepare-stream/index.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/map-results-step.d.ts +3 -3
- package/dist/agent/workflows/prepare-stream/map-results-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/prepare-memory-step.d.ts +3 -3
- package/dist/agent/workflows/prepare-stream/prepare-memory-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts +3 -3
- package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts.map +1 -1
- package/dist/bundler/types.d.ts +1 -0
- package/dist/bundler/types.d.ts.map +1 -1
- package/dist/chunk-2AU5ZHBL.js +79 -0
- package/dist/chunk-2AU5ZHBL.js.map +1 -0
- package/dist/{chunk-7HEAVZRS.cjs → chunk-2OOMJRXZ.cjs} +15 -15
- package/dist/{chunk-7HEAVZRS.cjs.map → chunk-2OOMJRXZ.cjs.map} +1 -1
- package/dist/chunk-37YWZMBX.js +27 -0
- package/dist/chunk-37YWZMBX.js.map +1 -0
- package/dist/{chunk-VETAQUW3.js → chunk-3HDRO3GG.js} +790 -1206
- package/dist/chunk-3HDRO3GG.js.map +1 -0
- package/dist/{chunk-MRRFTNF4.js → chunk-4DFWV4IR.js} +3 -4
- package/dist/chunk-4DFWV4IR.js.map +1 -0
- package/dist/{chunk-373OC54J.js → chunk-4HP7CS6L.js} +7 -6
- package/dist/chunk-4HP7CS6L.js.map +1 -0
- package/dist/{chunk-62Q7K656.js → chunk-4J4M2Q5R.js} +125 -121
- package/dist/chunk-4J4M2Q5R.js.map +1 -0
- package/dist/{chunk-HWMMIRIF.cjs → chunk-4U7ZLI36.cjs} +3 -2
- package/dist/chunk-4U7ZLI36.cjs.map +1 -0
- package/dist/{chunk-Z55SJVEC.cjs → chunk-6HJFCSJ4.cjs} +7 -6
- package/dist/chunk-6HJFCSJ4.cjs.map +1 -0
- package/dist/{chunk-Y7MZ5LJT.cjs → chunk-AAX7ZOM7.cjs} +101 -102
- package/dist/chunk-AAX7ZOM7.cjs.map +1 -0
- package/dist/{chunk-WPTTKULS.js → chunk-AR5CF3IN.js} +4 -4
- package/dist/{chunk-WPTTKULS.js.map → chunk-AR5CF3IN.js.map} +1 -1
- package/dist/{chunk-5VZGJTPR.js → chunk-BAZHNX5P.js} +57 -11
- package/dist/chunk-BAZHNX5P.js.map +1 -0
- package/dist/{chunk-MLKE7HRS.cjs → chunk-BC2VKOH4.cjs} +43 -21
- package/dist/chunk-BC2VKOH4.cjs.map +1 -0
- package/dist/{chunk-2IU4RGU5.js → chunk-BCUKD2XG.js} +59 -19
- package/dist/chunk-BCUKD2XG.js.map +1 -0
- package/dist/{chunk-WYGUWVTF.js → chunk-CBQ6WDUJ.js} +9 -9
- package/dist/chunk-CBQ6WDUJ.js.map +1 -0
- package/dist/chunk-CBVHOGXX.cjs +674 -0
- package/dist/chunk-CBVHOGXX.cjs.map +1 -0
- package/dist/{chunk-PJAK4U6R.cjs → chunk-CBY37FTP.cjs} +28 -28
- package/dist/chunk-CBY37FTP.cjs.map +1 -0
- package/dist/{chunk-BQDZIQ3G.js → chunk-D2IFWD7A.js} +365 -137
- package/dist/chunk-D2IFWD7A.js.map +1 -0
- package/dist/{chunk-R5AJGM55.cjs → chunk-DDK3URK2.cjs} +987 -519
- package/dist/chunk-DDK3URK2.cjs.map +1 -0
- package/dist/chunk-DRJTNGI4.cjs +263 -0
- package/dist/chunk-DRJTNGI4.cjs.map +1 -0
- package/dist/{chunk-X6IBA7FP.cjs → chunk-EMLEZXTQ.cjs} +22 -120
- package/dist/chunk-EMLEZXTQ.cjs.map +1 -0
- package/dist/{chunk-OWIEOL55.cjs → chunk-F75EQ574.cjs} +695 -254
- package/dist/chunk-F75EQ574.cjs.map +1 -0
- package/dist/{chunk-YPLZDWG7.js → chunk-FJEVLHJT.js} +3 -2
- package/dist/chunk-FJEVLHJT.js.map +1 -0
- package/dist/chunk-GVAPYQRO.cjs +252 -0
- package/dist/chunk-GVAPYQRO.cjs.map +1 -0
- package/dist/{chunk-MXBVP7HX.cjs → chunk-GXMJ5URG.cjs} +227 -181
- package/dist/chunk-GXMJ5URG.cjs.map +1 -0
- package/dist/chunk-H2NHG7QL.cjs +32 -0
- package/dist/chunk-H2NHG7QL.cjs.map +1 -0
- package/dist/chunk-HAYBGFPA.js +259 -0
- package/dist/chunk-HAYBGFPA.js.map +1 -0
- package/dist/{chunk-GIWC35YQ.js → chunk-IHISDRFV.js} +299 -49
- package/dist/chunk-IHISDRFV.js.map +1 -0
- package/dist/{chunk-VEPP75C4.cjs → chunk-IRTICXRZ.cjs} +101 -61
- package/dist/chunk-IRTICXRZ.cjs.map +1 -0
- package/dist/{chunk-ARAQIW6E.js → chunk-K66U47VL.js} +617 -188
- package/dist/chunk-K66U47VL.js.map +1 -0
- package/dist/{chunk-LGB4VNZI.cjs → chunk-LOV5NNGK.cjs} +811 -1235
- package/dist/chunk-LOV5NNGK.cjs.map +1 -0
- package/dist/{chunk-E5BQRAJK.js → chunk-NGWTSHNA.js} +823 -362
- package/dist/chunk-NGWTSHNA.js.map +1 -0
- package/dist/{chunk-72YCRTEX.cjs → chunk-O2CAMK4A.cjs} +13 -2
- package/dist/chunk-O2CAMK4A.cjs.map +1 -0
- package/dist/{chunk-4BC5FUAO.js → chunk-O7M7DR4E.js} +6 -5
- package/dist/chunk-O7M7DR4E.js.map +1 -0
- package/dist/chunk-OTIGV7CL.js +10215 -0
- package/dist/chunk-OTIGV7CL.js.map +1 -0
- package/dist/{chunk-WYWRMIQC.js → chunk-QXL3F3T2.js} +9 -105
- package/dist/chunk-QXL3F3T2.js.map +1 -0
- package/dist/{chunk-U4CSOY6T.cjs → chunk-RA2CHJCY.cjs} +399 -171
- package/dist/chunk-RA2CHJCY.cjs.map +1 -0
- package/dist/chunk-RMV5HJM7.cjs +10237 -0
- package/dist/chunk-RMV5HJM7.cjs.map +1 -0
- package/dist/{chunk-AGHLXC4I.cjs → chunk-S23TNDXG.cjs} +300 -50
- package/dist/chunk-S23TNDXG.cjs.map +1 -0
- package/dist/{chunk-H4VUIOWU.cjs → chunk-SSB4AVHU.cjs} +20 -19
- package/dist/chunk-SSB4AVHU.cjs.map +1 -0
- package/dist/chunk-ST7NBF4H.cjs +84 -0
- package/dist/chunk-ST7NBF4H.cjs.map +1 -0
- package/dist/{chunk-SZYSDJTN.cjs → chunk-T2LVULCK.cjs} +142 -137
- package/dist/chunk-T2LVULCK.cjs.map +1 -0
- package/dist/chunk-VE6HQ7H6.js +250 -0
- package/dist/chunk-VE6HQ7H6.js.map +1 -0
- package/dist/{chunk-RCJLMMTO.js → chunk-XJB7J4UT.js} +30 -8
- package/dist/chunk-XJB7J4UT.js.map +1 -0
- package/dist/chunk-YV43YEZ6.js +598 -0
- package/dist/chunk-YV43YEZ6.js.map +1 -0
- package/dist/{chunk-Y36Y5MTD.js → chunk-ZGIVAQRI.js} +13 -3
- package/dist/chunk-ZGIVAQRI.js.map +1 -0
- package/dist/error/index.cjs +6 -6
- package/dist/error/index.d.ts +1 -0
- package/dist/error/index.d.ts.map +1 -1
- package/dist/error/index.js +1 -1
- package/dist/evals/index.cjs +49 -9
- package/dist/evals/index.js +2 -2
- package/dist/evals/run/index.d.ts.map +1 -1
- package/dist/evals/scoreTraces/index.cjs +70 -22
- package/dist/evals/scoreTraces/index.cjs.map +1 -1
- package/dist/evals/scoreTraces/index.js +63 -15
- package/dist/evals/scoreTraces/index.js.map +1 -1
- package/dist/evals/scoreTraces/scoreTracesWorkflow.d.ts.map +1 -1
- package/dist/evals/scoreTraces/utils.d.ts.map +1 -1
- package/dist/evals/types.d.ts +568 -116
- package/dist/evals/types.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 +21 -21
- package/dist/llm/index.js +5 -5
- package/dist/llm/model/aisdk/generate-to-stream.d.ts +20 -0
- package/dist/llm/model/aisdk/generate-to-stream.d.ts.map +1 -0
- package/dist/llm/model/aisdk/v5/model.d.ts +4 -0
- package/dist/llm/model/aisdk/v5/model.d.ts.map +1 -1
- package/dist/llm/model/aisdk/v6/model.d.ts +43 -0
- package/dist/llm/model/aisdk/v6/model.d.ts.map +1 -0
- package/dist/llm/model/embedding-router.d.ts +1 -1
- package/dist/llm/model/model.d.ts.map +1 -1
- package/dist/llm/model/model.loop.d.ts +1 -1
- package/dist/llm/model/model.loop.d.ts.map +1 -1
- package/dist/llm/model/provider-options.d.ts +2 -1
- package/dist/llm/model/provider-options.d.ts.map +1 -1
- package/dist/llm/model/provider-types.generated.d.ts +126 -17
- package/dist/llm/model/resolve-model.d.ts +2 -2
- package/dist/llm/model/resolve-model.d.ts.map +1 -1
- package/dist/llm/model/shared.types.d.ts +18 -7
- package/dist/llm/model/shared.types.d.ts.map +1 -1
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +1 -1
- package/dist/loop/network/index.d.ts +8 -8
- package/dist/loop/network/index.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/MastraLanguageModelV3Mock.d.ts +29 -0
- package/dist/loop/test-utils/MastraLanguageModelV3Mock.d.ts.map +1 -0
- package/dist/loop/test-utils/fullStream.d.ts +2 -1
- package/dist/loop/test-utils/fullStream.d.ts.map +1 -1
- package/dist/loop/test-utils/resultObject.d.ts +2 -1
- package/dist/loop/test-utils/resultObject.d.ts.map +1 -1
- package/dist/loop/test-utils/streamObject.d.ts.map +1 -1
- package/dist/loop/test-utils/utils-v3.d.ts +55 -0
- package/dist/loop/test-utils/utils-v3.d.ts.map +1 -0
- package/dist/loop/types.d.ts +10 -8
- package/dist/loop/types.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/index.d.ts +36 -36
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +25 -25
- 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 +12 -12
- package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-loop/index.d.ts +36 -36
- package/dist/loop/workflows/agentic-loop/index.d.ts.map +1 -1
- package/dist/loop/workflows/run-state.d.ts +2 -2
- package/dist/loop/workflows/run-state.d.ts.map +1 -1
- package/dist/loop/workflows/schema.d.ts +12 -12
- package/dist/mastra/hooks.d.ts.map +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.d.ts +7 -2
- package/dist/mastra/index.d.ts.map +1 -1
- 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 +26 -6
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +1 -1
- package/dist/memory/memory.d.ts +9 -8
- package/dist/memory/memory.d.ts.map +1 -1
- package/dist/memory/mock.d.ts +2 -1
- package/dist/memory/mock.d.ts.map +1 -1
- package/dist/memory/types.d.ts +3 -4
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/memory/working-memory-utils.d.ts +20 -0
- package/dist/memory/working-memory-utils.d.ts.map +1 -0
- package/dist/models-dev-26XLUKVK.cjs +12 -0
- package/dist/{models-dev-D3EKFGAO.cjs.map → models-dev-26XLUKVK.cjs.map} +1 -1
- package/dist/models-dev-HUFLQFPB.js +3 -0
- package/dist/{models-dev-EO22XOXQ.js.map → models-dev-HUFLQFPB.js.map} +1 -1
- package/dist/netlify-CUYK2MZ2.cjs +12 -0
- package/dist/{netlify-WE42TZIT.cjs.map → netlify-CUYK2MZ2.cjs.map} +1 -1
- package/dist/netlify-J4QPOROO.js +3 -0
- package/dist/{netlify-AE4LNCAI.js.map → netlify-J4QPOROO.js.map} +1 -1
- package/dist/observability/index.cjs +14 -10
- package/dist/observability/index.js +1 -1
- package/dist/observability/types/tracing.d.ts +32 -19
- package/dist/observability/types/tracing.d.ts.map +1 -1
- package/dist/processors/index.cjs +37 -37
- package/dist/processors/index.d.ts +9 -7
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/index.js +1 -1
- package/dist/processors/memory/message-history.d.ts +7 -1
- package/dist/processors/memory/message-history.d.ts.map +1 -1
- package/dist/processors/processors/language-detector.d.ts.map +1 -1
- package/dist/processors/processors/moderation.d.ts.map +1 -1
- package/dist/processors/processors/pii-detector.d.ts.map +1 -1
- package/dist/processors/processors/prompt-injection-detector.d.ts.map +1 -1
- package/dist/processors/processors/token-limiter.d.ts +5 -2
- package/dist/processors/processors/token-limiter.d.ts.map +1 -1
- package/dist/processors/runner.d.ts +2 -0
- package/dist/processors/runner.d.ts.map +1 -1
- package/dist/processors/step-schema.d.ts +26 -26
- package/dist/processors/step-schema.d.ts.map +1 -1
- package/dist/provider-registry-6CIGRQVZ.js +3 -0
- package/dist/{provider-registry-6LF3NGC5.js.map → provider-registry-6CIGRQVZ.js.map} +1 -1
- package/dist/provider-registry-7O7FJ4BS.cjs +40 -0
- package/dist/{provider-registry-73FKMXJV.cjs.map → provider-registry-7O7FJ4BS.cjs.map} +1 -1
- package/dist/provider-registry.json +295 -45
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.cjs.map +1 -1
- package/dist/relevance/index.js +2 -2
- package/dist/relevance/index.js.map +1 -1
- package/dist/server/index.cjs +5 -5
- package/dist/server/index.js +1 -1
- package/dist/storage/base.d.ts +40 -292
- package/dist/storage/base.d.ts.map +1 -1
- package/dist/storage/constants.cjs +60 -0
- package/dist/storage/constants.cjs.map +1 -0
- package/dist/storage/constants.d.ts +6 -1
- package/dist/storage/constants.d.ts.map +1 -1
- package/dist/storage/constants.js +3 -0
- package/dist/storage/constants.js.map +1 -0
- package/dist/storage/domains/agents/base.d.ts +2 -2
- package/dist/storage/domains/agents/base.d.ts.map +1 -1
- package/dist/storage/domains/agents/inmemory.d.ts +5 -4
- package/dist/storage/domains/agents/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/base.d.ts +20 -0
- package/dist/storage/domains/base.d.ts.map +1 -0
- 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 +57 -0
- package/dist/storage/domains/inmemory-db.d.ts.map +1 -0
- package/dist/storage/domains/memory/base.d.ts +2 -2
- package/dist/storage/domains/memory/base.d.ts.map +1 -1
- package/dist/storage/domains/memory/inmemory.d.ts +5 -13
- package/dist/storage/domains/memory/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/observability/base.d.ts +24 -29
- package/dist/storage/domains/observability/base.d.ts.map +1 -1
- package/dist/storage/domains/observability/index.d.ts +1 -0
- package/dist/storage/domains/observability/index.d.ts.map +1 -1
- package/dist/storage/domains/observability/inmemory.d.ts +46 -35
- package/dist/storage/domains/observability/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/observability/types.d.ts +2365 -0
- package/dist/storage/domains/observability/types.d.ts.map +1 -0
- package/dist/storage/domains/scores/base.d.ts +9 -20
- package/dist/storage/domains/scores/base.d.ts.map +1 -1
- package/dist/storage/domains/scores/inmemory.d.ts +11 -22
- package/dist/storage/domains/scores/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/shared.d.ts +76 -0
- package/dist/storage/domains/shared.d.ts.map +1 -0
- package/dist/storage/domains/workflows/base.d.ts +4 -2
- package/dist/storage/domains/workflows/base.d.ts.map +1 -1
- package/dist/storage/domains/workflows/inmemory.d.ts +10 -9
- package/dist/storage/domains/workflows/inmemory.d.ts.map +1 -1
- package/dist/storage/index.cjs +272 -59
- package/dist/storage/index.js +2 -1
- package/dist/storage/mock.d.ts +28 -174
- package/dist/storage/mock.d.ts.map +1 -1
- package/dist/storage/types.d.ts +39 -44
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/utils.d.ts +5 -0
- package/dist/storage/utils.d.ts.map +1 -1
- package/dist/stream/MastraAgentNetworkStream.d.ts +1 -1
- package/dist/stream/MastraAgentNetworkStream.d.ts.map +1 -1
- package/dist/stream/MastraWorkflowStream.d.ts +1 -1
- package/dist/stream/MastraWorkflowStream.d.ts.map +1 -1
- package/dist/stream/RunOutput.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/execute.d.ts +4 -4
- package/dist/stream/aisdk/v5/execute.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/output.d.ts +2 -2
- package/dist/stream/aisdk/v5/output.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/transform.d.ts.map +1 -1
- package/dist/stream/base/output.d.ts +7 -5
- package/dist/stream/base/output.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 +32 -21
- package/dist/stream/types.d.ts.map +1 -1
- package/dist/test-utils/llm-mock.cjs +4 -4
- package/dist/test-utils/llm-mock.cjs.map +1 -1
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/test-utils/llm-mock.js.map +1 -1
- package/dist/token-6GSAFR2W-LTZ7QQUP.js +61 -0
- package/dist/token-6GSAFR2W-LTZ7QQUP.js.map +1 -0
- package/dist/token-6GSAFR2W-UEEINYAN.cjs +63 -0
- package/dist/token-6GSAFR2W-UEEINYAN.cjs.map +1 -0
- package/dist/token-util-NEHG7TUY-QTFZ26EN.js +8 -0
- package/dist/token-util-NEHG7TUY-QTFZ26EN.js.map +1 -0
- package/dist/token-util-NEHG7TUY-WZL2DNCG.cjs +10 -0
- package/dist/token-util-NEHG7TUY-WZL2DNCG.cjs.map +1 -0
- package/dist/tool-loop-agent/index.cjs +20 -0
- package/dist/tool-loop-agent/index.cjs.map +1 -0
- package/dist/tool-loop-agent/index.d.ts +36 -0
- package/dist/tool-loop-agent/index.d.ts.map +1 -0
- package/dist/tool-loop-agent/index.js +3 -0
- package/dist/tool-loop-agent/index.js.map +1 -0
- package/dist/tool-loop-agent/tool-loop-processor.d.ts +30 -0
- package/dist/tool-loop-agent/tool-loop-processor.d.ts.map +1 -0
- package/dist/tool-loop-agent/utils.d.ts +17 -0
- package/dist/tool-loop-agent/utils.d.ts.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.map +1 -1
- package/dist/tools/toolchecks.d.ts +1 -1
- package/dist/tools/toolchecks.d.ts.map +1 -1
- package/dist/tools/validation.d.ts +1 -1
- package/dist/tools/validation.d.ts.map +1 -1
- package/dist/utils/zod-utils.d.ts +34 -0
- package/dist/utils/zod-utils.d.ts.map +1 -0
- package/dist/utils.cjs +39 -22
- package/dist/utils.d.ts +3 -3
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +2 -1
- package/dist/vector/embed.d.ts +1 -0
- package/dist/vector/embed.d.ts.map +1 -1
- package/dist/vector/index.cjs +18 -5
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.js +9 -2
- package/dist/vector/index.js.map +1 -1
- package/dist/vector/vector.d.ts +26 -3
- package/dist/vector/vector.d.ts.map +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/default.d.ts +2 -0
- package/dist/workflows/default.d.ts.map +1 -1
- package/dist/workflows/evented/execution-engine.d.ts +1 -0
- 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 +5 -0
- package/dist/workflows/evented/step-executor.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/index.d.ts +20 -4
- package/dist/workflows/evented/workflow-event-processor/index.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/loop.d.ts +2 -2
- package/dist/workflows/evented/workflow-event-processor/loop.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/parallel.d.ts +2 -2
- package/dist/workflows/evented/workflow-event-processor/parallel.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/sleep.d.ts +2 -2
- package/dist/workflows/evented/workflow-event-processor/sleep.d.ts.map +1 -1
- package/dist/workflows/evented/workflow.d.ts +10 -2
- package/dist/workflows/evented/workflow.d.ts.map +1 -1
- package/dist/workflows/execution-engine.d.ts +1 -0
- package/dist/workflows/execution-engine.d.ts.map +1 -1
- package/dist/workflows/handlers/control-flow.d.ts +4 -0
- package/dist/workflows/handlers/control-flow.d.ts.map +1 -1
- package/dist/workflows/handlers/entry.d.ts +3 -2
- package/dist/workflows/handlers/entry.d.ts.map +1 -1
- package/dist/workflows/handlers/step.d.ts +1 -0
- package/dist/workflows/handlers/step.d.ts.map +1 -1
- package/dist/workflows/index.cjs +23 -23
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/types.d.ts +23 -3
- package/dist/workflows/types.d.ts.map +1 -1
- package/dist/workflows/utils.d.ts +1 -0
- package/dist/workflows/utils.d.ts.map +1 -1
- package/dist/workflows/workflow.d.ts +26 -9
- package/dist/workflows/workflow.d.ts.map +1 -1
- package/package.json +20 -12
- package/src/llm/model/provider-types.generated.d.ts +126 -17
- package/storage/constants.d.ts +1 -0
- package/tool-loop-agent.d.ts +1 -0
- package/dist/chunk-2IU4RGU5.js.map +0 -1
- package/dist/chunk-373OC54J.js.map +0 -1
- package/dist/chunk-4BC5FUAO.js.map +0 -1
- package/dist/chunk-5VZGJTPR.js.map +0 -1
- package/dist/chunk-62Q7K656.js.map +0 -1
- package/dist/chunk-72YCRTEX.cjs.map +0 -1
- package/dist/chunk-ADADLFDR.js +0 -42
- package/dist/chunk-ADADLFDR.js.map +0 -1
- package/dist/chunk-AGHLXC4I.cjs.map +0 -1
- package/dist/chunk-ARAQIW6E.js.map +0 -1
- package/dist/chunk-BQDZIQ3G.js.map +0 -1
- package/dist/chunk-E5BQRAJK.js.map +0 -1
- package/dist/chunk-GIWC35YQ.js.map +0 -1
- package/dist/chunk-H4VUIOWU.cjs.map +0 -1
- package/dist/chunk-HWMMIRIF.cjs.map +0 -1
- package/dist/chunk-IXZ2T2QX.cjs +0 -448
- package/dist/chunk-IXZ2T2QX.cjs.map +0 -1
- package/dist/chunk-LGB4VNZI.cjs.map +0 -1
- package/dist/chunk-MLKE7HRS.cjs.map +0 -1
- package/dist/chunk-MRRFTNF4.js.map +0 -1
- package/dist/chunk-MXBVP7HX.cjs.map +0 -1
- package/dist/chunk-OWIEOL55.cjs.map +0 -1
- package/dist/chunk-PJAK4U6R.cjs.map +0 -1
- package/dist/chunk-R5AJGM55.cjs.map +0 -1
- package/dist/chunk-RCJLMMTO.js.map +0 -1
- package/dist/chunk-SZYSDJTN.cjs.map +0 -1
- package/dist/chunk-T2VLUFGG.cjs +0 -47
- package/dist/chunk-T2VLUFGG.cjs.map +0 -1
- package/dist/chunk-U4CSOY6T.cjs.map +0 -1
- package/dist/chunk-UBSPZTQX.js +0 -434
- package/dist/chunk-UBSPZTQX.js.map +0 -1
- package/dist/chunk-VEPP75C4.cjs.map +0 -1
- package/dist/chunk-VETAQUW3.js.map +0 -1
- package/dist/chunk-WYGUWVTF.js.map +0 -1
- package/dist/chunk-WYWRMIQC.js.map +0 -1
- package/dist/chunk-X6IBA7FP.cjs.map +0 -1
- package/dist/chunk-Y36Y5MTD.js.map +0 -1
- package/dist/chunk-Y7MZ5LJT.cjs.map +0 -1
- package/dist/chunk-YPLZDWG7.js.map +0 -1
- package/dist/chunk-Z55SJVEC.cjs.map +0 -1
- package/dist/llm/model/is-v2-model.d.ts +0 -3
- package/dist/llm/model/is-v2-model.d.ts.map +0 -1
- package/dist/models-dev-D3EKFGAO.cjs +0 -12
- package/dist/models-dev-EO22XOXQ.js +0 -3
- package/dist/netlify-AE4LNCAI.js +0 -3
- package/dist/netlify-WE42TZIT.cjs +0 -12
- package/dist/provider-registry-6LF3NGC5.js +0 -3
- package/dist/provider-registry-73FKMXJV.cjs +0 -40
package/dist/relevance/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkDDK3URK2_cjs = require('../chunk-DDK3URK2.cjs');
|
|
4
4
|
|
|
5
5
|
// src/relevance/relevance-score-provider.ts
|
|
6
6
|
function createSimilarityPrompt(query, text) {
|
|
@@ -17,7 +17,7 @@ Relevance score (0-1):`;
|
|
|
17
17
|
var MastraAgentRelevanceScorer = class {
|
|
18
18
|
agent;
|
|
19
19
|
constructor(name, model) {
|
|
20
|
-
this.agent = new
|
|
20
|
+
this.agent = new chunkDDK3URK2_cjs.Agent({
|
|
21
21
|
id: `relevance-scorer-${name}`,
|
|
22
22
|
name: `Relevance Scorer ${name}`,
|
|
23
23
|
instructions: `You are a specialized agent for evaluating the relevance of text to queries.
|
|
@@ -37,7 +37,7 @@ Always return just the number, no explanation.`,
|
|
|
37
37
|
const prompt = createSimilarityPrompt(query, text);
|
|
38
38
|
const model = await this.agent.getModel();
|
|
39
39
|
let response;
|
|
40
|
-
if (model
|
|
40
|
+
if (chunkDDK3URK2_cjs.isSupportedLanguageModel(model)) {
|
|
41
41
|
const responseText = await this.agent.generate(prompt);
|
|
42
42
|
response = responseText.text;
|
|
43
43
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/relevance/relevance-score-provider.ts","../../src/relevance/mastra-agent/index.ts"],"names":["Agent"],"mappings":";;;;;AAMO,SAAS,sBAAA,CAAuB,OAAe,IAAA,EAAsB;AAC1E,EAAA,OAAO,CAAA;;AAAA,OAAA,EAEA,KAAK;;AAAA,MAAA,EAEN,IAAI;;AAAA,sBAAA,CAAA;AAGZ;;;ACRO,IAAM,6BAAN,MAAmE;AAAA,EAChE,KAAA;AAAA,EAER,WAAA,CAAY,MAAc,KAAA,EAA0B;AAClD,IAAA,IAAA,CAAK,KAAA,GAAQ,IAAIA,uBAAA,CAAM;AAAA,MACrB,EAAA,EAAI,oBAAoB,IAAI,CAAA,CAAA;AAAA,MAC5B,IAAA,EAAM,oBAAoB,IAAI,CAAA,CAAA;AAAA,MAC9B,YAAA,EAAc,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8CAAA,CAAA;AAAA,MAUd;AAAA,KACD,CAAA;AAAA,EACH;AAAA,EAEA,MAAM,iBAAA,CAAkB,KAAA,EAAe,IAAA,EAA+B;AACpE,IAAA,MAAM,MAAA,GAAS,sBAAA,CAAuB,KAAA,EAAO,IAAI,CAAA;AAEjD,IAAA,MAAM,KAAA,GAAQ,MAAM,IAAA,CAAK,KAAA,CAAM,QAAA,EAAS;AAExC,IAAA,IAAI,QAAA;AACJ,IAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/relevance/relevance-score-provider.ts","../../src/relevance/mastra-agent/index.ts"],"names":["Agent","isSupportedLanguageModel"],"mappings":";;;;;AAMO,SAAS,sBAAA,CAAuB,OAAe,IAAA,EAAsB;AAC1E,EAAA,OAAO,CAAA;;AAAA,OAAA,EAEA,KAAK;;AAAA,MAAA,EAEN,IAAI;;AAAA,sBAAA,CAAA;AAGZ;;;ACRO,IAAM,6BAAN,MAAmE;AAAA,EAChE,KAAA;AAAA,EAER,WAAA,CAAY,MAAc,KAAA,EAA0B;AAClD,IAAA,IAAA,CAAK,KAAA,GAAQ,IAAIA,uBAAA,CAAM;AAAA,MACrB,EAAA,EAAI,oBAAoB,IAAI,CAAA,CAAA;AAAA,MAC5B,IAAA,EAAM,oBAAoB,IAAI,CAAA,CAAA;AAAA,MAC9B,YAAA,EAAc,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8CAAA,CAAA;AAAA,MAUd;AAAA,KACD,CAAA;AAAA,EACH;AAAA,EAEA,MAAM,iBAAA,CAAkB,KAAA,EAAe,IAAA,EAA+B;AACpE,IAAA,MAAM,MAAA,GAAS,sBAAA,CAAuB,KAAA,EAAO,IAAI,CAAA;AAEjD,IAAA,MAAM,KAAA,GAAQ,MAAM,IAAA,CAAK,KAAA,CAAM,QAAA,EAAS;AAExC,IAAA,IAAI,QAAA;AACJ,IAAA,IAAIC,0CAAA,CAAyB,KAAK,CAAA,EAAG;AACnC,MAAA,MAAM,YAAA,GAAe,MAAM,IAAA,CAAK,KAAA,CAAM,SAAS,MAAM,CAAA;AACrD,MAAA,QAAA,GAAW,YAAA,CAAa,IAAA;AAAA,IAC1B,CAAA,MAAO;AACL,MAAA,MAAM,YAAA,GAAe,MAAM,IAAA,CAAK,KAAA,CAAM,eAAe,MAAM,CAAA;AAC3D,MAAA,QAAA,GAAW,YAAA,CAAa,IAAA;AAAA,IAC1B;AACA,IAAA,OAAO,WAAW,QAAQ,CAAA;AAAA,EAC5B;AACF","file":"index.cjs","sourcesContent":["// Provider interfaces\nexport interface RelevanceScoreProvider {\n getRelevanceScore(text1: string, text2: string): Promise<number>;\n}\n\n// Helper function used by providers\nexport function createSimilarityPrompt(query: string, text: string): string {\n return `Rate the semantic similarity between the following the query and the text on a scale from 0 to 1 (decimals allowed), where 1 means exactly the same meaning and 0 means completely different:\n\nQuery: ${query}\n\nText: ${text}\n\nRelevance score (0-1):`;\n}\n","import { Agent, isSupportedLanguageModel } from '../../agent';\nimport type { MastraModelConfig } from '../../llm/model/shared.types';\nimport { createSimilarityPrompt } from '../relevance-score-provider';\nimport type { RelevanceScoreProvider } from '../relevance-score-provider';\n\n// Mastra Agent implementation\nexport class MastraAgentRelevanceScorer implements RelevanceScoreProvider {\n private agent: Agent;\n\n constructor(name: string, model: MastraModelConfig) {\n this.agent = new Agent({\n id: `relevance-scorer-${name}`,\n name: `Relevance Scorer ${name}`,\n instructions: `You are a specialized agent for evaluating the relevance of text to queries.\nYour task is to rate how well a text passage answers a given query.\nOutput only a number between 0 and 1, where:\n1.0 = Perfectly relevant, directly answers the query\n0.0 = Completely irrelevant\nConsider:\n- Direct relevance to the question\n- Completeness of information\n- Quality and specificity\nAlways return just the number, no explanation.`,\n model,\n });\n }\n\n async getRelevanceScore(query: string, text: string): Promise<number> {\n const prompt = createSimilarityPrompt(query, text);\n\n const model = await this.agent.getModel();\n\n let response: string;\n if (isSupportedLanguageModel(model)) {\n const responseText = await this.agent.generate(prompt);\n response = responseText.text;\n } else {\n const responseText = await this.agent.generateLegacy(prompt);\n response = responseText.text;\n }\n return parseFloat(response);\n }\n}\n"]}
|
package/dist/relevance/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Agent } from '../chunk-
|
|
1
|
+
import { Agent, isSupportedLanguageModel } from '../chunk-NGWTSHNA.js';
|
|
2
2
|
|
|
3
3
|
// src/relevance/relevance-score-provider.ts
|
|
4
4
|
function createSimilarityPrompt(query, text) {
|
|
@@ -35,7 +35,7 @@ Always return just the number, no explanation.`,
|
|
|
35
35
|
const prompt = createSimilarityPrompt(query, text);
|
|
36
36
|
const model = await this.agent.getModel();
|
|
37
37
|
let response;
|
|
38
|
-
if (model
|
|
38
|
+
if (isSupportedLanguageModel(model)) {
|
|
39
39
|
const responseText = await this.agent.generate(prompt);
|
|
40
40
|
response = responseText.text;
|
|
41
41
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/relevance/relevance-score-provider.ts","../../src/relevance/mastra-agent/index.ts"],"names":[],"mappings":";;;AAMO,SAAS,sBAAA,CAAuB,OAAe,IAAA,EAAsB;AAC1E,EAAA,OAAO,CAAA;;AAAA,OAAA,EAEA,KAAK;;AAAA,MAAA,EAEN,IAAI;;AAAA,sBAAA,CAAA;AAGZ;;;ACRO,IAAM,6BAAN,MAAmE;AAAA,EAChE,KAAA;AAAA,EAER,WAAA,CAAY,MAAc,KAAA,EAA0B;AAClD,IAAA,IAAA,CAAK,KAAA,GAAQ,IAAI,KAAA,CAAM;AAAA,MACrB,EAAA,EAAI,oBAAoB,IAAI,CAAA,CAAA;AAAA,MAC5B,IAAA,EAAM,oBAAoB,IAAI,CAAA,CAAA;AAAA,MAC9B,YAAA,EAAc,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8CAAA,CAAA;AAAA,MAUd;AAAA,KACD,CAAA;AAAA,EACH;AAAA,EAEA,MAAM,iBAAA,CAAkB,KAAA,EAAe,IAAA,EAA+B;AACpE,IAAA,MAAM,MAAA,GAAS,sBAAA,CAAuB,KAAA,EAAO,IAAI,CAAA;AAEjD,IAAA,MAAM,KAAA,GAAQ,MAAM,IAAA,CAAK,KAAA,CAAM,QAAA,EAAS;AAExC,IAAA,IAAI,QAAA;AACJ,IAAA,IAAI,
|
|
1
|
+
{"version":3,"sources":["../../src/relevance/relevance-score-provider.ts","../../src/relevance/mastra-agent/index.ts"],"names":[],"mappings":";;;AAMO,SAAS,sBAAA,CAAuB,OAAe,IAAA,EAAsB;AAC1E,EAAA,OAAO,CAAA;;AAAA,OAAA,EAEA,KAAK;;AAAA,MAAA,EAEN,IAAI;;AAAA,sBAAA,CAAA;AAGZ;;;ACRO,IAAM,6BAAN,MAAmE;AAAA,EAChE,KAAA;AAAA,EAER,WAAA,CAAY,MAAc,KAAA,EAA0B;AAClD,IAAA,IAAA,CAAK,KAAA,GAAQ,IAAI,KAAA,CAAM;AAAA,MACrB,EAAA,EAAI,oBAAoB,IAAI,CAAA,CAAA;AAAA,MAC5B,IAAA,EAAM,oBAAoB,IAAI,CAAA,CAAA;AAAA,MAC9B,YAAA,EAAc,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8CAAA,CAAA;AAAA,MAUd;AAAA,KACD,CAAA;AAAA,EACH;AAAA,EAEA,MAAM,iBAAA,CAAkB,KAAA,EAAe,IAAA,EAA+B;AACpE,IAAA,MAAM,MAAA,GAAS,sBAAA,CAAuB,KAAA,EAAO,IAAI,CAAA;AAEjD,IAAA,MAAM,KAAA,GAAQ,MAAM,IAAA,CAAK,KAAA,CAAM,QAAA,EAAS;AAExC,IAAA,IAAI,QAAA;AACJ,IAAA,IAAI,wBAAA,CAAyB,KAAK,CAAA,EAAG;AACnC,MAAA,MAAM,YAAA,GAAe,MAAM,IAAA,CAAK,KAAA,CAAM,SAAS,MAAM,CAAA;AACrD,MAAA,QAAA,GAAW,YAAA,CAAa,IAAA;AAAA,IAC1B,CAAA,MAAO;AACL,MAAA,MAAM,YAAA,GAAe,MAAM,IAAA,CAAK,KAAA,CAAM,eAAe,MAAM,CAAA;AAC3D,MAAA,QAAA,GAAW,YAAA,CAAa,IAAA;AAAA,IAC1B;AACA,IAAA,OAAO,WAAW,QAAQ,CAAA;AAAA,EAC5B;AACF","file":"index.js","sourcesContent":["// Provider interfaces\nexport interface RelevanceScoreProvider {\n getRelevanceScore(text1: string, text2: string): Promise<number>;\n}\n\n// Helper function used by providers\nexport function createSimilarityPrompt(query: string, text: string): string {\n return `Rate the semantic similarity between the following the query and the text on a scale from 0 to 1 (decimals allowed), where 1 means exactly the same meaning and 0 means completely different:\n\nQuery: ${query}\n\nText: ${text}\n\nRelevance score (0-1):`;\n}\n","import { Agent, isSupportedLanguageModel } from '../../agent';\nimport type { MastraModelConfig } from '../../llm/model/shared.types';\nimport { createSimilarityPrompt } from '../relevance-score-provider';\nimport type { RelevanceScoreProvider } from '../relevance-score-provider';\n\n// Mastra Agent implementation\nexport class MastraAgentRelevanceScorer implements RelevanceScoreProvider {\n private agent: Agent;\n\n constructor(name: string, model: MastraModelConfig) {\n this.agent = new Agent({\n id: `relevance-scorer-${name}`,\n name: `Relevance Scorer ${name}`,\n instructions: `You are a specialized agent for evaluating the relevance of text to queries.\nYour task is to rate how well a text passage answers a given query.\nOutput only a number between 0 and 1, where:\n1.0 = Perfectly relevant, directly answers the query\n0.0 = Completely irrelevant\nConsider:\n- Direct relevance to the question\n- Completeness of information\n- Quality and specificity\nAlways return just the number, no explanation.`,\n model,\n });\n }\n\n async getRelevanceScore(query: string, text: string): Promise<number> {\n const prompt = createSimilarityPrompt(query, text);\n\n const model = await this.agent.getModel();\n\n let response: string;\n if (isSupportedLanguageModel(model)) {\n const responseText = await this.agent.generate(prompt);\n response = responseText.text;\n } else {\n const responseText = await this.agent.generateLegacy(prompt);\n response = responseText.text;\n }\n return parseFloat(response);\n }\n}\n"]}
|
package/dist/server/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk4U7ZLI36_cjs = require('../chunk-4U7ZLI36.cjs');
|
|
4
4
|
var chunkDGV2FWB4_cjs = require('../chunk-DGV2FWB4.cjs');
|
|
5
5
|
var chunkAF74UXR5_cjs = require('../chunk-AF74UXR5.cjs');
|
|
6
6
|
|
|
@@ -139,7 +139,7 @@ var SimpleAuth = class extends MastraAuthProvider {
|
|
|
139
139
|
function validateOptions(path, options) {
|
|
140
140
|
const opts = options;
|
|
141
141
|
if (opts.method === void 0) {
|
|
142
|
-
throw new
|
|
142
|
+
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
143
143
|
id: "MASTRA_SERVER_API_INVALID_ROUTE_OPTIONS",
|
|
144
144
|
text: `Invalid options for route "${path}", missing "method" property`,
|
|
145
145
|
domain: "MASTRA_SERVER" /* MASTRA_SERVER */,
|
|
@@ -147,7 +147,7 @@ function validateOptions(path, options) {
|
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
if (opts.handler === void 0 && opts.createHandler === void 0) {
|
|
150
|
-
throw new
|
|
150
|
+
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
151
151
|
id: "MASTRA_SERVER_API_INVALID_ROUTE_OPTIONS",
|
|
152
152
|
text: `Invalid options for route "${path}", you must define a "handler" or "createHandler" property`,
|
|
153
153
|
domain: "MASTRA_SERVER" /* MASTRA_SERVER */,
|
|
@@ -155,7 +155,7 @@ function validateOptions(path, options) {
|
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
if (opts.handler !== void 0 && opts.createHandler !== void 0) {
|
|
158
|
-
throw new
|
|
158
|
+
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
159
159
|
id: "MASTRA_SERVER_API_INVALID_ROUTE_OPTIONS",
|
|
160
160
|
text: `Invalid options for route "${path}", you can only define one of the following properties: "handler" or "createHandler"`,
|
|
161
161
|
domain: "MASTRA_SERVER" /* MASTRA_SERVER */,
|
|
@@ -165,7 +165,7 @@ function validateOptions(path, options) {
|
|
|
165
165
|
}
|
|
166
166
|
function registerApiRoute(path, options) {
|
|
167
167
|
if (path.startsWith("/api/")) {
|
|
168
|
-
throw new
|
|
168
|
+
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
169
169
|
id: "MASTRA_SERVER_API_PATH_RESERVED",
|
|
170
170
|
text: `Path must not start with "/api", it's reserved for internal API routes`,
|
|
171
171
|
domain: "MASTRA_SERVER" /* MASTRA_SERVER */,
|
package/dist/server/index.js
CHANGED
package/dist/storage/base.d.ts
CHANGED
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
import type { MastraMessageContentV2, MastraDBMessage } from '../agent/index.js';
|
|
2
1
|
import { MastraBase } from '../base.js';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type { TracingStorageStrategy } from '../observability/index.js';
|
|
6
|
-
import type { StepResult, WorkflowRunState } from '../workflows/types.js';
|
|
7
|
-
import type { TABLE_NAMES } from './constants.js';
|
|
8
|
-
import type { AgentsStorage, ScoresStorage, StoreOperations, WorkflowsStorage, MemoryStorage, ObservabilityStorage } from './domains/index.js';
|
|
9
|
-
import type { PaginationInfo, StorageColumn, StorageResourceType, StoragePagination, WorkflowRun, WorkflowRuns, SpanRecord, TraceRecord, TracesPaginatedArg, CreateIndexOptions, IndexInfo, StorageIndexStats, UpdateSpanRecord, CreateSpanRecord, StorageListMessagesInput, StorageListMessagesOutput, StorageListWorkflowRunsInput, StorageListThreadsByResourceIdInput, StorageListThreadsByResourceIdOutput, StorageAgentType, StorageCreateAgentInput, StorageUpdateAgentInput, StorageListAgentsInput, StorageListAgentsOutput, UpdateWorkflowStateOptions } from './types.js';
|
|
2
|
+
import type { AgentsStorage, ScoresStorage, WorkflowsStorage, MemoryStorage, ObservabilityStorage } from './domains/index.js';
|
|
3
|
+
import type { StorageSupports } from './types.js';
|
|
10
4
|
export type StorageDomains = {
|
|
11
|
-
operations: StoreOperations;
|
|
12
5
|
workflows: WorkflowsStorage;
|
|
13
6
|
scores: ScoresStorage;
|
|
14
7
|
memory: MemoryStorage;
|
|
15
8
|
observability?: ObservabilityStorage;
|
|
16
9
|
agents?: AgentsStorage;
|
|
17
10
|
};
|
|
18
|
-
export declare function ensureDate(date: Date | string | undefined): Date | undefined;
|
|
19
|
-
export declare function serializeDate(date: Date | string | undefined): string | undefined;
|
|
20
11
|
/**
|
|
21
12
|
* Normalizes perPage input for pagination queries.
|
|
22
13
|
*
|
|
@@ -38,6 +29,27 @@ export declare function calculatePagination(page: number, perPageInput: number |
|
|
|
38
29
|
offset: number;
|
|
39
30
|
perPage: number | false;
|
|
40
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* Base class for all Mastra storage adapters.
|
|
34
|
+
*
|
|
35
|
+
* Storage adapters provide persistence for various domains (memory, workflows, scores, observability, agents).
|
|
36
|
+
* All domain-specific operations should be accessed through `getStore()`:
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* // Access memory domain
|
|
41
|
+
* const memory = await storage.getStore('memory');
|
|
42
|
+
* await memory?.saveThread({ thread });
|
|
43
|
+
*
|
|
44
|
+
* // Access workflows domain
|
|
45
|
+
* const workflows = await storage.getStore('workflows');
|
|
46
|
+
* await workflows?.persistWorkflowSnapshot({ workflowName, runId, snapshot });
|
|
47
|
+
*
|
|
48
|
+
* // Access observability domain
|
|
49
|
+
* const observability = await storage.getStore('observability');
|
|
50
|
+
* await observability?.createSpan(span);
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
41
53
|
export declare abstract class MastraStorage extends MastraBase {
|
|
42
54
|
protected hasInitialized: null | Promise<boolean>;
|
|
43
55
|
protected shouldCacheInit: boolean;
|
|
@@ -68,290 +80,26 @@ export declare abstract class MastraStorage extends MastraBase {
|
|
|
68
80
|
name: string;
|
|
69
81
|
disableInit?: boolean;
|
|
70
82
|
});
|
|
71
|
-
get supports():
|
|
72
|
-
selectByIncludeResourceScope: boolean;
|
|
73
|
-
resourceWorkingMemory: boolean;
|
|
74
|
-
hasColumn: boolean;
|
|
75
|
-
createTable: boolean;
|
|
76
|
-
deleteMessages: boolean;
|
|
77
|
-
observabilityInstance?: boolean;
|
|
78
|
-
indexManagement?: boolean;
|
|
79
|
-
listScoresBySpan?: boolean;
|
|
80
|
-
agents?: boolean;
|
|
81
|
-
};
|
|
82
|
-
protected ensureDate(date: Date | string | undefined): Date | undefined;
|
|
83
|
-
protected serializeDate(date: Date | string | undefined): string | undefined;
|
|
84
|
-
abstract createTable({ tableName }: {
|
|
85
|
-
tableName: TABLE_NAMES;
|
|
86
|
-
schema: Record<string, StorageColumn>;
|
|
87
|
-
}): Promise<void>;
|
|
88
|
-
abstract clearTable({ tableName }: {
|
|
89
|
-
tableName: TABLE_NAMES;
|
|
90
|
-
}): Promise<void>;
|
|
91
|
-
abstract dropTable({ tableName }: {
|
|
92
|
-
tableName: TABLE_NAMES;
|
|
93
|
-
}): Promise<void>;
|
|
94
|
-
abstract alterTable(args: {
|
|
95
|
-
tableName: TABLE_NAMES;
|
|
96
|
-
schema: Record<string, StorageColumn>;
|
|
97
|
-
ifNotExists: string[];
|
|
98
|
-
}): Promise<void>;
|
|
99
|
-
abstract insert({ tableName, record }: {
|
|
100
|
-
tableName: TABLE_NAMES;
|
|
101
|
-
record: Record<string, any>;
|
|
102
|
-
}): Promise<void>;
|
|
103
|
-
abstract batchInsert({ tableName, records, }: {
|
|
104
|
-
tableName: TABLE_NAMES;
|
|
105
|
-
records: Record<string, any>[];
|
|
106
|
-
}): Promise<void>;
|
|
107
|
-
abstract load<R>({ tableName, keys }: {
|
|
108
|
-
tableName: TABLE_NAMES;
|
|
109
|
-
keys: Record<string, any>;
|
|
110
|
-
}): Promise<R | null>;
|
|
111
|
-
abstract getThreadById({ threadId }: {
|
|
112
|
-
threadId: string;
|
|
113
|
-
}): Promise<StorageThreadType | null>;
|
|
114
|
-
abstract saveThread({ thread }: {
|
|
115
|
-
thread: StorageThreadType;
|
|
116
|
-
}): Promise<StorageThreadType>;
|
|
117
|
-
abstract updateThread({ id, title, metadata, }: {
|
|
118
|
-
id: string;
|
|
119
|
-
title: string;
|
|
120
|
-
metadata: Record<string, unknown>;
|
|
121
|
-
}): Promise<StorageThreadType>;
|
|
122
|
-
abstract deleteThread({ threadId }: {
|
|
123
|
-
threadId: string;
|
|
124
|
-
}): Promise<void>;
|
|
125
|
-
getResourceById(_: {
|
|
126
|
-
resourceId: string;
|
|
127
|
-
}): Promise<StorageResourceType | null>;
|
|
128
|
-
saveResource(_: {
|
|
129
|
-
resource: StorageResourceType;
|
|
130
|
-
}): Promise<StorageResourceType>;
|
|
131
|
-
updateResource(_: {
|
|
132
|
-
resourceId: string;
|
|
133
|
-
workingMemory?: string;
|
|
134
|
-
metadata?: Record<string, unknown>;
|
|
135
|
-
}): Promise<StorageResourceType>;
|
|
136
|
-
abstract saveMessages(args: {
|
|
137
|
-
messages: MastraDBMessage[];
|
|
138
|
-
}): Promise<{
|
|
139
|
-
messages: MastraDBMessage[];
|
|
140
|
-
}>;
|
|
141
|
-
listMessages(args: StorageListMessagesInput): Promise<StorageListMessagesOutput>;
|
|
142
|
-
listWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
143
|
-
listThreadsByResourceId(args: StorageListThreadsByResourceIdInput): Promise<StorageListThreadsByResourceIdOutput>;
|
|
144
|
-
listMessagesById({ messageIds }: {
|
|
145
|
-
messageIds: string[];
|
|
146
|
-
}): Promise<{
|
|
147
|
-
messages: MastraDBMessage[];
|
|
148
|
-
}>;
|
|
149
|
-
abstract updateMessages(args: {
|
|
150
|
-
messages: (Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
151
|
-
id: string;
|
|
152
|
-
content?: Partial<MastraMessageContentV2>;
|
|
153
|
-
})[];
|
|
154
|
-
}): Promise<MastraDBMessage[]>;
|
|
155
|
-
deleteMessages(_messageIds: string[]): Promise<void>;
|
|
156
|
-
init(): Promise<void>;
|
|
157
|
-
persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, }: {
|
|
158
|
-
workflowName: string;
|
|
159
|
-
runId: string;
|
|
160
|
-
resourceId?: string;
|
|
161
|
-
snapshot: WorkflowRunState;
|
|
162
|
-
}): Promise<void>;
|
|
163
|
-
abstract updateWorkflowResults({ workflowName, runId, stepId, result, }: {
|
|
164
|
-
workflowName: string;
|
|
165
|
-
runId: string;
|
|
166
|
-
stepId: string;
|
|
167
|
-
result: StepResult<any, any, any, any>;
|
|
168
|
-
requestContext: Record<string, any>;
|
|
169
|
-
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
170
|
-
abstract updateWorkflowState({ workflowName, runId, opts, }: {
|
|
171
|
-
workflowName: string;
|
|
172
|
-
runId: string;
|
|
173
|
-
opts: UpdateWorkflowStateOptions;
|
|
174
|
-
}): Promise<WorkflowRunState | undefined>;
|
|
175
|
-
loadWorkflowSnapshot({ workflowName, runId, }: {
|
|
176
|
-
workflowName: string;
|
|
177
|
-
runId: string;
|
|
178
|
-
}): Promise<WorkflowRunState | null>;
|
|
179
|
-
/**
|
|
180
|
-
* SCORERS
|
|
181
|
-
*/
|
|
182
|
-
abstract getScoreById({ id }: {
|
|
183
|
-
id: string;
|
|
184
|
-
}): Promise<ScoreRowData | null>;
|
|
185
|
-
abstract saveScore(score: ValidatedSaveScorePayload): Promise<{
|
|
186
|
-
score: ScoreRowData;
|
|
187
|
-
}>;
|
|
188
|
-
abstract listScoresByScorerId({ scorerId, source, entityId, entityType, pagination, }: {
|
|
189
|
-
scorerId: string;
|
|
190
|
-
pagination: StoragePagination;
|
|
191
|
-
entityId?: string;
|
|
192
|
-
entityType?: string;
|
|
193
|
-
source?: ScoringSource;
|
|
194
|
-
}): Promise<{
|
|
195
|
-
pagination: PaginationInfo;
|
|
196
|
-
scores: ScoreRowData[];
|
|
197
|
-
}>;
|
|
198
|
-
abstract listScoresByRunId({ runId, pagination, }: {
|
|
199
|
-
runId: string;
|
|
200
|
-
pagination: StoragePagination;
|
|
201
|
-
}): Promise<{
|
|
202
|
-
pagination: PaginationInfo;
|
|
203
|
-
scores: ScoreRowData[];
|
|
204
|
-
}>;
|
|
205
|
-
abstract listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
206
|
-
pagination: StoragePagination;
|
|
207
|
-
entityId: string;
|
|
208
|
-
entityType: string;
|
|
209
|
-
}): Promise<{
|
|
210
|
-
pagination: PaginationInfo;
|
|
211
|
-
scores: ScoreRowData[];
|
|
212
|
-
}>;
|
|
213
|
-
listScoresBySpan({ traceId, spanId, pagination: _pagination, }: {
|
|
214
|
-
traceId: string;
|
|
215
|
-
spanId: string;
|
|
216
|
-
pagination: StoragePagination;
|
|
217
|
-
}): Promise<{
|
|
218
|
-
pagination: PaginationInfo;
|
|
219
|
-
scores: ScoreRowData[];
|
|
220
|
-
}>;
|
|
221
|
-
abstract getWorkflowRunById(args: {
|
|
222
|
-
runId: string;
|
|
223
|
-
workflowName?: string;
|
|
224
|
-
}): Promise<WorkflowRun | null>;
|
|
225
|
-
abstract deleteWorkflowRunById(args: {
|
|
226
|
-
runId: string;
|
|
227
|
-
workflowName: string;
|
|
228
|
-
}): Promise<void>;
|
|
229
|
-
/**
|
|
230
|
-
* OBSERVABILITY
|
|
231
|
-
*/
|
|
232
|
-
/**
|
|
233
|
-
* Provides hints for tracing strategy selection by the DefaultExporter.
|
|
234
|
-
* Storage adapters can override this to specify their preferred and supported strategies.
|
|
235
|
-
*/
|
|
236
|
-
get tracingStrategy(): {
|
|
237
|
-
preferred: TracingStorageStrategy;
|
|
238
|
-
supported: TracingStorageStrategy[];
|
|
239
|
-
};
|
|
240
|
-
/**
|
|
241
|
-
* Creates a single Span record in the storage provider.
|
|
242
|
-
*/
|
|
243
|
-
createSpan(span: CreateSpanRecord): Promise<void>;
|
|
244
|
-
/**
|
|
245
|
-
* Updates a single Span with partial data. Primarily used for realtime trace creation.
|
|
246
|
-
*/
|
|
247
|
-
updateSpan(params: {
|
|
248
|
-
spanId: string;
|
|
249
|
-
traceId: string;
|
|
250
|
-
updates: Partial<UpdateSpanRecord>;
|
|
251
|
-
}): Promise<void>;
|
|
252
|
-
/**
|
|
253
|
-
* Retrieves a single trace with all its associated spans.
|
|
254
|
-
*/
|
|
255
|
-
getTrace(traceId: string): Promise<TraceRecord | null>;
|
|
256
|
-
/**
|
|
257
|
-
* Retrieves a paginated list of traces with optional filtering.
|
|
258
|
-
*/
|
|
259
|
-
getTracesPaginated(args: TracesPaginatedArg): Promise<{
|
|
260
|
-
pagination: PaginationInfo;
|
|
261
|
-
spans: SpanRecord[];
|
|
262
|
-
}>;
|
|
263
|
-
/**
|
|
264
|
-
* Creates multiple Spans in a single batch.
|
|
265
|
-
*/
|
|
266
|
-
batchCreateSpans(args: {
|
|
267
|
-
records: CreateSpanRecord[];
|
|
268
|
-
}): Promise<void>;
|
|
269
|
-
/**
|
|
270
|
-
* Updates multiple Spans in a single batch.
|
|
271
|
-
*/
|
|
272
|
-
batchUpdateSpans(args: {
|
|
273
|
-
records: {
|
|
274
|
-
traceId: string;
|
|
275
|
-
spanId: string;
|
|
276
|
-
updates: Partial<UpdateSpanRecord>;
|
|
277
|
-
}[];
|
|
278
|
-
}): Promise<void>;
|
|
83
|
+
get supports(): StorageSupports;
|
|
279
84
|
/**
|
|
280
|
-
*
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
*
|
|
292
|
-
* @throws {MastraError} if not supported by the storage adapter
|
|
293
|
-
*/
|
|
294
|
-
createIndex(options: CreateIndexOptions): Promise<void>;
|
|
295
|
-
/**
|
|
296
|
-
* Drops a database index by name
|
|
297
|
-
* @throws {MastraError} if not supported by the storage adapter
|
|
298
|
-
*/
|
|
299
|
-
dropIndex(indexName: string): Promise<void>;
|
|
300
|
-
/**
|
|
301
|
-
* Lists database indexes for a table or all tables
|
|
302
|
-
* @throws {MastraError} if not supported by the storage adapter
|
|
303
|
-
*/
|
|
304
|
-
listIndexes(tableName?: string): Promise<IndexInfo[]>;
|
|
305
|
-
/**
|
|
306
|
-
* Gets detailed statistics for a specific index
|
|
307
|
-
* @throws {MastraError} if not supported by the storage adapter
|
|
308
|
-
*/
|
|
309
|
-
describeIndex(indexName: string): Promise<StorageIndexStats>;
|
|
310
|
-
/**
|
|
311
|
-
* AGENTS STORAGE
|
|
312
|
-
* These methods delegate to the agents store for agent CRUD operations.
|
|
313
|
-
* This enables dynamic creation of agents via Mastra Studio.
|
|
314
|
-
*/
|
|
315
|
-
/**
|
|
316
|
-
* Retrieves an agent by its unique identifier.
|
|
317
|
-
* @param id - The unique identifier of the agent
|
|
318
|
-
* @returns The agent if found, null otherwise
|
|
319
|
-
* @throws {MastraError} if not supported by the storage adapter
|
|
320
|
-
*/
|
|
321
|
-
getAgentById({ id }: {
|
|
322
|
-
id: string;
|
|
323
|
-
}): Promise<StorageAgentType | null>;
|
|
324
|
-
/**
|
|
325
|
-
* Creates a new agent in storage.
|
|
326
|
-
* @param agent - The agent data to create
|
|
327
|
-
* @returns The created agent with timestamps
|
|
328
|
-
* @throws {MastraError} if not supported by the storage adapter
|
|
329
|
-
*/
|
|
330
|
-
createAgent({ agent }: {
|
|
331
|
-
agent: StorageCreateAgentInput;
|
|
332
|
-
}): Promise<StorageAgentType>;
|
|
333
|
-
/**
|
|
334
|
-
* Updates an existing agent in storage.
|
|
335
|
-
* @param id - The unique identifier of the agent to update
|
|
336
|
-
* @param updates - The fields to update
|
|
337
|
-
* @returns The updated agent
|
|
338
|
-
* @throws {MastraError} if not supported by the storage adapter
|
|
339
|
-
*/
|
|
340
|
-
updateAgent(args: StorageUpdateAgentInput): Promise<StorageAgentType>;
|
|
341
|
-
/**
|
|
342
|
-
* Deletes an agent from storage.
|
|
343
|
-
* @param id - The unique identifier of the agent to delete
|
|
344
|
-
* @throws {MastraError} if not supported by the storage adapter
|
|
85
|
+
* Get a domain-specific storage interface.
|
|
86
|
+
*
|
|
87
|
+
* @param storeName - The name of the domain to access ('memory', 'workflows', 'scores', 'observability', 'agents')
|
|
88
|
+
* @returns The domain storage interface, or undefined if not available
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```typescript
|
|
92
|
+
* const memory = await storage.getStore('memory');
|
|
93
|
+
* if (memory) {
|
|
94
|
+
* await memory.saveThread({ thread });
|
|
95
|
+
* }
|
|
96
|
+
* ```
|
|
345
97
|
*/
|
|
346
|
-
|
|
347
|
-
id: string;
|
|
348
|
-
}): Promise<void>;
|
|
98
|
+
getStore<K extends keyof StorageDomains>(storeName: K): Promise<StorageDomains[K] | undefined>;
|
|
349
99
|
/**
|
|
350
|
-
*
|
|
351
|
-
*
|
|
352
|
-
* @returns Paginated list of agents
|
|
353
|
-
* @throws {MastraError} if not supported by the storage adapter
|
|
100
|
+
* Initialize all domain stores.
|
|
101
|
+
* This creates necessary tables, indexes, and performs any required migrations.
|
|
354
102
|
*/
|
|
355
|
-
|
|
103
|
+
init(): Promise<void>;
|
|
356
104
|
}
|
|
357
105
|
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/storage/base.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/storage/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAErH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,EAAE,aAAa,CAAC;IACtB,aAAa,CAAC,EAAE,oBAAoB,CAAC;IACrC,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAUvG;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,EACxC,iBAAiB,EAAE,MAAM,GACxB;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAA;CAAE,CAK7C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,8BAAsB,aAAc,SAAQ,UAAU;IACpD,SAAS,CAAC,cAAc,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAQ;IACzD,SAAS,CAAC,eAAe,UAAQ;IAEjC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,cAAc,CAAC;IAExB;;;;;;;;;;;;;;;;;;OAkBG;IACH,WAAW,EAAE,OAAO,CAAS;gBAEjB,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE;IAY1F,IAAW,QAAQ,IAAI,eAAe,CAYrC;IAED;;;;;;;;;;;;;OAaG;IACG,QAAQ,CAAC,CAAC,SAAS,MAAM,cAAc,EAAE,SAAS,EAAE,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAIpG;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAiC5B"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkCBVHOGXX_cjs = require('../chunk-CBVHOGXX.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "AGENTS_SCHEMA", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunkCBVHOGXX_cjs.AGENTS_SCHEMA; }
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, "OLD_SPAN_SCHEMA", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return chunkCBVHOGXX_cjs.OLD_SPAN_SCHEMA; }
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "SCORERS_SCHEMA", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return chunkCBVHOGXX_cjs.SCORERS_SCHEMA; }
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "SPAN_SCHEMA", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return chunkCBVHOGXX_cjs.SPAN_SCHEMA; }
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, "TABLE_AGENTS", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return chunkCBVHOGXX_cjs.TABLE_AGENTS; }
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports, "TABLE_MESSAGES", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () { return chunkCBVHOGXX_cjs.TABLE_MESSAGES; }
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "TABLE_RESOURCES", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return chunkCBVHOGXX_cjs.TABLE_RESOURCES; }
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(exports, "TABLE_SCHEMAS", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () { return chunkCBVHOGXX_cjs.TABLE_SCHEMAS; }
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, "TABLE_SCORERS", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () { return chunkCBVHOGXX_cjs.TABLE_SCORERS; }
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, "TABLE_SPANS", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () { return chunkCBVHOGXX_cjs.TABLE_SPANS; }
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(exports, "TABLE_THREADS", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function () { return chunkCBVHOGXX_cjs.TABLE_THREADS; }
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(exports, "TABLE_TRACES", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () { return chunkCBVHOGXX_cjs.TABLE_TRACES; }
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(exports, "TABLE_WORKFLOW_SNAPSHOT", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function () { return chunkCBVHOGXX_cjs.TABLE_WORKFLOW_SNAPSHOT; }
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=constants.cjs.map
|
|
60
|
+
//# sourceMappingURL=constants.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"constants.cjs"}
|
|
@@ -9,7 +9,12 @@ export declare const TABLE_SPANS = "mastra_ai_spans";
|
|
|
9
9
|
export declare const TABLE_AGENTS = "mastra_agents";
|
|
10
10
|
export type TABLE_NAMES = typeof TABLE_WORKFLOW_SNAPSHOT | typeof TABLE_MESSAGES | typeof TABLE_THREADS | typeof TABLE_TRACES | typeof TABLE_RESOURCES | typeof TABLE_SCORERS | typeof TABLE_SPANS | typeof TABLE_AGENTS;
|
|
11
11
|
export declare const SCORERS_SCHEMA: Record<string, StorageColumn>;
|
|
12
|
-
export declare const SPAN_SCHEMA: Record<
|
|
12
|
+
export declare const SPAN_SCHEMA: Record<"error" | "runId" | "source" | "input" | "output" | "name" | "createdAt" | "updatedAt" | "metadata" | "entityType" | "traceId" | "spanId" | "resourceId" | "threadId" | "entityId" | "links" | "endedAt" | "startedAt" | "spanType" | "isEvent" | "parentSpanId" | "attributes" | "entityName" | "userId" | "organizationId" | "sessionId" | "requestId" | "environment" | "serviceName" | "scope" | "tags", StorageColumn>;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Use SPAN_SCHEMA instead. This legacy schema is retained only for migration purposes.
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare const OLD_SPAN_SCHEMA: Record<string, StorageColumn>;
|
|
13
18
|
export declare const AGENTS_SCHEMA: Record<string, StorageColumn>;
|
|
14
19
|
export declare const TABLE_SCHEMAS: Record<TABLE_NAMES, Record<string, StorageColumn>>;
|
|
15
20
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/storage/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/storage/constants.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,uBAAuB,6BAA6B,CAAC;AAClE,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAChD,eAAO,MAAM,aAAa,mBAAmB,CAAC;AAC9C,eAAO,MAAM,YAAY,kBAAkB,CAAC;AAC5C,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAClD,eAAO,MAAM,aAAa,mBAAmB,CAAC;AAC9C,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,YAAY,kBAAkB,CAAC;AAE5C,MAAM,MAAM,WAAW,GACnB,OAAO,uBAAuB,GAC9B,OAAO,cAAc,GACrB,OAAO,aAAa,GACpB,OAAO,YAAY,GACnB,OAAO,eAAe,GACtB,OAAO,aAAa,GACpB,OAAO,WAAW,GAClB,OAAO,YAAY,CAAC;AAExB,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAoCxD,CAAC;AAEF,eAAO,MAAM,WAAW,oaAAuC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAmBzD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAiBvD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CA8D5E,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { AGENTS_SCHEMA, OLD_SPAN_SCHEMA, SCORERS_SCHEMA, SPAN_SCHEMA, TABLE_AGENTS, TABLE_MESSAGES, TABLE_RESOURCES, TABLE_SCHEMAS, TABLE_SCORERS, TABLE_SPANS, TABLE_THREADS, TABLE_TRACES, TABLE_WORKFLOW_SNAPSHOT } from '../chunk-YV43YEZ6.js';
|
|
2
|
+
//# sourceMappingURL=constants.js.map
|
|
3
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"constants.js"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MastraBase } from '../../../base.js';
|
|
2
1
|
import type { StorageAgentType, StorageCreateAgentInput, StorageUpdateAgentInput, StorageListAgentsInput, StorageListAgentsOutput, StorageOrderBy, ThreadOrderBy, ThreadSortDirection } from '../../types.js';
|
|
3
|
-
|
|
2
|
+
import { StorageDomain } from '../base.js';
|
|
3
|
+
export declare abstract class AgentsStorage extends StorageDomain {
|
|
4
4
|
constructor();
|
|
5
5
|
/**
|
|
6
6
|
* Retrieves an agent by its unique identifier.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/agents/base.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/agents/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACd,aAAa,EACb,mBAAmB,EACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,8BAAsB,aAAc,SAAQ,aAAa;;IAQvD;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAE/E;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,EAAE,uBAAuB,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAE9F;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,EAAE,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAE5F;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAE3D;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAEpF;;OAEG;IACH,SAAS,CAAC,YAAY,CACpB,OAAO,CAAC,EAAE,cAAc,EACxB,gBAAgB,GAAE,mBAA4B,GAC7C;QAAE,KAAK,EAAE,aAAa,CAAC;QAAC,SAAS,EAAE,mBAAmB,CAAA;KAAE;CAO5D"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { StorageAgentType, StorageCreateAgentInput, StorageUpdateAgentInput, StorageListAgentsInput, StorageListAgentsOutput } from '../../types.js';
|
|
2
|
+
import type { InMemoryDB } from '../inmemory-db.js';
|
|
2
3
|
import { AgentsStorage } from './base.js';
|
|
3
|
-
export type InMemoryAgents = Map<string, StorageAgentType>;
|
|
4
4
|
export declare class InMemoryAgentsStorage extends AgentsStorage {
|
|
5
|
-
private
|
|
6
|
-
constructor({
|
|
7
|
-
|
|
5
|
+
private db;
|
|
6
|
+
constructor({ db }: {
|
|
7
|
+
db: InMemoryDB;
|
|
8
8
|
});
|
|
9
|
+
dangerouslyClearAll(): Promise<void>;
|
|
9
10
|
getAgentById({ id }: {
|
|
10
11
|
id: string;
|
|
11
12
|
}): Promise<StorageAgentType | null>;
|