@mastra/core 1.86.0-alpha.6 → 1.86.0-alpha.7
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_core@0.1.4/dist/memory/index.d.ts +25 -0
- package/dist/agent/agent.d.ts +27 -11
- package/dist/agent/agent.types.d.ts +4 -0
- package/dist/agent/durable/create-durable-agent.d.ts +1 -1
- package/dist/agent/durable/durable-agent.d.ts +30 -500
- package/dist/agent/durable/durable-stream-until-idle.d.ts +2 -1
- package/dist/agent/durable/evented-agent.d.ts +2 -5
- package/dist/agent/durable/execution-engine.d.ts +20 -3
- package/dist/agent/durable/index.cjs +55 -6338
- package/dist/agent/durable/index.d.ts +3 -2
- package/dist/agent/durable/index.js +44 -6327
- package/dist/agent/durable/stream-adapter.d.ts +5 -5
- package/dist/agent/durable/types.d.ts +454 -3
- package/dist/agent/durable/workflows/durable-loop-builder.d.ts +7 -9
- package/dist/agent/helpers.d.ts +1 -1
- package/dist/agent/index.cjs +4 -4
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +4 -4
- package/dist/agent/streams/execution-capability.d.ts +3 -2
- package/dist/agent/streams/execution-policy.d.ts +1 -1
- package/dist/agent/streams/types.d.ts +3 -3
- package/dist/agent/types.d.ts +5 -5
- package/dist/agent-builder/ee/index.cjs +1 -1
- package/dist/agent-builder/ee/index.js +1 -1
- package/dist/agent-controller/index.cjs +2 -2
- package/dist/agent-controller/index.js +2 -2
- package/dist/{agent-controller-c4KbZ8DY.js → agent-controller-Cf3_IuY8.js} +9 -9
- package/dist/{agent-controller-6ORqG6hK.cjs → agent-controller-K5vHtqfO.cjs} +9 -9
- package/dist/{agent-skills-resolver-BIeWsb01.cjs → agent-skills-resolver-BMoCDoaK.cjs} +1 -1
- package/dist/{agent-skills-resolver-k04IRam7.js → agent-skills-resolver-CUEIMDbx.js} +1 -1
- package/dist/background-tasks/index.cjs +1 -1
- package/dist/background-tasks/index.js +1 -1
- package/dist/{background-tasks-CEglmAt7.js → background-tasks-BgpX1P_s.js} +1 -1
- package/dist/{background-tasks-Da0c3R-J.cjs → background-tasks-DqnQMfuf.cjs} +1 -1
- package/dist/browser/index.cjs +2 -2
- package/dist/browser/index.js +2 -2
- package/dist/{builder-DS826dWf.cjs → builder-D8Osghdo.cjs} +3 -3
- package/dist/{builder-0V9N8S15.js → builder-x295GDL6.js} +3 -3
- package/dist/capabilities/302ai.json +191 -191
- package/dist/capabilities/abliteratedllm.json +36 -36
- package/dist/capabilities/abliteration-ai.json +7 -7
- package/dist/capabilities/above.json +20 -20
- package/dist/capabilities/adaption.json +10 -10
- package/dist/capabilities/adzuki.json +31 -31
- package/dist/capabilities/agentrouter.json +10 -10
- package/dist/capabilities/ai-router.json +9 -9
- package/dist/capabilities/aiand.json +19 -19
- package/dist/capabilities/aigrow.json +14 -14
- package/dist/capabilities/aimlapi.json +142 -142
- package/dist/capabilities/aipg.json +2 -2
- package/dist/capabilities/aixy.json +20 -20
- package/dist/capabilities/aki-io.json +15 -15
- package/dist/capabilities/alibaba-cn.json +90 -90
- package/dist/capabilities/alibaba-coding-plan-cn.json +5 -5
- package/dist/capabilities/alibaba-coding-plan.json +5 -5
- package/dist/capabilities/alibaba-token-plan-cn.json +55 -55
- package/dist/capabilities/alibaba-token-plan.json +57 -57
- package/dist/capabilities/alibaba.json +64 -64
- package/dist/capabilities/ambient.json +12 -12
- package/dist/capabilities/amd.json +8 -8
- package/dist/capabilities/anthropic.json +60 -36
- package/dist/capabilities/anyapi.json +14 -14
- package/dist/capabilities/apiko.json +2 -2
- package/dist/capabilities/arcee.json +11 -11
- package/dist/capabilities/augure.json +5 -5
- package/dist/capabilities/auriko.json +19 -19
- package/dist/capabilities/bailing.json +5 -5
- package/dist/capabilities/baseten.json +18 -18
- package/dist/capabilities/bee.json +3 -3
- package/dist/capabilities/berget.json +8 -8
- package/dist/capabilities/bothub.json +13 -13
- package/dist/capabilities/boundless.json +35 -35
- package/dist/capabilities/bumo.json +44 -44
- package/dist/capabilities/byteplus.json +31 -31
- package/dist/capabilities/cerebras.json +4 -4
- package/dist/capabilities/cheapaimodel.json +10 -10
- package/dist/capabilities/cheapest-token.json +31 -31
- package/dist/capabilities/chutes.json +8 -8
- package/dist/capabilities/cline-pass.json +41 -41
- package/dist/capabilities/cloudcode.json +7 -7
- package/dist/capabilities/cloudflare-workers-ai.json +31 -31
- package/dist/capabilities/commandcode.json +147 -147
- package/dist/capabilities/concentrate.json +259 -259
- package/dist/capabilities/cortecs.json +109 -109
- package/dist/capabilities/crossmodel.json +169 -169
- package/dist/capabilities/crusoe.json +10 -10
- package/dist/capabilities/daoxe.json +9 -9
- package/dist/capabilities/databricks.json +59 -59
- package/dist/capabilities/deepinfra.json +85 -85
- package/dist/capabilities/deepseek.json +3 -3
- package/dist/capabilities/digitalocean.json +113 -113
- package/dist/capabilities/dothoosh.json +29 -29
- package/dist/capabilities/doubleword.json +23 -23
- package/dist/capabilities/edenai.json +454 -453
- package/dist/capabilities/empiriolabs.json +170 -170
- package/dist/capabilities/engy.json +22 -22
- package/dist/capabilities/entrim.json +6 -6
- package/dist/capabilities/evroc.json +16 -16
- package/dist/capabilities/ezkielyna.json +9 -9
- package/dist/capabilities/fastrouter.json +80 -80
- package/dist/capabilities/fireworks-ai.json +65 -65
- package/dist/capabilities/freemodel.json +21 -21
- package/dist/capabilities/friendli.json +6 -6
- package/dist/capabilities/frogbot.json +89 -89
- package/dist/capabilities/gisoo.json +19 -19
- package/dist/capabilities/gmicloud.json +16 -16
- package/dist/capabilities/google.json +57 -57
- package/dist/capabilities/graphn.json +12 -12
- package/dist/capabilities/greenpt.json +34 -34
- package/dist/capabilities/groq.json +2 -2
- package/dist/capabilities/helicone.json +83 -83
- package/dist/capabilities/hostinger-router.json +11 -11
- package/dist/capabilities/hpc-ai.json +14 -14
- package/dist/capabilities/huawei-maas.json +14 -14
- package/dist/capabilities/hubris.json +25 -25
- package/dist/capabilities/huggingface.json +48 -48
- package/dist/capabilities/hyper.json +26 -26
- package/dist/capabilities/impossibl.json +132 -132
- package/dist/capabilities/inception.json +2 -2
- package/dist/capabilities/inco.json +5 -5
- package/dist/capabilities/infer.json +12 -12
- package/dist/capabilities/inferall.json +10 -10
- package/dist/capabilities/inference-coop.json +11 -11
- package/dist/capabilities/inferenceapis.json +6 -6
- package/dist/capabilities/inferris.json +4 -4
- package/dist/capabilities/infersia.json +14 -14
- package/dist/capabilities/inferx.json +3 -3
- package/dist/capabilities/infomaniak.json +4 -4
- package/dist/capabilities/io-net.json +2 -2
- package/dist/capabilities/isoquant.json +4 -4
- package/dist/capabilities/iteracompute.json +60 -60
- package/dist/capabilities/jad-ai.json +3 -3
- package/dist/capabilities/jalapeno.json +10 -10
- package/dist/capabilities/jiekou.json +65 -65
- package/dist/capabilities/jzstoken.json +52 -52
- package/dist/capabilities/keln.json +23 -23
- package/dist/capabilities/kenari.json +122 -116
- package/dist/capabilities/kilo.json +627 -627
- 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 +2 -2
- package/dist/capabilities/klavo.json +24 -24
- package/dist/capabilities/korouter.json +29 -29
- package/dist/capabilities/kunavo.json +7 -7
- package/dist/capabilities/liquid.json +10 -10
- package/dist/capabilities/lithosai.json +2 -2
- package/dist/capabilities/llmgateway-providers.json +890 -890
- package/dist/capabilities/llmgateway.json +333 -333
- package/dist/capabilities/llmtr.json +30 -30
- package/dist/capabilities/longcat.json +3 -3
- package/dist/capabilities/lowrouter.json +51 -51
- package/dist/capabilities/lyceum.json +14 -14
- package/dist/capabilities/melious.json +15 -15
- package/dist/capabilities/merge-gateway.json +236 -236
- package/dist/capabilities/meta.json +11 -11
- package/dist/capabilities/mistral.json +21 -21
- package/dist/capabilities/mixlayer.json +3 -3
- package/dist/capabilities/modal.json +10 -10
- package/dist/capabilities/model-oracle-ai.json +24 -24
- package/dist/capabilities/modelis.json +20 -20
- package/dist/capabilities/modelscope.json +2 -2
- package/dist/capabilities/modular.json +5 -5
- package/dist/capabilities/moneo.json +16 -16
- package/dist/capabilities/moonshotai-cn.json +7 -7
- package/dist/capabilities/moonshotai.json +7 -7
- package/dist/capabilities/morph.json +16 -16
- package/dist/capabilities/munito-eu.json +4 -4
- package/dist/capabilities/munito.json +6 -6
- package/dist/capabilities/nan.json +29 -29
- package/dist/capabilities/nano-gpt.json +586 -556
- package/dist/capabilities/nearai.json +89 -89
- package/dist/capabilities/nebius.json +29 -29
- package/dist/capabilities/neon.json +126 -126
- package/dist/capabilities/neuralwatt.json +43 -43
- package/dist/capabilities/nokeep.json +2 -2
- package/dist/capabilities/novita-ai.json +140 -140
- package/dist/capabilities/nvidia.json +35 -35
- package/dist/capabilities/oathbreaker.json +2 -2
- package/dist/capabilities/obscurify.json +31 -31
- package/dist/capabilities/oci.json +7 -7
- package/dist/capabilities/ofox.json +354 -354
- package/dist/capabilities/ollama-cloud.json +54 -54
- package/dist/capabilities/openai.json +53 -60
- package/dist/capabilities/opencode-go.json +89 -89
- package/dist/capabilities/openreason.json +5 -5
- package/dist/capabilities/openrouter.json +553 -553
- package/dist/capabilities/opper.json +28 -28
- package/dist/capabilities/orcarouter.json +248 -248
- package/dist/capabilities/outerlabs.json +32 -32
- package/dist/capabilities/ovhcloud.json +4 -4
- package/dist/capabilities/pareto.json +5 -5
- package/dist/capabilities/perplexity-agent.json +55 -55
- package/dist/capabilities/phala.json +33 -33
- package/dist/capabilities/pioneer.json +28 -28
- package/dist/capabilities/poe.json +121 -121
- package/dist/capabilities/poolside.json +3 -3
- package/dist/capabilities/powerspring.json +12 -12
- package/dist/capabilities/primalabs.json +9 -9
- package/dist/capabilities/prime.json +111 -111
- package/dist/capabilities/privatemode-ai.json +13 -13
- package/dist/capabilities/proxystacks.json +7 -7
- package/dist/capabilities/qiniu-ai.json +15 -15
- package/dist/capabilities/refuseless.json +10 -10
- package/dist/capabilities/regolo-ai.json +6 -6
- package/dist/capabilities/requesty.json +171 -188
- package/dist/capabilities/ruapi.json +19 -19
- package/dist/capabilities/runcrate.json +8 -8
- package/dist/capabilities/runinfra.json +13 -13
- package/dist/capabilities/sakana.json +6 -6
- package/dist/capabilities/sambanova.json +6 -6
- package/dist/capabilities/sandbase.json +25 -25
- package/dist/capabilities/sarvam.json +13 -13
- package/dist/capabilities/scaleway.json +20 -20
- package/dist/capabilities/scnet-token-plan.json +8 -8
- package/dist/capabilities/scx-ai.json +30 -30
- package/dist/capabilities/sensenova.json +13 -13
- package/dist/capabilities/siliconflow-cn.json +68 -68
- package/dist/capabilities/siliconflow.json +60 -60
- package/dist/capabilities/snowflake-cortex.json +20 -20
- package/dist/capabilities/sokkan.json +7 -7
- package/dist/capabilities/sparrowcodes.json +23 -23
- package/dist/capabilities/standardcompute.json +103 -103
- package/dist/capabilities/steadyrouter.json +36 -36
- package/dist/capabilities/stepfun-ai-step-plan.json +4 -4
- package/dist/capabilities/stepfun-ai.json +4 -4
- package/dist/capabilities/stepfun-step-plan.json +4 -4
- package/dist/capabilities/stepfun.json +4 -4
- package/dist/capabilities/stepping-stone.json +20 -20
- package/dist/capabilities/subconscious.json +2 -2
- package/dist/capabilities/superbot-gg.json +4 -4
- package/dist/capabilities/synthetic.json +11 -11
- package/dist/capabilities/synthorai.json +23 -23
- package/dist/capabilities/teamorouter.json +21 -21
- package/dist/capabilities/teapot-router.json +12 -12
- package/dist/capabilities/tencent-coding-plan.json +2 -2
- package/dist/capabilities/tencent-token-plan.json +24 -24
- package/dist/capabilities/tencent-tokenhub.json +6 -6
- package/dist/capabilities/tensorx.json +50 -50
- package/dist/capabilities/tenstorrent.json +5 -5
- package/dist/capabilities/the-grid-ai.json +28 -28
- package/dist/capabilities/thinkingmachines.json +60 -60
- package/dist/capabilities/tinfoil.json +14 -14
- package/dist/capabilities/toapis.json +3 -3
- package/dist/capabilities/togetherai.json +51 -51
- package/dist/capabilities/tokengo.json +16 -16
- package/dist/capabilities/tokenify.json +9 -9
- package/dist/capabilities/trustedrouter.json +7 -7
- package/dist/capabilities/trustedtokens.json +15 -15
- package/dist/capabilities/umans-ai-coding-plan.json +14 -14
- package/dist/capabilities/umans-ai.json +12 -12
- package/dist/capabilities/uncensuredai.json +5 -5
- package/dist/capabilities/unrestricted.json +8 -8
- package/dist/capabilities/uplinkswitch.json +19 -19
- package/dist/capabilities/upstage.json +4 -4
- package/dist/capabilities/vancine.json +21 -21
- package/dist/capabilities/vercel.json +551 -551
- package/dist/capabilities/vivgrid.json +85 -85
- package/dist/capabilities/volcengine-coding-plan.json +30 -30
- package/dist/capabilities/volcengine.json +36 -36
- package/dist/capabilities/vultr.json +31 -31
- package/dist/capabilities/wafer.ai.json +16 -16
- package/dist/capabilities/wallaby.json +5 -5
- package/dist/capabilities/wally.json +12 -12
- package/dist/capabilities/wandb.json +15 -15
- package/dist/capabilities/watt.json +23 -23
- package/dist/capabilities/xai.json +6 -6
- package/dist/capabilities/xiaomi-token-plan-ams.json +2 -2
- package/dist/capabilities/xiaomi-token-plan-cn.json +3 -3
- package/dist/capabilities/xiaomi-token-plan-sgp.json +2 -2
- package/dist/capabilities/xiaomi.json +6 -6
- package/dist/capabilities/xpersona.json +13 -13
- package/dist/capabilities/xxapi.json +27 -27
- package/dist/capabilities/zai-coding-plan.json +10 -10
- package/dist/capabilities/zai.json +26 -26
- package/dist/capabilities/zenifra.json +28 -28
- package/dist/capabilities/zenmux.json +197 -197
- package/dist/capabilities/zerogpu.json +14 -14
- package/dist/capabilities/zhipuai-coding-plan.json +7 -7
- package/dist/capabilities/zhipuai.json +24 -24
- package/dist/capabilities/zro.json +7 -7
- package/dist/channels/agent-channels.d.ts +11 -0
- package/dist/channels/chat-tools.d.ts +156 -0
- package/dist/channels/index.cjs +7 -2
- package/dist/channels/index.d.ts +2 -0
- package/dist/channels/index.js +3 -3
- package/dist/{channels-C5DxhFRc.js → channels-Dx4jiXeK.js} +1 -1
- package/dist/{channels-B57qQolh.cjs → channels-q6qnuRNV.cjs} +1 -1
- package/dist/coding-agent/index.cjs +4 -4
- package/dist/coding-agent/index.js +4 -4
- package/dist/{constants-DaBkXs5H.cjs → constants-B9ZDvXZ4.cjs} +41 -0
- package/dist/{constants-BDHIyN28.js → constants-BmdTvEYN.js} +30 -1
- package/dist/datasets/index.cjs +2 -2
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1289 -1284
- package/dist/docs/references/reference-agents-agent.md +1 -1
- package/dist/docs/references/reference-agents-channels.md +34 -1
- package/dist/docs/references/reference-agents-durable-agent.md +26 -2
- package/dist/evals/index.cjs +2 -2
- package/dist/evals/index.js +2 -2
- package/dist/evals/scoreTraces/index.cjs +2 -2
- package/dist/evals/scoreTraces/index.js +2 -2
- package/dist/events/index.cjs +1 -1
- package/dist/events/index.js +1 -1
- package/dist/{filesystem-CUj0vclS.cjs → filesystem-B0AZrbj8.cjs} +1 -1
- package/dist/{filesystem-BBqrAmKK.js → filesystem-B3s0WRud.js} +1 -1
- package/dist/{filesystem-B_HACoLS.js → filesystem-B5X-5G0x.js} +1 -1
- package/dist/{filesystem-pZNvxjuW.cjs → filesystem-BDSpwBke.cjs} +1 -1
- package/dist/{filesystem-5Z777gYZ.js → filesystem-BsdkC311.js} +1 -1
- package/dist/{filesystem-BNHPgtjJ.cjs → filesystem-C-cyJfi1.cjs} +1 -1
- package/dist/{filesystem-U5o28b5w.cjs → filesystem-CEbD_77-.cjs} +1 -1
- package/dist/{filesystem-yHKEz2Pr.cjs → filesystem-CUAgLugE.cjs} +1 -1
- package/dist/{filesystem-Cb8iTPM-.js → filesystem-Cv79mHRk.js} +1 -1
- package/dist/{filesystem-DhiaddZe.cjs → filesystem-DsCQiBl2.cjs} +1 -1
- package/dist/{filesystem-DSYDB3ek.js → filesystem-DzM9pcQ8.js} +1 -1
- package/dist/{filesystem-gpIfFMed.js → filesystem-DzfqVTO_.js} +1 -1
- package/dist/{filesystem-versioned-CxbiSJF-.js → filesystem-versioned-Bijb_p9l.js} +44 -44
- package/dist/harness/index.cjs +2 -2
- package/dist/harness/index.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/knowledge/index.cjs +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/llm/index.cjs +3 -3
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/provider-types.generated.d.ts +7744 -7747
- package/dist/{llm-ByskI6z3.cjs → llm-CsQuqKPc.cjs} +2 -2
- package/dist/{llm-B0VtQDgT.js → llm-DnXK3Pmw.js} +2 -2
- package/dist/loop/base-loop-builder.d.ts +60 -0
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +2 -2
- package/dist/loop/loop-builder.d.ts +10 -32
- package/dist/loop/workflows/agentic-execution/index.d.ts +1 -1
- package/dist/loop/workflows/agentic-loop/index.d.ts +1 -1
- package/dist/{manager-C2RGNH68.js → manager-BsghM-UL.js} +3 -3
- package/dist/{manager-BJKx4lQf.cjs → manager-DwFnIrI6.cjs} +3 -3
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/{mastra-zUTq9ilk.js → mastra-B8i1UDZs.js} +51 -25
- package/dist/{mastra-FXCeC5rF.cjs → mastra-Cn5NC6Es.cjs} +51 -25
- package/dist/memory/index.cjs +2 -2
- package/dist/memory/index.js +2 -2
- package/dist/{model-BmTFNo62.cjs → model-CNPfry_X.cjs} +1 -1
- package/dist/{model-BTNRPDgQ.js → model-CsOcWMUt.js} +1 -1
- package/dist/{netlify-B_XdjYPY.cjs → netlify-C-83Fxus.cjs} +1 -1
- package/dist/{netlify-BCSVhO5q.js → netlify-C-OpNSGp.js} +1 -1
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/{output-helpers-RlvE2WPA.js → output-helpers-D4II19No.js} +45 -45
- package/dist/processor-provider/index.cjs +1 -1
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +2 -2
- package/dist/processors/index.js +2 -2
- package/dist/processors/processors/pii-detector.d.ts +1 -0
- package/dist/{provider-registry-D8O1G18A.cjs → provider-registry-9O-H9osy.cjs} +22407 -22407
- package/dist/{provider-registry-Ble43Wb4.js → provider-registry-RZ8EgSe8.js} +22407 -22407
- package/dist/provider-registry.json +22277 -22277
- package/dist/{registry-generator-BQ1noftK.cjs → registry-generator-DxCX-FiO.cjs} +1 -1
- package/dist/{registry-generator-D1Zslex6.js → registry-generator-e8sltJls.js} +1 -1
- package/dist/{rehydrate-BiA_HUJH.cjs → rehydrate-B-wrAN7C.cjs} +2 -2
- package/dist/{rehydrate-CgxEur9m.js → rehydrate-D3fPgJwp.js} +2 -2
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +2 -2
- package/dist/{run-registry-aomba2_Z.cjs → run-registry-5_LQBGn_.cjs} +83635 -77661
- package/dist/{run-registry-BUFmc_78.js → run-registry-DC03XLeZ.js} +83435 -76843
- package/dist/{scheduler-BuivoTeD.js → scheduler-B-VZUvv_.js} +1 -1
- package/dist/{scheduler-COSuIH7R.cjs → scheduler-D00X03jQ.cjs} +1 -1
- package/dist/schedules/index.cjs +1 -1
- package/dist/schedules/index.js +1 -1
- package/dist/{schedules-Dmu9qOgc.js → schedules-DZfSx-7P.js} +94 -94
- package/dist/{signal-provider-CicwpNwY.cjs → signal-provider-BFAvh_AJ.cjs} +1 -1
- package/dist/{signal-provider-BOtSN-_0.js → signal-provider-BslnAjWG.js} +1 -1
- package/dist/signals/index.cjs +3 -3
- package/dist/signals/index.js +3 -3
- package/dist/{signals-6EBDPHQX.cjs → signals-B1JSj-Ew.cjs} +2 -2
- package/dist/{signals-BH__LS8Y.js → signals-De9VnwL2.js} +2 -2
- package/dist/skills/index.cjs +2 -2
- package/dist/skills/index.js +2 -2
- package/dist/{source-8qxr6KJv.cjs → source-DDwx-87N.cjs} +1 -1
- package/dist/{source-DRqDgbCv.js → source-Did_2XQc.js} +1 -1
- package/dist/{state-processor-BRk8t1OR.js → state-processor-B9kxpM53.js} +140 -140
- package/dist/{state-processor-Bfs9LkY8.cjs → state-processor-kRNZ38Nf.cjs} +139 -139
- 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/mcp-clients/index.cjs +1 -1
- package/dist/storage/domains/mcp-clients/index.js +1 -1
- package/dist/storage/domains/mcp-servers/index.cjs +1 -1
- package/dist/storage/domains/mcp-servers/index.js +1 -1
- package/dist/storage/domains/memory/base.d.ts +3 -1
- package/dist/storage/domains/memory/observational-memory-lifecycle.d.ts +1 -1
- package/dist/storage/domains/prompt-blocks/index.cjs +1 -1
- package/dist/storage/domains/prompt-blocks/index.js +1 -1
- package/dist/storage/domains/scorer-definitions/index.cjs +1 -1
- package/dist/storage/domains/scorer-definitions/index.js +1 -1
- package/dist/storage/domains/skills/index.cjs +1 -1
- package/dist/storage/domains/skills/index.js +1 -1
- package/dist/storage/domains/workspaces/index.cjs +1 -1
- package/dist/storage/domains/workspaces/index.js +1 -1
- package/dist/storage/index.cjs +12 -11
- package/dist/storage/index.js +12 -12
- package/dist/storage/types.d.ts +13 -0
- package/dist/stream/index.cjs +2 -2
- package/dist/stream/index.js +2 -2
- package/dist/{stream-DUrp3Fcy.cjs → stream-4aNIw_TQ.cjs} +1 -1
- package/dist/{stream-S_NC5v9e.js → stream-CJUm6EAH.js} +1 -1
- package/dist/test-utils/llm-mock.cjs +1 -1
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/tool-loop-agent/index.cjs +1 -1
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/{tool-loop-agent-DU0BiemT.cjs → tool-loop-agent-Dn0QCB9n.cjs} +3 -3
- package/dist/{tool-loop-agent-BhCzpGfr.js → tool-loop-agent-FEEwHfmg.js} +3 -3
- package/dist/tools/index.cjs +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/{utils-DYIai19q.js → utils-Bd_y1_a-.js} +1 -1
- package/dist/{utils-CeEt4K7t.cjs → utils-DY01hxVd.cjs} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{validate-BRikrNhF.js → validate-CX0yQo_q.js} +1 -1
- package/dist/{validate-BckgxuJ0.cjs → validate-CuB_1Zd3.cjs} +1 -1
- package/dist/vector/index.cjs +1 -1
- package/dist/vector/index.js +1 -1
- package/dist/worker/index.cjs +1 -1
- package/dist/worker/index.js +1 -1
- package/dist/{worker-Du5ybt5o.js → worker-B80xkcKG.js} +3 -3
- package/dist/{worker-D9WwmcJa.cjs → worker-CbaSmip-.cjs} +3 -3
- package/dist/{worker-DcBfwJqD.js → worker-DSEfMPmq.js} +3 -3
- package/dist/{worker-BfhUD77l.cjs → worker-GsGIxPMa.cjs} +3 -3
- package/dist/{workflow-jNWVBYDJ.js → workflow-CZHY_C85.js} +4 -4
- package/dist/{workflow-BWV5m9Mx.cjs → workflow-CnBPXTpv.cjs} +4 -4
- package/dist/workflows/builder/index.cjs +1 -1
- package/dist/workflows/builder/index.js +1 -1
- package/dist/workflows/evented/index.cjs +1 -1
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/evented/workflow.d.ts +1 -1
- package/dist/workflows/index.cjs +6 -6
- package/dist/workflows/index.js +6 -6
- package/dist/workspace/index.cjs +2 -2
- package/dist/workspace/index.js +2 -2
- package/dist/{workspace-BQ2wZj5D.cjs → workspace-D2drutNg.cjs} +607 -607
- package/dist/{workspace-D7JRhn1Z.js → workspace-D7TIleIt.js} +609 -609
- package/dist/{workspace-skills-CGiXfKzA.js → workspace-skills-38OY32_b.js} +531 -531
- package/package.json +8 -8
- package/src/llm/model/provider-types.generated.d.ts +7744 -7747
- package/dist/agent/durable/evented-execution-engine.d.ts +0 -20
- package/dist/{filesystem-versioned-D-OCaYSl.cjs → filesystem-versioned-DZGyPbNC.cjs} +43 -43
- package/dist/{output-helpers-CncZ3y-g.cjs → output-helpers-JL-HeCbT.cjs} +44 -44
- package/dist/{schedules-qIHUKsj4.cjs → schedules-BZS8McF7.cjs} +93 -93
- package/dist/{workspace-skills-CUSjYHdi.cjs → workspace-skills-BcquhPDn.cjs} +530 -530
|
@@ -18,11 +18,11 @@ import type { AgentStreamEvent, DurableAgentStepFinishResult, AgentSuspendedEven
|
|
|
18
18
|
* untagged events, from runs fenced by a pubsub lease, are always kept.
|
|
19
19
|
*
|
|
20
20
|
* `minGeneration` and `rereadMinGeneration` work as on
|
|
21
|
-
* {@link
|
|
21
|
+
* {@link DurableStreamAdapterOptions}. The result is a boolean, so event order is
|
|
22
22
|
* kept, except while a failed claim read must be retried before a stream-ending
|
|
23
23
|
* event, which is the only time it is a promise.
|
|
24
24
|
*/
|
|
25
|
-
export declare function createRunGenerationFilter({ minGeneration, rereadMinGeneration, }: Pick<
|
|
25
|
+
export declare function createRunGenerationFilter({ minGeneration, rereadMinGeneration, }: Pick<DurableStreamAdapterOptions, 'minGeneration' | 'rereadMinGeneration'>): (event: AgentStreamEvent) => boolean | Promise<boolean>;
|
|
26
26
|
/** Drop only the uncheckpointed tail superseded by a later recovery. Earlier generations' committed steps remain. */
|
|
27
27
|
export declare function createSupersededEventFilter(history: AgentStreamEvent[]): (event: AgentStreamEvent) => boolean;
|
|
28
28
|
/** The newest run-log index in `history`, i.e. how far the run had got when it was read. */
|
|
@@ -30,7 +30,7 @@ export declare function newestLogIndex(history: AgentStreamEvent[]): number | un
|
|
|
30
30
|
/**
|
|
31
31
|
* Options for creating a durable agent stream
|
|
32
32
|
*/
|
|
33
|
-
export interface
|
|
33
|
+
export interface DurableStreamAdapterOptions<OUTPUT = undefined> {
|
|
34
34
|
/** Signal chunks to hide from this caller's stream. */
|
|
35
35
|
hideSignals?: AgentExecutionOptionsBase<OUTPUT>['hideSignals'];
|
|
36
36
|
/** Pubsub instance to subscribe to */
|
|
@@ -186,7 +186,7 @@ export interface DurableAgentStreamOptions<OUTPUT = undefined> {
|
|
|
186
186
|
/**
|
|
187
187
|
* Result from creating a durable agent stream
|
|
188
188
|
*/
|
|
189
|
-
export interface
|
|
189
|
+
export interface DurableStreamAdapterResult<OUTPUT = undefined> {
|
|
190
190
|
/** The MastraModelOutput that streams from pubsub events */
|
|
191
191
|
output: MastraModelOutput<OUTPUT>;
|
|
192
192
|
/** Cleanup function to unsubscribe from pubsub */
|
|
@@ -219,6 +219,6 @@ export interface DurableAgentStreamResult<OUTPUT = undefined> {
|
|
|
219
219
|
* pubsub events into a ReadableStream that MastraModelOutput can consume.
|
|
220
220
|
* Callbacks are invoked as events arrive.
|
|
221
221
|
*/
|
|
222
|
-
export declare function createDurableAgentStream<OUTPUT = undefined>(options:
|
|
222
|
+
export declare function createDurableAgentStream<OUTPUT = undefined>(options: DurableStreamAdapterOptions<OUTPUT>): DurableStreamAdapterResult<OUTPUT>;
|
|
223
223
|
export { createStepStartChunk, emitAbortEvent, emitChunkEvent, emitErrorEvent, emitFinishEvent, emitIterationCompleteEvent, emitIterationStartEvent, emitOwnershipClaimedEvent, emitStepFinishEvent, emitStepStartEvent, emitSuspendedEvent, publishStepStartChunk, } from '../streams/events.js';
|
|
224
224
|
//# sourceMappingURL=stream-adapter.d.ts.map
|
|
@@ -9,7 +9,7 @@ import type { BackgroundTaskManager } from '../../background-tasks/manager.js';
|
|
|
9
9
|
import type { AgentBackgroundConfig } from '../../background-tasks/types.js';
|
|
10
10
|
import type { ScoringFilter } from '../../evals/predicate.js';
|
|
11
11
|
import type { SystemMessage } from '../../llm/index.js';
|
|
12
|
-
import type { MastraLanguageModel, SharedProviderOptions } from '../../llm/model/shared.types.js';
|
|
12
|
+
import type { MastraLanguageModel, MastraModelConfig, SharedProviderOptions } from '../../llm/model/shared.types.js';
|
|
13
13
|
import type { ToolResultCommitOutcome } from '../../loop/shared/steps/tool-result-commit-core.js';
|
|
14
14
|
import type { ToolCallConcurrency } from '../../loop/types.js';
|
|
15
15
|
import type { Mastra } from '../../mastra/index.js';
|
|
@@ -20,9 +20,12 @@ import type { AIModelGenerationSpan, Span, SpanTermination, SpanType, TracingCon
|
|
|
20
20
|
import type { InputProcessorOrWorkflow, LLMRequestProcessorOrWorkflow, OutputProcessorOrWorkflow, ErrorProcessorOrWorkflow } from '../../processors/index.js';
|
|
21
21
|
import type { ProcessorState } from '../../processors/runner.js';
|
|
22
22
|
import type { RequestContext } from '../../request-context/index.js';
|
|
23
|
-
import type {
|
|
23
|
+
import type { MastraModelOutput } from '../../stream/base/output.js';
|
|
24
|
+
import type { ChunkType, MastraOnFinishCallback, MastraStreamTransformOptions, StepTripwireData } from '../../stream/types.js';
|
|
24
25
|
import type { ToolPayloadTransformMetadata } from '../../tools/payload-transform.js';
|
|
25
26
|
import type { CoreTool, MCPToolExecutionContext, RequireToolApproval, ToolPayloadTransformPolicy, ToolPayloadTransformTarget } from '../../tools/types.js';
|
|
27
|
+
import type { DynamicArgument } from '../../types/index.js';
|
|
28
|
+
import type { ShouldPersistSnapshotFn, WorkflowRunStatus } from '../../workflows/types.js';
|
|
26
29
|
import type { Workspace } from '../../workspace/index.js';
|
|
27
30
|
import type { Agent } from '../agent.js';
|
|
28
31
|
import type { AgentExecutionOptions } from '../agent.types.js';
|
|
@@ -30,8 +33,9 @@ import type { AIV5ResponseMessage, MessageList } from '../message-list/index.js'
|
|
|
30
33
|
import type { SerializedMessageListState } from '../message-list/state/index.js';
|
|
31
34
|
import type { SaveQueueManager } from '../save-queue/index.js';
|
|
32
35
|
import type { PendingSignalListener, AgentSignalInput, CreatedAgentSignal } from '../signals.js';
|
|
36
|
+
import type { AgentStreamsConfig } from '../streams/types.js';
|
|
33
37
|
import type { TripwireData } from '../trip-wire.js';
|
|
34
|
-
import type { AgentMethodType, GoalConfig, StructuredOutputOptions } from '../types.js';
|
|
38
|
+
import type { AgentMethodType, GoalConfig, StructuredOutputOptions, ToolsInput } from '../types.js';
|
|
35
39
|
import type { ExecutionFence } from './execution-fence.js';
|
|
36
40
|
import type { ResponseRecord } from './workflows/shared/schemas.js';
|
|
37
41
|
/**
|
|
@@ -1148,4 +1152,451 @@ export type DurableAgenticWorkflowInputSchema = z.ZodType<DurableAgenticWorkflow
|
|
|
1148
1152
|
export type DurableLLMStepOutputSchema = z.ZodType<DurableLLMStepOutput>;
|
|
1149
1153
|
export type DurableToolCallInputSchema = z.ZodType<DurableToolCallInput>;
|
|
1150
1154
|
export type DurableToolCallOutputSchema = z.ZodType<DurableToolCallOutput>;
|
|
1155
|
+
/**
|
|
1156
|
+
* Options for DurableAgent.stream()
|
|
1157
|
+
*/
|
|
1158
|
+
export interface DurableAgentStreamOptions<OUTPUT = undefined> {
|
|
1159
|
+
/** Signal chunks to hide from this caller's stream. Does not affect generated results. */
|
|
1160
|
+
hideSignals?: AgentExecutionOptions<OUTPUT>['hideSignals'];
|
|
1161
|
+
/** Custom instructions that override the agent's default instructions for this execution */
|
|
1162
|
+
instructions?: AgentExecutionOptions<OUTPUT>['instructions'];
|
|
1163
|
+
/** Additional context messages to provide to the agent */
|
|
1164
|
+
context?: AgentExecutionOptions<OUTPUT>['context'];
|
|
1165
|
+
/** Memory configuration for conversation persistence and retrieval */
|
|
1166
|
+
memory?: AgentExecutionOptions<OUTPUT>['memory'];
|
|
1167
|
+
/** Scopes this run acts with. See `AgentExecutionOptions.scopes`. */
|
|
1168
|
+
scopes?: string[];
|
|
1169
|
+
/** Unique identifier for this execution run */
|
|
1170
|
+
runId?: string;
|
|
1171
|
+
/** Request Context containing dynamic configuration and state */
|
|
1172
|
+
requestContext?: AgentExecutionOptions<OUTPUT>['requestContext'];
|
|
1173
|
+
/** Maximum number of steps to run */
|
|
1174
|
+
maxSteps?: number;
|
|
1175
|
+
/**
|
|
1176
|
+
* Model to run for this call instead of the agent's model.
|
|
1177
|
+
*
|
|
1178
|
+
* A model instance can't be persisted, so `recover()` in another process falls back to the
|
|
1179
|
+
* agent's own model and logs a warning.
|
|
1180
|
+
*/
|
|
1181
|
+
model?: DynamicArgument<MastraModelConfig>;
|
|
1182
|
+
/**
|
|
1183
|
+
* Conditions for stopping execution (e.g., step count, token limit).
|
|
1184
|
+
*
|
|
1185
|
+
* The predicate is non-serializable, so it's parked on the in-process run
|
|
1186
|
+
* registry and evaluated by the durable loop on every iteration. Cross-process
|
|
1187
|
+
* durable engines (e.g. Inngest after a worker restart) cannot recover the
|
|
1188
|
+
* closure and degrade to `maxSteps` only.
|
|
1189
|
+
*/
|
|
1190
|
+
stopWhen?: AgentExecutionOptions<OUTPUT>['stopWhen'];
|
|
1191
|
+
/** Additional tool sets that can be used for this execution */
|
|
1192
|
+
toolsets?: AgentExecutionOptions<OUTPUT>['toolsets'];
|
|
1193
|
+
/** Client-side tools available during execution */
|
|
1194
|
+
clientTools?: AgentExecutionOptions<OUTPUT>['clientTools'];
|
|
1195
|
+
/** Tool selection strategy */
|
|
1196
|
+
toolChoice?: AgentExecutionOptions<OUTPUT>['toolChoice'];
|
|
1197
|
+
/** Tool names enabled for this execution */
|
|
1198
|
+
activeTools?: AgentExecutionOptions<OUTPUT>['activeTools'];
|
|
1199
|
+
/** Model-specific settings like temperature */
|
|
1200
|
+
modelSettings?: AgentExecutionOptions<OUTPUT>['modelSettings'];
|
|
1201
|
+
/** Provider-specific options forwarded to the model (serialized into the durable workflow input) */
|
|
1202
|
+
providerOptions?: AgentExecutionOptions<OUTPUT>['providerOptions'];
|
|
1203
|
+
/** Require approval for tool calls. Boolean (gate all / none) or a per-call function policy. */
|
|
1204
|
+
requireToolApproval?: AgentExecutionOptions<OUTPUT>['requireToolApproval'];
|
|
1205
|
+
/** Automatically resume suspended tools */
|
|
1206
|
+
autoResumeSuspendedTools?: boolean;
|
|
1207
|
+
/** Maximum number of tool calls to execute concurrently, or an object with `limit`/`strategy` */
|
|
1208
|
+
toolCallConcurrency?: AgentExecutionOptions<OUTPUT>['toolCallConcurrency'];
|
|
1209
|
+
/** Whether to include raw chunks in the stream output */
|
|
1210
|
+
includeRawChunks?: boolean;
|
|
1211
|
+
/** Experimental transforms applied whenever `fullStream` is consumed. */
|
|
1212
|
+
experimentalTransform?: MastraStreamTransformOptions<OUTPUT>;
|
|
1213
|
+
/** Maximum processor retries */
|
|
1214
|
+
maxProcessorRetries?: number;
|
|
1215
|
+
/** Structured output configuration */
|
|
1216
|
+
structuredOutput?: AgentExecutionOptions<OUTPUT>['structuredOutput'];
|
|
1217
|
+
/** Whether to return detailed scoring data in the response */
|
|
1218
|
+
returnScorerData?: boolean;
|
|
1219
|
+
/** Version overrides for sub-agent delegation */
|
|
1220
|
+
versions?: AgentExecutionOptions<OUTPUT>['versions'];
|
|
1221
|
+
/** Callback when chunk is received */
|
|
1222
|
+
onChunk?: (chunk: ChunkType<OUTPUT>) => void | Promise<void>;
|
|
1223
|
+
/** Callback when step finishes */
|
|
1224
|
+
onStepFinish?: (result: DurableAgentStepFinishResult) => void | Promise<void>;
|
|
1225
|
+
/** Callback when execution finishes — receives rich step data (text, steps, toolResults) */
|
|
1226
|
+
onFinish?: MastraOnFinishCallback<OUTPUT>;
|
|
1227
|
+
/** Callback on error */
|
|
1228
|
+
onError?: ({ error }: {
|
|
1229
|
+
error: Error | string;
|
|
1230
|
+
}) => void | Promise<void>;
|
|
1231
|
+
/** Callback when workflow suspends (e.g., for tool approval) */
|
|
1232
|
+
onSuspended?: (data: AgentSuspendedEventData) => void | Promise<void>;
|
|
1233
|
+
/** Callback when execution is aborted via abortSignal */
|
|
1234
|
+
onAbort?: AgentExecutionOptions<OUTPUT>['onAbort'];
|
|
1235
|
+
/** Callback fired after each agentic-loop iteration */
|
|
1236
|
+
onIterationComplete?: AgentExecutionOptions<OUTPUT>['onIterationComplete'];
|
|
1237
|
+
/** Additional system message appended after context but before user messages. */
|
|
1238
|
+
system?: AgentExecutionOptions<OUTPUT>['system'];
|
|
1239
|
+
/** When true, background tasks are disabled for this run. */
|
|
1240
|
+
disableBackgroundTasks?: AgentExecutionOptions<OUTPUT>['disableBackgroundTasks'];
|
|
1241
|
+
/** Execution-scoped background dispatch policy for delegated agents. */
|
|
1242
|
+
backgroundTaskPolicy?: AgentExecutionOptions<OUTPUT>['backgroundTaskPolicy'];
|
|
1243
|
+
/** Tracing options forwarded to the agent/model spans. */
|
|
1244
|
+
tracingOptions?: AgentExecutionOptions<OUTPUT>['tracingOptions'];
|
|
1245
|
+
/** Per-call actor signal forwarded to FGA checks and tool execution. */
|
|
1246
|
+
actor?: AgentExecutionOptions<OUTPUT>['actor'];
|
|
1247
|
+
/** MCP protocol context forwarded to tools for in-process durable runs. */
|
|
1248
|
+
mcp?: AgentExecutionOptions<OUTPUT>['mcp'];
|
|
1249
|
+
/**
|
|
1250
|
+
* Per-call tool lifecycle hooks. Applied when tools are prepared for this execution.
|
|
1251
|
+
* Function hooks are not serialized; a cross-process recovery cannot restore them.
|
|
1252
|
+
*/
|
|
1253
|
+
hooks?: AgentExecutionOptions<OUTPUT>['hooks'];
|
|
1254
|
+
/**
|
|
1255
|
+
* Per-invocation tool payload transform policy. The closure rides on the
|
|
1256
|
+
* in-process run registry; only the JSON-safe `targets` shadow is serialized
|
|
1257
|
+
* for cross-process engines.
|
|
1258
|
+
*/
|
|
1259
|
+
transform?: AgentExecutionOptions<OUTPUT>['transform'];
|
|
1260
|
+
/**
|
|
1261
|
+
* Per-step preparation hook. Closure-only: stored on the in-process run
|
|
1262
|
+
* registry and invoked as a `PrepareStepProcessor` at the start of every
|
|
1263
|
+
* iteration. Cross-process resumes lose the hook.
|
|
1264
|
+
*/
|
|
1265
|
+
prepareStep?: AgentExecutionOptions<OUTPUT>['prepareStep'];
|
|
1266
|
+
/**
|
|
1267
|
+
* Per-call `isTaskComplete` policy. Scorer instances and `onComplete` are
|
|
1268
|
+
* closure-only and live on the in-process run registry; the JSON-safe
|
|
1269
|
+
* primitives (`strategy`, `timeout`, `parallel`, `suppressFeedback`,
|
|
1270
|
+
* `scorerNames`) are serialized for cross-process observability.
|
|
1271
|
+
*/
|
|
1272
|
+
isTaskComplete?: AgentExecutionOptions<OUTPUT>['isTaskComplete'];
|
|
1273
|
+
/**
|
|
1274
|
+
* Sub-agent delegation hooks (`onDelegationStart`, `onDelegationComplete`,
|
|
1275
|
+
* `messageFilter`, etc.). The callbacks are forwarded into `convertTools`
|
|
1276
|
+
* at prepare time and burned into the sub-agent `CoreTool` wrappers on the
|
|
1277
|
+
* in-process run registry. Cross-process resumes lose the callbacks (only
|
|
1278
|
+
* `includeSubAgentToolResultsInModelContext` would be JSON-safe), so a
|
|
1279
|
+
* fresh worker degrades to default delegation behaviour.
|
|
1280
|
+
*/
|
|
1281
|
+
delegation?: AgentExecutionOptions<OUTPUT>['delegation'];
|
|
1282
|
+
/**
|
|
1283
|
+
* When set, `stream()` delegates to the idle-loop wrapper that keeps the
|
|
1284
|
+
* outer stream open across background-task continuations — the same
|
|
1285
|
+
* behaviour as the now-deprecated `streamUntilIdle()`.
|
|
1286
|
+
*
|
|
1287
|
+
* Pass `true` for default idle timeout (5 min), or `{ maxIdleMs }` to
|
|
1288
|
+
* customise.
|
|
1289
|
+
*
|
|
1290
|
+
* @example
|
|
1291
|
+
* ```typescript
|
|
1292
|
+
* const { output, cleanup } = await durableAgent.stream('Research topic', {
|
|
1293
|
+
* untilIdle: true,
|
|
1294
|
+
* memory: { thread: 't1', resource: 'u1' },
|
|
1295
|
+
* });
|
|
1296
|
+
* ```
|
|
1297
|
+
*/
|
|
1298
|
+
untilIdle?: boolean | {
|
|
1299
|
+
maxIdleMs?: number;
|
|
1300
|
+
};
|
|
1301
|
+
/** When true, the in-loop background task check step skips waiting (streamUntilIdle sets this) */
|
|
1302
|
+
_skipBgTaskWait?: boolean;
|
|
1303
|
+
/**
|
|
1304
|
+
* @internal
|
|
1305
|
+
* Detach HTTP observers on reader cancellation instead of aborting execution.
|
|
1306
|
+
*/
|
|
1307
|
+
_detachObserverOnCancel?: boolean;
|
|
1308
|
+
/**
|
|
1309
|
+
* External abort signal. The durable agent always installs its own internal
|
|
1310
|
+
* `AbortController` for the run; when this signal is provided, its `abort`
|
|
1311
|
+
* event is forwarded to the internal controller so either source can cancel
|
|
1312
|
+
* the run.
|
|
1313
|
+
*
|
|
1314
|
+
* Cross-process resumes (e.g. Inngest after a worker restart) cannot
|
|
1315
|
+
* recover the signal — call `resume(runId, ..., { abortSignal })` with a
|
|
1316
|
+
* fresh signal on each segment if you need abortability post-resume.
|
|
1317
|
+
*/
|
|
1318
|
+
abortSignal?: AbortSignal;
|
|
1319
|
+
/**
|
|
1320
|
+
* Whether this caller's stream closes when the run suspends (e.g. for tool
|
|
1321
|
+
* approval). Defaults to `false`: the stream stays open across suspension so
|
|
1322
|
+
* a later resume can continue streaming on this same reader.
|
|
1323
|
+
*
|
|
1324
|
+
* Set to `true` so `fullStream`, `text`, and `getFullOutput()` resolve at the
|
|
1325
|
+
* suspension boundary (matching non-durable `Agent.stream()`), letting callers
|
|
1326
|
+
* such as AG-UI or A2A react instead of hanging. Resume the run with
|
|
1327
|
+
* `resumeStream()`/`resume()` — those always return a fresh stream.
|
|
1328
|
+
*/
|
|
1329
|
+
closeOnSuspend?: boolean;
|
|
1330
|
+
}
|
|
1331
|
+
/**
|
|
1332
|
+
* Result from DurableAgent.stream()
|
|
1333
|
+
*/
|
|
1334
|
+
export interface DurableAgentStreamResult<OUTPUT = undefined> {
|
|
1335
|
+
/** The streaming output */
|
|
1336
|
+
output: MastraModelOutput<OUTPUT>;
|
|
1337
|
+
/** The full stream - delegates to output.fullStream for server compatibility */
|
|
1338
|
+
readonly fullStream: ReadableStream<any>;
|
|
1339
|
+
/** The unique run ID for this execution */
|
|
1340
|
+
runId: string;
|
|
1341
|
+
/** Thread ID if using memory */
|
|
1342
|
+
threadId?: string;
|
|
1343
|
+
/** Resource ID if using memory */
|
|
1344
|
+
resourceId?: string;
|
|
1345
|
+
/** Trace ID of the run, when the run is traced */
|
|
1346
|
+
traceId?: string;
|
|
1347
|
+
/** ID of the agent run span, when the run is traced */
|
|
1348
|
+
spanId?: string;
|
|
1349
|
+
/** Cleanup function to call when done (unsubscribes from pubsub) */
|
|
1350
|
+
cleanup: () => void;
|
|
1351
|
+
/**
|
|
1352
|
+
* Abort the run. Flips the internal `AbortController` for this run, which
|
|
1353
|
+
* surfaces as an `AbortError` inside the durable LLM-execution step and
|
|
1354
|
+
* is bridged to the user's `onAbort` callback via the run's pubsub topic.
|
|
1355
|
+
*
|
|
1356
|
+
* Safe to call after the run has already finished — it's a no-op in that
|
|
1357
|
+
* case.
|
|
1358
|
+
*
|
|
1359
|
+
* Also publishes an abort request over pubsub so the abort reaches the
|
|
1360
|
+
* process executing the run, which in a load-balanced deployment is usually
|
|
1361
|
+
* not this one. That process flips its own controller and unwinds normally;
|
|
1362
|
+
* the workflow run is never hard-cancelled, so the terminal `finish` event
|
|
1363
|
+
* still reaches stream consumers. Await the returned promise to know the
|
|
1364
|
+
* request has been dispatched; ignoring it keeps the previous
|
|
1365
|
+
* fire-and-forget behaviour.
|
|
1366
|
+
*/
|
|
1367
|
+
abort: (reason?: unknown) => Promise<void>;
|
|
1368
|
+
}
|
|
1369
|
+
/**
|
|
1370
|
+
* Configuration for DurableAgent - wraps an existing Agent with durable execution
|
|
1371
|
+
*/
|
|
1372
|
+
export interface DurableAgentConfig<TAgentId extends string = string, TTools extends ToolsInput = ToolsInput, TOutput = undefined> extends AgentStreamsConfig {
|
|
1373
|
+
/**
|
|
1374
|
+
* The Agent to wrap with durable execution capabilities.
|
|
1375
|
+
* All agent methods (getModel, listTools, etc.) delegate to this agent.
|
|
1376
|
+
*/
|
|
1377
|
+
agent: Agent<TAgentId, TTools, TOutput>;
|
|
1378
|
+
/**
|
|
1379
|
+
* Optional ID override. Defaults to agent.id.
|
|
1380
|
+
*/
|
|
1381
|
+
id?: TAgentId;
|
|
1382
|
+
/**
|
|
1383
|
+
* Optional name override. Defaults to agent.name.
|
|
1384
|
+
*/
|
|
1385
|
+
name?: string;
|
|
1386
|
+
/**
|
|
1387
|
+
* Maximum steps for the agentic loop.
|
|
1388
|
+
* Defaults to the workflow default if not specified.
|
|
1389
|
+
*/
|
|
1390
|
+
maxSteps?: number;
|
|
1391
|
+
/**
|
|
1392
|
+
* Overrides the snapshot-persistence policy for this agent's durable
|
|
1393
|
+
* workflows. Returning false for a status skips that snapshot write.
|
|
1394
|
+
*
|
|
1395
|
+
* The default policy always persists `pending | paused | suspended`
|
|
1396
|
+
* (required for human-in-the-loop `resume()`), and persists `running`
|
|
1397
|
+
* when the Mastra instance is configured with
|
|
1398
|
+
* `recovery: { durableAgents: 'auto' }`, or at each step boundary after
|
|
1399
|
+
* `mastra.shutdown()` starts (even with recovery off). `running`
|
|
1400
|
+
* checkpoints exist solely so `listActiveRuns()` / `recover()` /
|
|
1401
|
+
* `recoverActiveRuns()` can see in-flight runs after a crash or shutdown.
|
|
1402
|
+
*
|
|
1403
|
+
* Footguns when providing a custom predicate:
|
|
1404
|
+
* - Excluding `paused` / `suspended` breaks human-in-the-loop resume.
|
|
1405
|
+
* - Excluding `running` makes the agent invisible to crash recovery.
|
|
1406
|
+
* A guardrail warning is logged for both cases (detected by probing the
|
|
1407
|
+
* predicate with an empty `stepResults`, so predicates that read
|
|
1408
|
+
* `stepResults` may probe inaccurately — the warning is best-effort).
|
|
1409
|
+
*
|
|
1410
|
+
* EventedAgent and InngestAgent own their persistence policy and ignore
|
|
1411
|
+
* this option with a warning.
|
|
1412
|
+
*/
|
|
1413
|
+
shouldPersistSnapshot?: ShouldPersistSnapshotFn;
|
|
1414
|
+
/**
|
|
1415
|
+
* How this agent's new runs are stored. `1` rewrites one snapshot per run
|
|
1416
|
+
* on every write. `2` stores a run header plus per-step entries, and each
|
|
1417
|
+
* write sends only what changed.
|
|
1418
|
+
*
|
|
1419
|
+
* Where the storage adapter doesn't support version 2, new runs are stored
|
|
1420
|
+
* as version 1 and a warning is logged. Runs keep the version they were
|
|
1421
|
+
* created with: a run resumed after this option changes continues in its
|
|
1422
|
+
* stored version.
|
|
1423
|
+
*
|
|
1424
|
+
* @default 1
|
|
1425
|
+
* @experimental
|
|
1426
|
+
*/
|
|
1427
|
+
storageVersion?: 1 | 2;
|
|
1428
|
+
}
|
|
1429
|
+
/**
|
|
1430
|
+
* DurableAgent wraps an existing Agent with durable execution capabilities.
|
|
1431
|
+
*
|
|
1432
|
+
* Key features:
|
|
1433
|
+
* 1. Resumable streams - clients can disconnect and reconnect without missing events
|
|
1434
|
+
* 2. Serializable workflow inputs - works with durable execution engines
|
|
1435
|
+
* 3. PubSub-based streaming - events flow through pubsub for distribution
|
|
1436
|
+
*
|
|
1437
|
+
* DurableAgent extends Agent, delegating most methods to the wrapped agent.
|
|
1438
|
+
* It overrides stream() to use durable execution with the agentic workflow.
|
|
1439
|
+
*
|
|
1440
|
+
* Subclasses (EventedAgent, InngestAgent) override executeWorkflow() to
|
|
1441
|
+
* customize how the workflow is executed.
|
|
1442
|
+
*
|
|
1443
|
+
* @example
|
|
1444
|
+
* ```typescript
|
|
1445
|
+
* import { Agent } from '@mastra/core/agent';
|
|
1446
|
+
* import { DurableAgent } from '@mastra/core/agent/durable';
|
|
1447
|
+
*
|
|
1448
|
+
* const agent = new Agent({
|
|
1449
|
+
* id: 'my-agent',
|
|
1450
|
+
* instructions: 'You are a helpful assistant',
|
|
1451
|
+
* model: openai('gpt-4'),
|
|
1452
|
+
* });
|
|
1453
|
+
*
|
|
1454
|
+
* const durableAgent = new DurableAgent({ agent });
|
|
1455
|
+
*
|
|
1456
|
+
* const { output, runId, cleanup } = await durableAgent.stream('Hello!');
|
|
1457
|
+
* const text = await output.text;
|
|
1458
|
+
* cleanup();
|
|
1459
|
+
* ```
|
|
1460
|
+
*/
|
|
1461
|
+
/**
|
|
1462
|
+
* Statuses of durable agent runs discoverable via {@link DurableAgent.listActiveRuns}.
|
|
1463
|
+
*
|
|
1464
|
+
* `running` is the status reported by the workflow engine while the durable
|
|
1465
|
+
* agent's agentic loop is actively executing (i.e. between suspend
|
|
1466
|
+
* boundaries). Persisted `running` snapshots are the recovery source for runs
|
|
1467
|
+
* orphaned by a process restart.
|
|
1468
|
+
*/
|
|
1469
|
+
export type DurableAgentActiveRunStatus = Extract<WorkflowRunStatus, 'running'>;
|
|
1470
|
+
/**
|
|
1471
|
+
* Filters for {@link DurableAgent.listActiveRuns}. Mirrors the
|
|
1472
|
+
* `listWorkflowRuns` filter contract, plus the agent-level `threadId` /
|
|
1473
|
+
* `resourceId` filters used by the base {@link Agent.listSuspendedRuns}.
|
|
1474
|
+
*/
|
|
1475
|
+
export interface DurableAgentListActiveRunsOptions {
|
|
1476
|
+
/** Only return runs that belong to this memory thread. */
|
|
1477
|
+
threadId?: string;
|
|
1478
|
+
/** Only return runs that belong to this memory resource. */
|
|
1479
|
+
resourceId?: string;
|
|
1480
|
+
/** Only return runs created at or after this date. */
|
|
1481
|
+
fromDate?: Date;
|
|
1482
|
+
/** Only return runs created at or before this date. */
|
|
1483
|
+
toDate?: Date;
|
|
1484
|
+
/**
|
|
1485
|
+
* Number of items per page. Pagination is applied when both `perPage` and
|
|
1486
|
+
* `page` are provided; otherwise all matching runs are returned.
|
|
1487
|
+
*/
|
|
1488
|
+
perPage?: number;
|
|
1489
|
+
/** Zero-indexed page number. */
|
|
1490
|
+
page?: number;
|
|
1491
|
+
}
|
|
1492
|
+
/**
|
|
1493
|
+
* A durable agent run currently reported as `running` in workflow snapshot
|
|
1494
|
+
* storage. These are the runs that a boot-time or operator-initiated
|
|
1495
|
+
* recovery would re-drive after a process restart.
|
|
1496
|
+
*/
|
|
1497
|
+
export interface DurableAgentActiveRun {
|
|
1498
|
+
/** Run ID accepted by {@link DurableAgent.recoverActiveRuns} and workflow `restart`. */
|
|
1499
|
+
runId: string;
|
|
1500
|
+
status: DurableAgentActiveRunStatus;
|
|
1501
|
+
threadId?: string;
|
|
1502
|
+
resourceId?: string;
|
|
1503
|
+
/** When the run's snapshot was last persisted while running. */
|
|
1504
|
+
updatedAt: Date;
|
|
1505
|
+
}
|
|
1506
|
+
export interface DurableAgentListActiveRunsResult {
|
|
1507
|
+
runs: DurableAgentActiveRun[];
|
|
1508
|
+
/** Total number of matching runs, before pagination. */
|
|
1509
|
+
total: number;
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1512
|
+
* Outcome of a single run restart attempted by
|
|
1513
|
+
* {@link DurableAgent.recoverActiveRuns}. `success` means `run.restart()`
|
|
1514
|
+
* returned; `failed` means it threw and the error was captured so recovery
|
|
1515
|
+
* of remaining runs could proceed; `skipped` means the run was not orphaned,
|
|
1516
|
+
* recovery hit a transient error, its recovery wait timed out, or recovery was interrupted by shutdown.
|
|
1517
|
+
*/
|
|
1518
|
+
export interface DurableAgentRecoveredRun {
|
|
1519
|
+
runId: string;
|
|
1520
|
+
status: 'success' | 'failed' | 'skipped';
|
|
1521
|
+
/** Set when `status` is `failed`. */
|
|
1522
|
+
error?: Error;
|
|
1523
|
+
/**
|
|
1524
|
+
* Set when `status` is `skipped`:
|
|
1525
|
+
* - `run-active`: another execution, possibly in another process, is live.
|
|
1526
|
+
* Check again at `retryAt`.
|
|
1527
|
+
* - `run-active-locally`: this process is executing the run.
|
|
1528
|
+
* - `already-in-progress`: this process is already recovering the run.
|
|
1529
|
+
* - `transient-error`: recovery hit a transient infrastructure error. Check again at `retryAt`.
|
|
1530
|
+
* - `recovery-timeout`: the attempt is still pending or its 30-second wait expired. Check again at `retryAt`.
|
|
1531
|
+
*/
|
|
1532
|
+
reason?: 'run-active' | 'run-active-locally' | 'already-in-progress' | 'transient-error' | 'recovery-timeout';
|
|
1533
|
+
/** Epoch ms to check again: claim expiry for `run-active`, or a retry delay for `transient-error` / `recovery-timeout`. */
|
|
1534
|
+
retryAt?: number;
|
|
1535
|
+
}
|
|
1536
|
+
/**
|
|
1537
|
+
* Filters for {@link DurableAgent.recoverActiveRuns}. Reuses the
|
|
1538
|
+
* {@link DurableAgentListActiveRunsOptions} discovery filters and adds an
|
|
1539
|
+
* escape hatch for targeting a specific run ID.
|
|
1540
|
+
*/
|
|
1541
|
+
export interface DurableAgentRecoverActiveRunsOptions extends DurableAgentListActiveRunsOptions {
|
|
1542
|
+
/**
|
|
1543
|
+
* Recover a specific run by ID. When set, the discovery filters and
|
|
1544
|
+
* pagination fields are ignored. Useful when the caller already knows the
|
|
1545
|
+
* run ID from another source (e.g. their own bookkeeping).
|
|
1546
|
+
*/
|
|
1547
|
+
runId?: string;
|
|
1548
|
+
}
|
|
1549
|
+
export interface DurableAgentRecoverActiveRunsResult {
|
|
1550
|
+
recovered: DurableAgentRecoveredRun[];
|
|
1551
|
+
/** Number of runs that restarted successfully. */
|
|
1552
|
+
succeeded: number;
|
|
1553
|
+
/** Number of runs whose restart threw. */
|
|
1554
|
+
failed: number;
|
|
1555
|
+
}
|
|
1556
|
+
/**
|
|
1557
|
+
* Options for {@link DurableAgent.recover}, a single-run streamable recovery
|
|
1558
|
+
* counterpart to {@link DurableAgent.resume}.
|
|
1559
|
+
*
|
|
1560
|
+
* `recover()` rebuilds the run's non-serializable state from the persisted
|
|
1561
|
+
* workflow snapshot (message list, model, tools, memory, saveQueueManager,
|
|
1562
|
+
* request context, agent span) and returns a fresh {@link DurableAgentStreamResult}
|
|
1563
|
+
* whose `fullStream` observes the recovered run through pubsub. Callbacks
|
|
1564
|
+
* mirror `stream()` / `resume()`.
|
|
1565
|
+
*/
|
|
1566
|
+
export interface DurableAgentRecoverOptions<OUTPUT = undefined> {
|
|
1567
|
+
/** Callback when chunk is received */
|
|
1568
|
+
onChunk?: (chunk: ChunkType<OUTPUT>) => void | Promise<void>;
|
|
1569
|
+
/** Experimental transforms applied whenever `fullStream` is consumed. */
|
|
1570
|
+
experimentalTransform?: MastraStreamTransformOptions<OUTPUT>;
|
|
1571
|
+
/** Callback when a step finishes */
|
|
1572
|
+
onStepFinish?: (result: DurableAgentStepFinishResult) => void | Promise<void>;
|
|
1573
|
+
/** Callback when the recovered run finishes */
|
|
1574
|
+
onFinish?: MastraOnFinishCallback<OUTPUT>;
|
|
1575
|
+
/** Callback when the recovered run errors */
|
|
1576
|
+
onError?: ({ error }: {
|
|
1577
|
+
error: Error | string;
|
|
1578
|
+
}) => void | Promise<void>;
|
|
1579
|
+
/** Callback when the recovered run is aborted */
|
|
1580
|
+
onAbort?: (data: AgentAbortEventData) => void | Promise<void>;
|
|
1581
|
+
/** Callback when the recovered run suspends again */
|
|
1582
|
+
onSuspended?: (data: AgentSuspendedEventData) => void | Promise<void>;
|
|
1583
|
+
/**
|
|
1584
|
+
* Close the recovered stream once the run suspends (e.g. awaiting tool
|
|
1585
|
+
* approval) so callers can hand off to `resume()`. Defaults to `false`.
|
|
1586
|
+
*/
|
|
1587
|
+
closeOnSuspend?: boolean;
|
|
1588
|
+
/**
|
|
1589
|
+
* Optional abort signal for the recovered segment. Forwarded onto a fresh
|
|
1590
|
+
* internal `AbortController` installed on the run's registry entry, so
|
|
1591
|
+
* `result.abort()` and the external signal can both cancel the recovered run.
|
|
1592
|
+
*/
|
|
1593
|
+
abortSignal?: AbortSignal;
|
|
1594
|
+
/**
|
|
1595
|
+
* Take the run over even while another execution is live. The other
|
|
1596
|
+
* execution loses the run and stops; its writes are rejected when the
|
|
1597
|
+
* workflows store supports run fencing. Without `force`, `recover()` throws
|
|
1598
|
+
* `DURABLE_AGENT_RUN_ACTIVE` for a live run.
|
|
1599
|
+
*/
|
|
1600
|
+
force?: boolean;
|
|
1601
|
+
}
|
|
1151
1602
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PubSub } from '../../../events/pubsub.js';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import { BaseAgenticLoopBuilder } from '../../../loop/base-loop-builder.js';
|
|
3
|
+
import type { LoopContinuationPredicate } from '../../../loop/base-loop-builder.js';
|
|
4
4
|
import type { LoopRuntime } from '../../../loop/loop-runtime.js';
|
|
5
5
|
import { pruneAgentLoopSnapshot } from '../../../loop/workflows/prune-snapshot.js';
|
|
6
6
|
import type { StepResultReads } from '../../../loop/workflows/prune-snapshot.js';
|
|
@@ -67,7 +67,7 @@ interface DurableLoopRuntime extends LoopRuntime {
|
|
|
67
67
|
pubsub?: PubSub;
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
-
* Builds the durable agent loop on the shared `
|
|
70
|
+
* Builds the durable agent loop on the shared `BaseAgenticLoopBuilder` shape.
|
|
71
71
|
*
|
|
72
72
|
* The durable loop implements the same agentic loop pattern as the main loop
|
|
73
73
|
* (LLM execution → tool-call foreach → mapping → background check → signal
|
|
@@ -75,13 +75,11 @@ interface DurableLoopRuntime extends LoopRuntime {
|
|
|
75
75
|
* through workflow input/output so it is durable across process restarts and
|
|
76
76
|
* execution engine replays.
|
|
77
77
|
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
* resolution via registry + serialized `messageListState`, pubsub chunk
|
|
82
|
-
* transport, the evented `workflowFactory`, and snapshot policies).
|
|
78
|
+
* Every method delegates to the durable step files; behavior shared with the
|
|
79
|
+
* main loop lives in the shared step cores (`loop/shared`), not in a common
|
|
80
|
+
* superclass.
|
|
83
81
|
*/
|
|
84
|
-
export declare class DurableAgenticLoopBuilder extends
|
|
82
|
+
export declare class DurableAgenticLoopBuilder extends BaseAgenticLoopBuilder {
|
|
85
83
|
#private;
|
|
86
84
|
constructor(options?: DurableAgenticWorkflowOptions);
|
|
87
85
|
/**
|
package/dist/agent/helpers.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mergeVersionOverrides } from '../mastra/types.js';
|
|
2
2
|
import type { VersionOverrides } from '../mastra/types.js';
|
|
3
3
|
import type { RequestContext } from '../request-context/index.js';
|
|
4
|
-
import type { DurableAgentRecoveredRun } from './durable/
|
|
4
|
+
import type { DurableAgentRecoveredRun } from './durable/types.js';
|
|
5
5
|
import type { MessageList } from './message-list/index.js';
|
|
6
6
|
import type { AgentInstructions } from './types.js';
|
|
7
7
|
export declare function resolveVersionContext(requestContext: RequestContext, requestVersions: VersionOverrides | undefined, defaultVersions: VersionOverrides | undefined, callOptions: {
|
package/dist/agent/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_stream = require("../stream-
|
|
3
|
-
const require_run_registry = require("../run-registry-
|
|
2
|
+
const require_stream = require("../stream-4aNIw_TQ.cjs");
|
|
3
|
+
const require_run_registry = require("../run-registry-5_LQBGn_.cjs");
|
|
4
4
|
const require_message_list = require("../message-list-DPXPXvin.cjs");
|
|
5
5
|
const require_signals = require("../signals-CWxAMEmE.cjs");
|
|
6
6
|
const require_to_prompt = require("../to-prompt-B9eZo2U5.cjs");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const require_schedules = require("../schedules-BZS8McF7.cjs");
|
|
8
|
+
const require_signal_provider = require("../signal-provider-BFAvh_AJ.cjs");
|
|
9
9
|
exports.AGENT_RESUME_CLAIM_STALE_MS = require_run_registry.AGENT_RESUME_CLAIM_STALE_MS;
|
|
10
10
|
exports.AGENT_SCHEDULE_PREFIX = require_schedules.AGENT_SCHEDULE_PREFIX;
|
|
11
11
|
exports.Agent = require_run_registry.Agent;
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export { getGoalActivityDurationMs } from './goal/index.js';
|
|
|
12
12
|
export { DEFAULT_TOOL_DECLINE_REASON, resolveDeclineReason } from './tool-approval.js';
|
|
13
13
|
export * from './utils.js';
|
|
14
14
|
export * from './fs-routing/index.js';
|
|
15
|
-
export type { AgentExecutionOptions, AgentExecutionOptionsBase, InnerAgentExecutionOptions, MultiPrimitiveExecutionOptions, DelegationStartContext, DelegationStartResult, OnDelegationStartHandler, DelegationCompleteContext, DelegationCompleteResult, OnDelegationCompleteHandler, DelegationHookError, DelegationConfig, MessageFilterContext,
|
|
15
|
+
export type { AgentExecutionOptions, AgentExecutionOptionsBase, AgentStreamOutput, InnerAgentExecutionOptions, MultiPrimitiveExecutionOptions, DelegationStartContext, DelegationStartResult, OnDelegationStartHandler, DelegationCompleteContext, DelegationCompleteResult, OnDelegationCompleteHandler, DelegationHookError, DelegationConfig, MessageFilterContext,
|
|
16
16
|
/** @deprecated Use MessageFilterContext instead */
|
|
17
17
|
MessageFilterContext as ContextFilterContext, IterationCompleteContext, IterationCompleteResult, OnIterationCompleteHandler, StreamIsTaskCompleteConfig, IsTaskCompleteConfig, IsTaskCompleteRunResult, CompletionConfig, CompletionRunResult, NetworkOptions, NetworkRoutingConfig, } from './agent.types.js';
|
|
18
18
|
export type { SubAgent, SubAgentGenerateResult, SubAgentStreamResult } from './subagent.js';
|
package/dist/agent/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { an as resolveThreadIdFromArgs, cn as tryStreamWithJsonFallback, in as resolveSuspendedToolRunId, l as TripWire, on as supportedLanguageModelSpecifications, rn as isSupportedLanguageModel, sn as tryGenerateWithJsonFallback } from "../stream-
|
|
2
|
-
import {
|
|
1
|
+
import { an as resolveThreadIdFromArgs, cn as tryStreamWithJsonFallback, in as resolveSuspendedToolRunId, l as TripWire, on as supportedLanguageModelSpecifications, rn as isSupportedLanguageModel, sn as tryGenerateWithJsonFallback } from "../stream-CJUm6EAH.js";
|
|
2
|
+
import { A as agentInstructions, It as DEFAULT_TOOL_DECLINE_REASON, Lt as resolveDeclineReason, M as MAX_FS_SUBAGENT_DEPTH, N as AGENT_RESUME_CLAIM_STALE_MS, P as Agent, dl as isDurableAgentLike, j as assembleAgentFromFsEntry, jl as isAgentCompatible, k as agentConfig, ul as hasResumableStreams, ys as getGoalActivityDurationMs } from "../run-registry-DC03XLeZ.js";
|
|
3
3
|
import { Q as TypeDetector, n as MessageList, t as convertMessages } from "../message-list-DEuRl82K.js";
|
|
4
4
|
import { a as isCreatedAgentSignal, c as isUserAuthoredMessage, d as signalSpanAttributes, f as signalToDataPartFormat, h as signalToXmlMarkup, i as getMessageAuthor, l as mastraDBMessageToSignal, m as signalToMessage, n as createSignal, o as isMastraSignalMessage, p as signalToMastraDBMessage, r as dataPartToSignal, s as isTransientSignalMessage, t as createMessageSignal, u as resolveDeliveryAttributes } from "../signals-CqR_iWkg.js";
|
|
5
5
|
import { n as aiV5ModelMessageToV2PromptMessage } from "../to-prompt-BsDtVXrf.js";
|
|
6
|
-
import { i as
|
|
7
|
-
import {
|
|
6
|
+
import { d as ScheduleInputSchema, f as ScheduleOutputSchema, i as toWorkflowSchedule, n as toAgentSchedule, p as WORKFLOW_SCHEDULE_PREFIX, r as toScheduleView, s as defineSchedule, t as Schedules, u as AGENT_SCHEDULE_PREFIX } from "../schedules-DZfSx-7P.js";
|
|
7
|
+
import { i as isSignalProvider, n as WebhookSignalProvider, r as SignalProvider } from "../signal-provider-BslnAjWG.js";
|
|
8
8
|
export { AGENT_RESUME_CLAIM_STALE_MS, AGENT_SCHEDULE_PREFIX, Agent, DEFAULT_TOOL_DECLINE_REASON, MAX_FS_SUBAGENT_DEPTH, MessageList, ScheduleInputSchema, ScheduleOutputSchema, Schedules, SignalProvider, TripWire, TypeDetector, WORKFLOW_SCHEDULE_PREFIX, WebhookSignalProvider, agentConfig, agentInstructions, aiV5ModelMessageToV2PromptMessage, assembleAgentFromFsEntry, convertMessages, createMessageSignal, createSignal, dataPartToSignal, defineSchedule, getGoalActivityDurationMs, getMessageAuthor, hasResumableStreams, isAgentCompatible, isCreatedAgentSignal, isDurableAgentLike, isMastraSignalMessage, isSignalProvider, isSupportedLanguageModel, isTransientSignalMessage, isUserAuthoredMessage, mastraDBMessageToSignal, resolveDeclineReason, resolveDeliveryAttributes, resolveSuspendedToolRunId, resolveThreadIdFromArgs, signalSpanAttributes, signalToDataPartFormat, signalToMastraDBMessage, signalToMessage, signalToXmlMarkup, supportedLanguageModelSpecifications, toAgentSchedule, toScheduleView, toWorkflowSchedule, tryGenerateWithJsonFallback, tryStreamWithJsonFallback };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import type { Agent } from '../agent.js';
|
|
1
2
|
import type { DurableAgentLike } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
export declare function hasDurableExecution(obj: unknown): obj is DurableAgentLike;
|
|
3
|
+
/** Native engine selection or the released structural adapter contract (including Inngest). */
|
|
4
|
+
export declare function hasDurableExecution(obj: unknown): obj is Agent<any, any, any> | DurableAgentLike;
|
|
4
5
|
//# sourceMappingURL=execution-capability.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentStreamsConfig } from './types.js';
|
|
2
|
-
export type ExecutionEngine = '
|
|
2
|
+
export type ExecutionEngine = 'default' | 'evented' | false;
|
|
3
3
|
export type ExecutionEngineDefaults = Omit<AgentStreamsConfig, 'pubsub' | 'cache'>;
|
|
4
4
|
type DurableOption = boolean | AgentStreamsConfig | undefined;
|
|
5
5
|
/** Policy only: selecting an engine does not grant native execution capability. */
|
|
@@ -38,9 +38,9 @@ export interface AgentStreamEvent<T = unknown> {
|
|
|
38
38
|
* are published on and the replay cache that lets readers reconnect.
|
|
39
39
|
*/
|
|
40
40
|
export interface AgentStreamsConfig {
|
|
41
|
-
/**
|
|
42
|
-
executionEngine?: '
|
|
43
|
-
/**
|
|
41
|
+
/** Select the default (in-process) or evented durable engine, or false for the plain Agent loop. */
|
|
42
|
+
executionEngine?: 'default' | 'evented' | false;
|
|
43
|
+
/** Snapshot persistence policy for durable execution. */
|
|
44
44
|
shouldPersistSnapshot?: ShouldPersistSnapshotFn;
|
|
45
45
|
/**
|
|
46
46
|
* PubSub instance for streaming events.
|