@mastra/core 1.87.0-alpha.18 → 1.87.0-alpha.19
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/dist/_types/@internal_ai-v6@0.0.99/dist/index.d.ts +2075 -123
- package/dist/_types/@internal_core@0.1.4/dist/knowledge-compat/index.d.ts +30 -3
- package/dist/agent/agent.d.ts +2 -4
- package/dist/agent/agent.types.d.ts +1 -0
- package/dist/agent/durable/index.cjs +86 -86
- package/dist/agent/durable/index.js +2 -2
- package/dist/agent/durable/run-registry.d.ts +54 -25
- package/dist/agent/index.cjs +16 -16
- package/dist/agent/index.d.ts +1 -0
- package/dist/agent/index.js +3 -3
- package/dist/agent/scopes.d.ts +8 -0
- package/dist/agent/types.d.ts +1 -0
- package/dist/agent-builder/ee/index.cjs +1 -1
- package/dist/agent-builder/ee/index.js +1 -1
- package/dist/agent-controller/agent-controller.d.ts +8 -1
- package/dist/agent-controller/index.cjs +3 -3
- package/dist/agent-controller/index.js +3 -3
- package/dist/{agent-controller-D_OKCLUP.cjs → agent-controller-DzOEhUjR.cjs} +39 -35
- package/dist/{agent-controller-UZNIM4h-.js → agent-controller-lBdNfcFi.js} +15 -11
- package/dist/{agent-skills-resolver-BMoCDoaK.cjs → agent-skills-resolver-2d8k7ioj.cjs} +134 -109
- package/dist/{agent-skills-resolver-CUEIMDbx.js → agent-skills-resolver-D2HktP6Y.js} +134 -109
- package/dist/background-tasks/index.cjs +1 -1
- package/dist/background-tasks/index.js +1 -1
- package/dist/{background-tasks-CioDMzgY.js → background-tasks-DAu4WaCb.js} +1 -1
- package/dist/{background-tasks-CLWnX7SN.cjs → background-tasks-DOmQdBVn.cjs} +1 -1
- package/dist/browser/index.cjs +4 -4
- package/dist/browser/index.js +4 -4
- package/dist/{builder-BC4l-RN5.cjs → builder-BFcVEbX0.cjs} +3 -3
- package/dist/{builder-CQLqpQO_.js → builder-DHFtMW8D.js} +2 -2
- package/dist/capabilities/302ai.json +198 -198
- package/dist/capabilities/abacus.json +2 -96
- package/dist/capabilities/abliteratedllm.json +36 -36
- package/dist/capabilities/abliteration-ai.json +11 -11
- package/dist/capabilities/above.json +19 -19
- package/dist/capabilities/adaption.json +11 -11
- package/dist/capabilities/adzuki.json +32 -32
- package/dist/capabilities/agentrouter.json +12 -12
- package/dist/capabilities/agnes.json +4 -4
- package/dist/capabilities/ai-router.json +5 -5
- package/dist/capabilities/aiand.json +25 -25
- package/dist/capabilities/aigrow.json +13 -13
- package/dist/capabilities/aimlapi.json +144 -144
- package/dist/capabilities/aipg.json +2 -2
- package/dist/capabilities/aixy.json +24 -24
- package/dist/capabilities/aki-io.json +12 -12
- package/dist/capabilities/alibaba-cn.json +81 -126
- package/dist/capabilities/alibaba-coding-plan-cn.json +4 -4
- package/dist/capabilities/alibaba-coding-plan.json +4 -4
- package/dist/capabilities/alibaba-token-plan-cn.json +57 -53
- package/dist/capabilities/alibaba-token-plan.json +57 -53
- package/dist/capabilities/alibaba.json +76 -71
- package/dist/capabilities/ambient.json +14 -32
- package/dist/capabilities/amd-tokenlab.json +41 -0
- package/dist/capabilities/amd.json +8 -8
- package/dist/capabilities/anthropic.json +32 -56
- package/dist/capabilities/anyapi.json +47 -47
- package/dist/capabilities/apiko.json +5 -5
- package/dist/capabilities/arcee.json +5 -5
- package/dist/capabilities/augure.json +4 -4
- package/dist/capabilities/auriko.json +15 -15
- package/dist/capabilities/bailing.json +3 -3
- package/dist/capabilities/baseten.json +35 -35
- package/dist/capabilities/bee.json +5 -5
- package/dist/capabilities/berget.json +2 -35
- package/dist/capabilities/bothub.json +14 -14
- package/dist/capabilities/boundless.json +39 -39
- package/dist/capabilities/bumo.json +40 -40
- package/dist/capabilities/byteplus.json +28 -28
- package/dist/capabilities/cheapest-token.json +31 -31
- package/dist/capabilities/chutes.json +48 -17
- package/dist/capabilities/cline-pass.json +32 -45
- package/dist/capabilities/cloudcode.json +8 -8
- package/dist/capabilities/cloudferro-sherlock.json +4 -4
- package/dist/capabilities/cloudflare-workers-ai.json +17 -17
- package/dist/capabilities/commandcode.json +141 -156
- package/dist/capabilities/concentrate.json +289 -289
- package/dist/capabilities/cortecs.json +103 -103
- package/dist/capabilities/crossmodel.json +194 -194
- package/dist/capabilities/crusoe.json +18 -18
- package/dist/capabilities/daoxe.json +9 -9
- package/dist/capabilities/databricks.json +128 -128
- package/dist/capabilities/deepinfra.json +98 -94
- package/dist/capabilities/deepseek.json +4 -4
- package/dist/capabilities/digitalocean.json +114 -114
- package/dist/capabilities/dinference.json +1 -2
- package/dist/capabilities/dothoosh.json +26 -26
- package/dist/capabilities/doubleword.json +23 -23
- package/dist/capabilities/edenai.json +285 -285
- package/dist/capabilities/empiriolabs.json +176 -167
- package/dist/capabilities/engy.json +16 -16
- package/dist/capabilities/entrim.json +8 -8
- package/dist/capabilities/evroc.json +15 -15
- package/dist/capabilities/ezkielyna.json +10 -10
- package/dist/capabilities/fastrouter.json +93 -97
- package/dist/capabilities/fireworks-ai.json +85 -85
- package/dist/capabilities/fortytwo.json +4 -4
- package/dist/capabilities/freemodel.json +7 -51
- package/dist/capabilities/friendli.json +8 -8
- package/dist/capabilities/frogbot.json +95 -103
- package/dist/capabilities/gisoo.json +15 -15
- package/dist/capabilities/gmicloud.json +21 -21
- package/dist/capabilities/google.json +55 -55
- package/dist/capabilities/graphn.json +10 -10
- package/dist/capabilities/greenpt.json +35 -35
- package/dist/capabilities/groq.json +7 -20
- package/dist/capabilities/helicone.json +84 -86
- package/dist/capabilities/hetzner.json +4 -4
- package/dist/capabilities/hopper.json +2 -2
- package/dist/capabilities/hostinger-router.json +5 -5
- package/dist/capabilities/hpc-ai.json +8 -24
- package/dist/capabilities/huawei-maas.json +13 -13
- package/dist/capabilities/hubris.json +30 -30
- package/dist/capabilities/huggingface.json +86 -101
- package/dist/capabilities/hyper.json +24 -24
- package/dist/capabilities/impossibl.json +152 -199
- package/dist/capabilities/inceptron.json +8 -8
- package/dist/capabilities/inco.json +4 -21
- package/dist/capabilities/infer.json +16 -16
- package/dist/capabilities/inferall.json +2 -18
- package/dist/capabilities/inference-coop.json +6 -6
- package/dist/capabilities/inference.json +2 -11
- package/dist/capabilities/inferenceapis.json +24 -24
- package/dist/capabilities/infersia.json +13 -13
- package/dist/capabilities/inferx.json +3 -3
- package/dist/capabilities/infomaniak.json +3 -3
- package/dist/capabilities/io-net.json +6 -16
- package/dist/capabilities/isoquant.json +4 -4
- package/dist/capabilities/iteracompute.json +42 -80
- package/dist/capabilities/jalapeno.json +11 -11
- package/dist/capabilities/jiekou.json +19 -167
- package/dist/capabilities/joingonka.json +4 -4
- package/dist/capabilities/jzstoken.json +54 -54
- package/dist/capabilities/keln.json +23 -23
- package/dist/capabilities/kenari.json +122 -130
- package/dist/capabilities/kilo.json +649 -647
- package/dist/capabilities/kimi-code-plan-cn.json +7 -7
- package/dist/capabilities/kimi-code-plan-global.json +7 -7
- package/dist/capabilities/kitani.json +4 -4
- package/dist/capabilities/klavo.json +24 -24
- package/dist/capabilities/korouter.json +32 -32
- package/dist/capabilities/kunavo.json +7 -7
- package/dist/capabilities/liquid.json +8 -8
- package/dist/capabilities/lithosai.json +3 -3
- package/dist/capabilities/llmgateway-providers.json +885 -893
- package/dist/capabilities/llmgateway.json +340 -340
- package/dist/capabilities/llmtr.json +16 -54
- package/dist/capabilities/lowrouter.json +61 -61
- package/dist/capabilities/lyceum.json +14 -14
- package/dist/capabilities/meganova.json +0 -1
- package/dist/capabilities/melious.json +14 -14
- package/dist/capabilities/merge-gateway.json +292 -292
- package/dist/capabilities/meta.json +11 -11
- package/dist/capabilities/minimax-cn-coding-plan.json +2 -2
- package/dist/capabilities/minimax-cn.json +5 -5
- package/dist/capabilities/minimax-coding-plan.json +2 -2
- package/dist/capabilities/minimax.json +5 -5
- package/dist/capabilities/mistral.json +15 -31
- package/dist/capabilities/mixlayer.json +5 -5
- package/dist/capabilities/moark.json +0 -2
- package/dist/capabilities/modal.json +8 -8
- package/dist/capabilities/model-oracle-ai.json +19 -27
- package/dist/capabilities/modelis.json +14 -14
- package/dist/capabilities/modelscope.json +2 -2
- package/dist/capabilities/modular.json +11 -11
- package/dist/capabilities/moneo.json +7 -38
- package/dist/capabilities/moonshotai-cn.json +7 -7
- package/dist/capabilities/moonshotai.json +7 -7
- package/dist/capabilities/morph.json +13 -13
- package/dist/capabilities/munito-eu.json +8 -8
- package/dist/capabilities/munito.json +10 -10
- package/dist/capabilities/nan.json +31 -31
- package/dist/capabilities/nano-gpt.json +581 -603
- package/dist/capabilities/nearai.json +119 -119
- package/dist/capabilities/nebius.json +30 -31
- package/dist/capabilities/neon.json +132 -132
- package/dist/capabilities/neuralwatt.json +41 -41
- package/dist/capabilities/nokeep.json +5 -5
- package/dist/capabilities/novita-ai.json +113 -227
- package/dist/capabilities/nvidia.json +14 -82
- package/dist/capabilities/oathbreaker.json +2 -2
- package/dist/capabilities/obscurify.json +28 -28
- package/dist/capabilities/oci.json +4 -4
- package/dist/capabilities/ofox.json +270 -270
- package/dist/capabilities/ollama-cloud.json +53 -53
- package/dist/capabilities/openai.json +57 -57
- package/dist/capabilities/opencode-go.json +88 -90
- package/dist/capabilities/openreason.json +5 -5
- package/dist/capabilities/openrouter.json +574 -563
- package/dist/capabilities/opper.json +29 -34
- package/dist/capabilities/orcarouter.json +307 -367
- package/dist/capabilities/outerlabs.json +30 -30
- package/dist/capabilities/ovhcloud.json +19 -19
- package/dist/capabilities/pareto.json +2 -7
- package/dist/capabilities/perplexity-agent.json +47 -102
- package/dist/capabilities/perplexity.json +2 -2
- package/dist/capabilities/phala.json +35 -35
- package/dist/capabilities/pioneer.json +5 -122
- package/dist/capabilities/poe.json +130 -130
- package/dist/capabilities/poolside.json +2 -2
- package/dist/capabilities/powerspring.json +14 -14
- package/dist/capabilities/primalabs.json +12 -12
- package/dist/capabilities/prime.json +123 -115
- package/dist/capabilities/privatemode-ai.json +8 -36
- package/dist/capabilities/proxystacks.json +5 -5
- package/dist/capabilities/qihang-ai.json +3 -15
- package/dist/capabilities/qiniu-ai.json +13 -87
- package/dist/capabilities/refuseless.json +7 -14
- package/dist/capabilities/regolo-ai.json +9 -13
- package/dist/capabilities/requesty.json +202 -202
- package/dist/capabilities/routing-run.json +3 -40
- package/dist/capabilities/ruapi.json +21 -21
- package/dist/capabilities/runcrate.json +10 -10
- package/dist/capabilities/runinfra.json +16 -16
- package/dist/capabilities/sakana.json +3 -3
- package/dist/capabilities/sambanova.json +9 -9
- package/dist/capabilities/sandbase.json +20 -20
- package/dist/capabilities/sarvam.json +22 -13
- package/dist/capabilities/scaleway.json +18 -18
- package/dist/capabilities/scnet-token-plan.json +7 -7
- package/dist/capabilities/scx-ai.json +16 -32
- package/dist/capabilities/sensenova.json +12 -12
- package/dist/capabilities/siliconflow-cn.json +45 -97
- package/dist/capabilities/siliconflow.json +53 -53
- package/dist/capabilities/snowflake-cortex.json +26 -26
- package/dist/capabilities/sokkan.json +8 -20
- package/dist/capabilities/sparrowcodes.json +21 -21
- package/dist/capabilities/stackit.json +1 -2
- package/dist/capabilities/standardcompute.json +84 -120
- package/dist/capabilities/steadyrouter.json +41 -41
- package/dist/capabilities/stepfun-ai-step-plan.json +8 -8
- package/dist/capabilities/stepfun-ai.json +8 -8
- package/dist/capabilities/stepfun-step-plan.json +8 -8
- package/dist/capabilities/stepfun.json +8 -8
- package/dist/capabilities/stepping-stone.json +15 -15
- package/dist/capabilities/subconscious.json +2 -2
- package/dist/capabilities/superbot-gg.json +4 -4
- package/dist/capabilities/synthetic.json +8 -17
- package/dist/capabilities/synthorai.json +21 -21
- package/dist/capabilities/teamorouter.json +23 -23
- package/dist/capabilities/teapot-router.json +10 -10
- package/dist/capabilities/tencent-token-plan-intl.json +25 -25
- package/dist/capabilities/tencent-token-plan.json +38 -38
- package/dist/capabilities/tencent-tokenhub.json +46 -46
- package/dist/capabilities/tensorx.json +48 -48
- package/dist/capabilities/tenstorrent.json +4 -4
- package/dist/capabilities/the-grid-ai.json +29 -29
- package/dist/capabilities/thinkingmachines.json +71 -71
- package/dist/capabilities/tinfoil.json +8 -8
- package/dist/capabilities/toapis.json +3 -3
- package/dist/capabilities/togetherai.json +42 -42
- package/dist/capabilities/tokengo.json +21 -21
- package/dist/capabilities/tokenify.json +2 -2
- package/dist/capabilities/trustedrouter.json +5 -5
- package/dist/capabilities/trustedtokens.json +15 -15
- package/dist/capabilities/umans-ai-coding-plan.json +16 -16
- package/dist/capabilities/umans-ai.json +13 -13
- package/dist/capabilities/uncensuredai.json +4 -4
- package/dist/capabilities/unorouter.json +1 -22
- package/dist/capabilities/unrestricted.json +4 -20
- package/dist/capabilities/uplinkswitch.json +21 -21
- package/dist/capabilities/upstage.json +3 -15
- package/dist/capabilities/vancine.json +20 -20
- package/dist/capabilities/vercel.json +551 -551
- package/dist/capabilities/vivgrid.json +51 -131
- package/dist/capabilities/volcengine-coding-plan.json +29 -29
- package/dist/capabilities/volcengine.json +27 -27
- package/dist/capabilities/vultr.json +14 -67
- package/dist/capabilities/wafer.ai.json +17 -17
- package/dist/capabilities/wallaby.json +2 -2
- package/dist/capabilities/wally.json +12 -12
- package/dist/capabilities/wandb.json +21 -21
- package/dist/capabilities/watt.json +22 -22
- package/dist/capabilities/xai.json +5 -5
- package/dist/capabilities/xiaomi-token-plan-ams.json +2 -2
- package/dist/capabilities/xiaomi-token-plan-cn.json +2 -2
- package/dist/capabilities/xiaomi-token-plan-sgp.json +2 -2
- package/dist/capabilities/xiaomi.json +2 -2
- package/dist/capabilities/xpersona.json +13 -13
- package/dist/capabilities/xxapi.json +30 -30
- package/dist/capabilities/zai-coding-plan.json +17 -17
- package/dist/capabilities/zai.json +31 -31
- package/dist/capabilities/zenifra.json +26 -26
- package/dist/capabilities/zenmux.json +190 -233
- package/dist/capabilities/zerogpu.json +8 -8
- package/dist/capabilities/zhipuai-coding-plan.json +3 -14
- package/dist/capabilities/zhipuai.json +30 -30
- package/dist/capabilities/zro.json +6 -6
- package/dist/channels/index.cjs +24 -24
- package/dist/channels/index.js +2 -2
- package/dist/{channels-Bemsws_d.js → channels-BBwgs50q.js} +2 -2
- package/dist/{channels-B7-KI9Ob.cjs → channels-CbhgGgQD.cjs} +6 -6
- package/dist/coding-agent/index.cjs +7 -7
- package/dist/coding-agent/index.js +4 -4
- package/dist/{constants-CFO8w780.cjs → constants-B2FVV_2e.cjs} +1 -1
- package/dist/{constants-CUv0mU2y.js → constants-Dro9fuhk.js} +1 -1
- package/dist/datasets/index.cjs +9 -9
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1147 -1142
- package/dist/docs/references/docs-agents-overview.md +9 -0
- package/dist/docs/references/docs-deployment-workers.md +1 -1
- package/dist/docs/references/docs-harness-background-tasks.md +8 -5
- package/dist/docs/references/docs-harness-durable-agents.md +1 -0
- package/dist/docs/references/docs-knowledge-search.md +1 -1
- package/dist/docs/references/docs-server-pubsub.md +1 -1
- package/dist/docs/references/docs-skills.md +4 -1
- package/dist/docs/references/docs-workflows-overview.md +2 -0
- package/dist/docs/references/reference-agents-createSkill.md +20 -1
- package/dist/docs/references/reference-knowledge-knowledge-tools.md +1 -2
- package/dist/docs/references/reference-observability-metrics-metrics-context.md +63 -3
- package/dist/docs/references/reference-pubsub-base.md +1 -1
- package/dist/docs/references/reference-pubsub-redis-streams.md +3 -5
- package/dist/docs/references/reference-pubsub-valkey-streams.md +2 -2
- package/dist/docs/references/reference-templates-overview.md +31 -1
- package/dist/docs/references/reference-workflows-run-methods-restart.md +2 -0
- package/dist/evals/index.cjs +13 -13
- package/dist/evals/index.js +2 -2
- package/dist/evals/scoreTraces/index.cjs +4 -4
- package/dist/evals/scoreTraces/index.js +2 -2
- package/dist/events/index.cjs +1 -1
- package/dist/events/index.js +1 -1
- package/dist/events/pubsub.d.ts +1 -3
- package/dist/{run-registry-Cu9CK7AR.js → execution-fence-B8yV_n51.js} +62508 -62052
- package/dist/{run-registry-CXeR1Qso.cjs → execution-fence-fqV6FGdV.cjs} +63621 -63153
- package/dist/harness/index.cjs +3 -3
- package/dist/harness/index.js +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/integration/index.cjs +1 -1
- package/dist/integration/index.js +1 -1
- package/dist/knowledge/index.cjs +163 -153
- package/dist/knowledge/index.js +18 -8
- package/dist/llm/index.cjs +3 -3
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/gateways/opencode-session-header.d.ts +28 -0
- package/dist/llm/model/provider-types.generated.d.ts +7412 -7795
- package/dist/llm/model/resolve-model.d.ts +1 -0
- package/dist/llm/model/shared.types.d.ts +1 -0
- package/dist/{llm-ZA8oIVog.cjs → llm-B7ul27Ay.cjs} +32 -14
- package/dist/{llm-DCoDWje0.js → llm-Cy3WZXgA.js} +32 -14
- package/dist/loop/index.cjs +15 -15
- package/dist/loop/index.js +2 -2
- package/dist/loop/server.cjs +1 -1
- package/dist/loop/server.js +1 -1
- package/dist/{manager-oP6iB_H-.cjs → manager-CY-RzZJL.cjs} +21 -19
- package/dist/{manager-DSbR85XK.js → manager-Dsub5fyz.js} +9 -7
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.d.ts +33 -4
- package/dist/mastra/index.js +1 -1
- package/dist/{mastra-FEJ-anIN.cjs → mastra-DXQUuwFl.cjs} +116 -67
- package/dist/{mastra-RgFRZ_Az.js → mastra-yjoYfTS5.js} +76 -27
- package/dist/memory/index.cjs +24 -24
- package/dist/memory/index.js +2 -2
- package/dist/memory/mock.d.ts +2 -3
- package/dist/{model-opyZwnK3.cjs → model-BARBpXDN.cjs} +2 -2
- package/dist/{model-DSBVKOW8.js → model-DauH8JTo.js} +2 -2
- package/dist/{netlify-BqMGvc2s.js → netlify-BNBtKR4Q.js} +86 -4
- package/dist/{netlify-DzturPW3.cjs → netlify-DGsETiFB.cjs} +97 -3
- package/dist/notifications/index.cjs +18 -18
- package/dist/notifications/index.js +2 -2
- package/dist/observability/index.cjs +1 -1
- package/dist/observability/index.js +1 -1
- package/dist/{observability-D7RNOAPx.js → observability-DPDWibyH.js} +648 -648
- package/dist/{output-helpers-DgsH4aTb.cjs → output-helpers-By5FbLpp.cjs} +71 -73
- package/dist/{output-helpers-CVzhy1Y0.js → output-helpers-k2-48ssH.js} +72 -74
- package/dist/processor-provider/index.cjs +10 -10
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +65 -65
- package/dist/processors/index.js +2 -2
- package/dist/{provider-registry-BcG2ooFa.js → provider-registry-CfHy4Zhw.js} +21401 -22401
- package/dist/{provider-registry-BZw14X9M.cjs → provider-registry-Y6tbfFhH.cjs} +21401 -22401
- package/dist/provider-registry.json +21940 -22961
- package/dist/{registry-generator-BrzPSCHS.cjs → registry-generator-BEJ0APNc.cjs} +1 -1
- package/dist/{registry-generator-CA4YBIHo.js → registry-generator-DJiQAI8V.js} +1 -1
- package/dist/{rehydrate-CfS6KkCr.cjs → rehydrate-4Sl7D3kO.cjs} +14 -14
- package/dist/{rehydrate-Chuw5IrY.js → rehydrate-Da4_E_N8.js} +2 -2
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +2 -2
- package/dist/{signal-provider-BslnAjWG.js → signal-provider-B_mfW-J4.js} +1 -1
- package/dist/{signal-provider-BFAvh_AJ.cjs → signal-provider-D9gbevHN.cjs} +1 -1
- package/dist/signals/index.cjs +3 -3
- package/dist/signals/index.js +3 -3
- package/dist/{signals-CbmgVwL-.cjs → signals-BwDXGqxc.cjs} +2 -2
- package/dist/{signals-Clupx3jz.js → signals-TznxWfM3.js} +2 -2
- package/dist/skills/create-skill.d.ts +3 -0
- package/dist/skills/index.cjs +1 -1
- package/dist/skills/index.js +1 -1
- package/dist/skills/inline-skill-source.d.ts +5 -1
- package/dist/skills/types.d.ts +16 -1
- package/dist/{source-DYZMfjv3.js → source-B3He4_mz.js} +1 -1
- package/dist/{source-BC8Et5qZ.cjs → source-C_nWbqI0.cjs} +1 -1
- package/dist/{state-processor-B9kxpM53.js → state-processor-B_KsS82m.js} +1 -1
- package/dist/{state-processor-kRNZ38Nf.cjs → state-processor-DaSmhVUX.cjs} +1 -1
- package/dist/storage/constants.cjs +1 -1
- package/dist/storage/constants.js +1 -1
- package/dist/storage/domains/agents/index.cjs +1 -1
- package/dist/storage/domains/agents/index.js +1 -1
- package/dist/storage/domains/inmemory-db.d.ts +1 -1
- package/dist/storage/domains/knowledge/pages.d.ts +8 -1
- package/dist/storage/domains/memory/base.d.ts +19 -9
- package/dist/storage/domains/memory/inmemory.d.ts +4 -1
- package/dist/storage/domains/memory/queue-thread.d.ts +7 -1
- package/dist/storage/domains/workflows/base.d.ts +18 -5
- package/dist/storage/domains/workflows/inmemory.d.ts +3 -5
- package/dist/storage/domains/workflows/journal.d.ts +16 -1
- package/dist/storage/index.cjs +187 -186
- package/dist/storage/index.js +6 -6
- package/dist/storage/workflow-snapshot.d.ts +4 -0
- package/dist/storage/workflow-step-guard.d.ts +5 -0
- package/dist/stream/base/output.d.ts +1 -0
- package/dist/stream/index.cjs +2 -2
- package/dist/stream/index.js +2 -2
- package/dist/{stream-DTpp9Tk-.js → stream-BFhCDJvz.js} +18 -8
- package/dist/{stream-CiXZtgym.cjs → stream-CZy8XA_q.cjs} +23 -7
- package/dist/telemetry/index.cjs +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/test-utils/llm-mock.cjs +1 -1
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/{tool-Z3bykc1m.js → tool-DIFduuTw.js} +2 -5
- package/dist/{tool-CYlT2UA-.cjs → tool-Dn9WSDVn.cjs} +2 -5
- package/dist/tool-loop-agent/index.cjs +1 -1
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/{tool-loop-agent-DtEg90Zj.cjs → tool-loop-agent-DifR6VLI.cjs} +4 -4
- package/dist/{tool-loop-agent-CqzgY98a.js → tool-loop-agent-SOpIJRws.js} +3 -3
- package/dist/{toolchecks-DrsZdc3S.js → toolchecks-CRAfUe9H.js} +1 -1
- package/dist/{toolchecks-MFU48cit.cjs → toolchecks-DbBsQGHW.cjs} +1 -1
- package/dist/tools/index.cjs +5 -5
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +5 -5
- package/dist/tools/is-vercel-tool.cjs +1 -1
- package/dist/tools/is-vercel-tool.js +1 -1
- package/dist/tools/tool.d.ts +2 -4
- package/dist/tools/types.d.ts +1 -0
- package/dist/{tools-BEYxowf0.cjs → tools-C2q0ougI.cjs} +1 -1
- package/dist/{tools-tPy2FwMI.js → tools-ybbz1YKg.js} +1 -1
- package/dist/{utils-B_y5EDSz.cjs → utils-BjFntMW_.cjs} +6 -5
- package/dist/{utils-tRzJ8Xfy.js → utils-DN_kWhH6.js} +6 -5
- package/dist/utils.cjs +3 -3
- package/dist/utils.js +3 -3
- package/dist/{validate-DpK_G9aa.cjs → validate-CBQ0dMBb.cjs} +1 -1
- package/dist/{validate-hFVBw9Sw.js → validate-KIBMWuyc.js} +1 -1
- package/dist/vector/index.cjs +8 -8
- package/dist/vector/index.js +1 -1
- package/dist/worker/index.cjs +1 -1
- package/dist/worker/index.js +1 -1
- package/dist/{worker-BFAw0uVe.js → worker-Bqg7bsxX.js} +8 -3
- package/dist/{worker-BhaB8pNL.cjs → worker-CJ_JYSy0.cjs} +3 -3
- package/dist/{worker-KkDudGwX.cjs → worker-Ct6E5_2p.cjs} +16 -11
- package/dist/{worker-m_uyOwiv.js → worker-DVM_pvH7.js} +2 -2
- package/dist/{workflow-Uroh6hlJ.js → workflow-BmShpn3p.js} +4 -4
- package/dist/{workflow-BwKfyvhR.cjs → workflow-DEAvg0pI.cjs} +8 -8
- package/dist/workflows/builder/index.cjs +1 -1
- package/dist/workflows/builder/index.js +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/evented/workflow-event-processor/index.d.ts +0 -2
- package/dist/workflows/evented/workflow.d.ts +2 -1
- package/dist/workflows/index.cjs +54 -54
- package/dist/workflows/index.js +4 -4
- package/dist/workflows/run-storage.d.ts +16 -1
- package/dist/workflows/types.d.ts +10 -0
- package/dist/workflows/workflow.d.ts +3 -1
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/{workspace-CzzrnE6Q.cjs → workspace-BQD4tcQi.cjs} +3 -3
- package/dist/{workspace-Ct2kAiDv.js → workspace-sqcfdZRR.js} +2 -2
- package/package.json +9 -8
- package/skills/mastra/SKILL.md +171 -0
- package/skills/mastra/references/common-errors.md +557 -0
- package/skills/mastra/references/core-concepts.md +21 -0
- package/skills/mastra/references/create-mastra.md +233 -0
- package/skills/mastra/references/embedded-docs.md +103 -0
- package/skills/mastra/references/feedback.md +69 -0
- package/skills/mastra/references/gateway.md +66 -0
- package/skills/mastra/references/mastra-api.md +222 -0
- package/skills/mastra/references/migration-guide.md +185 -0
- package/skills/mastra/references/model-selection.md +29 -0
- package/skills/mastra/references/platform.md +164 -0
- package/skills/mastra/references/remote-docs.md +193 -0
- package/skills/mastra/references/trace-query.md +150 -0
- package/skills/mastra/scripts/provider-registry.mjs +271 -0
- package/src/llm/model/provider-types.generated.d.ts +7412 -7795
- package/dist/{observability-B0R_D1PZ.cjs → observability-VaoaeadK.cjs} +647 -647
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
# Common errors and troubleshooting
|
|
2
|
+
|
|
3
|
+
Comprehensive guide to common Mastra errors and their solutions.
|
|
4
|
+
|
|
5
|
+
## Quickstart
|
|
6
|
+
|
|
7
|
+
In a lot of cases, debugging errors can be greatly simplified by first checking the behavior in Mastra Studio. This allows you to interactively test agents and workflows, inspect logs, and see real-time error messages.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm run dev
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Open `http://localhost:4111` in your browser to access Mastra Studio.
|
|
14
|
+
|
|
15
|
+
## Build and configuration errors
|
|
16
|
+
|
|
17
|
+
### "Cannot find module" or import errors
|
|
18
|
+
|
|
19
|
+
**Symptoms**:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
Error: Cannot find module '@mastra/core'
|
|
23
|
+
SyntaxError: Cannot use import statement outside a module
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Causes**:
|
|
27
|
+
|
|
28
|
+
- CommonJS configuration in `tsconfig.json`
|
|
29
|
+
- Missing `"type": "module"` in `package.json`
|
|
30
|
+
- Incorrect module resolution
|
|
31
|
+
|
|
32
|
+
**Solutions**:
|
|
33
|
+
|
|
34
|
+
1. Update `tsconfig.json`:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"compilerOptions": {
|
|
39
|
+
"target": "ES2022",
|
|
40
|
+
"module": "ES2022",
|
|
41
|
+
"moduleResolution": "bundler"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
2. Add to `package.json`:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"type": "module"
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
3. Ensure imports use `.js` extensions for local files (if needed by your bundler)
|
|
55
|
+
|
|
56
|
+
### "Property X does not exist on type Y"
|
|
57
|
+
|
|
58
|
+
**Symptoms**:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
Property 'tools' does not exist on type 'Agent'
|
|
62
|
+
Property 'memory' does not exist on type 'AgentConfig'
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Causes**:
|
|
66
|
+
|
|
67
|
+
- Outdated API usage (Mastra is actively developed)
|
|
68
|
+
- Incorrect import or type
|
|
69
|
+
- Version mismatch between docs and installed package
|
|
70
|
+
|
|
71
|
+
**Solutions**:
|
|
72
|
+
|
|
73
|
+
1. Check embedded docs (see `embedded-docs.md`) to check current API
|
|
74
|
+
2. Check `node_modules/@mastra/core/dist/docs/assets/SOURCE_MAP.json` for current exports
|
|
75
|
+
3. Verify package versions: `npm list @mastra/core`
|
|
76
|
+
4. Update dependencies: `npm update @mastra/core`
|
|
77
|
+
|
|
78
|
+
## Agent errors
|
|
79
|
+
|
|
80
|
+
### Agent not using assigned tools
|
|
81
|
+
|
|
82
|
+
**Symptoms**:
|
|
83
|
+
|
|
84
|
+
- Agent responds "I don't have access to that tool"
|
|
85
|
+
- Tools never get called despite being relevant
|
|
86
|
+
|
|
87
|
+
**Causes**:
|
|
88
|
+
|
|
89
|
+
- Tools not registered in Mastra instance
|
|
90
|
+
- Tools not passed to Agent constructor
|
|
91
|
+
- Tool IDs don't match
|
|
92
|
+
|
|
93
|
+
**Solutions**:
|
|
94
|
+
|
|
95
|
+
**Correct pattern**:
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
// 1. Create tool
|
|
99
|
+
const weatherTool = createTool({
|
|
100
|
+
id: "get-weather",
|
|
101
|
+
// ... tool config
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// 2. Register in Mastra instance
|
|
105
|
+
const mastra = new Mastra({
|
|
106
|
+
tools: {
|
|
107
|
+
weatherTool, // or 'weatherTool': weatherTool
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// 3. Assign to agent
|
|
112
|
+
const agent = new Agent({
|
|
113
|
+
id: "weather-agent",
|
|
114
|
+
tools: { weatherTool }, // Reference the tool
|
|
115
|
+
// ... other config
|
|
116
|
+
});
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Alternative pattern (direct assignment)**:
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
const agent = new Agent({
|
|
123
|
+
id: "weather-agent",
|
|
124
|
+
tools: {
|
|
125
|
+
weatherTool: createTool({ id: "get-weather" /* ... */ }),
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Agent memory not persisting
|
|
131
|
+
|
|
132
|
+
**Symptoms**:
|
|
133
|
+
|
|
134
|
+
- Agent doesn't remember previous messages
|
|
135
|
+
- Conversation history is lost between calls
|
|
136
|
+
|
|
137
|
+
**Causes**:
|
|
138
|
+
|
|
139
|
+
- No storage backend configured
|
|
140
|
+
- Missing or inconsistent `threadId`
|
|
141
|
+
- Memory not assigned to agent
|
|
142
|
+
|
|
143
|
+
**Solutions**:
|
|
144
|
+
|
|
145
|
+
```typescript
|
|
146
|
+
// 1. Configure storage
|
|
147
|
+
const storage = new PostgresStore({
|
|
148
|
+
id: "pg-storage",
|
|
149
|
+
connectionString: process.env.DATABASE_URL,
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
// 2. Create memory with storage
|
|
153
|
+
const memory = new Memory({
|
|
154
|
+
id: "chat-memory",
|
|
155
|
+
storage,
|
|
156
|
+
options: {
|
|
157
|
+
lastMessages: 10, // How many messages to retrieve
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
// 3. Assign memory to agent
|
|
162
|
+
const agent = new Agent({
|
|
163
|
+
id: "chat-agent",
|
|
164
|
+
name: "Chat Agent",
|
|
165
|
+
instructions: "You are a helpful assistant.",
|
|
166
|
+
model: "openai/gpt-6.2-sol",
|
|
167
|
+
memory,
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// 4. Use consistent threadId
|
|
171
|
+
await agent.generate("Hello", {
|
|
172
|
+
memory: {
|
|
173
|
+
thread: "user-123-conversation", // Same thread for entire conversation
|
|
174
|
+
resource: "user-123",
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Workflow errors
|
|
180
|
+
|
|
181
|
+
### "Cannot read property 'then' of undefined"
|
|
182
|
+
|
|
183
|
+
**Symptoms**:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
TypeError: Cannot read property 'then' of undefined
|
|
187
|
+
Workflow execution fails immediately
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Causes**:
|
|
191
|
+
|
|
192
|
+
- Forgot to call `.commit()` on workflow
|
|
193
|
+
- Step returns undefined
|
|
194
|
+
|
|
195
|
+
**Solutions**:
|
|
196
|
+
|
|
197
|
+
**Correct pattern**:
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
const workflow = createWorkflow({
|
|
201
|
+
id: "my-workflow",
|
|
202
|
+
inputSchema: z.object({ data: z.string() }),
|
|
203
|
+
outputSchema: z.object({ result: z.string() }),
|
|
204
|
+
})
|
|
205
|
+
.then(step1)
|
|
206
|
+
.then(step2)
|
|
207
|
+
.commit(); // REQUIRED!
|
|
208
|
+
|
|
209
|
+
// Then execute
|
|
210
|
+
const run = await workflow.createRun();
|
|
211
|
+
const result = await run.start({ inputData: { data: "test" } });
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Workflow state not updating
|
|
215
|
+
|
|
216
|
+
**Symptoms**:
|
|
217
|
+
|
|
218
|
+
- State changes don't persist across steps
|
|
219
|
+
- `getStepResult()` returns undefined
|
|
220
|
+
|
|
221
|
+
**Causes**:
|
|
222
|
+
|
|
223
|
+
- Not using `setState` to update state
|
|
224
|
+
- Accessing state before step completes
|
|
225
|
+
|
|
226
|
+
**Solutions**:
|
|
227
|
+
|
|
228
|
+
```typescript
|
|
229
|
+
const stateSchema = z.object({ counter: z.number().optional() });
|
|
230
|
+
|
|
231
|
+
const step1 = createStep({
|
|
232
|
+
id: "step1",
|
|
233
|
+
inputSchema: z.object({}),
|
|
234
|
+
outputSchema: z.object({ result: z.string() }),
|
|
235
|
+
stateSchema,
|
|
236
|
+
execute: async ({ state, setState }) => {
|
|
237
|
+
// Update state
|
|
238
|
+
await setState({ ...state, counter: (state.counter || 0) + 1 });
|
|
239
|
+
return { result: "done" };
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
// Access state in subsequent steps
|
|
244
|
+
const step2 = createStep({
|
|
245
|
+
id: "step2",
|
|
246
|
+
inputSchema: z.object({ result: z.string() }),
|
|
247
|
+
outputSchema: z.object({ result: z.string() }),
|
|
248
|
+
stateSchema,
|
|
249
|
+
execute: async ({ state }) => {
|
|
250
|
+
console.log(state.counter); // Access updated state
|
|
251
|
+
return { result: "complete" };
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## Memory errors
|
|
257
|
+
|
|
258
|
+
### "Storage is required for Memory"
|
|
259
|
+
|
|
260
|
+
**Symptoms**:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
Error: Storage is required for Memory
|
|
264
|
+
Memory instantiation fails
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
**Causes**:
|
|
268
|
+
|
|
269
|
+
- Memory created without storage backend
|
|
270
|
+
|
|
271
|
+
**Solutions**:
|
|
272
|
+
|
|
273
|
+
```typescript
|
|
274
|
+
// Always provide storage when creating Memory
|
|
275
|
+
const memory = new Memory({
|
|
276
|
+
id: "my-memory",
|
|
277
|
+
storage: postgresStore, // REQUIRED
|
|
278
|
+
options: {
|
|
279
|
+
lastMessages: 10,
|
|
280
|
+
},
|
|
281
|
+
});
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Semantic recall not working
|
|
285
|
+
|
|
286
|
+
**Symptoms**:
|
|
287
|
+
|
|
288
|
+
- Memory doesn't retrieve semantically similar messages
|
|
289
|
+
- Only recent messages are returned
|
|
290
|
+
|
|
291
|
+
**Causes**:
|
|
292
|
+
|
|
293
|
+
- No vector store configured
|
|
294
|
+
- No embedder configured
|
|
295
|
+
- `semanticRecall` not enabled
|
|
296
|
+
|
|
297
|
+
**Solutions**:
|
|
298
|
+
|
|
299
|
+
```typescript
|
|
300
|
+
const memory = new Memory({
|
|
301
|
+
id: "semantic-memory",
|
|
302
|
+
storage: postgresStore,
|
|
303
|
+
vector: chromaVectorStore, // REQUIRED for semantic recall
|
|
304
|
+
embedder: openaiEmbedder, // REQUIRED for semantic recall
|
|
305
|
+
options: {
|
|
306
|
+
lastMessages: 10,
|
|
307
|
+
semanticRecall: true, // REQUIRED
|
|
308
|
+
},
|
|
309
|
+
});
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
## Tool errors
|
|
313
|
+
|
|
314
|
+
### "Tool validation failed"
|
|
315
|
+
|
|
316
|
+
**Symptoms**:
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
Error: Input validation failed for tool 'my-tool'
|
|
320
|
+
ZodError: Expected string, received number
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
**Causes**:
|
|
324
|
+
|
|
325
|
+
- Input doesn't match inputSchema
|
|
326
|
+
- Missing required fields
|
|
327
|
+
- Type mismatch
|
|
328
|
+
|
|
329
|
+
**Solutions**:
|
|
330
|
+
|
|
331
|
+
```typescript
|
|
332
|
+
const tool = createTool({
|
|
333
|
+
id: "my-tool",
|
|
334
|
+
description: "Greets a person by name",
|
|
335
|
+
inputSchema: z.object({
|
|
336
|
+
name: z.string(),
|
|
337
|
+
age: z.number().optional(), // Make optional fields explicit
|
|
338
|
+
}),
|
|
339
|
+
execute: async (input) => {
|
|
340
|
+
// input is validated and typed
|
|
341
|
+
return { result: `Hello ${input.name}` };
|
|
342
|
+
},
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
// Correct usage
|
|
346
|
+
await tool.execute({ name: "Alice" }); // Works
|
|
347
|
+
await tool.execute({ name: "Bob", age: 30 }); // Works
|
|
348
|
+
await tool.execute({ age: 30 }); // ERROR: name is required
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### Tool suspension not resuming
|
|
352
|
+
|
|
353
|
+
**Symptoms**:
|
|
354
|
+
|
|
355
|
+
- Tool suspends but never resumes
|
|
356
|
+
- resumeData is undefined
|
|
357
|
+
|
|
358
|
+
**Causes**:
|
|
359
|
+
|
|
360
|
+
- Not calling workflow.resume() or agent.generate() with resumeData
|
|
361
|
+
- Incorrect resumeSchema
|
|
362
|
+
|
|
363
|
+
**Solutions**:
|
|
364
|
+
|
|
365
|
+
```typescript
|
|
366
|
+
const approvalTool = createTool({
|
|
367
|
+
id: "approval",
|
|
368
|
+
description: "Requests human approval before continuing",
|
|
369
|
+
inputSchema: z.object({ request: z.string() }),
|
|
370
|
+
outputSchema: z.object({ approved: z.boolean() }),
|
|
371
|
+
suspendSchema: z.object({ requestId: z.string() }),
|
|
372
|
+
resumeSchema: z.object({ approved: z.boolean() }),
|
|
373
|
+
execute: async (input, context) => {
|
|
374
|
+
// Running in a workflow; use context.agent when an agent calls the tool
|
|
375
|
+
const workflowContext = context.workflow!;
|
|
376
|
+
|
|
377
|
+
if (!workflowContext.resumeData) {
|
|
378
|
+
// First call - suspend
|
|
379
|
+
const requestId = generateId();
|
|
380
|
+
await workflowContext.suspend({ requestId });
|
|
381
|
+
return; // Execution pauses here
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// Resumed - use resumeData
|
|
385
|
+
return { approved: workflowContext.resumeData.approved };
|
|
386
|
+
},
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
// Resume the workflow run
|
|
390
|
+
await run.resume({
|
|
391
|
+
resumeData: { approved: true },
|
|
392
|
+
});
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
## Storage errors
|
|
396
|
+
|
|
397
|
+
### "Connection refused" or "Database does not exist"
|
|
398
|
+
|
|
399
|
+
**Symptoms**:
|
|
400
|
+
|
|
401
|
+
```bash
|
|
402
|
+
Error: connect ECONNREFUSED 127.0.0.1:5432
|
|
403
|
+
Error: database "mastra" does not exist
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
**Causes**:
|
|
407
|
+
|
|
408
|
+
- Database not running
|
|
409
|
+
- Incorrect connection string
|
|
410
|
+
- Database not created
|
|
411
|
+
|
|
412
|
+
**Solutions**:
|
|
413
|
+
|
|
414
|
+
1. Start database (Postgres example):
|
|
415
|
+
|
|
416
|
+
```bash
|
|
417
|
+
docker run -d \
|
|
418
|
+
--name mastra-postgres \
|
|
419
|
+
-e POSTGRES_PASSWORD=password \
|
|
420
|
+
-e POSTGRES_DB=mastra \
|
|
421
|
+
-p 5432:5432 \
|
|
422
|
+
postgres:16
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
2. Verify connection string:
|
|
426
|
+
|
|
427
|
+
```env
|
|
428
|
+
DATABASE_URL=postgresql://postgres:password@localhost:5432/mastra
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
3. Initialize storage:
|
|
432
|
+
|
|
433
|
+
```typescript
|
|
434
|
+
const storage = new PostgresStore({
|
|
435
|
+
id: "pg-storage",
|
|
436
|
+
connectionString: process.env.DATABASE_URL,
|
|
437
|
+
});
|
|
438
|
+
await storage.init(); // Creates tables if needed
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
## Environment variable errors
|
|
442
|
+
|
|
443
|
+
### "API key not found"
|
|
444
|
+
|
|
445
|
+
**Symptoms**:
|
|
446
|
+
|
|
447
|
+
```bash
|
|
448
|
+
Error: OPENAI_API_KEY environment variable is not set
|
|
449
|
+
401 Unauthorized
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
**Causes**:
|
|
453
|
+
|
|
454
|
+
- Missing .env file
|
|
455
|
+
- Environment variables not loaded
|
|
456
|
+
- Incorrect variable name
|
|
457
|
+
|
|
458
|
+
**Solutions**:
|
|
459
|
+
|
|
460
|
+
1. Create .env file:
|
|
461
|
+
|
|
462
|
+
```env
|
|
463
|
+
OPENAI_API_KEY=sk-...
|
|
464
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
465
|
+
GOOGLE_GENERATIVE_AI_API_KEY=...
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
2. Load environment variables (for Node.js):
|
|
469
|
+
|
|
470
|
+
```typescript
|
|
471
|
+
import "dotenv/config"; // At top of entry file
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
3. Verify variable is loaded:
|
|
475
|
+
|
|
476
|
+
```typescript
|
|
477
|
+
if (!process.env.OPENAI_API_KEY) {
|
|
478
|
+
throw new Error("OPENAI_API_KEY is required");
|
|
479
|
+
}
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
## Model errors
|
|
483
|
+
|
|
484
|
+
### "Model not found" or "Invalid model"
|
|
485
|
+
|
|
486
|
+
**Symptoms**:
|
|
487
|
+
|
|
488
|
+
```bash
|
|
489
|
+
Error: Model 'gpt-4' not found
|
|
490
|
+
Error: Invalid model format
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
**Causes**:
|
|
494
|
+
|
|
495
|
+
- Incorrect model format (should be `provider/model`)
|
|
496
|
+
- Unsupported model
|
|
497
|
+
- Missing provider API key
|
|
498
|
+
|
|
499
|
+
**Solutions**:
|
|
500
|
+
|
|
501
|
+
**Correct model format**:
|
|
502
|
+
|
|
503
|
+
```typescript
|
|
504
|
+
const agent = new Agent({
|
|
505
|
+
model: "openai/gpt-6.2-sol", // ✅ Correct
|
|
506
|
+
// NOT: model: 'gpt-6.2-sol' // ❌ Missing provider
|
|
507
|
+
});
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
**Common models**:
|
|
511
|
+
|
|
512
|
+
- OpenAI: `openai/gpt-6.2-sol`, `openai/gpt-6.2-astra`, `openai/gpt-6-luna`
|
|
513
|
+
- Anthropic: `anthropic/claude-sonnet-5-5`, `anthropic/claude-haiku-5-5`, `anthropic/claude-opus-5-5`
|
|
514
|
+
- Google: `google/gemini-4-neon`, `google/gemini-4-hydrogen`, `google/gemini-4-carbon`
|
|
515
|
+
|
|
516
|
+
**Use embedded docs to verify**:
|
|
517
|
+
|
|
518
|
+
```bash
|
|
519
|
+
# Check supported models
|
|
520
|
+
ls node_modules/@mastra/core/dist/docs/
|
|
521
|
+
# See embedded-docs.md for lookup instructions
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
## Debugging tips
|
|
525
|
+
|
|
526
|
+
### Enable verbose logging
|
|
527
|
+
|
|
528
|
+
```typescript
|
|
529
|
+
const mastra = new Mastra({
|
|
530
|
+
logger: new PinoLogger({
|
|
531
|
+
name: "mastra",
|
|
532
|
+
level: "debug", // or 'trace' for even more detail
|
|
533
|
+
}),
|
|
534
|
+
});
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
### Check package versions
|
|
538
|
+
|
|
539
|
+
```bash
|
|
540
|
+
npm list @mastra/core
|
|
541
|
+
npm list @mastra/memory
|
|
542
|
+
npm list @mastra/rag
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
### Validate TypeScript config
|
|
546
|
+
|
|
547
|
+
```bash
|
|
548
|
+
npx tsc --showConfig
|
|
549
|
+
# Verify target: ES2022, module: ES2022
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
## Getting help
|
|
553
|
+
|
|
554
|
+
1. **Check embedded docs**: Check embedded docs (see `embedded-docs.md`)
|
|
555
|
+
2. **Search documentation**: [mastra.ai/docs](https://mastra.ai/docs)
|
|
556
|
+
3. **Check version compatibility**: Ensure installed @mastra packages satisfy each other's peer dependency ranges (versions differ between packages; `npm ls` reports invalid peers)
|
|
557
|
+
4. **File an issue**: [github.com/mastra-ai/mastra](https://github.com/mastra-ai/mastra)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Core Concepts Reference
|
|
2
|
+
|
|
3
|
+
Use this reference when choosing Mastra primitives and native capabilities before designing custom infrastructure.
|
|
4
|
+
|
|
5
|
+
## Discover native capabilities first
|
|
6
|
+
|
|
7
|
+
Check whether Mastra already provides the requested behavior before designing custom infrastructure. Verify the installed version's capabilities, configuration, and limits using [embedded docs](embedded-docs.md), or [remote docs](remote-docs.md) when unavailable. Prefer native capabilities where they fit; add custom logic for identified gaps and application-specific business rules.
|
|
8
|
+
|
|
9
|
+
## Agents vs workflows
|
|
10
|
+
|
|
11
|
+
Agent: Autonomous, makes decisions, uses tools.
|
|
12
|
+
Use for open-ended tasks such as support, research, analysis, and tool-using assistants.
|
|
13
|
+
|
|
14
|
+
Workflow: Structured sequence of steps.
|
|
15
|
+
Use for defined processes such as pipelines, approvals, ETL, multi-step business logic, and resumable processes.
|
|
16
|
+
|
|
17
|
+
## Key components
|
|
18
|
+
|
|
19
|
+
- Tools: Extend agent capabilities through APIs, databases, external services, and deterministic functions.
|
|
20
|
+
- Memory: Maintain context through message history, working memory, semantic recall, and observational memory.
|
|
21
|
+
- Storage: Persist data with providers such as Postgres, LibSQL, and MongoDB.
|