@mastra/core 1.87.0-alpha.18 → 1.87.0-alpha.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_types/@internal_ai-v6@0.0.99/dist/index.d.ts +2075 -123
- package/dist/_types/@internal_core@0.1.4/dist/knowledge-compat/index.d.ts +30 -3
- package/dist/agent/agent.d.ts +2 -4
- package/dist/agent/agent.types.d.ts +1 -0
- package/dist/agent/durable/index.cjs +86 -86
- package/dist/agent/durable/index.js +2 -2
- package/dist/agent/durable/run-registry.d.ts +54 -25
- package/dist/agent/index.cjs +16 -16
- package/dist/agent/index.d.ts +1 -0
- package/dist/agent/index.js +3 -3
- package/dist/agent/scopes.d.ts +8 -0
- package/dist/agent/types.d.ts +1 -0
- package/dist/agent-builder/ee/index.cjs +1 -1
- package/dist/agent-builder/ee/index.js +1 -1
- package/dist/agent-controller/agent-controller.d.ts +8 -1
- package/dist/agent-controller/index.cjs +3 -3
- package/dist/agent-controller/index.js +3 -3
- package/dist/{agent-controller-D_OKCLUP.cjs → agent-controller-DzOEhUjR.cjs} +39 -35
- package/dist/{agent-controller-UZNIM4h-.js → agent-controller-lBdNfcFi.js} +15 -11
- package/dist/{agent-skills-resolver-BMoCDoaK.cjs → agent-skills-resolver-2d8k7ioj.cjs} +134 -109
- package/dist/{agent-skills-resolver-CUEIMDbx.js → agent-skills-resolver-D2HktP6Y.js} +134 -109
- package/dist/background-tasks/index.cjs +1 -1
- package/dist/background-tasks/index.js +1 -1
- package/dist/{background-tasks-CioDMzgY.js → background-tasks-DAu4WaCb.js} +1 -1
- package/dist/{background-tasks-CLWnX7SN.cjs → background-tasks-DOmQdBVn.cjs} +1 -1
- package/dist/browser/index.cjs +4 -4
- package/dist/browser/index.js +4 -4
- package/dist/{builder-BC4l-RN5.cjs → builder-BFcVEbX0.cjs} +3 -3
- package/dist/{builder-CQLqpQO_.js → builder-DHFtMW8D.js} +2 -2
- package/dist/capabilities/302ai.json +198 -198
- package/dist/capabilities/abacus.json +2 -96
- package/dist/capabilities/abliteratedllm.json +36 -36
- package/dist/capabilities/abliteration-ai.json +11 -11
- package/dist/capabilities/above.json +19 -19
- package/dist/capabilities/adaption.json +11 -11
- package/dist/capabilities/adzuki.json +32 -32
- package/dist/capabilities/agentrouter.json +12 -12
- package/dist/capabilities/agnes.json +4 -4
- package/dist/capabilities/ai-router.json +5 -5
- package/dist/capabilities/aiand.json +25 -25
- package/dist/capabilities/aigrow.json +13 -13
- package/dist/capabilities/aimlapi.json +144 -144
- package/dist/capabilities/aipg.json +2 -2
- package/dist/capabilities/aixy.json +24 -24
- package/dist/capabilities/aki-io.json +12 -12
- package/dist/capabilities/alibaba-cn.json +81 -126
- package/dist/capabilities/alibaba-coding-plan-cn.json +4 -4
- package/dist/capabilities/alibaba-coding-plan.json +4 -4
- package/dist/capabilities/alibaba-token-plan-cn.json +57 -53
- package/dist/capabilities/alibaba-token-plan.json +57 -53
- package/dist/capabilities/alibaba.json +76 -71
- package/dist/capabilities/ambient.json +14 -32
- package/dist/capabilities/amd-tokenlab.json +41 -0
- package/dist/capabilities/amd.json +8 -8
- package/dist/capabilities/anthropic.json +32 -56
- package/dist/capabilities/anyapi.json +47 -47
- package/dist/capabilities/apiko.json +5 -5
- package/dist/capabilities/arcee.json +5 -5
- package/dist/capabilities/augure.json +4 -4
- package/dist/capabilities/auriko.json +15 -15
- package/dist/capabilities/bailing.json +3 -3
- package/dist/capabilities/baseten.json +35 -35
- package/dist/capabilities/bee.json +5 -5
- package/dist/capabilities/berget.json +2 -35
- package/dist/capabilities/bothub.json +14 -14
- package/dist/capabilities/boundless.json +39 -39
- package/dist/capabilities/bumo.json +40 -40
- package/dist/capabilities/byteplus.json +28 -28
- package/dist/capabilities/cheapest-token.json +31 -31
- package/dist/capabilities/chutes.json +48 -17
- package/dist/capabilities/cline-pass.json +32 -45
- package/dist/capabilities/cloudcode.json +8 -8
- package/dist/capabilities/cloudferro-sherlock.json +4 -4
- package/dist/capabilities/cloudflare-workers-ai.json +17 -17
- package/dist/capabilities/commandcode.json +141 -156
- package/dist/capabilities/concentrate.json +289 -289
- package/dist/capabilities/cortecs.json +103 -103
- package/dist/capabilities/crossmodel.json +194 -194
- package/dist/capabilities/crusoe.json +18 -18
- package/dist/capabilities/daoxe.json +9 -9
- package/dist/capabilities/databricks.json +128 -128
- package/dist/capabilities/deepinfra.json +98 -94
- package/dist/capabilities/deepseek.json +4 -4
- package/dist/capabilities/digitalocean.json +114 -114
- package/dist/capabilities/dinference.json +1 -2
- package/dist/capabilities/dothoosh.json +26 -26
- package/dist/capabilities/doubleword.json +23 -23
- package/dist/capabilities/edenai.json +285 -285
- package/dist/capabilities/empiriolabs.json +176 -167
- package/dist/capabilities/engy.json +16 -16
- package/dist/capabilities/entrim.json +8 -8
- package/dist/capabilities/evroc.json +15 -15
- package/dist/capabilities/ezkielyna.json +10 -10
- package/dist/capabilities/fastrouter.json +93 -97
- package/dist/capabilities/fireworks-ai.json +85 -85
- package/dist/capabilities/fortytwo.json +4 -4
- package/dist/capabilities/freemodel.json +7 -51
- package/dist/capabilities/friendli.json +8 -8
- package/dist/capabilities/frogbot.json +95 -103
- package/dist/capabilities/gisoo.json +15 -15
- package/dist/capabilities/gmicloud.json +21 -21
- package/dist/capabilities/google.json +55 -55
- package/dist/capabilities/graphn.json +10 -10
- package/dist/capabilities/greenpt.json +35 -35
- package/dist/capabilities/groq.json +7 -20
- package/dist/capabilities/helicone.json +84 -86
- package/dist/capabilities/hetzner.json +4 -4
- package/dist/capabilities/hopper.json +2 -2
- package/dist/capabilities/hostinger-router.json +5 -5
- package/dist/capabilities/hpc-ai.json +8 -24
- package/dist/capabilities/huawei-maas.json +13 -13
- package/dist/capabilities/hubris.json +30 -30
- package/dist/capabilities/huggingface.json +86 -101
- package/dist/capabilities/hyper.json +24 -24
- package/dist/capabilities/impossibl.json +152 -199
- package/dist/capabilities/inceptron.json +8 -8
- package/dist/capabilities/inco.json +4 -21
- package/dist/capabilities/infer.json +16 -16
- package/dist/capabilities/inferall.json +2 -18
- package/dist/capabilities/inference-coop.json +6 -6
- package/dist/capabilities/inference.json +2 -11
- package/dist/capabilities/inferenceapis.json +24 -24
- package/dist/capabilities/infersia.json +13 -13
- package/dist/capabilities/inferx.json +3 -3
- package/dist/capabilities/infomaniak.json +3 -3
- package/dist/capabilities/io-net.json +6 -16
- package/dist/capabilities/isoquant.json +4 -4
- package/dist/capabilities/iteracompute.json +42 -80
- package/dist/capabilities/jalapeno.json +11 -11
- package/dist/capabilities/jiekou.json +19 -167
- package/dist/capabilities/joingonka.json +4 -4
- package/dist/capabilities/jzstoken.json +54 -54
- package/dist/capabilities/keln.json +23 -23
- package/dist/capabilities/kenari.json +122 -130
- package/dist/capabilities/kilo.json +649 -647
- package/dist/capabilities/kimi-code-plan-cn.json +7 -7
- package/dist/capabilities/kimi-code-plan-global.json +7 -7
- package/dist/capabilities/kitani.json +4 -4
- package/dist/capabilities/klavo.json +24 -24
- package/dist/capabilities/korouter.json +32 -32
- package/dist/capabilities/kunavo.json +7 -7
- package/dist/capabilities/liquid.json +8 -8
- package/dist/capabilities/lithosai.json +3 -3
- package/dist/capabilities/llmgateway-providers.json +885 -893
- package/dist/capabilities/llmgateway.json +340 -340
- package/dist/capabilities/llmtr.json +16 -54
- package/dist/capabilities/lowrouter.json +61 -61
- package/dist/capabilities/lyceum.json +14 -14
- package/dist/capabilities/meganova.json +0 -1
- package/dist/capabilities/melious.json +14 -14
- package/dist/capabilities/merge-gateway.json +292 -292
- package/dist/capabilities/meta.json +11 -11
- package/dist/capabilities/minimax-cn-coding-plan.json +2 -2
- package/dist/capabilities/minimax-cn.json +5 -5
- package/dist/capabilities/minimax-coding-plan.json +2 -2
- package/dist/capabilities/minimax.json +5 -5
- package/dist/capabilities/mistral.json +15 -31
- package/dist/capabilities/mixlayer.json +5 -5
- package/dist/capabilities/moark.json +0 -2
- package/dist/capabilities/modal.json +8 -8
- package/dist/capabilities/model-oracle-ai.json +19 -27
- package/dist/capabilities/modelis.json +14 -14
- package/dist/capabilities/modelscope.json +2 -2
- package/dist/capabilities/modular.json +11 -11
- package/dist/capabilities/moneo.json +7 -38
- package/dist/capabilities/moonshotai-cn.json +7 -7
- package/dist/capabilities/moonshotai.json +7 -7
- package/dist/capabilities/morph.json +13 -13
- package/dist/capabilities/munito-eu.json +8 -8
- package/dist/capabilities/munito.json +10 -10
- package/dist/capabilities/nan.json +31 -31
- package/dist/capabilities/nano-gpt.json +581 -603
- package/dist/capabilities/nearai.json +119 -119
- package/dist/capabilities/nebius.json +30 -31
- package/dist/capabilities/neon.json +132 -132
- package/dist/capabilities/neuralwatt.json +41 -41
- package/dist/capabilities/nokeep.json +5 -5
- package/dist/capabilities/novita-ai.json +113 -227
- package/dist/capabilities/nvidia.json +14 -82
- package/dist/capabilities/oathbreaker.json +2 -2
- package/dist/capabilities/obscurify.json +28 -28
- package/dist/capabilities/oci.json +4 -4
- package/dist/capabilities/ofox.json +270 -270
- package/dist/capabilities/ollama-cloud.json +53 -53
- package/dist/capabilities/openai.json +57 -57
- package/dist/capabilities/opencode-go.json +88 -90
- package/dist/capabilities/openreason.json +5 -5
- package/dist/capabilities/openrouter.json +574 -563
- package/dist/capabilities/opper.json +29 -34
- package/dist/capabilities/orcarouter.json +307 -367
- package/dist/capabilities/outerlabs.json +30 -30
- package/dist/capabilities/ovhcloud.json +19 -19
- package/dist/capabilities/pareto.json +2 -7
- package/dist/capabilities/perplexity-agent.json +47 -102
- package/dist/capabilities/perplexity.json +2 -2
- package/dist/capabilities/phala.json +35 -35
- package/dist/capabilities/pioneer.json +5 -122
- package/dist/capabilities/poe.json +130 -130
- package/dist/capabilities/poolside.json +2 -2
- package/dist/capabilities/powerspring.json +14 -14
- package/dist/capabilities/primalabs.json +12 -12
- package/dist/capabilities/prime.json +123 -115
- package/dist/capabilities/privatemode-ai.json +8 -36
- package/dist/capabilities/proxystacks.json +5 -5
- package/dist/capabilities/qihang-ai.json +3 -15
- package/dist/capabilities/qiniu-ai.json +13 -87
- package/dist/capabilities/refuseless.json +7 -14
- package/dist/capabilities/regolo-ai.json +9 -13
- package/dist/capabilities/requesty.json +202 -202
- package/dist/capabilities/routing-run.json +3 -40
- package/dist/capabilities/ruapi.json +21 -21
- package/dist/capabilities/runcrate.json +10 -10
- package/dist/capabilities/runinfra.json +16 -16
- package/dist/capabilities/sakana.json +3 -3
- package/dist/capabilities/sambanova.json +9 -9
- package/dist/capabilities/sandbase.json +20 -20
- package/dist/capabilities/sarvam.json +22 -13
- package/dist/capabilities/scaleway.json +18 -18
- package/dist/capabilities/scnet-token-plan.json +7 -7
- package/dist/capabilities/scx-ai.json +16 -32
- package/dist/capabilities/sensenova.json +12 -12
- package/dist/capabilities/siliconflow-cn.json +45 -97
- package/dist/capabilities/siliconflow.json +53 -53
- package/dist/capabilities/snowflake-cortex.json +26 -26
- package/dist/capabilities/sokkan.json +8 -20
- package/dist/capabilities/sparrowcodes.json +21 -21
- package/dist/capabilities/stackit.json +1 -2
- package/dist/capabilities/standardcompute.json +84 -120
- package/dist/capabilities/steadyrouter.json +41 -41
- package/dist/capabilities/stepfun-ai-step-plan.json +8 -8
- package/dist/capabilities/stepfun-ai.json +8 -8
- package/dist/capabilities/stepfun-step-plan.json +8 -8
- package/dist/capabilities/stepfun.json +8 -8
- package/dist/capabilities/stepping-stone.json +15 -15
- package/dist/capabilities/subconscious.json +2 -2
- package/dist/capabilities/superbot-gg.json +4 -4
- package/dist/capabilities/synthetic.json +8 -17
- package/dist/capabilities/synthorai.json +21 -21
- package/dist/capabilities/teamorouter.json +23 -23
- package/dist/capabilities/teapot-router.json +10 -10
- package/dist/capabilities/tencent-token-plan-intl.json +25 -25
- package/dist/capabilities/tencent-token-plan.json +38 -38
- package/dist/capabilities/tencent-tokenhub.json +46 -46
- package/dist/capabilities/tensorx.json +48 -48
- package/dist/capabilities/tenstorrent.json +4 -4
- package/dist/capabilities/the-grid-ai.json +29 -29
- package/dist/capabilities/thinkingmachines.json +71 -71
- package/dist/capabilities/tinfoil.json +8 -8
- package/dist/capabilities/toapis.json +3 -3
- package/dist/capabilities/togetherai.json +42 -42
- package/dist/capabilities/tokengo.json +21 -21
- package/dist/capabilities/tokenify.json +2 -2
- package/dist/capabilities/trustedrouter.json +5 -5
- package/dist/capabilities/trustedtokens.json +15 -15
- package/dist/capabilities/umans-ai-coding-plan.json +16 -16
- package/dist/capabilities/umans-ai.json +13 -13
- package/dist/capabilities/uncensuredai.json +4 -4
- package/dist/capabilities/unorouter.json +1 -22
- package/dist/capabilities/unrestricted.json +4 -20
- package/dist/capabilities/uplinkswitch.json +21 -21
- package/dist/capabilities/upstage.json +3 -15
- package/dist/capabilities/vancine.json +20 -20
- package/dist/capabilities/vercel.json +551 -551
- package/dist/capabilities/vivgrid.json +51 -131
- package/dist/capabilities/volcengine-coding-plan.json +29 -29
- package/dist/capabilities/volcengine.json +27 -27
- package/dist/capabilities/vultr.json +14 -67
- package/dist/capabilities/wafer.ai.json +17 -17
- package/dist/capabilities/wallaby.json +2 -2
- package/dist/capabilities/wally.json +12 -12
- package/dist/capabilities/wandb.json +21 -21
- package/dist/capabilities/watt.json +22 -22
- package/dist/capabilities/xai.json +5 -5
- package/dist/capabilities/xiaomi-token-plan-ams.json +2 -2
- package/dist/capabilities/xiaomi-token-plan-cn.json +2 -2
- package/dist/capabilities/xiaomi-token-plan-sgp.json +2 -2
- package/dist/capabilities/xiaomi.json +2 -2
- package/dist/capabilities/xpersona.json +13 -13
- package/dist/capabilities/xxapi.json +30 -30
- package/dist/capabilities/zai-coding-plan.json +17 -17
- package/dist/capabilities/zai.json +31 -31
- package/dist/capabilities/zenifra.json +26 -26
- package/dist/capabilities/zenmux.json +190 -233
- package/dist/capabilities/zerogpu.json +8 -8
- package/dist/capabilities/zhipuai-coding-plan.json +3 -14
- package/dist/capabilities/zhipuai.json +30 -30
- package/dist/capabilities/zro.json +6 -6
- package/dist/channels/index.cjs +24 -24
- package/dist/channels/index.js +2 -2
- package/dist/{channels-Bemsws_d.js → channels-BBwgs50q.js} +2 -2
- package/dist/{channels-B7-KI9Ob.cjs → channels-CbhgGgQD.cjs} +6 -6
- package/dist/coding-agent/index.cjs +7 -7
- package/dist/coding-agent/index.js +4 -4
- package/dist/{constants-CFO8w780.cjs → constants-B2FVV_2e.cjs} +1 -1
- package/dist/{constants-CUv0mU2y.js → constants-Dro9fuhk.js} +1 -1
- package/dist/datasets/index.cjs +9 -9
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1147 -1142
- package/dist/docs/references/docs-agents-overview.md +9 -0
- package/dist/docs/references/docs-deployment-workers.md +1 -1
- package/dist/docs/references/docs-harness-background-tasks.md +8 -5
- package/dist/docs/references/docs-harness-durable-agents.md +1 -0
- package/dist/docs/references/docs-knowledge-search.md +1 -1
- package/dist/docs/references/docs-server-pubsub.md +1 -1
- package/dist/docs/references/docs-skills.md +4 -1
- package/dist/docs/references/docs-workflows-overview.md +2 -0
- package/dist/docs/references/reference-agents-createSkill.md +20 -1
- package/dist/docs/references/reference-knowledge-knowledge-tools.md +1 -2
- package/dist/docs/references/reference-observability-metrics-metrics-context.md +63 -3
- package/dist/docs/references/reference-pubsub-base.md +1 -1
- package/dist/docs/references/reference-pubsub-redis-streams.md +3 -5
- package/dist/docs/references/reference-pubsub-valkey-streams.md +2 -2
- package/dist/docs/references/reference-templates-overview.md +31 -1
- package/dist/docs/references/reference-workflows-run-methods-restart.md +2 -0
- package/dist/evals/index.cjs +13 -13
- package/dist/evals/index.js +2 -2
- package/dist/evals/scoreTraces/index.cjs +4 -4
- package/dist/evals/scoreTraces/index.js +2 -2
- package/dist/events/index.cjs +1 -1
- package/dist/events/index.js +1 -1
- package/dist/events/pubsub.d.ts +1 -3
- package/dist/{run-registry-Cu9CK7AR.js → execution-fence-B8yV_n51.js} +62508 -62052
- package/dist/{run-registry-CXeR1Qso.cjs → execution-fence-fqV6FGdV.cjs} +63621 -63153
- package/dist/harness/index.cjs +3 -3
- package/dist/harness/index.js +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/integration/index.cjs +1 -1
- package/dist/integration/index.js +1 -1
- package/dist/knowledge/index.cjs +163 -153
- package/dist/knowledge/index.js +18 -8
- package/dist/llm/index.cjs +3 -3
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/gateways/opencode-session-header.d.ts +28 -0
- package/dist/llm/model/provider-types.generated.d.ts +7412 -7795
- package/dist/llm/model/resolve-model.d.ts +1 -0
- package/dist/llm/model/shared.types.d.ts +1 -0
- package/dist/{llm-ZA8oIVog.cjs → llm-B7ul27Ay.cjs} +32 -14
- package/dist/{llm-DCoDWje0.js → llm-Cy3WZXgA.js} +32 -14
- package/dist/loop/index.cjs +15 -15
- package/dist/loop/index.js +2 -2
- package/dist/loop/server.cjs +1 -1
- package/dist/loop/server.js +1 -1
- package/dist/{manager-oP6iB_H-.cjs → manager-CY-RzZJL.cjs} +21 -19
- package/dist/{manager-DSbR85XK.js → manager-Dsub5fyz.js} +9 -7
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.d.ts +33 -4
- package/dist/mastra/index.js +1 -1
- package/dist/{mastra-FEJ-anIN.cjs → mastra-DXQUuwFl.cjs} +116 -67
- package/dist/{mastra-RgFRZ_Az.js → mastra-yjoYfTS5.js} +76 -27
- package/dist/memory/index.cjs +24 -24
- package/dist/memory/index.js +2 -2
- package/dist/memory/mock.d.ts +2 -3
- package/dist/{model-opyZwnK3.cjs → model-BARBpXDN.cjs} +2 -2
- package/dist/{model-DSBVKOW8.js → model-DauH8JTo.js} +2 -2
- package/dist/{netlify-BqMGvc2s.js → netlify-BNBtKR4Q.js} +86 -4
- package/dist/{netlify-DzturPW3.cjs → netlify-DGsETiFB.cjs} +97 -3
- package/dist/notifications/index.cjs +18 -18
- package/dist/notifications/index.js +2 -2
- package/dist/observability/index.cjs +1 -1
- package/dist/observability/index.js +1 -1
- package/dist/{observability-D7RNOAPx.js → observability-DPDWibyH.js} +648 -648
- package/dist/{output-helpers-DgsH4aTb.cjs → output-helpers-By5FbLpp.cjs} +71 -73
- package/dist/{output-helpers-CVzhy1Y0.js → output-helpers-k2-48ssH.js} +72 -74
- package/dist/processor-provider/index.cjs +10 -10
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +65 -65
- package/dist/processors/index.js +2 -2
- package/dist/{provider-registry-BcG2ooFa.js → provider-registry-CfHy4Zhw.js} +21401 -22401
- package/dist/{provider-registry-BZw14X9M.cjs → provider-registry-Y6tbfFhH.cjs} +21401 -22401
- package/dist/provider-registry.json +21940 -22961
- package/dist/{registry-generator-BrzPSCHS.cjs → registry-generator-BEJ0APNc.cjs} +1 -1
- package/dist/{registry-generator-CA4YBIHo.js → registry-generator-DJiQAI8V.js} +1 -1
- package/dist/{rehydrate-CfS6KkCr.cjs → rehydrate-4Sl7D3kO.cjs} +14 -14
- package/dist/{rehydrate-Chuw5IrY.js → rehydrate-Da4_E_N8.js} +2 -2
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +2 -2
- package/dist/{signal-provider-BslnAjWG.js → signal-provider-B_mfW-J4.js} +1 -1
- package/dist/{signal-provider-BFAvh_AJ.cjs → signal-provider-D9gbevHN.cjs} +1 -1
- package/dist/signals/index.cjs +3 -3
- package/dist/signals/index.js +3 -3
- package/dist/{signals-CbmgVwL-.cjs → signals-BwDXGqxc.cjs} +2 -2
- package/dist/{signals-Clupx3jz.js → signals-TznxWfM3.js} +2 -2
- package/dist/skills/create-skill.d.ts +3 -0
- package/dist/skills/index.cjs +1 -1
- package/dist/skills/index.js +1 -1
- package/dist/skills/inline-skill-source.d.ts +5 -1
- package/dist/skills/types.d.ts +16 -1
- package/dist/{source-DYZMfjv3.js → source-B3He4_mz.js} +1 -1
- package/dist/{source-BC8Et5qZ.cjs → source-C_nWbqI0.cjs} +1 -1
- package/dist/{state-processor-B9kxpM53.js → state-processor-B_KsS82m.js} +1 -1
- package/dist/{state-processor-kRNZ38Nf.cjs → state-processor-DaSmhVUX.cjs} +1 -1
- package/dist/storage/constants.cjs +1 -1
- package/dist/storage/constants.js +1 -1
- package/dist/storage/domains/agents/index.cjs +1 -1
- package/dist/storage/domains/agents/index.js +1 -1
- package/dist/storage/domains/inmemory-db.d.ts +1 -1
- package/dist/storage/domains/knowledge/pages.d.ts +8 -1
- package/dist/storage/domains/memory/base.d.ts +19 -9
- package/dist/storage/domains/memory/inmemory.d.ts +4 -1
- package/dist/storage/domains/memory/queue-thread.d.ts +7 -1
- package/dist/storage/domains/workflows/base.d.ts +18 -5
- package/dist/storage/domains/workflows/inmemory.d.ts +3 -5
- package/dist/storage/domains/workflows/journal.d.ts +16 -1
- package/dist/storage/index.cjs +187 -186
- package/dist/storage/index.js +6 -6
- package/dist/storage/workflow-snapshot.d.ts +4 -0
- package/dist/storage/workflow-step-guard.d.ts +5 -0
- package/dist/stream/base/output.d.ts +1 -0
- package/dist/stream/index.cjs +2 -2
- package/dist/stream/index.js +2 -2
- package/dist/{stream-DTpp9Tk-.js → stream-BFhCDJvz.js} +18 -8
- package/dist/{stream-CiXZtgym.cjs → stream-CZy8XA_q.cjs} +23 -7
- package/dist/telemetry/index.cjs +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/test-utils/llm-mock.cjs +1 -1
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/{tool-Z3bykc1m.js → tool-DIFduuTw.js} +2 -5
- package/dist/{tool-CYlT2UA-.cjs → tool-Dn9WSDVn.cjs} +2 -5
- package/dist/tool-loop-agent/index.cjs +1 -1
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/{tool-loop-agent-DtEg90Zj.cjs → tool-loop-agent-DifR6VLI.cjs} +4 -4
- package/dist/{tool-loop-agent-CqzgY98a.js → tool-loop-agent-SOpIJRws.js} +3 -3
- package/dist/{toolchecks-DrsZdc3S.js → toolchecks-CRAfUe9H.js} +1 -1
- package/dist/{toolchecks-MFU48cit.cjs → toolchecks-DbBsQGHW.cjs} +1 -1
- package/dist/tools/index.cjs +5 -5
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +5 -5
- package/dist/tools/is-vercel-tool.cjs +1 -1
- package/dist/tools/is-vercel-tool.js +1 -1
- package/dist/tools/tool.d.ts +2 -4
- package/dist/tools/types.d.ts +1 -0
- package/dist/{tools-BEYxowf0.cjs → tools-C2q0ougI.cjs} +1 -1
- package/dist/{tools-tPy2FwMI.js → tools-ybbz1YKg.js} +1 -1
- package/dist/{utils-B_y5EDSz.cjs → utils-BjFntMW_.cjs} +6 -5
- package/dist/{utils-tRzJ8Xfy.js → utils-DN_kWhH6.js} +6 -5
- package/dist/utils.cjs +3 -3
- package/dist/utils.js +3 -3
- package/dist/{validate-DpK_G9aa.cjs → validate-CBQ0dMBb.cjs} +1 -1
- package/dist/{validate-hFVBw9Sw.js → validate-KIBMWuyc.js} +1 -1
- package/dist/vector/index.cjs +8 -8
- package/dist/vector/index.js +1 -1
- package/dist/worker/index.cjs +1 -1
- package/dist/worker/index.js +1 -1
- package/dist/{worker-BFAw0uVe.js → worker-Bqg7bsxX.js} +8 -3
- package/dist/{worker-BhaB8pNL.cjs → worker-CJ_JYSy0.cjs} +3 -3
- package/dist/{worker-KkDudGwX.cjs → worker-Ct6E5_2p.cjs} +16 -11
- package/dist/{worker-m_uyOwiv.js → worker-DVM_pvH7.js} +2 -2
- package/dist/{workflow-Uroh6hlJ.js → workflow-BmShpn3p.js} +4 -4
- package/dist/{workflow-BwKfyvhR.cjs → workflow-DEAvg0pI.cjs} +8 -8
- package/dist/workflows/builder/index.cjs +1 -1
- package/dist/workflows/builder/index.js +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/evented/workflow-event-processor/index.d.ts +0 -2
- package/dist/workflows/evented/workflow.d.ts +2 -1
- package/dist/workflows/index.cjs +54 -54
- package/dist/workflows/index.js +4 -4
- package/dist/workflows/run-storage.d.ts +16 -1
- package/dist/workflows/types.d.ts +10 -0
- package/dist/workflows/workflow.d.ts +3 -1
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/{workspace-CzzrnE6Q.cjs → workspace-BQD4tcQi.cjs} +3 -3
- package/dist/{workspace-Ct2kAiDv.js → workspace-sqcfdZRR.js} +2 -2
- package/package.json +9 -8
- package/skills/mastra/SKILL.md +171 -0
- package/skills/mastra/references/common-errors.md +557 -0
- package/skills/mastra/references/core-concepts.md +21 -0
- package/skills/mastra/references/create-mastra.md +233 -0
- package/skills/mastra/references/embedded-docs.md +103 -0
- package/skills/mastra/references/feedback.md +69 -0
- package/skills/mastra/references/gateway.md +66 -0
- package/skills/mastra/references/mastra-api.md +222 -0
- package/skills/mastra/references/migration-guide.md +185 -0
- package/skills/mastra/references/model-selection.md +29 -0
- package/skills/mastra/references/platform.md +164 -0
- package/skills/mastra/references/remote-docs.md +193 -0
- package/skills/mastra/references/trace-query.md +150 -0
- package/skills/mastra/scripts/provider-registry.mjs +271 -0
- package/src/llm/model/provider-types.generated.d.ts +7412 -7795
- package/dist/{observability-B0R_D1PZ.cjs → observability-VaoaeadK.cjs} +647 -647
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_execution_fence = require("./execution-fence-fqV6FGdV.cjs");
|
|
2
2
|
const require_message_list = require("./message-list-C0F2sDNC.cjs");
|
|
3
3
|
const require_signals = require("./signals-CWxAMEmE.cjs");
|
|
4
4
|
const require_ee_iTj2bRDt = require("./ee-iTj2bRDt-D3-QLGDF.cjs");
|
|
5
|
-
const require_channels = require("./channels-
|
|
6
|
-
const require_llm = require("./llm-
|
|
7
|
-
const require_mastra = require("./mastra-
|
|
8
|
-
const require_stream = require("./stream-
|
|
5
|
+
const require_channels = require("./channels-CbhgGgQD.cjs");
|
|
6
|
+
const require_llm = require("./llm-B7ul27Ay.cjs");
|
|
7
|
+
const require_mastra = require("./mastra-DXQUuwFl.cjs");
|
|
8
|
+
const require_stream = require("./stream-CZy8XA_q.cjs");
|
|
9
9
|
const require_request_context = require("./request-context-D9RXYCy8.cjs");
|
|
10
10
|
const require_dynamic_argument = require("./dynamic-argument-CUc1BBOS.cjs");
|
|
11
11
|
const require_error = require("./error-D90lJ6M7.cjs");
|
|
12
12
|
const require_utils_safe_stringify = require("./utils/safe-stringify.cjs");
|
|
13
|
-
const require_workspace = require("./workspace-
|
|
14
|
-
const require_output_helpers = require("./output-helpers-
|
|
13
|
+
const require_workspace = require("./workspace-BQD4tcQi.cjs");
|
|
14
|
+
const require_output_helpers = require("./output-helpers-By5FbLpp.cjs");
|
|
15
15
|
const require_memory_om_events_index = require("./memory/om-events/index.cjs");
|
|
16
|
-
const require_tools = require("./tools-
|
|
16
|
+
const require_tools = require("./tools-C2q0ougI.cjs");
|
|
17
17
|
const require_payload_transform = require("./payload-transform-CWgnsO9w.cjs");
|
|
18
|
-
const require_tool = require("./tool-
|
|
19
|
-
const require_state_processor = require("./state-processor-
|
|
18
|
+
const require_tool = require("./tool-Dn9WSDVn.cjs");
|
|
19
|
+
const require_state_processor = require("./state-processor-DaSmhVUX.cjs");
|
|
20
20
|
let zod_v4 = require("zod/v4");
|
|
21
21
|
let _mastra_schema_compat_schema = require("@mastra/schema-compat/schema");
|
|
22
22
|
// src/agent-controller/errors.ts
|
|
@@ -217,7 +217,7 @@ function getDisplayTransform(metadata, phase, fallback) {
|
|
|
217
217
|
* way to tell the response did not come from the model they selected.
|
|
218
218
|
*/
|
|
219
219
|
function describeServerSideFallback(providerMetadata) {
|
|
220
|
-
const fallback =
|
|
220
|
+
const fallback = require_execution_fence.getServerSideFallbackInfo(providerMetadata);
|
|
221
221
|
if (!fallback) return;
|
|
222
222
|
return fallback.model ? `The selected model declined this turn; the response was generated by fallback model ${fallback.model}.` : "The selected model declined this turn; the response was generated by a fallback model.";
|
|
223
223
|
}
|
|
@@ -586,7 +586,7 @@ var SessionRunEngine = class {
|
|
|
586
586
|
currentMessage: this.createEmptyAssistantMessage(threadId),
|
|
587
587
|
messageStarted: false,
|
|
588
588
|
isSuspended: false,
|
|
589
|
-
spans: new
|
|
589
|
+
spans: new require_execution_fence.MessagePartSpans({ providerMetadata: false }),
|
|
590
590
|
announcedTextSpans: /* @__PURE__ */ new Set(),
|
|
591
591
|
announcedReasoningSpans: /* @__PURE__ */ new Set(),
|
|
592
592
|
messageIdObserved: false,
|
|
@@ -737,7 +737,7 @@ var SessionRunEngine = class {
|
|
|
737
737
|
this.#session.run.setRunId({ runId: chunk.runId });
|
|
738
738
|
this.#session.__captureRunThreadOwnerId(chunk.runId, requestContext);
|
|
739
739
|
}
|
|
740
|
-
if (
|
|
740
|
+
if (require_execution_fence.isSpanChunk(chunk)) {
|
|
741
741
|
const partIndex = state.currentMessage.content.parts.length;
|
|
742
742
|
if (chunk.type === "text-start") {
|
|
743
743
|
state.spans.fold(state.currentMessage.content.parts, chunk);
|
|
@@ -995,7 +995,7 @@ var SessionRunEngine = class {
|
|
|
995
995
|
const pubsub = typeof agent.getPubSub === "function" ? agent.getPubSub() : void 0;
|
|
996
996
|
const getLeaseProvider = pubsub?.getLeaseProvider;
|
|
997
997
|
const hasPersistentLease = getLeaseProvider ? getLeaseProvider.call(pubsub) !== void 0 : require_output_helpers.isLeaseProvider(pubsub);
|
|
998
|
-
const currentSuspension = currentRunId && currentThreadId && hasPersistentLease ?
|
|
998
|
+
const currentSuspension = currentRunId && currentThreadId && hasPersistentLease ? require_execution_fence.agentThreadStreamRuntime.getResumableThreadRunSuspension({
|
|
999
999
|
threadId: currentThreadId,
|
|
1000
1000
|
resourceId: binding.resourceId,
|
|
1001
1001
|
runId: currentRunId,
|
|
@@ -1157,7 +1157,7 @@ var SessionRunEngine = class {
|
|
|
1157
1157
|
type: "error",
|
|
1158
1158
|
error: streamError
|
|
1159
1159
|
});
|
|
1160
|
-
if (!(streamError instanceof
|
|
1160
|
+
if (!(streamError instanceof require_execution_fence.AgentThreadLeaseLostError)) this.retractFailedRunSuspensions({
|
|
1161
1161
|
resourceId: state.resourceId,
|
|
1162
1162
|
threadId: state.threadId,
|
|
1163
1163
|
runId: chunk.runId ?? this.#session.run.getRunId(),
|
|
@@ -1219,7 +1219,7 @@ var SessionRunEngine = class {
|
|
|
1219
1219
|
if (finishReason === "stop" || finishReason === "end-turn") this.setStopReason(state.currentMessage, "complete", true);
|
|
1220
1220
|
else if (finishReason === "tool-calls") this.setStopReason(state.currentMessage, "tool_use", true);
|
|
1221
1221
|
else {
|
|
1222
|
-
const errorMessage =
|
|
1222
|
+
const errorMessage = require_execution_fence.describeNonSuccessFinishReason(finishReason, finishProviderMetadata);
|
|
1223
1223
|
if (errorMessage) {
|
|
1224
1224
|
this.setStopReason(state.currentMessage, "error", true);
|
|
1225
1225
|
this.setErrorMessage(state.currentMessage, errorMessage);
|
|
@@ -1606,7 +1606,7 @@ var SessionRunEngine = class {
|
|
|
1606
1606
|
type: "error",
|
|
1607
1607
|
error: streamError
|
|
1608
1608
|
});
|
|
1609
|
-
if (!(streamError instanceof
|
|
1609
|
+
if (!(streamError instanceof require_execution_fence.AgentThreadLeaseLostError)) this.retractFailedRunSuspensions({
|
|
1610
1610
|
resourceId,
|
|
1611
1611
|
threadId,
|
|
1612
1612
|
runId: this.#session.run.getRunId(),
|
|
@@ -5958,7 +5958,7 @@ var Session = class {
|
|
|
5958
5958
|
aborted = true;
|
|
5959
5959
|
});
|
|
5960
5960
|
try {
|
|
5961
|
-
const outcome = await Promise.race([
|
|
5961
|
+
const outcome = await Promise.race([require_execution_fence.agentThreadStreamRuntime.waitForCrossAgentThreadRun(agent, {
|
|
5962
5962
|
memory: {
|
|
5963
5963
|
thread: threadId,
|
|
5964
5964
|
resource: this.identity.getResourceId()
|
|
@@ -6500,7 +6500,7 @@ var Session = class {
|
|
|
6500
6500
|
* the resumed steps; otherwise the resume records them itself.
|
|
6501
6501
|
*/
|
|
6502
6502
|
#resumeUsageRecorder(agent, runId, requestContext) {
|
|
6503
|
-
if (
|
|
6503
|
+
if (require_execution_fence.agentThreadStreamRuntime.hasRunContinuation(runId, agent.getPubSub())) return void 0;
|
|
6504
6504
|
return this.machinery.buildSharedRunOptions(requestContext).onStepFinish;
|
|
6505
6505
|
}
|
|
6506
6506
|
async #approveToolCall({ toolCallId, requestContext: requestContextInput, runId: inputRunId, threadId: inputThreadId, resourceId = this.identity.getResourceId(), agent: inputAgent, abortSignal: inputAbortSignal }, onDispatch, armed) {
|
|
@@ -6637,7 +6637,7 @@ var Session = class {
|
|
|
6637
6637
|
};
|
|
6638
6638
|
const removeDeletionListener = this.machinery.onSessionDeleted?.(() => detach());
|
|
6639
6639
|
const pubsub = agent.getPubSub();
|
|
6640
|
-
const suspension =
|
|
6640
|
+
const suspension = require_execution_fence.agentThreadStreamRuntime.getResumableThreadRunSuspension(address, pubsub);
|
|
6641
6641
|
const subscription = await this.machinery.subscribeToThread({
|
|
6642
6642
|
agent,
|
|
6643
6643
|
...address,
|
|
@@ -6646,7 +6646,7 @@ var Session = class {
|
|
|
6646
6646
|
removeDeletionListener?.();
|
|
6647
6647
|
throw error;
|
|
6648
6648
|
});
|
|
6649
|
-
if (suspension && !
|
|
6649
|
+
if (suspension && !require_execution_fence.agentThreadStreamRuntime.getResumableThreadRun(address, pubsub)) require_execution_fence.agentThreadStreamRuntime.__restoreThreadRunSuspension(address, suspension, pubsub);
|
|
6650
6650
|
detach = () => {
|
|
6651
6651
|
disposed = true;
|
|
6652
6652
|
subscription.unsubscribe();
|
|
@@ -7131,7 +7131,7 @@ Use this tool when:
|
|
|
7131
7131
|
});
|
|
7132
7132
|
subagentRequestContext.set(require_request_context.MASTRA_THREAD_ID_KEY, forkedThread.id);
|
|
7133
7133
|
subagentRequestContext.set(require_request_context.MASTRA_RESOURCE_ID_KEY, forkedThread.resourceId);
|
|
7134
|
-
subagentRequestContext.delete(
|
|
7134
|
+
subagentRequestContext.delete(require_execution_fence.CHAT_CHANNEL_RENDER_CONTEXT_KEY);
|
|
7135
7135
|
}
|
|
7136
7136
|
const inheritedToolsets = await opts.getParentToolsets?.(subagentRequestContext);
|
|
7137
7137
|
if (inheritedToolsets) {
|
|
@@ -7175,7 +7175,7 @@ Use this tool when:
|
|
|
7175
7175
|
isError: true
|
|
7176
7176
|
};
|
|
7177
7177
|
}
|
|
7178
|
-
subagentToRun = new
|
|
7178
|
+
subagentToRun = new require_execution_fence.Agent({
|
|
7179
7179
|
id: `subagent-${definition.id}`,
|
|
7180
7180
|
name: `${definition.name} Subagent`,
|
|
7181
7181
|
instructions: definition.instructions,
|
|
@@ -7712,13 +7712,13 @@ var AgentController = class {
|
|
|
7712
7712
|
releaseSuspendedRun: async (runId) => {
|
|
7713
7713
|
const mastra = this.getMastra();
|
|
7714
7714
|
if (!mastra) return;
|
|
7715
|
-
mastra.__unregisterInternalWorkflow(
|
|
7715
|
+
mastra.__unregisterInternalWorkflow(require_execution_fence.AGENTIC_LOOP_WORKFLOW_ID, runId);
|
|
7716
7716
|
const workflowsStore = await mastra.getStorage()?.getStore("workflows");
|
|
7717
7717
|
await Promise.all([
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
|
|
7718
|
+
require_execution_fence.AGENTIC_LOOP_WORKFLOW_ID,
|
|
7719
|
+
require_execution_fence.AGENTIC_EXECUTION_WORKFLOW_ID,
|
|
7720
|
+
require_execution_fence.DurableStepIds.AGENTIC_LOOP,
|
|
7721
|
+
require_execution_fence.DurableStepIds.AGENTIC_EXECUTION
|
|
7722
7722
|
].map((workflowName) => workflowsStore?.deleteWorkflowRunById({
|
|
7723
7723
|
runId,
|
|
7724
7724
|
workflowName
|
|
@@ -7781,8 +7781,9 @@ var AgentController = class {
|
|
|
7781
7781
|
* @param resourceId - Memory resource to bind this session to. Defaults to the controller `resourceId` or `id`.
|
|
7782
7782
|
* @param createInitialThread - Create a thread when no existing thread matches. Defaults to true.
|
|
7783
7783
|
* @param resumeOnly - Only return a live session or recover one from a stored thread; never start a new conversation.
|
|
7784
|
+
* @param resumeLatestThread - Bind the most recent matching thread when no `threadId` is given. Defaults to true.
|
|
7784
7785
|
*/
|
|
7785
|
-
async createSession({ resourceId, ownerId, id, tags, threadId, createInitialThread = true, resumeOnly = false, workspace, browser, requestContext } = {}) {
|
|
7786
|
+
async createSession({ resourceId, ownerId, id, tags, threadId, createInitialThread = true, resumeOnly = false, resumeLatestThread = true, workspace, browser, requestContext } = {}) {
|
|
7786
7787
|
const effectiveResourceId = resourceId ?? this.config.resourceId ?? this.config.id;
|
|
7787
7788
|
const effectiveSessionId = id ?? effectiveResourceId;
|
|
7788
7789
|
const effectiveOwnerId = ownerId ?? this.config.id;
|
|
@@ -7847,6 +7848,7 @@ var AgentController = class {
|
|
|
7847
7848
|
threadId,
|
|
7848
7849
|
createInitialThread: resumeOnly ? false : createInitialThread,
|
|
7849
7850
|
resumeOnly,
|
|
7851
|
+
resumeLatestThread,
|
|
7850
7852
|
workspace,
|
|
7851
7853
|
browser,
|
|
7852
7854
|
requestContext
|
|
@@ -7962,11 +7964,13 @@ var AgentController = class {
|
|
|
7962
7964
|
id: overrides.threadId,
|
|
7963
7965
|
requestContext
|
|
7964
7966
|
});
|
|
7967
|
+
} else if (overrides?.resumeLatestThread === false && !overrides.resumeOnly) {
|
|
7968
|
+
if (overrides.createInitialThread !== false) await session.thread.create({ requestContext });
|
|
7965
7969
|
} else {
|
|
7966
7970
|
const scopeEntries = Object.entries(session.getThreadScope());
|
|
7967
7971
|
let metadata;
|
|
7968
7972
|
try {
|
|
7969
|
-
if (scopeEntries.length > 0) metadata =
|
|
7973
|
+
if (scopeEntries.length > 0) metadata = require_execution_fence.validateStorageMetadataFilter(Object.fromEntries(scopeEntries));
|
|
7970
7974
|
} catch {}
|
|
7971
7975
|
const candidates = await this.queryThreads({
|
|
7972
7976
|
resourceId: session.identity.getResourceId(),
|
|
@@ -8006,7 +8010,7 @@ var AgentController = class {
|
|
|
8006
8010
|
let metadata;
|
|
8007
8011
|
let filterable = true;
|
|
8008
8012
|
try {
|
|
8009
|
-
if (scopeEntries.length > 0) metadata =
|
|
8013
|
+
if (scopeEntries.length > 0) metadata = require_execution_fence.validateStorageMetadataFilter(Object.fromEntries(scopeEntries));
|
|
8010
8014
|
} catch {
|
|
8011
8015
|
filterable = false;
|
|
8012
8016
|
}
|
|
@@ -8475,7 +8479,7 @@ var AgentController = class {
|
|
|
8475
8479
|
const boundedLimit = limit === void 0 ? void 0 : Math.max(0, Math.floor(limit));
|
|
8476
8480
|
if (boundedLimit === 0) return [];
|
|
8477
8481
|
let threads;
|
|
8478
|
-
if (boundedLimit === void 0 || memoryStorage instanceof
|
|
8482
|
+
if (boundedLimit === void 0 || memoryStorage instanceof require_execution_fence.InMemoryMemory || memoryStorage.listThreadsPaginatesInMemory) threads = (await memoryStorage.listThreads({
|
|
8479
8483
|
filter,
|
|
8480
8484
|
perPage: false,
|
|
8481
8485
|
orderBy: {
|
|
@@ -8696,7 +8700,7 @@ var AgentController = class {
|
|
|
8696
8700
|
...mode.additionalTools
|
|
8697
8701
|
};
|
|
8698
8702
|
const model = mode.defaultModelId;
|
|
8699
|
-
this.#legacyAgentMode[mode.id] = new
|
|
8703
|
+
this.#legacyAgentMode[mode.id] = new require_execution_fence.Agent({
|
|
8700
8704
|
id: `${this.id}-agent`,
|
|
8701
8705
|
name: `Harness ${this.id} agent`,
|
|
8702
8706
|
model,
|
|
@@ -9017,7 +9021,7 @@ var AgentController = class {
|
|
|
9017
9021
|
...callTimeInstructions && { instructions: callTimeInstructions }
|
|
9018
9022
|
};
|
|
9019
9023
|
streamOptions.toolsets = await this.buildToolsets(session, requestContext);
|
|
9020
|
-
requestContext.setRaw(
|
|
9024
|
+
requestContext.setRaw(require_execution_fence.CONTROLLER_RUN_BINDING_KEY, {
|
|
9021
9025
|
controllerId: this.id,
|
|
9022
9026
|
agentId: this.getCurrentAgent(session).id,
|
|
9023
9027
|
sessionId: session.identity.getId(),
|
|
@@ -9206,7 +9210,7 @@ var AgentController = class {
|
|
|
9206
9210
|
abortSignal
|
|
9207
9211
|
});
|
|
9208
9212
|
const context = restored.get("controller");
|
|
9209
|
-
|
|
9213
|
+
require_execution_fence.restoredWorkerControllerContexts.add(context);
|
|
9210
9214
|
return restored;
|
|
9211
9215
|
}
|
|
9212
9216
|
/** @internal Rebuild worker tools from the controller's local configuration. */
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ca as validateStorageMetadataFilter, H as MessagePartSpans, T as Agent, U as isSpanChunk, Xr as InMemoryMemory, a as AGENTIC_EXECUTION_WORKFLOW_ID, bc as DurableStepIds, i as agentThreadStreamRuntime, kn as CHAT_CHANNEL_RENDER_CONTEXT_KEY, lu as CONTROLLER_RUN_BINDING_KEY, o as AGENTIC_LOOP_WORKFLOW_ID, r as AgentThreadLeaseLostError, s as describeNonSuccessFinishReason, uu as restoredWorkerControllerContexts, xt as getServerSideFallbackInfo } from "./execution-fence-B8yV_n51.js";
|
|
2
2
|
import { n as MessageList } from "./message-list-RgFlLrxG.js";
|
|
3
3
|
import { c as isUserAuthoredMessage, n as createSignal, u as resolveDeliveryAttributes } from "./signals-CqR_iWkg.js";
|
|
4
4
|
import { i as MastraFGAPermissions } from "./ee-iTj2bRDt-By_B9ngH.js";
|
|
5
|
-
import { a as AgentControllerChannels } from "./channels-
|
|
6
|
-
import { a as ModelRouterLanguageModel, l as defaultGateways, s as GatewayManager } from "./llm-
|
|
7
|
-
import { t as Mastra } from "./mastra-
|
|
8
|
-
import {
|
|
5
|
+
import { a as AgentControllerChannels } from "./channels-BBwgs50q.js";
|
|
6
|
+
import { a as ModelRouterLanguageModel, l as defaultGateways, s as GatewayManager } from "./llm-Cy3WZXgA.js";
|
|
7
|
+
import { t as Mastra } from "./mastra-yjoYfTS5.js";
|
|
8
|
+
import { qt as TITLE_PINNED_THREAD_METADATA_KEY, zn as createRunScopeKey } from "./stream-BFhCDJvz.js";
|
|
9
9
|
import { c as MASTRA_THREAD_ID_KEY, i as MASTRA_MESSAGE_AUTHOR_KEY, o as MASTRA_RESOURCE_ID_KEY, u as RequestContext } from "./request-context-COnZHt2-.js";
|
|
10
10
|
import { n as resolveDynamicArgument } from "./dynamic-argument-BzPK3qPN.js";
|
|
11
11
|
import { i as MastraError, o as getErrorFromUnknown } from "./error-oh2DLsP2.js";
|
|
12
12
|
import { toStandardSchema } from "./schema/index.js";
|
|
13
13
|
import { safeStringify } from "./utils/safe-stringify.js";
|
|
14
|
-
import { c as Workspace, h as createWorkspaceTools } from "./workspace-
|
|
15
|
-
import {
|
|
14
|
+
import { c as Workspace, h as createWorkspaceTools } from "./workspace-sqcfdZRR.js";
|
|
15
|
+
import { S as isLeaseProvider } from "./output-helpers-k2-48ssH.js";
|
|
16
16
|
import { omEventFromChunk } from "./memory/om-events/index.js";
|
|
17
|
-
import { s as askUserTool, t as submitPlanTool } from "./tools-
|
|
17
|
+
import { s as askUserTool, t as submitPlanTool } from "./tools-ybbz1YKg.js";
|
|
18
18
|
import { n as hasTransformedToolPayload, t as getTransformedToolPayload } from "./payload-transform-Dj3HUeD4.js";
|
|
19
|
-
import { r as createTool, s as isValidationError } from "./tool-
|
|
20
|
-
import { d as summarizeTaskCheck, f as taskCheckTool, h as taskWriteTool, m as taskUpdateTool, p as taskCompleteTool } from "./state-processor-
|
|
19
|
+
import { r as createTool, s as isValidationError } from "./tool-DIFduuTw.js";
|
|
20
|
+
import { d as summarizeTaskCheck, f as taskCheckTool, h as taskWriteTool, m as taskUpdateTool, p as taskCompleteTool } from "./state-processor-B_KsS82m.js";
|
|
21
21
|
import { z } from "zod/v4";
|
|
22
22
|
// src/agent-controller/errors.ts
|
|
23
23
|
/** The session was aborted or switched before a pending prompt could start. */
|
|
@@ -7781,8 +7781,9 @@ var AgentController = class {
|
|
|
7781
7781
|
* @param resourceId - Memory resource to bind this session to. Defaults to the controller `resourceId` or `id`.
|
|
7782
7782
|
* @param createInitialThread - Create a thread when no existing thread matches. Defaults to true.
|
|
7783
7783
|
* @param resumeOnly - Only return a live session or recover one from a stored thread; never start a new conversation.
|
|
7784
|
+
* @param resumeLatestThread - Bind the most recent matching thread when no `threadId` is given. Defaults to true.
|
|
7784
7785
|
*/
|
|
7785
|
-
async createSession({ resourceId, ownerId, id, tags, threadId, createInitialThread = true, resumeOnly = false, workspace, browser, requestContext } = {}) {
|
|
7786
|
+
async createSession({ resourceId, ownerId, id, tags, threadId, createInitialThread = true, resumeOnly = false, resumeLatestThread = true, workspace, browser, requestContext } = {}) {
|
|
7786
7787
|
const effectiveResourceId = resourceId ?? this.config.resourceId ?? this.config.id;
|
|
7787
7788
|
const effectiveSessionId = id ?? effectiveResourceId;
|
|
7788
7789
|
const effectiveOwnerId = ownerId ?? this.config.id;
|
|
@@ -7847,6 +7848,7 @@ var AgentController = class {
|
|
|
7847
7848
|
threadId,
|
|
7848
7849
|
createInitialThread: resumeOnly ? false : createInitialThread,
|
|
7849
7850
|
resumeOnly,
|
|
7851
|
+
resumeLatestThread,
|
|
7850
7852
|
workspace,
|
|
7851
7853
|
browser,
|
|
7852
7854
|
requestContext
|
|
@@ -7962,6 +7964,8 @@ var AgentController = class {
|
|
|
7962
7964
|
id: overrides.threadId,
|
|
7963
7965
|
requestContext
|
|
7964
7966
|
});
|
|
7967
|
+
} else if (overrides?.resumeLatestThread === false && !overrides.resumeOnly) {
|
|
7968
|
+
if (overrides.createInitialThread !== false) await session.thread.create({ requestContext });
|
|
7965
7969
|
} else {
|
|
7966
7970
|
const scopeEntries = Object.entries(session.getThreadScope());
|
|
7967
7971
|
let metadata;
|
|
@@ -22,6 +22,9 @@ const require_workspace_skills = require("./workspace-skills-BcquhPDn.cjs");
|
|
|
22
22
|
* references: {
|
|
23
23
|
* 'checklist.md': '# Review Checklist\n...',
|
|
24
24
|
* },
|
|
25
|
+
* scripts: {
|
|
26
|
+
* 'lint.sh': '#!/bin/sh\npnpm lint',
|
|
27
|
+
* },
|
|
25
28
|
* });
|
|
26
29
|
* ```
|
|
27
30
|
*/
|
|
@@ -34,23 +37,32 @@ const require_workspace_skills = require("./workspace-skills-BcquhPDn.cjs");
|
|
|
34
37
|
* @throws Error if the skill metadata fails validation
|
|
35
38
|
*/
|
|
36
39
|
function createSkill(input) {
|
|
37
|
-
const { name, description, instructions, license, compatibility, metadata
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
const { name, description, instructions, license, compatibility, metadata } = input;
|
|
41
|
+
const references = input.references ?? {};
|
|
42
|
+
const scripts = input.scripts ?? {};
|
|
43
|
+
const assets = input.assets ?? {};
|
|
44
|
+
const errors = [
|
|
45
|
+
...require_workspace_skills.validateSkillMetadata({
|
|
46
|
+
metadata: {
|
|
47
|
+
name,
|
|
48
|
+
description,
|
|
49
|
+
license,
|
|
50
|
+
compatibility,
|
|
51
|
+
"user-invocable": input["user-invocable"],
|
|
52
|
+
metadata
|
|
53
|
+
},
|
|
54
|
+
instructions
|
|
55
|
+
}).errors,
|
|
56
|
+
...invalidFilePaths("references", references),
|
|
57
|
+
...invalidFilePaths("scripts", scripts),
|
|
58
|
+
...invalidFilePaths("assets", assets)
|
|
59
|
+
];
|
|
60
|
+
if (errors.length > 0) throw new Error(`Invalid skill "${name}": ${errors.join("; ")}`);
|
|
51
61
|
return {
|
|
52
62
|
__inline: true,
|
|
53
|
-
__referenceContents: references
|
|
63
|
+
__referenceContents: references,
|
|
64
|
+
__scriptContents: scripts,
|
|
65
|
+
__assetContents: assets,
|
|
54
66
|
name,
|
|
55
67
|
description,
|
|
56
68
|
instructions,
|
|
@@ -63,12 +75,29 @@ function createSkill(input) {
|
|
|
63
75
|
type: "local",
|
|
64
76
|
projectPath: `inline/${name}`
|
|
65
77
|
},
|
|
66
|
-
references:
|
|
67
|
-
scripts:
|
|
68
|
-
assets:
|
|
78
|
+
references: Object.keys(references),
|
|
79
|
+
scripts: Object.keys(scripts),
|
|
80
|
+
assets: Object.keys(assets)
|
|
69
81
|
};
|
|
70
82
|
}
|
|
71
83
|
/**
|
|
84
|
+
* File keys are paths inside the skill's `references/`, `scripts/`, or `assets/`
|
|
85
|
+
* directory, so they must be relative, use `/` separators, stay inside it, and
|
|
86
|
+
* never name both a file and a directory.
|
|
87
|
+
*/
|
|
88
|
+
function invalidFilePaths(dir, files) {
|
|
89
|
+
const keys = Object.keys(files);
|
|
90
|
+
const errors = [];
|
|
91
|
+
for (const key of keys) if (key.includes("\\")) errors.push(`${dir}: "${key}" must use / to separate directories`);
|
|
92
|
+
else if (key.startsWith("/") || /^[a-zA-Z]:/.test(key) || key.split("/").some((segment) => [
|
|
93
|
+
"",
|
|
94
|
+
".",
|
|
95
|
+
".."
|
|
96
|
+
].includes(segment))) errors.push(`${dir}: "${key}" must be a relative file path inside ${dir}/`);
|
|
97
|
+
else if (keys.some((other) => other.startsWith(`${key}/`))) errors.push(`${dir}: "${key}" is both a file and a directory`);
|
|
98
|
+
return errors;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
72
101
|
* Type guard: is this skill an inline skill (from createSkill)?
|
|
73
102
|
*/
|
|
74
103
|
function isInlineSkill(skill) {
|
|
@@ -84,16 +113,17 @@ function isInlineSkill(skill) {
|
|
|
84
113
|
* Directory layout emulation:
|
|
85
114
|
* Each inline skill appears as a directory at `inline/<name>/` with:
|
|
86
115
|
* - SKILL.md (generated from the skill's metadata + instructions)
|
|
87
|
-
* - references/<
|
|
116
|
+
* - references/<path> (from the skill's `references` map)
|
|
117
|
+
* - scripts/<path> (from the skill's `scripts` map)
|
|
118
|
+
* - assets/<path> (from the skill's `assets` map)
|
|
119
|
+
*
|
|
120
|
+
* Keys containing `/` become nested directories.
|
|
88
121
|
*/
|
|
89
122
|
var InlineSkillSource = class {
|
|
90
|
-
#
|
|
91
|
-
|
|
92
|
-
#skillMdCache;
|
|
123
|
+
#trees;
|
|
124
|
+
#createdAt = /* @__PURE__ */ new Date();
|
|
93
125
|
constructor(skills) {
|
|
94
|
-
this.#
|
|
95
|
-
this.#skillMdCache = /* @__PURE__ */ new Map();
|
|
96
|
-
for (const skill of skills) this.#skillMdCache.set(skill.name, this.#buildSkillMd(skill));
|
|
126
|
+
this.#trees = new Map(skills.map((skill) => [skill.name, this.#buildTree(skill)]));
|
|
97
127
|
}
|
|
98
128
|
/**
|
|
99
129
|
* Build a synthetic SKILL.md from an inline skill's metadata and instructions.
|
|
@@ -109,112 +139,107 @@ var InlineSkillSource = class {
|
|
|
109
139
|
if (skill.metadata) frontmatter.metadata = skill.metadata;
|
|
110
140
|
return require_workspace_skills.stringifyFrontmatter(skill.instructions, frontmatter);
|
|
111
141
|
}
|
|
142
|
+
#buildTree(skill) {
|
|
143
|
+
const files = /* @__PURE__ */ new Map([["SKILL.md", this.#buildSkillMd(skill)]]);
|
|
144
|
+
const directories = /* @__PURE__ */ new Set([""]);
|
|
145
|
+
const subdirs = [
|
|
146
|
+
["references", skill.__referenceContents],
|
|
147
|
+
["scripts", skill.__scriptContents],
|
|
148
|
+
["assets", skill.__assetContents]
|
|
149
|
+
];
|
|
150
|
+
for (const [subdir, contents] of subdirs) for (const [relativePath, content] of Object.entries(contents ?? {})) {
|
|
151
|
+
const filePath = `${subdir}/${relativePath}`;
|
|
152
|
+
files.set(filePath, content);
|
|
153
|
+
const segments = filePath.split("/");
|
|
154
|
+
for (let i = 1; i < segments.length; i++) directories.add(segments.slice(0, i).join("/"));
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
files,
|
|
158
|
+
directories
|
|
159
|
+
};
|
|
160
|
+
}
|
|
112
161
|
/**
|
|
113
|
-
*
|
|
114
|
-
*
|
|
162
|
+
* Resolve a path like `inline/<name>/references/file.md` to the skill's tree
|
|
163
|
+
* and the skill-relative sub-path.
|
|
115
164
|
*/
|
|
116
|
-
#
|
|
165
|
+
#resolve(inputPath) {
|
|
117
166
|
if (!inputPath.startsWith("inline/")) return null;
|
|
118
|
-
const rest = inputPath.slice(7);
|
|
167
|
+
const rest = inputPath.slice(7).replace(/\/+$/, "");
|
|
119
168
|
const slashIdx = rest.indexOf("/");
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
};
|
|
169
|
+
const name = slashIdx === -1 ? rest : rest.slice(0, slashIdx);
|
|
170
|
+
const tree = this.#trees.get(name);
|
|
171
|
+
if (!tree) return null;
|
|
124
172
|
return {
|
|
125
|
-
|
|
126
|
-
|
|
173
|
+
name,
|
|
174
|
+
tree,
|
|
175
|
+
subPath: slashIdx === -1 ? "" : rest.slice(slashIdx + 1)
|
|
127
176
|
};
|
|
128
177
|
}
|
|
129
|
-
#
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
if (!skill) return null;
|
|
134
|
-
return {
|
|
135
|
-
skill,
|
|
136
|
-
subPath: parsed.subPath
|
|
137
|
-
};
|
|
178
|
+
#enoent(path) {
|
|
179
|
+
const error = /* @__PURE__ */ new Error(`ENOENT: no such file or directory: ${path}`);
|
|
180
|
+
error.code = "ENOENT";
|
|
181
|
+
return error;
|
|
138
182
|
}
|
|
139
183
|
async exists(path) {
|
|
140
|
-
const
|
|
141
|
-
if (!
|
|
142
|
-
|
|
143
|
-
if (subPath === "") return true;
|
|
144
|
-
if (subPath === "SKILL.md") return true;
|
|
145
|
-
if (subPath === "references") return (skill.references?.length ?? 0) > 0;
|
|
146
|
-
if (subPath.startsWith("references/")) {
|
|
147
|
-
const refPath = subPath.slice(11);
|
|
148
|
-
return skill.references.includes(refPath);
|
|
149
|
-
}
|
|
150
|
-
return false;
|
|
184
|
+
const resolved = this.#resolve(path);
|
|
185
|
+
if (!resolved) return false;
|
|
186
|
+
return resolved.tree.files.has(resolved.subPath) || resolved.tree.directories.has(resolved.subPath);
|
|
151
187
|
}
|
|
152
188
|
async stat(path) {
|
|
153
|
-
const
|
|
154
|
-
if (!
|
|
155
|
-
const {
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
189
|
+
const resolved = this.#resolve(path);
|
|
190
|
+
if (!resolved) throw this.#enoent(path);
|
|
191
|
+
const { name, tree, subPath } = resolved;
|
|
192
|
+
const createdAt = this.#createdAt;
|
|
193
|
+
const baseName = subPath === "" ? name : subPath.slice(subPath.lastIndexOf("/") + 1);
|
|
194
|
+
if (tree.directories.has(subPath)) return {
|
|
195
|
+
name: baseName,
|
|
159
196
|
type: "directory",
|
|
160
197
|
size: 0,
|
|
161
|
-
createdAt
|
|
162
|
-
modifiedAt:
|
|
198
|
+
createdAt,
|
|
199
|
+
modifiedAt: createdAt
|
|
163
200
|
};
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
if (subPath === "references") return {
|
|
176
|
-
name: "references",
|
|
177
|
-
type: "directory",
|
|
178
|
-
size: 0,
|
|
179
|
-
createdAt: now,
|
|
180
|
-
modifiedAt: now
|
|
201
|
+
const content = tree.files.get(subPath);
|
|
202
|
+
if (content === void 0) throw this.#enoent(path);
|
|
203
|
+
return {
|
|
204
|
+
name: baseName,
|
|
205
|
+
type: "file",
|
|
206
|
+
size: typeof content === "string" ? Buffer.byteLength(content, "utf-8") : content.byteLength,
|
|
207
|
+
createdAt,
|
|
208
|
+
modifiedAt: createdAt,
|
|
209
|
+
...subPath === "SKILL.md" ? { mimeType: "text/markdown" } : {}
|
|
181
210
|
};
|
|
182
|
-
throw new Error(`ENOENT: no such file or directory: ${path}`);
|
|
183
211
|
}
|
|
184
212
|
async readFile(path) {
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
if (subPath.startsWith("references/")) {
|
|
190
|
-
const refPath = subPath.slice(11);
|
|
191
|
-
const content = skill.__referenceContents[refPath];
|
|
192
|
-
if (content !== void 0) return content;
|
|
193
|
-
}
|
|
194
|
-
throw new Error(`ENOENT: no such file or directory: ${path}`);
|
|
213
|
+
const resolved = this.#resolve(path);
|
|
214
|
+
const content = resolved?.tree.files.get(resolved.subPath);
|
|
215
|
+
if (content === void 0) throw this.#enoent(path);
|
|
216
|
+
return typeof content === "string" ? content : Buffer.from(content.buffer, content.byteOffset, content.byteLength);
|
|
195
217
|
}
|
|
196
218
|
async readdir(path) {
|
|
197
|
-
const
|
|
198
|
-
if (!
|
|
199
|
-
const {
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
name: "references",
|
|
219
|
+
const resolved = this.#resolve(path);
|
|
220
|
+
if (!resolved || !resolved.tree.directories.has(resolved.subPath)) return [];
|
|
221
|
+
const { tree, subPath } = resolved;
|
|
222
|
+
const prefix = subPath === "" ? "" : `${subPath}/`;
|
|
223
|
+
const entries = /* @__PURE__ */ new Map();
|
|
224
|
+
for (const dir of tree.directories) {
|
|
225
|
+
if (dir === "" || !dir.startsWith(prefix)) continue;
|
|
226
|
+
const rest = dir.slice(prefix.length);
|
|
227
|
+
if (rest.includes("/")) continue;
|
|
228
|
+
entries.set(rest, {
|
|
229
|
+
name: rest,
|
|
209
230
|
type: "directory"
|
|
210
231
|
});
|
|
211
|
-
return entries;
|
|
212
232
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
233
|
+
for (const filePath of tree.files.keys()) {
|
|
234
|
+
if (!filePath.startsWith(prefix)) continue;
|
|
235
|
+
const rest = filePath.slice(prefix.length);
|
|
236
|
+
if (rest.includes("/")) continue;
|
|
237
|
+
entries.set(rest, {
|
|
238
|
+
name: rest,
|
|
239
|
+
type: "file"
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
return [...entries.values()];
|
|
218
243
|
}
|
|
219
244
|
};
|
|
220
245
|
// src/skills/agent-skills-resolver.ts
|