@mastra/core 1.87.0-alpha.17 → 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/session.d.ts +16 -0
- package/dist/{agent-controller-cqcUP-xy.cjs → agent-controller-DzOEhUjR.cjs} +55 -35
- package/dist/{agent-controller-ChZ3qcXE.js → agent-controller-lBdNfcFi.js} +31 -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-CH_gzJwc.js → background-tasks-DAu4WaCb.js} +1 -1
- package/dist/{background-tasks-BIk1TRPw.cjs → background-tasks-DOmQdBVn.cjs} +1 -1
- package/dist/browser/index.cjs +4 -4
- package/dist/browser/index.js +4 -4
- package/dist/{builder-ZAUhFqtD.cjs → builder-BFcVEbX0.cjs} +3 -3
- package/dist/{builder-v01k8_0x.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-B7lf5BnT.js → channels-BBwgs50q.js} +2 -2
- package/dist/{channels-CAA8MkDQ.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-agent-controller-session.md +19 -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-bm6b6mwQ.js → execution-fence-B8yV_n51.js} +62508 -62052
- package/dist/{run-registry-BaVTwGKh.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-CGl_FZsb.cjs → llm-B7ul27Ay.cjs} +32 -14
- package/dist/{llm-B5OxUmL4.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-BuPZ97U6.cjs → manager-CY-RzZJL.cjs} +21 -19
- package/dist/{manager-R_QVoiy9.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-CHYi4Woq.cjs → mastra-DXQUuwFl.cjs} +116 -67
- package/dist/{mastra-Cl5EC-jR.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-WmKuSHa8.cjs → model-BARBpXDN.cjs} +2 -2
- package/dist/{model-BNIR9RSw.js → model-DauH8JTo.js} +2 -2
- package/dist/{netlify-D4orVt-5.js → netlify-BNBtKR4Q.js} +86 -4
- package/dist/{netlify-C_6KLad8.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-CkHZ7heH.js → provider-registry-CfHy4Zhw.js} +21401 -22401
- package/dist/{provider-registry-DH7XbpHT.cjs → provider-registry-Y6tbfFhH.cjs} +21401 -22401
- package/dist/provider-registry.json +21940 -22961
- package/dist/{registry-generator-Dn8HU1Jz.cjs → registry-generator-BEJ0APNc.cjs} +1 -1
- package/dist/{registry-generator-CAXpGkmM.js → registry-generator-DJiQAI8V.js} +1 -1
- package/dist/{rehydrate-DZyZNbaq.cjs → rehydrate-4Sl7D3kO.cjs} +14 -14
- package/dist/{rehydrate-Cy7-QPU-.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-B9dswdIM.js → stream-BFhCDJvz.js} +18 -8
- package/dist/{stream-CbG7k93m.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-BnlPROel.cjs → tool-loop-agent-DifR6VLI.cjs} +4 -4
- package/dist/{tool-loop-agent-BmlzhMxc.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-N_OPw-9g.cjs → utils-BjFntMW_.cjs} +6 -5
- package/dist/{utils-BU8lpEZ4.js → utils-DN_kWhH6.js} +6 -5
- package/dist/utils.cjs +3 -3
- package/dist/utils.js +3 -3
- package/dist/{validate-BvxwUPNa.cjs → validate-CBQ0dMBb.cjs} +1 -1
- package/dist/{validate-BANPY3pi.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-BpVWGM6Q.js → worker-Bqg7bsxX.js} +8 -3
- package/dist/{worker-E2MdhICW.cjs → worker-CJ_JYSy0.cjs} +3 -3
- package/dist/{worker-B3s2DjXP.cjs → worker-Ct6E5_2p.cjs} +16 -11
- package/dist/{worker-CZ_07SOb.js → worker-DVM_pvH7.js} +2 -2
- package/dist/{workflow-BrcVks0j.js → workflow-BmShpn3p.js} +4 -4
- package/dist/{workflow-BuPW86ke.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 +7 -6
- 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
package/dist/workflows/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const require_stream = require("../stream-
|
|
2
|
+
const require_execution_fence = require("../execution-fence-fqV6FGdV.cjs");
|
|
3
|
+
const require_stream = require("../stream-CZy8XA_q.cjs");
|
|
4
4
|
const require_predicate_index = require("../predicate/index.cjs");
|
|
5
5
|
const require_schedules = require("../schedules-BZS8McF7.cjs");
|
|
6
6
|
const require_scheduler = require("../scheduler-CMjK0LoQ.cjs");
|
|
7
|
-
const require_validate = require("../validate-
|
|
8
|
-
const require_rehydrate = require("../rehydrate-
|
|
7
|
+
const require_validate = require("../validate-CBQ0dMBb.cjs");
|
|
8
|
+
const require_rehydrate = require("../rehydrate-4Sl7D3kO.cjs");
|
|
9
9
|
// src/workflows/state-reader.ts
|
|
10
10
|
const getStep = (state, stepId) => state.steps?.[stepId];
|
|
11
11
|
const getFirstStepResult = (step) => {
|
|
@@ -71,50 +71,50 @@ function createWorkflowStateReader(state) {
|
|
|
71
71
|
getResumeLabels: () => getWorkflowResumeLabels(state)
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
exports.DefaultExecutionEngine =
|
|
75
|
-
exports.ExecutionEngine =
|
|
76
|
-
exports.RESUME_SNAPSHOT_POLL_INTERVAL_MS =
|
|
77
|
-
exports.RESUME_SNAPSHOT_WAIT_STATUSES =
|
|
78
|
-
exports.Run =
|
|
74
|
+
exports.DefaultExecutionEngine = require_execution_fence.DefaultExecutionEngine;
|
|
75
|
+
exports.ExecutionEngine = require_execution_fence.ExecutionEngine;
|
|
76
|
+
exports.RESUME_SNAPSHOT_POLL_INTERVAL_MS = require_execution_fence.RESUME_SNAPSHOT_POLL_INTERVAL_MS;
|
|
77
|
+
exports.RESUME_SNAPSHOT_WAIT_STATUSES = require_execution_fence.RESUME_SNAPSHOT_WAIT_STATUSES;
|
|
78
|
+
exports.Run = require_execution_fence.Run;
|
|
79
79
|
exports.Scheduler = require_scheduler.Scheduler;
|
|
80
|
-
exports.Workflow =
|
|
80
|
+
exports.Workflow = require_execution_fence.Workflow;
|
|
81
81
|
exports.WorkflowScheduler = require_scheduler.WorkflowScheduler;
|
|
82
|
-
exports.abortableSleep =
|
|
82
|
+
exports.abortableSleep = require_execution_fence.abortableSleep;
|
|
83
83
|
exports.analyzeMapConfig = require_validate.analyzeMapConfig;
|
|
84
|
-
exports.applyStateDelta =
|
|
85
|
-
exports.assertTimeTravelGraphMatchesSnapshot =
|
|
84
|
+
exports.applyStateDelta = require_execution_fence.applyStateDelta;
|
|
85
|
+
exports.assertTimeTravelGraphMatchesSnapshot = require_execution_fence.assertTimeTravelGraphMatchesSnapshot;
|
|
86
86
|
exports.assertValidDynamicWorkflow = require_validate.assertValidDynamicWorkflow;
|
|
87
87
|
exports.claimScheduleFire = require_scheduler.claimScheduleFire;
|
|
88
|
-
exports.cleanStepResult =
|
|
89
|
-
exports.cloneStep =
|
|
90
|
-
exports.cloneWorkflow =
|
|
88
|
+
exports.cleanStepResult = require_execution_fence.cleanStepResult;
|
|
89
|
+
exports.cloneStep = require_execution_fence.cloneStep$1;
|
|
90
|
+
exports.cloneWorkflow = require_execution_fence.cloneWorkflow;
|
|
91
91
|
exports.collectNestedWorkflowIds = require_validate.collectNestedWorkflowIds;
|
|
92
92
|
exports.computeNextFireAt = require_schedules.computeNextFireAt;
|
|
93
|
-
exports.computeScheduleDefinitionHash =
|
|
94
|
-
exports.createDeprecationProxy =
|
|
95
|
-
exports.createEventedWorkflow =
|
|
96
|
-
exports.createMappingStep =
|
|
97
|
-
exports.createRestartExecutionParams =
|
|
98
|
-
exports.createStep =
|
|
99
|
-
exports.createStepFromAgent =
|
|
100
|
-
exports.createStepFromClassifier =
|
|
101
|
-
exports.createStepFromTool =
|
|
102
|
-
exports.createTimeTravelExecutionParams =
|
|
103
|
-
exports.createWorkflow =
|
|
93
|
+
exports.computeScheduleDefinitionHash = require_execution_fence.computeScheduleDefinitionHash;
|
|
94
|
+
exports.createDeprecationProxy = require_execution_fence.createDeprecationProxy;
|
|
95
|
+
exports.createEventedWorkflow = require_execution_fence.createEventedWorkflow;
|
|
96
|
+
exports.createMappingStep = require_execution_fence.createMappingStep;
|
|
97
|
+
exports.createRestartExecutionParams = require_execution_fence.createRestartExecutionParams;
|
|
98
|
+
exports.createStep = require_execution_fence.createStep$1;
|
|
99
|
+
exports.createStepFromAgent = require_execution_fence.createStepFromAgent;
|
|
100
|
+
exports.createStepFromClassifier = require_execution_fence.createStepFromClassifier;
|
|
101
|
+
exports.createStepFromTool = require_execution_fence.createStepFromTool;
|
|
102
|
+
exports.createTimeTravelExecutionParams = require_execution_fence.createTimeTravelExecutionParams;
|
|
103
|
+
exports.createWorkflow = require_execution_fence.createWorkflow;
|
|
104
104
|
exports.createWorkflowStateReader = createWorkflowStateReader;
|
|
105
|
-
exports.defineLazyWriter =
|
|
106
|
-
exports.defineStateAccessors =
|
|
105
|
+
exports.defineLazyWriter = require_execution_fence.defineLazyWriter;
|
|
106
|
+
exports.defineStateAccessors = require_execution_fence.defineStateAccessors;
|
|
107
107
|
exports.derivePredicateLabel = require_predicate_index.derivePredicateLabel;
|
|
108
108
|
exports.entryOptionFields = require_rehydrate.entryOptionFields;
|
|
109
|
-
exports.evaluatePredicate =
|
|
109
|
+
exports.evaluatePredicate = require_execution_fence.evaluatePredicate;
|
|
110
110
|
exports.forEachSingleStepEntry = require_validate.forEachSingleStepEntry;
|
|
111
111
|
exports.forEachSingleStepEntryWithPath = require_validate.forEachSingleStepEntryWithPath;
|
|
112
|
-
exports.getEntryId =
|
|
113
|
-
exports.getEntryWorkflow =
|
|
114
|
-
exports.getRestartStartIndex =
|
|
115
|
-
exports.getResumeLabelsByStepId =
|
|
116
|
-
exports.getSingleStepEntryId =
|
|
117
|
-
exports.getStepIds =
|
|
112
|
+
exports.getEntryId = require_execution_fence.getEntryId;
|
|
113
|
+
exports.getEntryWorkflow = require_execution_fence.getEntryWorkflow;
|
|
114
|
+
exports.getRestartStartIndex = require_execution_fence.getRestartStartIndex;
|
|
115
|
+
exports.getResumeLabelsByStepId = require_execution_fence.getResumeLabelsByStepId;
|
|
116
|
+
exports.getSingleStepEntryId = require_execution_fence.getSingleStepEntryId;
|
|
117
|
+
exports.getStepIds = require_execution_fence.getStepIds;
|
|
118
118
|
exports.getStepResult = require_stream.getStepResult;
|
|
119
119
|
exports.getStepResultAsync = require_stream.getStepResultAsync;
|
|
120
120
|
exports.getWorkflowResumeLabel = getWorkflowResumeLabel;
|
|
@@ -123,36 +123,36 @@ exports.getWorkflowStepOutput = getWorkflowStepOutput;
|
|
|
123
123
|
exports.getWorkflowStepPayload = getWorkflowStepPayload;
|
|
124
124
|
exports.getWorkflowSuspendedStep = getWorkflowSuspendedStep;
|
|
125
125
|
exports.getWorkflowSuspendedSteps = getWorkflowSuspendedSteps;
|
|
126
|
-
exports.hydrateSerializedStepErrors =
|
|
126
|
+
exports.hydrateSerializedStepErrors = require_execution_fence.hydrateSerializedStepErrors;
|
|
127
127
|
exports.inferGraphSchemas = require_validate.inferGraphSchemas;
|
|
128
|
-
exports.isEntryFinished =
|
|
129
|
-
exports.isProcessor =
|
|
130
|
-
exports.isSingleStepEntry =
|
|
128
|
+
exports.isEntryFinished = require_execution_fence.isEntryFinished;
|
|
129
|
+
exports.isProcessor = require_execution_fence.isProcessor;
|
|
130
|
+
exports.isSingleStepEntry = require_execution_fence.isSingleStepEntry;
|
|
131
131
|
exports.jsonSchemaToZod = require_validate.jsonSchemaToZod;
|
|
132
|
-
exports.mapVariable =
|
|
133
|
-
exports.omitPriorCompletionFields =
|
|
134
|
-
exports.omitPriorSuspensionFields =
|
|
132
|
+
exports.mapVariable = require_execution_fence.mapVariable;
|
|
133
|
+
exports.omitPriorCompletionFields = require_execution_fence.omitPriorCompletionFields;
|
|
134
|
+
exports.omitPriorSuspensionFields = require_execution_fence.omitPriorSuspensionFields;
|
|
135
135
|
exports.parseMapConfig = require_validate.parseMapConfig;
|
|
136
136
|
exports.predicateSchema = require_predicate_index.predicateSchema;
|
|
137
|
-
exports.predicateToCondition =
|
|
137
|
+
exports.predicateToCondition = require_execution_fence.predicateToCondition;
|
|
138
138
|
exports.rehydrateWorkflow = require_rehydrate.rehydrateWorkflow;
|
|
139
|
-
exports.resolveForeachConcurrency =
|
|
140
|
-
exports.runCountDeprecationMessage =
|
|
139
|
+
exports.resolveForeachConcurrency = require_execution_fence.resolveForeachConcurrency;
|
|
140
|
+
exports.runCountDeprecationMessage = require_execution_fence.runCountDeprecationMessage;
|
|
141
141
|
exports.runScheduleTick = require_scheduler.runScheduleTick;
|
|
142
142
|
exports.schemaCompatibility = require_validate.schemaCompatibility;
|
|
143
|
-
exports.setLongTimeout =
|
|
143
|
+
exports.setLongTimeout = require_execution_fence.setLongTimeout;
|
|
144
144
|
exports.toJsonSchemaOrUndefined = require_validate.toJsonSchemaOrUndefined;
|
|
145
145
|
exports.toStorableGraph = require_rehydrate.toStorableGraph;
|
|
146
146
|
exports.validateCron = require_schedules.validateCron;
|
|
147
147
|
exports.validateDynamicWorkflow = require_validate.validateDynamicWorkflow;
|
|
148
|
-
exports.validateStepInput =
|
|
149
|
-
exports.validateStepRequestContext =
|
|
150
|
-
exports.validateStepResumeData =
|
|
151
|
-
exports.validateStepStateData =
|
|
152
|
-
exports.validateStepSuspendData =
|
|
148
|
+
exports.validateStepInput = require_execution_fence.validateStepInput;
|
|
149
|
+
exports.validateStepRequestContext = require_execution_fence.validateStepRequestContext;
|
|
150
|
+
exports.validateStepResumeData = require_execution_fence.validateStepResumeData;
|
|
151
|
+
exports.validateStepStateData = require_execution_fence.validateStepStateData;
|
|
152
|
+
exports.validateStepSuspendData = require_execution_fence.validateStepSuspendData;
|
|
153
153
|
exports.validateStorableJsonSchema = require_validate.validateStorableJsonSchema;
|
|
154
154
|
exports.validateWorkflowRefs = require_validate.validateWorkflowRefs;
|
|
155
155
|
exports.validateWorkflowSchemas = require_validate.validateWorkflowSchemas;
|
|
156
156
|
exports.validateWorkflowStructure = require_validate.validateWorkflowStructure;
|
|
157
|
-
exports.waitForSuspendedSnapshot =
|
|
158
|
-
exports.workflowTermination =
|
|
157
|
+
exports.waitForSuspendedSnapshot = require_execution_fence.waitForSuspendedSnapshot;
|
|
158
|
+
exports.workflowTermination = require_execution_fence.workflowTermination;
|
package/dist/workflows/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Ot as getStepResult, kt as getStepResultAsync } from "../stream-
|
|
1
|
+
import { Al as validateStepRequestContext, Cl as isSingleStepEntry, Dl as runCountDeprecationMessage, Ds as createEventedWorkflow, El as resolveForeachConcurrency, Es as cloneWorkflow, Fc as isProcessor, Fl as getEntryId, Ic as mapVariable, Il as getEntryWorkflow, Lc as predicateToCondition, Ls as computeScheduleDefinitionHash, Mc as Workflow, Ml as validateStepStateData, Nc as cloneStep, Nl as validateStepSuspendData, Ol as setLongTimeout, Os as createWorkflow, Pc as createStep, Pl as waitForSuspendedSnapshot, Qc as ExecutionEngine, Rc as evaluatePredicate, Sl as isEntryFinished, Tl as omitPriorSuspensionFields, Wc as DefaultExecutionEngine, _l as getRestartStartIndex, al as createStepFromTool, bl as getStepIds, cl as abortableSleep, dl as cleanStepResult, fl as createDeprecationProxy, gl as defineStateAccessors, hl as defineLazyWriter, il as createStepFromClassifier, jc as Run, jl as validateStepResumeData, kl as validateStepInput, ll as applyStateDelta, ml as createTimeTravelExecutionParams, nl as createMappingStep, ol as RESUME_SNAPSHOT_POLL_INTERVAL_MS, pl as createRestartExecutionParams, rl as createStepFromAgent, sl as RESUME_SNAPSHOT_WAIT_STATUSES, ul as assertTimeTravelGraphMatchesSnapshot, vl as getResumeLabelsByStepId, wl as omitPriorCompletionFields, xl as hydrateSerializedStepErrors, yl as getSingleStepEntryId, zl as workflowTermination } from "../execution-fence-B8yV_n51.js";
|
|
2
|
+
import { Ot as getStepResult, kt as getStepResultAsync } from "../stream-BFhCDJvz.js";
|
|
3
3
|
import { derivePredicateLabel, predicateSchema } from "../predicate/index.js";
|
|
4
4
|
import { _ as validateCron, h as computeNextFireAt } from "../schedules-DZfSx-7P.js";
|
|
5
5
|
import { i as runScheduleTick, n as WorkflowScheduler, r as claimScheduleFire, t as Scheduler } from "../scheduler-0ShtMM1I.js";
|
|
6
|
-
import { a as jsonSchemaToZod, c as analyzeMapConfig, d as toJsonSchemaOrUndefined, f as validateWorkflowRefs, h as forEachSingleStepEntryWithPath, i as validateWorkflowSchemas, l as parseMapConfig, m as forEachSingleStepEntry, n as validateDynamicWorkflow, o as validateStorableJsonSchema, p as collectNestedWorkflowIds, r as validateWorkflowStructure, s as inferGraphSchemas, t as assertValidDynamicWorkflow, u as schemaCompatibility } from "../validate-
|
|
7
|
-
import { n as entryOptionFields, r as toStorableGraph, t as rehydrateWorkflow } from "../rehydrate-
|
|
6
|
+
import { a as jsonSchemaToZod, c as analyzeMapConfig, d as toJsonSchemaOrUndefined, f as validateWorkflowRefs, h as forEachSingleStepEntryWithPath, i as validateWorkflowSchemas, l as parseMapConfig, m as forEachSingleStepEntry, n as validateDynamicWorkflow, o as validateStorableJsonSchema, p as collectNestedWorkflowIds, r as validateWorkflowStructure, s as inferGraphSchemas, t as assertValidDynamicWorkflow, u as schemaCompatibility } from "../validate-KIBMWuyc.js";
|
|
7
|
+
import { n as entryOptionFields, r as toStorableGraph, t as rehydrateWorkflow } from "../rehydrate-Da4_E_N8.js";
|
|
8
8
|
// src/workflows/state-reader.ts
|
|
9
9
|
const getStep = (state, stepId) => state.steps?.[stepId];
|
|
10
10
|
const getFirstStepResult = (step) => {
|
|
@@ -95,15 +95,30 @@ type StepResultWrite = StateWrite & {
|
|
|
95
95
|
startGuard?: WorkflowStepStartGuard;
|
|
96
96
|
/** The store rejects the write unless this delivery owns the running step (not on v2's `mergeStepResult`). */
|
|
97
97
|
completionGuard?: WorkflowStepCompletionGuard;
|
|
98
|
+
/**
|
|
99
|
+
* An `updateHeader` to make once the step is written (not on `mergeStepResult`). v2 makes it in
|
|
100
|
+
* the same store write where the store supports it; v1, and v2 on other stores, make the two
|
|
101
|
+
* calls. A write the store rejects by throwing (a guard, the fence) makes neither. When the step
|
|
102
|
+
* write finds no stored run, the one-write path writes nothing, and the two-call paths still make
|
|
103
|
+
* the `updateHeader`, which finds no run either.
|
|
104
|
+
*/
|
|
105
|
+
headerPatch?: UpdateWorkflowStateOptions;
|
|
98
106
|
};
|
|
99
107
|
/**
|
|
100
108
|
* After a step write: v1 returns every step's result, v2 the written step's (merged, for
|
|
101
109
|
* `mergeStepResult`) and the run's `lastSeq`. `results` is `{}` when the run isn't stored; the
|
|
102
|
-
* whole result is undefined without a store.
|
|
110
|
+
* whole result is undefined without a store. With `headerPatch`, `header` says whether the patch was
|
|
111
|
+
* applied and holds the run's header as stored after it (null when the run isn't stored).
|
|
103
112
|
*/
|
|
104
113
|
type StepWriteResult = {
|
|
105
114
|
results: StepResults;
|
|
106
115
|
seq?: number;
|
|
116
|
+
header?: HeaderPatchResult;
|
|
117
|
+
};
|
|
118
|
+
/** @internal */
|
|
119
|
+
export type HeaderPatchResult = {
|
|
120
|
+
applied: boolean;
|
|
121
|
+
stored: WorkflowRunHeader | null;
|
|
107
122
|
};
|
|
108
123
|
type RunStorageArgs = {
|
|
109
124
|
workflowName: string;
|
|
@@ -352,6 +352,16 @@ export interface WorkflowRunState {
|
|
|
352
352
|
* the same run id is kept.
|
|
353
353
|
*/
|
|
354
354
|
guardedOnlySnapshotId?: string;
|
|
355
|
+
/**
|
|
356
|
+
* @internal Every resume or time travel event the evented start handler applied to this run, in
|
|
357
|
+
* order, so a repeated delivery of any of them does not rewrite the run again.
|
|
358
|
+
*/
|
|
359
|
+
appliedTriggerEventIds?: string[];
|
|
360
|
+
/**
|
|
361
|
+
* @internal The occurrence the latest applied event expected on the step it targets. A resume event
|
|
362
|
+
* on storage v2 carries no step results, so a repeated delivery compares the stored step against this.
|
|
363
|
+
*/
|
|
364
|
+
appliedTriggerTargetStartedBy?: string;
|
|
355
365
|
/** Tripwire data when status is 'tripwire' */
|
|
356
366
|
tripwire?: StepTripwireInfo;
|
|
357
367
|
stepExecutionPath?: string[];
|
|
@@ -811,6 +811,7 @@ export declare class Run<TEngineType = DefaultEngineType, TSteps extends Step<st
|
|
|
811
811
|
protected _validateResumeData<TResume>(resumeData: TResume, suspendedStep?: StepWithComponent): Promise<any>;
|
|
812
812
|
protected _validateTimetravelInputData<TInput>(inputData: TInput, step: Step<string, any, TInput, any, any, any, TEngineType, any>): Promise<TInput>;
|
|
813
813
|
protected _resolveTimetravelInputData(inputData: unknown, steps: string[]): Promise<any>;
|
|
814
|
+
protected _resolveTimetravelSnapshotState(_snapshot: WorkflowRunState): Record<string, unknown> | undefined;
|
|
814
815
|
protected _start(params: (TInput extends unknown ? {
|
|
815
816
|
inputData?: TInput;
|
|
816
817
|
} : {
|
|
@@ -1019,7 +1020,8 @@ export declare class Run<TEngineType = DefaultEngineType, TSteps extends Step<st
|
|
|
1019
1020
|
runId: string;
|
|
1020
1021
|
}>;
|
|
1021
1022
|
/**
|
|
1022
|
-
* Restarts the workflow execution that was previously active
|
|
1023
|
+
* Restarts the workflow execution that was previously active.
|
|
1024
|
+
* Deprecated for evented workflows on a pubsub that redelivers unacknowledged events, where it logs a warning.
|
|
1023
1025
|
* @returns A promise that resolves to the workflow output
|
|
1024
1026
|
*/
|
|
1025
1027
|
restart(args?: {
|
package/dist/workspace/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_workspace = require("../workspace-
|
|
2
|
+
const require_workspace = require("../workspace-BQD4tcQi.cjs");
|
|
3
3
|
const require_errors = require("../errors-D5kMB1FQ.cjs");
|
|
4
4
|
const require_workspace_skills = require("../workspace-skills-BcquhPDn.cjs");
|
|
5
5
|
exports.CompositeFilesystem = require_workspace.CompositeFilesystem;
|
package/dist/workspace/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as SandboxAbortError, A as deleteFileTool, B as MastraSandbox, C as fileStatTool, E as truncateOutput, F as LocalSandbox, G as supportsComputer, H as UnsupportedStdinCloseError, I as detectIsolation, J as MountManager, K as supportsNetworking, L as getRecommendedIsolation, M as requireFilesystem, N as requireSandbox, P as requireWorkspace, Q as MountNotSupportedError, R as isIsolationAvailable, S as indexContentTool, T as DEFAULT_TAIL_LINES, U as MAX_SANDBOX_FILE_MODE, V as ProcessHandle, W as assertModesUnsupported, X as IsolationUnavailableError, Y as FilesystemNotMountableError, Z as MountError, _ as writeFileTool, a as describeFactorySandbox, b as mkdirTool, c as Workspace, ct as MastraFilesystem, d as collectSkillForPublish, dt as WORKSPACE_TOOLS, et as SandboxError, f as publishSkillFromSource, ft as WORKSPACE_TOOLS_PREFIX, g as resolveToolConfig, h as createWorkspaceTools, i as FactorySandbox, it as SandboxUnsupportedFeatureError, j as applyPatchTool, k as editFileTool, l as createSkillTools, lt as CompositeFilesystem, m as VersionedSkillSource, n as createRecreateSandboxTool, nt as SandboxNotReadyError, o as isFactorySandbox, p as CompositeVersionedSkillSource, q as validateSandboxFileMode, r as FACTORY_SANDBOX_BRAND, rt as SandboxTimeoutError, s as normalizeFactorySandboxSettings, st as LocalFilesystem, t as RECREATE_SANDBOX_TOOL_ID, tt as SandboxExecutionError, u as formatSkillActivation, ut as callLifecycle, v as searchTool, w as executeCommandTool, x as listFilesTool, y as readFileTool, z as SandboxProcessManager } from "../workspace-
|
|
1
|
+
import { $ as SandboxAbortError, A as deleteFileTool, B as MastraSandbox, C as fileStatTool, E as truncateOutput, F as LocalSandbox, G as supportsComputer, H as UnsupportedStdinCloseError, I as detectIsolation, J as MountManager, K as supportsNetworking, L as getRecommendedIsolation, M as requireFilesystem, N as requireSandbox, P as requireWorkspace, Q as MountNotSupportedError, R as isIsolationAvailable, S as indexContentTool, T as DEFAULT_TAIL_LINES, U as MAX_SANDBOX_FILE_MODE, V as ProcessHandle, W as assertModesUnsupported, X as IsolationUnavailableError, Y as FilesystemNotMountableError, Z as MountError, _ as writeFileTool, a as describeFactorySandbox, b as mkdirTool, c as Workspace, ct as MastraFilesystem, d as collectSkillForPublish, dt as WORKSPACE_TOOLS, et as SandboxError, f as publishSkillFromSource, ft as WORKSPACE_TOOLS_PREFIX, g as resolveToolConfig, h as createWorkspaceTools, i as FactorySandbox, it as SandboxUnsupportedFeatureError, j as applyPatchTool, k as editFileTool, l as createSkillTools, lt as CompositeFilesystem, m as VersionedSkillSource, n as createRecreateSandboxTool, nt as SandboxNotReadyError, o as isFactorySandbox, p as CompositeVersionedSkillSource, q as validateSandboxFileMode, r as FACTORY_SANDBOX_BRAND, rt as SandboxTimeoutError, s as normalizeFactorySandboxSettings, st as LocalFilesystem, t as RECREATE_SANDBOX_TOOL_ID, tt as SandboxExecutionError, u as formatSkillActivation, ut as callLifecycle, v as searchTool, w as executeCommandTool, x as listFilesTool, y as readFileTool, z as SandboxProcessManager } from "../workspace-sqcfdZRR.js";
|
|
2
2
|
import { _ as WorkspaceError, a as FileReadRequiredError, b as WorkspaceReadOnlyError, c as FilesystemNotReadyError, d as PermissionError, f as SandboxFeatureNotSupportedError, g as UnsupportedGrepPatternError, h as StaleFileError, i as FileNotFoundError, l as IsDirectoryError, m as SearchNotAvailableError, n as DirectoryNotFoundError, o as FilesystemError, p as SandboxNotAvailableError, r as FileExistsError, s as FilesystemNotAvailableError, t as DirectoryNotEmptyError, u as NotDirectoryError, v as WorkspaceNotAvailableError, y as WorkspaceNotReadyError } from "../errors-CzFYpCHw.js";
|
|
3
3
|
import { b as getMimeType, f as createGlobMatcher, h as matchGlob, l as LocalSkillSource, m as isGlobPattern, p as extractGlobBase } from "../workspace-skills-38OY32_b.js";
|
|
4
4
|
export { CompositeFilesystem, CompositeVersionedSkillSource, DEFAULT_TAIL_LINES, DirectoryNotEmptyError, DirectoryNotFoundError, FACTORY_SANDBOX_BRAND, FactorySandbox, FileExistsError, FileNotFoundError, FileReadRequiredError, FilesystemError, FilesystemNotAvailableError, FilesystemNotMountableError, FilesystemNotReadyError, IsDirectoryError, IsolationUnavailableError, LocalFilesystem, LocalSandbox, LocalSkillSource, MAX_SANDBOX_FILE_MODE, MastraFilesystem, MastraSandbox, MountError, MountManager, MountNotSupportedError, NotDirectoryError, PermissionError, ProcessHandle, RECREATE_SANDBOX_TOOL_ID, SandboxAbortError, SandboxError, SandboxExecutionError, SandboxFeatureNotSupportedError, SandboxNotAvailableError, SandboxNotReadyError, SandboxProcessManager, SandboxTimeoutError, SandboxUnsupportedFeatureError, SearchNotAvailableError, StaleFileError, UnsupportedGrepPatternError, UnsupportedStdinCloseError, VersionedSkillSource, WORKSPACE_TOOLS, WORKSPACE_TOOLS_PREFIX, Workspace, WorkspaceError, WorkspaceNotAvailableError, WorkspaceNotReadyError, WorkspaceReadOnlyError, applyPatchTool, assertModesUnsupported, callLifecycle, collectSkillForPublish, createGlobMatcher, createRecreateSandboxTool, createSkillTools, createWorkspaceTools, deleteFileTool, describeFactorySandbox, detectIsolation, editFileTool, executeCommandTool, extractGlobBase, fileStatTool, formatSkillActivation, getMimeType, getRecommendedIsolation, indexContentTool, isFactorySandbox, isGlobPattern, isIsolationAvailable, listFilesTool, matchGlob, mkdirTool, normalizeFactorySandboxSettings, publishSkillFromSource, readFileTool, requireFilesystem, requireSandbox, requireWorkspace, resolveToolConfig, searchTool, supportsComputer, supportsNetworking, truncateOutput, validateSandboxFileMode, writeFileTool };
|
|
@@ -4,15 +4,15 @@ const require_errors = require("./errors-D5kMB1FQ.cjs");
|
|
|
4
4
|
const require_workspace_skills = require("./workspace-skills-BcquhPDn.cjs");
|
|
5
5
|
const require_base = require("./base-BIzR1D3_.cjs");
|
|
6
6
|
const require_logger = require("./logger-CvzZYuJd.cjs");
|
|
7
|
-
const require_tool = require("./tool-
|
|
7
|
+
const require_tool = require("./tool-Dn9WSDVn.cjs");
|
|
8
8
|
require("./utils-D-eNsgDM.cjs");
|
|
9
9
|
let stream = require("stream");
|
|
10
10
|
let zod_v4 = require("zod/v4");
|
|
11
11
|
let crypto = require("crypto");
|
|
12
|
-
let fs = require("fs");
|
|
13
|
-
let module$1 = require("module");
|
|
14
12
|
let os = require("os");
|
|
15
13
|
os = require_rolldown_runtime.__toESM(os, 1);
|
|
14
|
+
let fs = require("fs");
|
|
15
|
+
let module$1 = require("module");
|
|
16
16
|
let path = require("path");
|
|
17
17
|
path = require_rolldown_runtime.__toESM(path, 1);
|
|
18
18
|
let fs_promises = require("fs/promises");
|
|
@@ -4,14 +4,14 @@ import { t as MastraBase } from "./base-CKLWBhDo.js";
|
|
|
4
4
|
import { a as RegisteredLogger } from "./logger-BwbmRqfc.js";
|
|
5
5
|
import { u as RequestContext } from "./request-context-COnZHt2-.js";
|
|
6
6
|
import { standardSchemaToJSONSchema, toStandardSchema } from "./schema/index.js";
|
|
7
|
-
import { r as createTool, s as isValidationError } from "./tool-
|
|
7
|
+
import { r as createTool, s as isValidationError } from "./tool-DIFduuTw.js";
|
|
8
8
|
import "./utils-DU_pU5SK.js";
|
|
9
9
|
import { createRequire } from "module";
|
|
10
10
|
import { Readable, Writable } from "stream";
|
|
11
11
|
import { z } from "zod/v4";
|
|
12
12
|
import { createHash } from "crypto";
|
|
13
|
-
import { constants, existsSync, lstatSync, readFileSync, readlinkSync, realpathSync } from "fs";
|
|
14
13
|
import os, * as os$1 from "os";
|
|
14
|
+
import { constants, existsSync, lstatSync, readFileSync, readlinkSync, realpathSync } from "fs";
|
|
15
15
|
import * as nodePath from "path";
|
|
16
16
|
import path, { dirname, join, parse, posix } from "path";
|
|
17
17
|
import fs$1, * as fs$2 from "fs/promises";
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/core",
|
|
3
|
-
"version": "1.87.0-alpha.
|
|
3
|
+
"version": "1.87.0-alpha.19",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
|
+
"skills",
|
|
10
11
|
"!dist/**/*.d.*ts.map",
|
|
11
12
|
"./**/*.d.ts"
|
|
12
13
|
],
|
|
@@ -924,7 +925,7 @@
|
|
|
924
925
|
"ws": "^8.23.0",
|
|
925
926
|
"xxhash-wasm": "^1.1.0",
|
|
926
927
|
"yaml": "^2.9.1",
|
|
927
|
-
"@mastra/schema-compat": "1.4.
|
|
928
|
+
"@mastra/schema-compat": "1.4.2-alpha.0"
|
|
928
929
|
},
|
|
929
930
|
"peerDependencies": {
|
|
930
931
|
"@json-render/chat": "^0.22.0",
|
|
@@ -988,17 +989,17 @@
|
|
|
988
989
|
"zod-v3": "npm:zod@3.25.76",
|
|
989
990
|
"@internal/ai-sdk-v4": "0.0.99",
|
|
990
991
|
"@internal/ai-sdk-v5": "0.0.99",
|
|
991
|
-
"@internal/ai-v6": "0.0.99",
|
|
992
992
|
"@internal/auth": "0.0.40",
|
|
993
993
|
"@internal/core": "0.1.4",
|
|
994
|
+
"@internal/ai-v6": "0.0.99",
|
|
994
995
|
"@internal/deployer": "0.0.5",
|
|
995
996
|
"@internal/external-types": "0.0.102",
|
|
996
997
|
"@internal/lint": "0.0.152",
|
|
997
998
|
"@internal/llm-recorder": "0.0.88",
|
|
998
|
-
"@internal/types-builder": "0.0.127",
|
|
999
999
|
"@internal/test-utils": "0.0.88",
|
|
1000
|
-
"@internal/
|
|
1001
|
-
"@internal/ai-v7": "0.0.99"
|
|
1000
|
+
"@internal/types-builder": "0.0.127",
|
|
1001
|
+
"@internal/ai-v7": "0.0.99",
|
|
1002
|
+
"@internal/voice": "0.0.48"
|
|
1002
1003
|
},
|
|
1003
1004
|
"engines": {
|
|
1004
1005
|
"node": ">=22.13.0"
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mastra
|
|
3
|
+
description: "Comprehensive Mastra framework guide for building agents, workflows, tools, memory, workspaces, and storage with current APIs. Use for native capability discovery, logging, tracing, metrics/cost estimates, dataset experiments, documentation lookup, API verification, TypeScript setup, common errors, migrations, building and deploying apps to Mastra Platform via Platform APIs and `mastra deploy`, Mastra Gateway model setup, and `mastra api` CLI tasks: inspect or call resources on local, Mastra platform, or remote servers. For Mastra Factory operations, discover and activate the companion mastra-factory skill. Also report verified bugs and concrete documentation defects to the Mastra team automatically via the feedback endpoint."
|
|
4
|
+
license: Apache-2.0
|
|
5
|
+
metadata:
|
|
6
|
+
author: Mastra
|
|
7
|
+
version: "2.6.0"
|
|
8
|
+
repository: https://github.com/mastra-ai/skills
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Mastra Framework Guide
|
|
12
|
+
|
|
13
|
+
Build AI applications with Mastra. This skill teaches you how to find current documentation and build agents and workflows.
|
|
14
|
+
|
|
15
|
+
## Critical: Do not trust internal knowledge
|
|
16
|
+
|
|
17
|
+
Everything you know about Mastra is likely outdated or wrong. Never rely on memory. Always verify against current documentation.
|
|
18
|
+
|
|
19
|
+
Your training data contains obsolete APIs, deprecated patterns, and incorrect usage. Mastra evolves rapidly - APIs change between versions, constructor signatures shift, and patterns get refactored.
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
Before writing any Mastra code, check if packages are installed:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
ls node_modules/@mastra/
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- If packages exist: Use embedded docs first (most reliable)
|
|
30
|
+
- If no packages: Install first or use remote docs
|
|
31
|
+
|
|
32
|
+
## Resources
|
|
33
|
+
|
|
34
|
+
### References
|
|
35
|
+
|
|
36
|
+
| User Question | First Check | How To |
|
|
37
|
+
| ----------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------- |
|
|
38
|
+
| Create/install Mastra project | [`references/create-mastra.md`](references/create-mastra.md) | Setup guide with CLI and manual steps |
|
|
39
|
+
| Choose Agent/Workflow/Tool/Memory/Storage | [`references/core-concepts.md`](references/core-concepts.md) | Core concepts and when to use each primitive |
|
|
40
|
+
| Add logging or set up tracing | [`references/embedded-docs.md`](references/embedded-docs.md) | Look up PinoLogger and observability configuration before custom instrumentation |
|
|
41
|
+
| Track automatic metrics or estimated model cost | [`references/embedded-docs.md`](references/embedded-docs.md) | Look up span-derived metrics, storage support, and pricing coverage |
|
|
42
|
+
| Evaluate quality or compare prompts/models | [`references/embedded-docs.md`](references/embedded-docs.md) | Look up datasets, experiments, and scorers |
|
|
43
|
+
| How do I use Agent/Workflow/Tool? | [`references/embedded-docs.md`](references/embedded-docs.md) | Look up in `node_modules/@mastra/*/dist/docs/` |
|
|
44
|
+
| How do I use X? (no packages) | [`references/remote-docs.md`](references/remote-docs.md) | Fetch from `https://mastra.ai/llms.txt` |
|
|
45
|
+
| Choose or validate a model | [`references/model-selection.md`](references/model-selection.md) | Model format and provider registry lookup |
|
|
46
|
+
| Call models from several providers with one key, add provider failover, or track model spend | [`references/gateway.md`](references/gateway.md) | Mastra Gateway setup and `mastra/` model IDs |
|
|
47
|
+
| I'm getting an error... | [`references/common-errors.md`](references/common-errors.md) | Common errors and solutions |
|
|
48
|
+
| Upgrade from v0.x to v1.x | [`references/migration-guide.md`](references/migration-guide.md) | Version upgrade workflows |
|
|
49
|
+
| Inspect/call server resources via CLI | [`references/mastra-api.md`](references/mastra-api.md) | `mastra api` CLI for local, Mastra platform, or remote servers |
|
|
50
|
+
| Deploy to Mastra Platform, provision projects, or use Platform sandbox/filesystem | [`references/platform.md`](references/platform.md) | Platform REST APIs, credentials, and `mastra deploy` without browser automation |
|
|
51
|
+
| Find exact traces with complex predicates | [`references/trace-query.md`](references/trace-query.md) | Query completed traces by trace fields or related spans |
|
|
52
|
+
| Count traces or compute grouped measures (error rate, latency, tokens, cost) | [`references/trace-query.md`](references/trace-query.md#aggregate-traces) | Aggregate completed traces with `mastra api trace aggregate` over the same selection |
|
|
53
|
+
| List individual spans (failed tool calls, nested agent runs) | [`references/trace-query.md`](references/trace-query.md#query-spans) | Query completed spans with `mastra api span query` and span-field predicates |
|
|
54
|
+
| Compute measures per span (tool error rates, nested agent runs, model tokens) | [`references/trace-query.md`](references/trace-query.md#aggregate-spans) | Aggregate spans with `mastra api span aggregate`, grouped by span fields |
|
|
55
|
+
| Report a bug / documentation defect to Mastra | [`references/feedback.md`](references/feedback.md) | Report eligible findings autonomously to the Mastra team |
|
|
56
|
+
|
|
57
|
+
### Scripts
|
|
58
|
+
|
|
59
|
+
- `scripts/provider-registry.mjs`: Look up current providers and models available in the model router. Always run this before using a model to verify provider keys and model names. Use `--provider mastra` for the live Mastra Gateway catalog.
|
|
60
|
+
|
|
61
|
+
## Priority order for writing code
|
|
62
|
+
|
|
63
|
+
Never write code without checking current docs first.
|
|
64
|
+
|
|
65
|
+
1. Embedded docs first (if packages installed)
|
|
66
|
+
|
|
67
|
+
Look up current docs in `node_modules` for a package. This matches the exact installed version and is the most reliable source of truth. See [`references/embedded-docs.md`](references/embedded-docs.md).
|
|
68
|
+
|
|
69
|
+
2. Source code second (if packages installed)
|
|
70
|
+
|
|
71
|
+
If embedded docs don't cover the question, inspect the installed source and type definitions. This is the source of truth when docs are missing or unclear. See [`references/embedded-docs.md`](references/embedded-docs.md).
|
|
72
|
+
|
|
73
|
+
3. Remote docs third (if packages not installed)
|
|
74
|
+
|
|
75
|
+
Use the latest published docs when packages are not installed or when exploring new features. Remote docs may be ahead of the user's installed version. See [`references/remote-docs.md`](references/remote-docs.md).
|
|
76
|
+
|
|
77
|
+
## Core concepts
|
|
78
|
+
|
|
79
|
+
Use [`references/core-concepts.md`](references/core-concepts.md) when choosing between agents, workflows, tools, memory, and storage.
|
|
80
|
+
|
|
81
|
+
- Agent: Use for open-ended tasks that make decisions and use tools.
|
|
82
|
+
- Workflow: Use for defined multi-step processes.
|
|
83
|
+
|
|
84
|
+
## Mastra Studio
|
|
85
|
+
|
|
86
|
+
Studio is the interactive UI for building, testing, and managing agents, workflows, and tools. Use Studio when advising a human to inspect or debug visually.
|
|
87
|
+
|
|
88
|
+
Inside a Mastra project, run:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npm run dev
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Then open `http://localhost:4111` in a browser to show Mastra Studio to your human user.
|
|
95
|
+
|
|
96
|
+
## Mastra API CLI
|
|
97
|
+
|
|
98
|
+
Use `mastra api` to inspect or call resources on local dev servers, Mastra platform deployments, or remote Mastra endpoints. It is useful for agent-readable state, execution, traces, logs, scores, threads, and workflow operations. See [`references/mastra-api.md`](references/mastra-api.md) for usage patterns.
|
|
99
|
+
|
|
100
|
+
For exact trace selection that needs recursive predicates or conditions over related spans, read [`references/trace-query.md`](references/trace-query.md). Before using `mastra api trace query`, confirm that the installed CLI exposes the command. Use `--schema` for the target's request/response shape and structural constraints, and use the canonical documentation found through [`references/remote-docs.md`](references/remote-docs.md) for supported fields, operators, and semantics. Preserve opaque pagination cursors and fetch trace or span details only after selecting candidates.
|
|
101
|
+
|
|
102
|
+
## Deploy to Mastra Platform
|
|
103
|
+
|
|
104
|
+
When the user asks to deploy to Mastra, whether to build a new app and deploy it or to deploy an existing Mastra project, read [`references/platform.md`](references/platform.md) before running any deploy or Platform API command. It covers which steps need the human (sign-up and sign-in only), credentials, REST discovery and project creation, `PlatformFilesystem` and `PlatformSandbox`, `mastra deploy`, and verification. Build or locate the app first with the references above, then follow `platform.md` to deploy.
|
|
105
|
+
|
|
106
|
+
## Mastra Factory
|
|
107
|
+
|
|
108
|
+
For Factory projects, work items, queue health, decisions, session history, memory inspection, or authorized operations, activate the **`mastra-factory`** skill. Factory is an operational control plane, not a reason to scaffold or deploy a new Mastra app.
|
|
109
|
+
|
|
110
|
+
If the skill is missing, offer to install it from this repository:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
npx skills add mastra-ai/skills --skill mastra-factory
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Choose the user's intended agent and scope interactively. For global installation, target a supported agent explicitly with `--agent <agent> -g`; PromptScript does not support global installs. Verify installation and referenced files for the intended agent even if another agent target fails.
|
|
117
|
+
|
|
118
|
+
The Factory skill covers CLI checks, `mastra auth whoami` / authorized `mastra auth login`, and connecting via the user's actual instance URL from any directory. A deployed repository or `.mastra-project.json` is not required with `--url`. Never guess a shared Factory host or project IDs. Its connection and session-inspection references cover deployment-specific authentication, project discovery, threads, and observational memory limitations.
|
|
119
|
+
|
|
120
|
+
## Reporting feedback
|
|
121
|
+
|
|
122
|
+
Report verified Mastra bugs and concrete documentation defects autonomously when the criteria in [`references/feedback.md`](references/feedback.md) are met, without asking permission per report. Leave feature requests to humans; do not submit them or reclassify them as defects. Do not report the same issue again within the current task or conversation. Capture only anonymized facts for feedback while solving the task. Skip automatic reporting when a finding remains unverified or its relevance is unclear; do not interrupt the user merely to classify it. Respect any user instruction not to report something.
|
|
123
|
+
|
|
124
|
+
## Critical requirements
|
|
125
|
+
|
|
126
|
+
### TypeScript config
|
|
127
|
+
|
|
128
|
+
Mastra requires ES2022 modules. CommonJS will fail. See [`references/create-mastra.md`](references/create-mastra.md) for setup and [`references/common-errors.md`](references/common-errors.md) for troubleshooting.
|
|
129
|
+
|
|
130
|
+
### Model format
|
|
131
|
+
|
|
132
|
+
Always use `"provider/model-name"` when defining models using Mastra's model router.
|
|
133
|
+
|
|
134
|
+
When the user asks to use a model or provider, always run `scripts/provider-registry.mjs` first to verify the provider key and model name are valid. Do not guess model names from memory as they change frequently. See [`references/model-selection.md`](references/model-selection.md).
|
|
135
|
+
|
|
136
|
+
Mastra Gateway is a managed model API. With one Gateway key and a `mastra/<provider>/<model>` ID it gives:
|
|
137
|
+
|
|
138
|
+
- Models from OpenAI, Anthropic, Google, and other providers without separate provider keys
|
|
139
|
+
- Failover: eligible failures retry on another route before any output reaches the client
|
|
140
|
+
- Recorded attempts and cost for every request, and keys limited to specific models
|
|
141
|
+
- Web search for tool-capable chat models
|
|
142
|
+
|
|
143
|
+
For setup, see [`references/gateway.md`](references/gateway.md), and validate Gateway model IDs with `scripts/provider-registry.mjs --provider mastra`.
|
|
144
|
+
|
|
145
|
+
## When you see errors
|
|
146
|
+
|
|
147
|
+
Type errors often mean your knowledge is outdated.
|
|
148
|
+
|
|
149
|
+
Common signs of outdated knowledge:
|
|
150
|
+
|
|
151
|
+
- `Property X does not exist on type Y`
|
|
152
|
+
- `Cannot find module`
|
|
153
|
+
- `Type mismatch` errors
|
|
154
|
+
- Constructor parameter errors
|
|
155
|
+
|
|
156
|
+
What to do:
|
|
157
|
+
|
|
158
|
+
1. Check [`references/common-errors.md`](references/common-errors.md)
|
|
159
|
+
2. Verify current API in embedded docs
|
|
160
|
+
3. Don't assume the error is a user mistake - it might be your outdated knowledge
|
|
161
|
+
|
|
162
|
+
## Development workflow
|
|
163
|
+
|
|
164
|
+
Always verify before writing code:
|
|
165
|
+
|
|
166
|
+
1. Identify whether Mastra already provides the requested behavior using [`references/core-concepts.md`](references/core-concepts.md#discover-native-capabilities-first), before designing custom infrastructure.
|
|
167
|
+
2. Check installed packages and versions, then verify the capability's APIs, configuration, and limits.
|
|
168
|
+
- If installed: Use embedded docs [`references/embedded-docs.md`](references/embedded-docs.md) and installed types/source.
|
|
169
|
+
- If not: Use remote docs [`references/remote-docs.md`](references/remote-docs.md); verify compatibility before adopting newer features.
|
|
170
|
+
3. Use the native capability where it fits; implement custom logic only for the identified gap or application-owned requirements.
|
|
171
|
+
4. Test with the project scripts or Studio when available.
|