@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
|
@@ -117,6 +117,8 @@ export const mastra = new Mastra({
|
|
|
117
117
|
})
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
+
This Mastra instance uses in-memory storage, so you'll see a warning when it starts and data is lost on restart. To keep data, configure a [persistent storage adapter](https://mastra.ai/docs/storage).
|
|
121
|
+
|
|
120
122
|
You're now able to run the agent directly. For this, import the Mastra instance and call the agent.generate() after retrieving the agent by its id. Node.js 22.18.0 and later are able to run TypeScript files directly. Ensure you add file extensions when importing local files. Example:
|
|
121
123
|
|
|
122
124
|
```ts
|
|
@@ -125,9 +127,14 @@ import { mastra } from './src/mastra/index.ts'
|
|
|
125
127
|
|
|
126
128
|
const agent = mastra.getAgentById('weather-agent')
|
|
127
129
|
const response = await agent.generate('Weather in SF')
|
|
130
|
+
// The agent's final answer
|
|
128
131
|
console.log(response.text)
|
|
132
|
+
// Names of the tools the agent called in this run, as keys of the agent's tools object
|
|
133
|
+
console.log(response.toolCalls.map(call => call.payload.toolName))
|
|
129
134
|
```
|
|
130
135
|
|
|
136
|
+
The last `console.log` prints `[ 'weatherTool' ]` when the agent called the tool once, with one entry per call. To log every tool call that runs, including failed ones, add an [`afterToolCall` hook](https://mastra.ai/docs/agents/tools) to the agent. Calls that a `beforeToolCall` hook blocks never run, so they aren't logged, and provider-executed tools such as web search don't trigger the hook.
|
|
137
|
+
|
|
131
138
|
## When to use agents
|
|
132
139
|
|
|
133
140
|
Use agents when the task is open-ended and the steps aren't known in advance. An agent decides which tools to call, how many times to loop, and when to stop. You provide the goal and constraints instead of defining each step. For predetermined, multi-step processes with explicit control flow, use [workflows](https://mastra.ai/docs/workflows/overview) instead.
|
|
@@ -162,6 +169,8 @@ export const mastra = new Mastra({
|
|
|
162
169
|
})
|
|
163
170
|
```
|
|
164
171
|
|
|
172
|
+
This Mastra instance uses in-memory storage, so you'll see a warning when it starts and data is lost on restart. To keep data, configure a [persistent storage adapter](https://mastra.ai/docs/storage).
|
|
173
|
+
|
|
165
174
|
Once registered, it can be called from workflows, tools, or other agents, and has access to shared resources such as memory, logging, and observability features.
|
|
166
175
|
|
|
167
176
|
Visit the [agent reference](https://mastra.ai/reference/agents/agent) for more information on available properties and configurations.
|
|
@@ -396,7 +396,7 @@ Worker build artifacts expose `GET /health` on `PORT`, or port `4111` when `PORT
|
|
|
396
396
|
|
|
397
397
|
A distributed PubSub backend persists unacknowledged events, which lets orchestration and background task workers resume after a restart. When the API is unavailable, a failed step-execution request causes the event to be delivered again.
|
|
398
398
|
|
|
399
|
-
When a worker stops during an evented workflow step, the broker redelivers the step's event to another worker after `reclaimIdleMs` (60 seconds by default) with Redis or Valkey Streams, or after the ack deadline with Google Cloud Pub/Sub, so instances that boot meanwhile don't restart the run.
|
|
399
|
+
When a worker stops during an evented workflow step, the broker redelivers the step's event to another worker after `reclaimIdleMs` (60 seconds by default) with Redis or Valkey Streams, or after the ack deadline with Google Cloud Pub/Sub, so instances that boot meanwhile don't restart the run.
|
|
400
400
|
|
|
401
401
|
A step can run more than once. If a worker stops during a step, or after the step finishes but before it publishes the result, the step runs again when its event is redelivered. Make steps with side effects idempotent. See [restarting active workflow runs](https://mastra.ai/docs/workflows/overview) for how to build an idempotency key for a step, and [make tools safe to repeat](https://mastra.ai/docs/harness/durable-agents) for agent tools.
|
|
402
402
|
|
|
@@ -335,12 +335,14 @@ Which layer to use depends on where consistency matters: subagent-level configur
|
|
|
335
335
|
|
|
336
336
|
A background task can pause itself mid-execution and wait for an external signal before continuing. This is useful for human approvals, webhooks, or any flow where the next step depends on data that arrives later.
|
|
337
337
|
|
|
338
|
-
A tool calls `suspend(data)` from inside its `execute
|
|
338
|
+
A tool calls `suspend(data)` from inside its `execute`. Once `execute` returns, Mastra:
|
|
339
339
|
|
|
340
|
-
- Persists `status: 'suspended'` and the `data` payload on the task record.
|
|
341
340
|
- Saves the workflow snapshot so the run survives process restarts.
|
|
342
|
-
-
|
|
341
|
+
- Persists `status: 'suspended'` and the `data` payload on the task record.
|
|
343
342
|
- Releases the concurrency slot so other tasks can run.
|
|
343
|
+
- Emits a `background-task-suspended` chunk on the manager stream.
|
|
344
|
+
|
|
345
|
+
The task is stored as `suspended` only after its snapshot is saved, so a task stored as `suspended` can always be resumed, even after a crash. Until then the task reads as `running`.
|
|
344
346
|
|
|
345
347
|
Resume the task with `mastra.backgroundTaskManager.resume(taskId, resumeData)`. The `resumeData` arrives in the tool's `execute` options on the resumed run, and the task transitions back to `running`.
|
|
346
348
|
|
|
@@ -557,7 +559,7 @@ Before a manager runs a task, it claims the task with a conditional write. The w
|
|
|
557
559
|
|
|
558
560
|
While the task runs, the owner renews the lease every `leaseDurationMs / 3`, with a minimum of one second. Each renewal is conditional on the task still being `running` under the same owner. The task's final writes, such as `completed`, `failed`, `timed_out`, or `suspended`, carry the same condition, so a manager that lost the task can't overwrite the result of the manager that replaced it.
|
|
559
561
|
|
|
560
|
-
The owner stops renewing when the task completes, fails, or suspends. On shutdown, the manager releases the leases it still holds, so other managers can recover those tasks without waiting for the lease to expire. A running task with `maxRetries: 0` can't run again, so shutdown fails it with `Worker process terminated before task completed`, the same ending as a crash, rather than cancelling it. A lease that isn't released, for example because the process crashed, expires on its own.
|
|
562
|
+
The owner stops renewing when the task completes, fails, or suspends. On shutdown, the manager releases the leases it still holds, so other managers can recover those tasks without waiting for the lease to expire. A running task with `maxRetries: 0` can't run again, so shutdown fails it with `Worker process terminated before task completed`, the same ending as a crash, rather than cancelling it. A task whose tool already called `suspend()` is kept instead, so its snapshot can still be saved. Once the tool returns or stops on the abort signal, Mastra saves the snapshot and stores the task as `suspended`, so it can be answered after the restart. If the tool is still running when shutdown ends, nothing is saved and the task is recovered as if its worker crashed. Stale-task recovery uses a retry if one is left and fails the task otherwise, while a redelivered dispatch can run it again even with `maxRetries: 0`. See [Recover a task from a dead owner](#recover-a-task-from-a-dead-owner). A lease that isn't released, for example because the process crashed, expires on its own.
|
|
561
563
|
|
|
562
564
|
### Recover a task from a dead owner
|
|
563
565
|
|
|
@@ -565,6 +567,7 @@ A manager treats a `running` task as abandoned only after its lease expires.
|
|
|
565
567
|
|
|
566
568
|
When `recoverStaleTasksOnStart` is `true`, the default, each manager that runs tasks scans for abandoned tasks on startup. If the scan finds a lease that hasn't expired yet, the manager scans again shortly after that lease expires, and repeats until no live lease is left. After startup, the manager also checks for running tasks with an expired lease every `leaseDurationMs`, so a task whose worker dies later is recovered without a restart. Each check reads up to `globalConcurrency` running tasks (at least 100, at most 1,000), which normally covers all of them, so the task is recovered within about one `leaseDurationMs` after its lease expires. When more tasks are running than that, for example because other servers use a higher `globalConcurrency`, each further page of running tasks adds one `leaseDurationMs`. For each task the scan recovers:
|
|
567
569
|
|
|
570
|
+
- If the task's snapshot already holds a suspension from its current attempt, the task is stored as `suspended` without using a retry, and you can answer it with `resume()`.
|
|
568
571
|
- If the task's worker shut down gracefully, it returns to `pending` and is dispatched again without using a retry.
|
|
569
572
|
- If the worker died and the task's `retryCount` is below `maxRetries`, it uses a retry, returns to `pending`, and is dispatched again.
|
|
570
573
|
- Otherwise, it fails with `Worker process terminated before task completed`. The failure fires `task.failed` and `onTaskFailed` like any other failure.
|
|
@@ -573,7 +576,7 @@ Only a crash counts against `maxRetries`, so a task that keeps taking its worker
|
|
|
573
576
|
|
|
574
577
|
The recovery write is conditional on the owner and lease that the scan read, so only one manager recovers each task.
|
|
575
578
|
|
|
576
|
-
If the pubsub redelivers the unacknowledged dispatch of an abandoned task, the redelivery claims the task once its lease expires and runs it again, even when `maxRetries` is `0`.
|
|
579
|
+
If the pubsub redelivers the unacknowledged dispatch of an abandoned task, the redelivery claims the task once its lease expires and runs it again, even when `maxRetries` is `0`. If the task's snapshot already holds a suspension from its current attempt, the redelivery stores the task as `suspended` instead of running it again.
|
|
577
580
|
|
|
578
581
|
The manager that runs the recovered task needs an executor for it. See the known limitations under [non-agent owners](#non-agent-owners).
|
|
579
582
|
|
|
@@ -453,6 +453,7 @@ A durable or evented agent can run the same tool call more than once. A tool cal
|
|
|
453
453
|
- The process stops while the tool runs, or after the tool returns but before Mastra saves its result. When the run is [recovered](#crash-recovery), the tool runs again.
|
|
454
454
|
- The server shuts down gracefully while the tool runs, and the tool is still running when the [drain timeout](https://mastra.ai/docs/deployment/mastra-server) ends. Mastra discards the tool's result, and recovery runs the tool again. A tool whose result Mastra saves within the drain timeout keeps it.
|
|
455
455
|
- With Postgres or libSQL storage and Redis Streams PubSub, an evented worker stops before it publishes the tool's result. Another worker [reclaims the step](https://mastra.ai/reference/pubsub/redis-streams) and runs the tool again.
|
|
456
|
+
- The PubSub backend delivers an evented agent's tool step again while the tool runs, for example after the event's acknowledgment deadline passes, and the tool runs again with any storage adapter.
|
|
456
457
|
- Recovery takes over a run while the previous execution is still running the tool, for example with [`recover()` and `force: true`](#manual-recovery). Both executions can run the tool concurrently. See [stop work after ownership loss](#stop-work-after-ownership-loss).
|
|
457
458
|
|
|
458
459
|
[Inngest agents](#inngest-powered-with-createinngestagent) configured with `retries` also run an interrupted tool step again.
|
|
@@ -10,7 +10,7 @@ Agents find pages with `knowledge_search`, which matches words out of the box. T
|
|
|
10
10
|
|
|
11
11
|
## How search finds pages
|
|
12
12
|
|
|
13
|
-
`knowledge_search` matches the words in the query against page names, descriptions and bodies, and against note text. A
|
|
13
|
+
`knowledge_search` matches the words in the query against page names, descriptions and bodies, and against note text. A rare word counts for more than a common one. A page or note scores the sum of what its matched words count, and the highest score ranks first. Among equal matches, a word in the name counts for more than one in the description, and a word in the description counts for more than one in the body. Pages and notes share one ranked list, and the limit applies to that list.
|
|
14
14
|
|
|
15
15
|
To help search find a page, put the words people search for in its name and description. For the full ranking order, see [`knowledge_search`](https://mastra.ai/reference/knowledge/knowledge-tools).
|
|
16
16
|
|
|
@@ -163,7 +163,7 @@ export class MyBrokerPubSub extends PubSub {
|
|
|
163
163
|
}
|
|
164
164
|
```
|
|
165
165
|
|
|
166
|
-
Return `true` from `redeliversUnacked` only when the broker redelivers an abandoned event to another consumer of the same group
|
|
166
|
+
Return `true` from `redeliversUnacked` only when the broker redelivers an abandoned event to another consumer of the same group. If your implementation delivers only inside the publishing process, return `false` from `deliversAcrossProcesses` instead. See the [`PubSub` properties](https://mastra.ai/reference/pubsub/base).
|
|
167
167
|
|
|
168
168
|
To disable the warning for a setup that one process uses, set the `MASTRA_DISABLE_EVENTED_SETUP_WARNING` environment variable to `true`.
|
|
169
169
|
|
|
@@ -68,10 +68,13 @@ export const releaseChecklist = createSkill({
|
|
|
68
68
|
references: {
|
|
69
69
|
'changelog-format.md': '# Changelog Format\nUse Keep a Changelog...',
|
|
70
70
|
},
|
|
71
|
+
scripts: {
|
|
72
|
+
'tag-release.sh': '#!/bin/sh\ngit tag "v$1" && git push origin "refs/tags/v$1"',
|
|
73
|
+
},
|
|
71
74
|
})
|
|
72
75
|
```
|
|
73
76
|
|
|
74
|
-
The `references`
|
|
77
|
+
The `references`, `scripts`, and `assets` fields bundle files that the agent can read with the `skill_read` tool, like the `references/`, `scripts/`, and `assets/` directories of a filesystem skill. Inline skills keep these files in memory. A filesystem skill reads its `scripts/` and `assets/` files from disk only when the agent opens them, so put large scripts and binary files there. It reads `references/` when the skill loads, to index them for search. Visit [`createSkill()` reference](https://mastra.ai/reference/agents/createSkill) for the full API.
|
|
75
78
|
|
|
76
79
|
## Filesystem path skills
|
|
77
80
|
|
|
@@ -600,6 +600,8 @@ When a restart takes over a run whose lease lapsed, it logs a warning and double
|
|
|
600
600
|
|
|
601
601
|
Use `restart()` to restart an active workflow run from the last active step. This will resume execution from the last active step, and the workflow will continue from there.
|
|
602
602
|
|
|
603
|
+
On evented workflows with a pubsub that redelivers unacknowledged events, `restart()` is deprecated and logs a warning, because that pubsub redelivers the events of an interrupted run.
|
|
604
|
+
|
|
603
605
|
```typescript
|
|
604
606
|
const run = await workflow.createRun()
|
|
605
607
|
|
|
@@ -101,6 +101,25 @@ const unsubscribe = session.subscribe(send)
|
|
|
101
101
|
|
|
102
102
|
Returns: `AgentControllerEvent[]`
|
|
103
103
|
|
|
104
|
+
### Memory
|
|
105
|
+
|
|
106
|
+
#### `getMemory({ requestContext? }?)`
|
|
107
|
+
|
|
108
|
+
Resolve the current mode agent's effective memory without starting an agent run. Dynamic memory factories receive the session's selected thread, resource, and current settings through the same request context as a turn.
|
|
109
|
+
|
|
110
|
+
Use this method to prepare memory before the first message. Resolve memory again after changing the thread, mode, or memory settings. A memory implementation can perform its own model calls during preparation. `getMemory()` only resolves the instance.
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
const memory = await session.getMemory()
|
|
114
|
+
if (memory) {
|
|
115
|
+
console.log(memory.getMergedThreadConfig())
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**requestContext** (`RequestContext`): Additional context values merged with the session-bound context, as for sendMessage().
|
|
120
|
+
|
|
121
|
+
Returns: `Promise<MastraMemory | undefined>`. Returns `undefined` when the current agent has no memory configured.
|
|
122
|
+
|
|
104
123
|
### Messages and run control
|
|
105
124
|
|
|
106
125
|
#### `sendMessage({ content, files?, requestContext?, author? })`
|
|
@@ -24,10 +24,22 @@ const reviewSkill = createSkill({
|
|
|
24
24
|
`,
|
|
25
25
|
references: {
|
|
26
26
|
'checklist.md': '# Review Checklist\n- No unused imports\n- Error handling present',
|
|
27
|
+
'languages/typescript.md': '# TypeScript\n- No `any` without a comment',
|
|
28
|
+
},
|
|
29
|
+
scripts: {
|
|
30
|
+
'lint.sh': '#!/bin/sh\npnpm lint',
|
|
31
|
+
},
|
|
32
|
+
assets: {
|
|
33
|
+
'badge.svg':
|
|
34
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8"><circle cx="4" cy="4" r="4"/></svg>',
|
|
27
35
|
},
|
|
28
36
|
})
|
|
29
37
|
```
|
|
30
38
|
|
|
39
|
+
The agent reads bundled files with the `skill_read` tool using paths like `references/languages/typescript.md`, `scripts/lint.sh`, or `assets/badge.svg`. Keys containing `/` become nested directories.
|
|
40
|
+
|
|
41
|
+
> **Note:** The skill holds every bundled file in memory for as long as it exists. A [filesystem skill](https://mastra.ai/docs/skills) reads its `scripts/` and `assets/` files from disk only when the agent opens them, so keep large scripts and binary files there. It reads `references/` when the skill loads, to index them for search. To load skills from a database, return them from an async [`skills` resolver](https://mastra.ai/docs/skills), which runs per request.
|
|
42
|
+
|
|
31
43
|
## Parameters
|
|
32
44
|
|
|
33
45
|
**name** (`string`): Unique skill name. Used as the identifier when agents activate the skill. Must be a valid slug (lowercase, hyphens allowed).
|
|
@@ -36,7 +48,11 @@ const reviewSkill = createSkill({
|
|
|
36
48
|
|
|
37
49
|
**instructions** (`string`): The full skill instructions in markdown. Loaded into the conversation when the agent activates the skill.
|
|
38
50
|
|
|
39
|
-
**references** (`Record<string, string>`): Supporting documents the agent can read with the skill_read tool. Keys are
|
|
51
|
+
**references** (`Record<string, string>`): Supporting documents the agent can read with the skill_read tool. Keys are paths inside references/, values are file contents.
|
|
52
|
+
|
|
53
|
+
**scripts** (`Record<string, string>`): Scripts the agent can read with the skill_read tool. Keys are paths inside scripts/, values are file contents.
|
|
54
|
+
|
|
55
|
+
**assets** (`Record<string, string | Uint8Array>`): Templates, images, or other files the agent can read with the skill_read tool. Keys are paths inside assets/. Values can be text or binary. skill_read returns supported images and PDFs up to 10 MiB to the model as media. Other binary files, such as ZIP archives, and media over 10 MiB come back as their path and size only.
|
|
40
56
|
|
|
41
57
|
**license** (`string`): SPDX license identifier for the skill.
|
|
42
58
|
|
|
@@ -54,6 +70,8 @@ Returns an `InlineSkill` object that implements the `Skill` interface:
|
|
|
54
70
|
interface InlineSkill extends Skill {
|
|
55
71
|
__inline: true
|
|
56
72
|
__referenceContents: Record<string, string>
|
|
73
|
+
__scriptContents?: Record<string, string>
|
|
74
|
+
__assetContents?: Record<string, string | Uint8Array>
|
|
57
75
|
}
|
|
58
76
|
```
|
|
59
77
|
|
|
@@ -65,6 +83,7 @@ The skill is assigned a synthetic path of `inline/<name>` (e.g., `inline/code-re
|
|
|
65
83
|
|
|
66
84
|
- `name` is required and must be a valid slug
|
|
67
85
|
- `description` is required
|
|
86
|
+
- Keys in `references`, `scripts`, and `assets` must be relative file paths separated by `/`, without empty, `.`, or `..` segments, and can't start with a drive letter such as `C:`. A key can't also be the directory of another key
|
|
68
87
|
|
|
69
88
|
If validation fails, an `Error` is thrown with details about the invalid fields.
|
|
70
89
|
|
|
@@ -56,8 +56,7 @@ The query is split into words, and quote marks are ignored. Each word matches ca
|
|
|
56
56
|
Keyword results are ranked in this order:
|
|
57
57
|
|
|
58
58
|
1. Pages whose name contains the whole query.
|
|
59
|
-
2. Other pages,
|
|
60
|
-
3. Notes, by how many query words they contain, then newest.
|
|
59
|
+
2. Other pages and notes together, in one list. Each query word counts more the fewer readable pages and notes contain it. A result's score is the sum of the counts of the words it contains. So two common words can outrank one rare word. Ties go to more query words matched, then where the words are (name over description, description over body; a note counts as body), then most recently updated, then pages before notes, then ID.
|
|
61
60
|
|
|
62
61
|
Access checks and `scope` filter results before ranking. `limit` applies after it. With `vector` and `embedder` on the Knowledge instance, keyword and semantic results are merged by rank, so this order no longer holds.
|
|
63
62
|
|
|
@@ -4,12 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
# `MetricsContext`
|
|
6
6
|
|
|
7
|
-
`MetricsContext` emits custom metrics from your code. Tools and
|
|
7
|
+
`MetricsContext` emits custom metrics from your code. Tools, workflow steps, processors, and scorer steps receive it as `metrics`, scoped to the span of the current operation. For code outside a traced operation, `mastra.metrics` returns a `MetricsContext` that isn't tied to a span. Custom metrics are stored and exported alongside [automatic metrics](https://mastra.ai/reference/observability/metrics/automatic-metrics), and you query them by name with the [metric query APIs](https://mastra.ai/reference/observability/metrics/queries). Custom metrics are available to view in the Mastra platform, not Studio.
|
|
8
8
|
|
|
9
9
|
For an introduction, see [Emit custom metrics](https://mastra.ai/docs/observability/metrics/overview).
|
|
10
10
|
|
|
11
11
|
## Usage example
|
|
12
12
|
|
|
13
|
+
`metrics` is typed as optional on tool, step, processor, and scorer contexts, so use optional chaining. `mastra.metrics` is always defined. When observability isn't configured, `metrics` is a no-op context and `emit()` does nothing.
|
|
14
|
+
|
|
15
|
+
### Tool
|
|
16
|
+
|
|
17
|
+
In a tool, `metrics` is a property of the execution context:
|
|
18
|
+
|
|
13
19
|
```typescript
|
|
14
20
|
import { createTool } from '@mastra/core/tools'
|
|
15
21
|
import { z } from 'zod'
|
|
@@ -30,6 +36,8 @@ export const searchDocs = createTool({
|
|
|
30
36
|
})
|
|
31
37
|
```
|
|
32
38
|
|
|
39
|
+
### Workflow step
|
|
40
|
+
|
|
33
41
|
In a workflow step, `metrics` is a property of the `execute` parameters:
|
|
34
42
|
|
|
35
43
|
```typescript
|
|
@@ -48,7 +56,57 @@ const indexDocuments = createStep({
|
|
|
48
56
|
})
|
|
49
57
|
```
|
|
50
58
|
|
|
51
|
-
|
|
59
|
+
### Processor
|
|
60
|
+
|
|
61
|
+
In a processor, `metrics` is a property of the arguments of every processor method:
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
import type { Processor, ProcessOutputResultArgs } from '@mastra/core/processors'
|
|
65
|
+
|
|
66
|
+
export class OutputSizeProcessor implements Processor {
|
|
67
|
+
id = 'output-size'
|
|
68
|
+
|
|
69
|
+
processOutputResult({ messages, metrics }: ProcessOutputResultArgs) {
|
|
70
|
+
metrics?.emit('agent_output_messages', messages.length, { processor: 'output-size' })
|
|
71
|
+
|
|
72
|
+
return messages
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Scorer
|
|
78
|
+
|
|
79
|
+
In a scorer, `metrics` is a property of the context passed to the `preprocess`, `analyze`, `generateScore`, and `generateReason` step functions:
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
import { createScorer } from '@mastra/core/evals'
|
|
83
|
+
|
|
84
|
+
export const toolUsageScorer = createScorer({
|
|
85
|
+
id: 'tool-usage',
|
|
86
|
+
description: 'Scores 1 when the agent called at least one tool',
|
|
87
|
+
type: 'agent',
|
|
88
|
+
}).generateScore(({ run, metrics }) => {
|
|
89
|
+
const toolCalls = run.output
|
|
90
|
+
.flatMap(message => message.content.parts)
|
|
91
|
+
.filter(part => part.type === 'tool-invocation').length
|
|
92
|
+
|
|
93
|
+
metrics?.emit('scored_tool_calls', toolCalls, { scorer: 'tool-usage' })
|
|
94
|
+
|
|
95
|
+
return toolCalls > 0 ? 1 : 0
|
|
96
|
+
})
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Outside a traced operation
|
|
100
|
+
|
|
101
|
+
Outside a tool, step, processor, or scorer, use the `metrics` property of your `Mastra` instance. These metrics aren't correlated with a trace, as described in [Trace correlation](#trace-correlation):
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
import { mastra } from '../mastra'
|
|
105
|
+
|
|
106
|
+
const synced = await syncCatalog()
|
|
107
|
+
|
|
108
|
+
mastra.metrics.emit('catalog_items_synced', synced.length, { source: 'erp' })
|
|
109
|
+
```
|
|
52
110
|
|
|
53
111
|
## Methods
|
|
54
112
|
|
|
@@ -74,7 +132,9 @@ Records one observation of a metric. Each call stores a separate row, and aggreg
|
|
|
74
132
|
|
|
75
133
|
## Trace correlation
|
|
76
134
|
|
|
77
|
-
|
|
135
|
+
Observations emitted through the `metrics` context of a tool, workflow step, processor, or scorer step record the trace and span ID of that operation, plus the same correlation context as automatic metrics, such as the entity, environment, and service name. Use these fields to go from a metric to the trace that produced it. They're stored separately from labels, so cardinality filtering doesn't remove them.
|
|
136
|
+
|
|
137
|
+
Observations emitted through `mastra.metrics` have no span. They don't record a trace or span ID, and they don't inherit correlation or cost context from a span. Mastra stores only the environment and the service name of the default observability instance with them. To attribute cost, pass `costContext` in the `options` argument of `emit()`.
|
|
78
138
|
|
|
79
139
|
## Cardinality protection
|
|
80
140
|
|
|
@@ -176,7 +176,7 @@ await pubsub.subscribeFromOffset('my-topic', 42, event => {
|
|
|
176
176
|
|
|
177
177
|
**deliversAcrossProcesses** (`boolean`): Whether a published event can reach a subscriber in another process. Defaults to true, so Mastra coordinates runs with other processes unless the implementation says otherwise. Return false only when every subscriber lives in the publishing process, as EventEmitterPubSub does.
|
|
178
178
|
|
|
179
|
-
**redeliversUnacked** (`boolean`): Whether an event delivered to a consumer that neither acks nor nacks it, for example because its process stopped, is delivered again to another consumer of the same group once the broker considers it abandoned. Defaults to false. Workflow recovery doesn't restart evented runs on a pubsub that returns true, so return true only when the broker does this
|
|
179
|
+
**redeliversUnacked** (`boolean`): Whether an event delivered to a consumer that neither acks nor nacks it, for example because its process stopped, is delivered again to another consumer of the same group once the broker considers it abandoned. Defaults to false. Workflow recovery doesn't restart evented runs on a pubsub that returns true, so return true only when the broker does this. Evented workflows and agents that run on several processes need true. See evented workflows and agents.
|
|
180
180
|
|
|
181
181
|
## Types
|
|
182
182
|
|
|
@@ -105,11 +105,11 @@ const pubsub = new RedisStreamsPubSub({
|
|
|
105
105
|
|
|
106
106
|
**reclaimIntervalMs** (`number`): How often, in milliseconds, a subscription reclaims events that an earlier consumer read but never acknowledged. Set to 0 to disable. While it's enabled, workflow recovery leaves evented runs to this reclaim instead of restarting them. With 0, the pubsub no longer redelivers a stopped worker's events, so workflow recovery restarts evented runs when an instance boots, as it does without a broker. (Default: `30000`)
|
|
107
107
|
|
|
108
|
-
**reclaimIdleMs** (`number`): Minimum idle time, in milliseconds, before a pending event is eligible for reclaim. Keep this well above typical processing time to avoid double delivery
|
|
108
|
+
**reclaimIdleMs** (`number`): Minimum idle time, in milliseconds, before a pending event is eligible for reclaim. Keep this well above typical processing time to avoid double delivery. The orchestration worker's heartbeat resets an event's idle time every leaseRenewIntervalMs (10 seconds by default). Keep reclaimIdleMs above that interval, or an evented workflow step that's still running can be delivered again. (Default: `60000`)
|
|
109
109
|
|
|
110
110
|
**maxDeliveryAttempts** (`number`): Maximum times an event is redelivered through nack before it is dropped. Pass Infinity to disable the cap. (Default: `5`)
|
|
111
111
|
|
|
112
|
-
**inFlightTimeoutMs** (`number`): How long a handler may hold an event without acking or nacking before the reclaim loop nacks it on its behalf. The event is republished with an incremented deliveryAttempt, so maxDeliveryAttempts still applies. Set this to recover hung handlers in single-consumer groups. 0 disables it. (Default: `0`)
|
|
112
|
+
**inFlightTimeoutMs** (`number`): How long a handler may hold an event without acking or nacking before the reclaim loop nacks it on its behalf. The event is republished with an incremented deliveryAttempt, so maxDeliveryAttempts still applies. Set this to recover hung handlers in single-consumer groups. The reclaim loop checks the timeout on each pass, and the orchestration worker's heartbeat resets it every leaseRenewIntervalMs (10 seconds by default). Keep it above that interval, or an evented workflow step that's still running can be delivered again. 0 disables it. (Default: `0`)
|
|
113
113
|
|
|
114
114
|
**publishRetryBudgetMs** (`number`): How long, in milliseconds, publish keeps retrying a write that failed with a transient connection error, such as a closed socket, ECONNRESET, or Redis answering LOADING after a restart. When the budget runs out, publish rejects with PublishRetryBudgetExhaustedError instead of hanging. PublishRetryBudgetExhaustedError is exported from @mastra/redis-streams. (Default: `120000`)
|
|
115
115
|
|
|
@@ -230,13 +230,11 @@ A subscription never reclaims an event its own handler is still processing, so a
|
|
|
230
230
|
|
|
231
231
|
With Postgres or libSQL storage, distributed evented agents publish worker orchestration events through Redis. If a worker exits before acknowledging an event, another worker can reclaim it and finish the run while the original API process stays alive. Configure the API process with `MASTRA_WORKERS=false` and worker processes with `MASTRA_WORKERS=orchestration`. All processes must share the same database, Redis connection settings, and `keyPrefix`. With libSQL, use a libSQL server such as sqld or Turso when processes run on more than one machine. A database file only works when every process runs on the same machine, because the step guards depend on SQLite file locking, which isn't reliable on network filesystems. An in-memory (`:memory:`) database isn't shared between processes.
|
|
232
232
|
|
|
233
|
-
Keep `reclaimIdleMs` above 30 seconds (the default is 60 seconds). A lower value can reclaim an event while the stopped worker still holds the step, causing the event to be acknowledged without running.
|
|
234
|
-
|
|
235
233
|
Runs started on older versions can finish after upgrading, but don't have guaranteed crash recovery. An evented workflow run, including a nested workflow run, that was already running with `shouldPersistSnapshot` returning `false` has no stored record, so it fails at its next step after the upgrade. Let those runs finish before upgrading. Saved steps without occurrence identifiers keep their existing unguarded behavior. Other storage adapters keep distributed internal orchestration on the worker process. Worker takeover isn't verified with libSQL embedded replicas (`syncUrl`) shared by several workers.
|
|
236
234
|
|
|
237
235
|
Worker takeover needs a pubsub that delivers each event to one worker of a consumer group and redelivers the events a stopped worker held, as Redis Streams does. See [evented workflows and agents](https://mastra.ai/docs/server/pubsub) for the backends and storage adapters that qualify.
|
|
238
236
|
|
|
239
|
-
An interrupted step can execute again, so make external side effects idempotent. Completed step occurrences are protected against stale redeliveries, and a completed loop iteration reuses its saved result and loop decision. Guarded execution persists the records needed for recovery even when `shouldPersistSnapshot` returns `false`.
|
|
237
|
+
An interrupted step can execute again, so make external side effects idempotent. Completed step occurrences are protected against stale redeliveries, and a completed loop iteration reuses its saved result and loop decision. Guarded execution persists the records needed for recovery even when `shouldPersistSnapshot` returns `false`. Restart races, individual `foreach` items, two deliveries of the same resume or time travel event handled at the same moment, and, with `storageVersion: 2`, a late copy of a finished step that arrives under a new event ID aren't covered by these occurrence guards. See [make tools safe to repeat](https://mastra.ai/docs/harness/durable-agents) for agent tools.
|
|
240
238
|
|
|
241
239
|
## Distributed leasing
|
|
242
240
|
|
|
@@ -63,11 +63,11 @@ export const mastra = new Mastra({
|
|
|
63
63
|
|
|
64
64
|
**reclaimIntervalMs** (`number`): Interval for reclaiming unacknowledged events. Set to 0 to disable. While it's enabled, workflow recovery leaves evented runs to this reclaim instead of restarting them. With 0, the pubsub no longer redelivers a stopped worker's events, so workflow recovery restarts evented runs when an instance boots, as it does without a broker. (Default: `30000`)
|
|
65
65
|
|
|
66
|
-
**reclaimIdleMs** (`number`): Minimum idle time before an event can be reclaimed. Keep
|
|
66
|
+
**reclaimIdleMs** (`number`): Minimum idle time before an event can be reclaimed. Keep this well above typical processing time to avoid double delivery. The orchestration worker's heartbeat resets an event's idle time every leaseRenewIntervalMs (10 seconds by default). Keep reclaimIdleMs above that interval, or an evented workflow step that's still running can be delivered again. (Default: `60000`)
|
|
67
67
|
|
|
68
68
|
**maxDeliveryAttempts** (`number`): Maximum nack redeliveries. Pass Infinity to disable the cap. (Default: `5`)
|
|
69
69
|
|
|
70
|
-
**inFlightTimeoutMs** (`number`): How long a handler may hold an event without acking or nacking before the reclaim loop nacks it on its behalf. The event is republished with an incremented deliveryAttempt, so maxDeliveryAttempts still applies. Set this to recover hung handlers in single-consumer groups. 0 disables it. (Default: `0`)
|
|
70
|
+
**inFlightTimeoutMs** (`number`): How long a handler may hold an event without acking or nacking before the reclaim loop nacks it on its behalf. The event is republished with an incremented deliveryAttempt, so maxDeliveryAttempts still applies. Set this to recover hung handlers in single-consumer groups. The reclaim loop checks the timeout on each pass, and the orchestration worker's heartbeat resets it every leaseRenewIntervalMs (10 seconds by default). Keep it above that interval, or an evented workflow step that's still running can be delivered again. 0 disables it. (Default: `0`)
|
|
71
71
|
|
|
72
72
|
**logger** (`{ debug?: Function; warn?: Function }`): Optional diagnostic logger.
|
|
73
73
|
|
|
@@ -115,4 +115,34 @@ your-template/
|
|
|
115
115
|
├── package.json
|
|
116
116
|
├── tsconfig.json
|
|
117
117
|
└── README.md
|
|
118
|
-
```
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Publishing a template
|
|
121
|
+
|
|
122
|
+
Publish a template as its own public GitHub repository, or as a folder inside a larger one. Users install a repository with its URL and a folder with its degit path, `<owner>/<repository>[/<path>][#<ref>]`:
|
|
123
|
+
|
|
124
|
+
**npm**:
|
|
125
|
+
|
|
126
|
+
```sh
|
|
127
|
+
npx create-mastra@latest my-project --template mastra-ai/mastra/templates/template-agent-harness
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**pnpm**:
|
|
131
|
+
|
|
132
|
+
```sh
|
|
133
|
+
pnpm dlx create-mastra@latest my-project --template mastra-ai/mastra/templates/template-agent-harness
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Yarn**:
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
yarn dlx create-mastra@latest my-project --template mastra-ai/mastra/templates/template-agent-harness
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Bun**:
|
|
143
|
+
|
|
144
|
+
```sh
|
|
145
|
+
bun x create-mastra@latest my-project --template mastra-ai/mastra/templates/template-agent-harness
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The folder must be a standalone Mastra project that follows the structure above. Its `package.json` can't use `workspace:`, `catalog:`, `link:`, or `file:` dependency specifiers, because the folder is installed outside your repository.
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
The `.restart()` method restarts an active workflow run that lost connection to the server, allowing you to continue execution from the moment it lost connection (the last active step).
|
|
8
8
|
|
|
9
|
+
On evented workflows with a pubsub that redelivers unacknowledged events, `restart()` is deprecated and logs a warning, because that pubsub redelivers the events of an interrupted run.
|
|
10
|
+
|
|
9
11
|
## Usage example
|
|
10
12
|
|
|
11
13
|
```typescript
|
package/dist/evals/index.cjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const require_constants = require("../constants-
|
|
2
|
+
const require_execution_fence = require("../execution-fence-fqV6FGdV.cjs");
|
|
3
|
+
const require_constants = require("../constants-B2FVV_2e.cjs");
|
|
4
4
|
const require_collect_tool_mocks = require("../collect-tool-mocks-k9fM6oDl.cjs");
|
|
5
|
-
exports.MastraScorer =
|
|
6
|
-
exports.SCORING_PREDICATE_ROOTS =
|
|
7
|
-
exports.ScorerRunError =
|
|
5
|
+
exports.MastraScorer = require_execution_fence.MastraScorer;
|
|
6
|
+
exports.SCORING_PREDICATE_ROOTS = require_execution_fence.SCORING_PREDICATE_ROOTS;
|
|
7
|
+
exports.ScorerRunError = require_execution_fence.ScorerRunError;
|
|
8
8
|
exports.collectToolMocks = require_collect_tool_mocks.collectToolMocks;
|
|
9
|
-
exports.createClassifierScorer =
|
|
10
|
-
exports.createScorer =
|
|
11
|
-
exports.evaluateScoringPredicate =
|
|
9
|
+
exports.createClassifierScorer = require_execution_fence.createClassifierScorer;
|
|
10
|
+
exports.createScorer = require_execution_fence.createScorer;
|
|
11
|
+
exports.evaluateScoringPredicate = require_execution_fence.evaluateScoringPredicate;
|
|
12
12
|
exports.extractTrajectory = require_constants.extractTrajectory;
|
|
13
13
|
exports.extractTrajectoryFromTrace = require_constants.extractTrajectoryFromTrace;
|
|
14
14
|
exports.extractWorkflowTrajectory = require_constants.extractWorkflowTrajectory;
|
|
15
|
-
exports.filterRun =
|
|
16
|
-
exports.isNotScorable =
|
|
15
|
+
exports.filterRun = require_execution_fence.filterRun;
|
|
16
|
+
exports.isNotScorable = require_execution_fence.isNotScorable;
|
|
17
17
|
exports.listScoresResponseSchema = require_constants.listScoresResponseSchema;
|
|
18
|
-
exports.notScorable =
|
|
19
|
-
exports.runEvals =
|
|
18
|
+
exports.notScorable = require_execution_fence.notScorable;
|
|
19
|
+
exports.runEvals = require_execution_fence.runEvals;
|
|
20
20
|
exports.saveScorePayloadSchema = require_constants.saveScorePayloadSchema;
|
|
21
21
|
exports.scoreResultSchema = require_constants.scoreResultSchema;
|
|
22
22
|
exports.scoreRowDataSchema = require_constants.scoreRowDataSchema;
|
|
@@ -30,4 +30,4 @@ exports.scoringInputWithExtractStepResultSchema = require_constants.scoringInput
|
|
|
30
30
|
exports.scoringPromptsSchema = require_constants.scoringPromptsSchema;
|
|
31
31
|
exports.scoringSourceSchema = require_constants.scoringSourceSchema;
|
|
32
32
|
exports.scoringValueSchema = require_constants.scoringValueSchema;
|
|
33
|
-
exports.validateScoringPredicate =
|
|
33
|
+
exports.validateScoringPredicate = require_execution_fence.validateScoringPredicate;
|
package/dist/evals/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Ar as scoringEntityTypeSchema, Cr as extractTrajectory, Dr as saveScorePayloadSchema, Er as listScoresResponseSchema, Fr as scoringInputWithExtractStepResultAndScoreAndReasonSchema, Ir as scoringInputWithExtractStepResultSchema, Lr as scoringPromptsSchema, Mr as scoringHookInputSchema, Nr as scoringInputSchema, Or as scoreResultSchema, Pr as scoringInputWithExtractStepResultAndAnalyzeStepResultSchema, Rr as scoringSourceSchema, Tr as extractWorkflowTrajectory, jr as scoringExtractStepResultSchema, kr as scoreRowDataSchema, wr as extractTrajectoryFromTrace, zr as scoringValueSchema } from "../constants-
|
|
1
|
+
import { Gc as SCORING_PREDICATE_ROOTS, Kc as evaluateScoringPredicate, _ as isNotScorable, c as runEvals, f as createClassifierScorer, g as filterRun, h as createScorer, m as ScorerRunError, p as MastraScorer, qc as validateScoringPredicate, v as notScorable } from "../execution-fence-B8yV_n51.js";
|
|
2
|
+
import { Ar as scoringEntityTypeSchema, Cr as extractTrajectory, Dr as saveScorePayloadSchema, Er as listScoresResponseSchema, Fr as scoringInputWithExtractStepResultAndScoreAndReasonSchema, Ir as scoringInputWithExtractStepResultSchema, Lr as scoringPromptsSchema, Mr as scoringHookInputSchema, Nr as scoringInputSchema, Or as scoreResultSchema, Pr as scoringInputWithExtractStepResultAndAnalyzeStepResultSchema, Rr as scoringSourceSchema, Tr as extractWorkflowTrajectory, jr as scoringExtractStepResultSchema, kr as scoreRowDataSchema, wr as extractTrajectoryFromTrace, zr as scoringValueSchema } from "../constants-Dro9fuhk.js";
|
|
3
3
|
import { t as collectToolMocks } from "../collect-tool-mocks-3s2BN8o7.js";
|
|
4
4
|
export { MastraScorer, SCORING_PREDICATE_ROOTS, ScorerRunError, collectToolMocks, createClassifierScorer, createScorer, evaluateScoringPredicate, extractTrajectory, extractTrajectoryFromTrace, extractWorkflowTrajectory, filterRun, isNotScorable, listScoresResponseSchema, notScorable, runEvals, saveScorePayloadSchema, scoreResultSchema, scoreRowDataSchema, scoringEntityTypeSchema, scoringExtractStepResultSchema, scoringHookInputSchema, scoringInputSchema, scoringInputWithExtractStepResultAndAnalyzeStepResultSchema, scoringInputWithExtractStepResultAndScoreAndReasonSchema, scoringInputWithExtractStepResultSchema, scoringPromptsSchema, scoringSourceSchema, scoringValueSchema, validateScoringPredicate };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_error = require("../../error-D90lJ6M7.cjs");
|
|
3
3
|
const require_utils = require("../../utils-D-eNsgDM.cjs");
|
|
4
|
-
const
|
|
5
|
-
const require_constants = require("../../constants-
|
|
4
|
+
const require_execution_fence = require("../../execution-fence-fqV6FGdV.cjs");
|
|
5
|
+
const require_constants = require("../../constants-B2FVV_2e.cjs");
|
|
6
6
|
let zod_v4 = require("zod/v4");
|
|
7
7
|
// src/evals/scoreTraces/scoreTraces.ts
|
|
8
8
|
async function scoreTraces({ scorerId, targets, mastra }) {
|
|
@@ -232,7 +232,7 @@ function transformTraceToScorerInputAndOutput(trace) {
|
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
234
|
// src/evals/scoreTraces/scoreTracesWorkflow.ts
|
|
235
|
-
const getTraceStep =
|
|
235
|
+
const getTraceStep = require_execution_fence.createStep({
|
|
236
236
|
id: "__process-trace-scoring",
|
|
237
237
|
inputSchema: zod_v4.z.object({
|
|
238
238
|
targets: zod_v4.z.array(zod_v4.z.object({
|
|
@@ -539,7 +539,7 @@ async function attachScoreToSpan({ storage, span, scoreRecord }) {
|
|
|
539
539
|
});
|
|
540
540
|
} catch {}
|
|
541
541
|
}
|
|
542
|
-
const scoreTracesWorkflow =
|
|
542
|
+
const scoreTracesWorkflow = require_execution_fence.createWorkflow$1({
|
|
543
543
|
id: "__batch-scoring-traces",
|
|
544
544
|
inputSchema: zod_v4.z.object({
|
|
545
545
|
targets: zod_v4.z.array(zod_v4.z.object({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as MastraError, n as ErrorDomain, t as ErrorCategory } from "../../error-oh2DLsP2.js";
|
|
2
2
|
import { i as getEntityTypeForSpan } from "../../utils-DU_pU5SK.js";
|
|
3
|
-
import {
|
|
4
|
-
import { Dr as saveScorePayloadSchema } from "../../constants-
|
|
3
|
+
import { Ns as createStep, Ps as createWorkflow } from "../../execution-fence-B8yV_n51.js";
|
|
4
|
+
import { Dr as saveScorePayloadSchema } from "../../constants-Dro9fuhk.js";
|
|
5
5
|
import { z } from "zod/v4";
|
|
6
6
|
// src/evals/scoreTraces/scoreTraces.ts
|
|
7
7
|
async function scoreTraces({ scorerId, targets, mastra }) {
|
package/dist/events/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("../rolldown-runtime-BrhgMLW6.cjs");
|
|
3
|
-
const require_output_helpers = require("../output-helpers-
|
|
3
|
+
const require_output_helpers = require("../output-helpers-By5FbLpp.cjs");
|
|
4
4
|
const require_file = require("../file-BEndQUN1.cjs");
|
|
5
5
|
let crypto = require("crypto");
|
|
6
6
|
let path = require("path");
|
package/dist/events/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as
|
|
1
|
+
import { S as isLeaseProvider, _ as PublisherQueueLimitError, a as withCaching, b as NoopLeaseProvider, c as RUN_LOCAL_TOPIC_PREFIXES, d as isRunLocalTopic, f as streamTopicIdleTtlMs, i as CachingPubSub, l as RUN_LOG_TTL_MS, n as rehydrateError, o as DEFAULT_RUN_LOG_TTL_MS, p as toCachedLogFrame, r as serializeError, s as DEFAULT_THREAD_STREAM_LOG_TTL_MS, t as DefaultStepResult, u as cachedLogTtlMs, v as EventEmitterPubSub, x as PubSub, y as withAck } from "../output-helpers-k2-48ssH.js";
|
|
2
2
|
import { n as DefaultGeneratedFileWithType, t as DefaultGeneratedFile } from "../file-DGZrR5f7.js";
|
|
3
3
|
import { createHash } from "crypto";
|
|
4
4
|
import { basename, dirname, join, sep } from "path";
|
package/dist/events/pubsub.d.ts
CHANGED
|
@@ -130,9 +130,7 @@ export declare abstract class PubSub {
|
|
|
130
130
|
*
|
|
131
131
|
* Workflow recovery leaves the evented runs on such a pubsub to the broker:
|
|
132
132
|
* the message of the step a dead worker held is redelivered, so no recovery
|
|
133
|
-
* pass restarts the run.
|
|
134
|
-
* 30 s, the evented step fence a dead worker leaves behind; a redelivery that
|
|
135
|
-
* arrives before the fence expires is dropped as a duplicate.
|
|
133
|
+
* pass restarts the run.
|
|
136
134
|
*
|
|
137
135
|
* Evented workflows and agents that run on several processes need `true`
|
|
138
136
|
* here. Without it, no other worker picks up the step a stopped worker held.
|