@mastra/core 1.86.0-alpha.7 → 1.86.0-alpha.9
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/knowledge-compat/index.d.ts +363 -0
- package/dist/a2a/index.cjs +1 -1
- package/dist/a2a/index.js +1 -1
- package/dist/agent/agent.d.ts +72 -1
- package/dist/agent/agent.types.d.ts +30 -2
- package/dist/agent/durable/create-evented-agent.d.ts +6 -0
- package/dist/agent/durable/durable-agent.d.ts +1 -15
- package/dist/agent/durable/index.cjs +7 -26
- package/dist/agent/durable/index.js +7 -26
- package/dist/agent/durable/preparation.d.ts +2 -0
- package/dist/agent/durable/utils/resolve-runtime.d.ts +9 -0
- package/dist/agent/durable/workflows/durable-loop-builder.d.ts +4 -0
- package/dist/agent/durable/workflows/finalize-run.d.ts +3 -1
- package/dist/agent/durable/workflows/steps/llm-execution.d.ts +1 -0
- package/dist/agent/index.cjs +3 -3
- package/dist/agent/index.js +3 -3
- package/dist/agent/message-list/index.cjs +1 -1
- package/dist/agent/message-list/index.js +1 -1
- package/dist/agent/message-list/message-list.d.ts +11 -0
- package/dist/agent/message-list/utils/provider-compat.d.ts +1 -0
- package/dist/agent/request-context-snapshot.d.ts +1 -1
- package/dist/agent/streams/types.d.ts +10 -0
- package/dist/agent/thread-stream-runtime.d.ts +5 -0
- package/dist/agent/types.d.ts +25 -0
- package/dist/agent-builder/ee/index.cjs +1 -1
- package/dist/agent-builder/ee/index.js +1 -1
- package/dist/agent-controller/index.cjs +1 -1
- package/dist/agent-controller/index.js +1 -1
- package/dist/{agent-controller-K5vHtqfO.cjs → agent-controller-CrQ9OF80.cjs} +8 -8
- package/dist/{agent-controller-Cf3_IuY8.js → agent-controller-SSlKzE6A.js} +8 -8
- package/dist/background-tasks/index.cjs +1 -1
- package/dist/background-tasks/index.js +1 -1
- package/dist/{background-tasks-DqnQMfuf.cjs → background-tasks-BDrYBis-.cjs} +5 -3
- package/dist/{background-tasks-BgpX1P_s.js → background-tasks-BnJfNLFo.js} +5 -3
- package/dist/browser/index.cjs +2 -2
- package/dist/browser/index.js +2 -2
- package/dist/{builder-x295GDL6.js → builder-Cl-0BWkh.js} +2 -2
- package/dist/{builder-D8Osghdo.cjs → builder-Cw8u3pPl.cjs} +2 -2
- package/dist/capabilities/302ai.json +192 -192
- package/dist/capabilities/abliteratedllm.json +34 -34
- package/dist/capabilities/abliteration-ai.json +11 -11
- package/dist/capabilities/above.json +17 -17
- package/dist/capabilities/adaption.json +12 -12
- package/dist/capabilities/adzuki.json +30 -30
- package/dist/capabilities/agentrouter.json +10 -10
- package/dist/capabilities/agnes.json +4 -4
- package/dist/capabilities/ai-router.json +9 -9
- package/dist/capabilities/aiand.json +19 -11
- package/dist/capabilities/aigrow.json +11 -11
- package/dist/capabilities/aimlapi.json +146 -149
- package/dist/capabilities/aipg.json +2 -2
- package/dist/capabilities/aixy.json +14 -14
- package/dist/capabilities/aki-io.json +11 -11
- package/dist/capabilities/alibaba-cn.json +128 -109
- package/dist/capabilities/alibaba-coding-plan-cn.json +7 -19
- package/dist/capabilities/alibaba-coding-plan.json +7 -19
- package/dist/capabilities/alibaba-token-plan-cn.json +49 -67
- package/dist/capabilities/alibaba-token-plan.json +51 -69
- package/dist/capabilities/alibaba.json +71 -118
- package/dist/capabilities/ambient.json +14 -14
- package/dist/capabilities/amd.json +11 -11
- package/dist/capabilities/anthropic.json +48 -48
- package/dist/capabilities/anyapi.json +18 -18
- package/dist/capabilities/apiko.json +2 -2
- package/dist/capabilities/arcee.json +10 -10
- package/dist/capabilities/augure.json +6 -6
- package/dist/capabilities/auriko.json +20 -20
- package/dist/capabilities/bailing.json +5 -5
- package/dist/capabilities/baseten.json +46 -16
- package/dist/capabilities/bee.json +5 -5
- package/dist/capabilities/berget.json +4 -4
- package/dist/capabilities/bothub.json +16 -16
- package/dist/capabilities/boundless.json +36 -36
- package/dist/capabilities/bumo.json +40 -40
- package/dist/capabilities/byteplus.json +32 -32
- package/dist/capabilities/cerebras.json +4 -4
- package/dist/capabilities/cheapaimodel.json +5 -5
- package/dist/capabilities/cheapest-token.json +24 -24
- package/dist/capabilities/chutes.json +9 -9
- package/dist/capabilities/cline-pass.json +37 -37
- package/dist/capabilities/cloudcode.json +4 -4
- package/dist/capabilities/cloudflare-workers-ai.json +24 -24
- package/dist/capabilities/commandcode.json +152 -152
- package/dist/capabilities/concentrate.json +290 -266
- package/dist/capabilities/cortecs.json +105 -105
- package/dist/capabilities/crossmodel.json +160 -160
- package/dist/capabilities/crusoe.json +10 -10
- package/dist/capabilities/daoxe.json +7 -7
- package/dist/capabilities/databricks.json +318 -62
- package/dist/capabilities/deepinfra.json +73 -129
- package/dist/capabilities/deepseek.json +2 -2
- package/dist/capabilities/digitalocean.json +114 -114
- package/dist/capabilities/dothoosh.json +28 -28
- package/dist/capabilities/doubleword.json +24 -24
- package/dist/capabilities/edenai.json +458 -458
- package/dist/capabilities/empiriolabs.json +166 -166
- package/dist/capabilities/engy.json +20 -20
- package/dist/capabilities/evroc.json +8 -8
- package/dist/capabilities/ezkielyna.json +8 -8
- package/dist/capabilities/fastrouter.json +85 -85
- package/dist/capabilities/fireworks-ai.json +107 -44
- package/dist/capabilities/freemodel.json +23 -23
- package/dist/capabilities/friendli.json +9 -9
- package/dist/capabilities/frogbot.json +94 -94
- package/dist/capabilities/gisoo.json +16 -16
- package/dist/capabilities/gmicloud.json +17 -17
- package/dist/capabilities/google.json +57 -57
- package/dist/capabilities/graphn.json +10 -10
- package/dist/capabilities/greenpt.json +36 -36
- package/dist/capabilities/groq.json +2 -2
- package/dist/capabilities/helicone.json +68 -68
- package/dist/capabilities/hopper.json +2 -2
- package/dist/capabilities/hostinger-router.json +12 -12
- package/dist/capabilities/hpc-ai.json +13 -13
- package/dist/capabilities/huawei-maas.json +17 -17
- package/dist/capabilities/hubris.json +30 -30
- package/dist/capabilities/huggingface.json +193 -37
- package/dist/capabilities/hyper.json +23 -23
- package/dist/capabilities/impossibl.json +140 -140
- package/dist/capabilities/inception.json +2 -2
- package/dist/capabilities/inceptron.json +4 -4
- package/dist/capabilities/inco.json +3 -3
- package/dist/capabilities/infer.json +15 -15
- package/dist/capabilities/inferall.json +10 -10
- package/dist/capabilities/inference-coop.json +9 -9
- package/dist/capabilities/inferenceapis.json +9 -9
- package/dist/capabilities/inferris.json +3 -3
- package/dist/capabilities/infersia.json +2 -2
- 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 +12 -12
- package/dist/capabilities/jiekou.json +63 -63
- package/dist/capabilities/jzstoken.json +50 -50
- package/dist/capabilities/keln.json +14 -21
- package/dist/capabilities/kenari.json +123 -120
- package/dist/capabilities/kilo.json +622 -647
- package/dist/capabilities/kimi-code-plan-cn.json +5 -5
- package/dist/capabilities/kimi-code-plan-global.json +5 -5
- package/dist/capabilities/kitani.json +6 -6
- package/dist/capabilities/klavo.json +18 -18
- package/dist/capabilities/korouter.json +29 -29
- package/dist/capabilities/kunavo.json +10 -10
- package/dist/capabilities/liquid.json +11 -11
- package/dist/capabilities/lithosai.json +2 -2
- package/dist/capabilities/llmgateway-providers.json +932 -905
- package/dist/capabilities/llmgateway.json +336 -336
- package/dist/capabilities/llmtr.json +22 -22
- package/dist/capabilities/logits.json +2 -2
- package/dist/capabilities/longcat.json +2 -7
- package/dist/capabilities/lowrouter.json +54 -54
- package/dist/capabilities/lyceum.json +12 -12
- package/dist/capabilities/melious.json +13 -13
- package/dist/capabilities/merge-gateway.json +260 -260
- package/dist/capabilities/meta.json +7 -7
- package/dist/capabilities/mistral.json +20 -20
- package/dist/capabilities/mixlayer.json +4 -4
- package/dist/capabilities/modal.json +10 -10
- package/dist/capabilities/model-oracle-ai.json +25 -25
- package/dist/capabilities/modelis.json +20 -20
- package/dist/capabilities/modular.json +6 -6
- 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 +11 -11
- package/dist/capabilities/munito-eu.json +6 -6
- package/dist/capabilities/munito.json +6 -6
- package/dist/capabilities/nan.json +27 -27
- package/dist/capabilities/nano-gpt.json +578 -578
- package/dist/capabilities/nearai.json +84 -84
- package/dist/capabilities/nebius.json +37 -28
- package/dist/capabilities/neon.json +126 -126
- package/dist/capabilities/neuralwatt.json +41 -41
- package/dist/capabilities/nokeep.json +4 -4
- package/dist/capabilities/novita-ai.json +154 -154
- package/dist/capabilities/nvidia.json +35 -35
- package/dist/capabilities/oathbreaker.json +2 -2
- package/dist/capabilities/obscurify.json +32 -32
- package/dist/capabilities/oci.json +7 -7
- package/dist/capabilities/ofox.json +357 -357
- package/dist/capabilities/ollama-cloud.json +56 -56
- package/dist/capabilities/openai.json +51 -51
- package/dist/capabilities/opencode-go.json +85 -84
- package/dist/capabilities/openrouter.json +542 -567
- package/dist/capabilities/opper.json +30 -24
- package/dist/capabilities/orcarouter.json +236 -236
- package/dist/capabilities/outerlabs.json +32 -32
- package/dist/capabilities/ovhcloud.json +7 -7
- package/dist/capabilities/pareto.json +6 -6
- package/dist/capabilities/pendra.json +4 -4
- package/dist/capabilities/perplexity-agent.json +61 -61
- package/dist/capabilities/phala.json +34 -34
- package/dist/capabilities/pioneer.json +30 -30
- package/dist/capabilities/poe.json +136 -136
- package/dist/capabilities/powerspring.json +13 -13
- package/dist/capabilities/primalabs.json +10 -10
- package/dist/capabilities/prime.json +124 -107
- package/dist/capabilities/privatemode-ai.json +14 -14
- package/dist/capabilities/proxystacks.json +6 -6
- package/dist/capabilities/qiniu-ai.json +16 -16
- package/dist/capabilities/refuseless.json +6 -6
- package/dist/capabilities/regolo-ai.json +6 -6
- package/dist/capabilities/requesty.json +172 -172
- package/dist/capabilities/ruapi.json +17 -17
- package/dist/capabilities/runcrate.json +5 -5
- package/dist/capabilities/runinfra.json +13 -13
- package/dist/capabilities/sakana.json +6 -6
- package/dist/capabilities/sambanova.json +9 -9
- package/dist/capabilities/sandbase.json +27 -27
- package/dist/capabilities/sarvam.json +12 -12
- package/dist/capabilities/scaleway.json +14 -14
- package/dist/capabilities/scnet-token-plan.json +9 -9
- package/dist/capabilities/scx-ai.json +26 -26
- package/dist/capabilities/sensenova.json +12 -12
- package/dist/capabilities/siliconflow-cn.json +49 -49
- package/dist/capabilities/siliconflow.json +46 -46
- package/dist/capabilities/snowflake-cortex.json +20 -20
- package/dist/capabilities/sokkan.json +7 -7
- package/dist/capabilities/sparrowcodes.json +25 -25
- package/dist/capabilities/standardcompute.json +102 -102
- package/dist/capabilities/steadyrouter.json +40 -40
- package/dist/capabilities/stepfun-ai-step-plan.json +6 -6
- package/dist/capabilities/stepfun-ai.json +15 -8
- package/dist/capabilities/stepfun-step-plan.json +15 -8
- package/dist/capabilities/stepfun.json +15 -8
- package/dist/capabilities/stepping-stone.json +16 -16
- package/dist/capabilities/synthetic.json +13 -13
- package/dist/capabilities/synthorai.json +19 -19
- package/dist/capabilities/teamorouter.json +24 -24
- package/dist/capabilities/teapot-router.json +13 -13
- package/dist/capabilities/tencent-coding-plan.json +1 -23
- package/dist/capabilities/tencent-token-plan.json +60 -23
- package/dist/capabilities/tencent-tokenhub.json +182 -7
- package/dist/capabilities/tensorx.json +50 -50
- package/dist/capabilities/tenstorrent.json +6 -6
- package/dist/capabilities/the-grid-ai.json +28 -28
- package/dist/capabilities/thinkingmachines.json +72 -55
- package/dist/capabilities/tinfoil.json +13 -13
- package/dist/capabilities/toapis.json +2 -2
- package/dist/capabilities/togetherai.json +54 -83
- package/dist/capabilities/tokengo.json +25 -25
- package/dist/capabilities/tokenify.json +9 -9
- package/dist/capabilities/trustedrouter.json +4 -4
- package/dist/capabilities/trustedtokens.json +17 -17
- package/dist/capabilities/umans-ai-coding-plan.json +13 -13
- package/dist/capabilities/umans-ai.json +10 -10
- package/dist/capabilities/unrestricted.json +6 -6
- package/dist/capabilities/uplinkswitch.json +21 -21
- package/dist/capabilities/upstage.json +4 -4
- package/dist/capabilities/vancine.json +23 -23
- package/dist/capabilities/vercel.json +540 -527
- package/dist/capabilities/vivgrid.json +80 -80
- package/dist/capabilities/volcengine-coding-plan.json +24 -54
- package/dist/capabilities/volcengine.json +55 -60
- package/dist/capabilities/vultr.json +24 -24
- package/dist/capabilities/wafer.ai.json +19 -19
- package/dist/capabilities/wallaby.json +5 -5
- package/dist/capabilities/wally.json +11 -11
- package/dist/capabilities/wandb.json +21 -21
- package/dist/capabilities/watt.json +24 -24
- package/dist/capabilities/xai.json +7 -7
- package/dist/capabilities/xiaomi-token-plan-ams.json +2 -12
- package/dist/capabilities/xiaomi-token-plan-cn.json +2 -12
- package/dist/capabilities/xiaomi-token-plan-sgp.json +2 -12
- package/dist/capabilities/xiaomi.json +3 -25
- package/dist/capabilities/xpersona.json +13 -13
- package/dist/capabilities/xxapi.json +31 -31
- package/dist/capabilities/zai-coding-plan.json +18 -18
- package/dist/capabilities/zai.json +49 -26
- package/dist/capabilities/zenifra.json +26 -26
- package/dist/capabilities/zenmux.json +205 -205
- package/dist/capabilities/zerogpu.json +11 -11
- package/dist/capabilities/zhipuai-coding-plan.json +6 -6
- package/dist/capabilities/zhipuai.json +39 -24
- package/dist/capabilities/zro.json +6 -6
- package/dist/channels/index.cjs +2 -2
- package/dist/channels/index.js +2 -2
- package/dist/{channels-Dx4jiXeK.js → channels-Cz1y3W6u.js} +1 -1
- package/dist/{channels-q6qnuRNV.cjs → channels-DQg4v_gm.cjs} +1 -1
- package/dist/coding-agent/index.cjs +2 -2
- package/dist/coding-agent/index.js +2 -2
- package/dist/datasets/dataset.d.ts +13 -6
- package/dist/datasets/experiment/durable.d.ts +16 -0
- package/dist/datasets/experiment/index.d.ts +2 -1
- package/dist/datasets/experiment/item.d.ts +26 -4
- package/dist/datasets/experiment/retries.d.ts +18 -0
- package/dist/datasets/experiment/types.d.ts +18 -0
- package/dist/datasets/experiment/workflow-id.d.ts +7 -0
- package/dist/datasets/experiment/workflow.d.ts +74 -0
- package/dist/datasets/index.cjs +3 -2
- package/dist/datasets/index.d.ts +2 -1
- package/dist/datasets/index.js +3 -3
- package/dist/docs/SKILL.md +4 -3
- package/dist/docs/assets/SOURCE_MAP.json +928 -903
- package/dist/docs/references/docs-deployment-workers.md +1 -1
- package/dist/docs/references/docs-evals-experiments.md +29 -1
- package/dist/docs/references/docs-harness-background-tasks.md +4 -1
- package/dist/docs/references/docs-harness-durable-agents.md +9 -5
- package/dist/docs/references/docs-knowledge-agents-and-tools.md +1 -0
- package/dist/docs/references/docs-knowledge-importers.md +195 -0
- package/dist/docs/references/docs-knowledge-load-your-content.md +2 -2
- package/dist/docs/references/docs-knowledge-overview.md +1 -1
- package/dist/docs/references/docs-mastra-platform-observability-overview.md +1 -1
- package/dist/docs/references/docs-sandbox-filesystem.md +1 -1
- package/dist/docs/references/docs-server-pubsub.md +51 -8
- package/dist/docs/references/docs-signals-running-across-processes.md +2 -0
- package/dist/docs/references/docs-signals-thread-streams.md +1 -1
- package/dist/docs/references/docs-studio-auth.md +54 -7
- package/dist/docs/references/docs-workflows-overview.md +1 -1
- package/dist/docs/references/docs-workflows-scheduled-workflows.md +1 -1
- package/dist/docs/references/integrations-auth-clerk.md +48 -4
- package/dist/docs/references/integrations-channels-slack.md +4 -2
- package/dist/docs/references/integrations.md +6 -0
- package/dist/docs/references/reference-agents-agent.md +3 -1
- package/dist/docs/references/reference-agents-channels.md +116 -27
- package/dist/docs/references/reference-agents-durable-agent.md +12 -4
- package/dist/docs/references/reference-auth-clerk.md +21 -1
- package/dist/docs/references/reference-datasets-runExperimentItem.md +13 -1
- package/dist/docs/references/reference-datasets-startExperimentAsync.md +3 -1
- package/dist/docs/references/reference-editor-mastra-editor.md +3 -1
- package/dist/docs/references/reference-knowledge-knowledge-class.md +13 -6
- package/dist/docs/references/reference-knowledge-knowledge-tools.md +43 -20
- package/dist/docs/references/reference-memory-observational-memory.md +2 -2
- package/dist/docs/references/reference-processors-moderation-processor.md +2 -2
- package/dist/docs/references/reference-pubsub-base.md +5 -1
- package/dist/docs/references/reference-pubsub-event-emitter.md +2 -0
- package/dist/docs/references/reference-pubsub-redis-streams.md +1 -1
- package/dist/docs/references/reference-pubsub-unix-socket-pubsub.md +2 -0
- package/dist/docs/references/reference-streaming-ChunkType.md +3 -3
- package/dist/docs/references/reference-workers-overview.md +1 -1
- package/dist/docs/references/reference-workflows-run-methods-start.md +23 -0
- package/dist/docs/references/reference-workflows-run-methods-timeTravel.md +4 -0
- package/dist/docs/references/reference-workflows-run.md +1 -1
- package/dist/docs/references/reference-workspace-local-sandbox.md +2 -0
- package/dist/error/index.cjs +1 -1
- package/dist/error/index.js +1 -1
- package/dist/{error-C9d_24w-.js → error-BLwEXqOK.js} +2 -2
- package/dist/{error-BRQf2ku0.cjs → error-BdEvO8za.cjs} +2 -2
- package/dist/evals/index.cjs +1 -1
- package/dist/evals/index.js +1 -1
- package/dist/evals/scoreTraces/index.cjs +1 -1
- package/dist/evals/scoreTraces/index.js +1 -1
- package/dist/events/caching-pubsub.d.ts +1 -0
- package/dist/events/event-emitter/index.d.ts +12 -5
- package/dist/events/index.cjs +15 -1
- package/dist/events/index.js +15 -1
- package/dist/events/pubsub.d.ts +29 -0
- package/dist/events/reach.d.ts +11 -0
- package/dist/events/unix-socket-pubsub.d.ts +14 -0
- package/dist/features/index.cjs +1 -0
- package/dist/features/index.js +1 -0
- package/dist/{filesystem-B5X-5G0x.js → filesystem-B8ad6kAW.js} +1 -1
- package/dist/{filesystem-BDSpwBke.cjs → filesystem-BB5YWXH-.cjs} +1 -1
- package/dist/{filesystem-DzM9pcQ8.js → filesystem-BDHUxbHn.js} +1 -1
- package/dist/{filesystem-B0AZrbj8.cjs → filesystem-BP5yz5LG.cjs} +1 -1
- package/dist/{filesystem-BsdkC311.js → filesystem-B_afSgYk.js} +1 -1
- package/dist/{filesystem-C-cyJfi1.cjs → filesystem-BaOJOc-V.cjs} +1 -1
- package/dist/{filesystem-B3s0WRud.js → filesystem-BhYgU8qg.js} +1 -1
- package/dist/{filesystem-DzfqVTO_.js → filesystem-CLBVmR5j.js} +1 -1
- package/dist/{filesystem-CEbD_77-.cjs → filesystem-Cgxc2a_-.cjs} +1 -1
- package/dist/{filesystem-Cv79mHRk.js → filesystem-ClBOBoDc.js} +1 -1
- package/dist/{filesystem-DsCQiBl2.cjs → filesystem-DVVecqZt.cjs} +1 -1
- package/dist/{filesystem-CUAgLugE.cjs → filesystem-Fpsu7e24.cjs} +1 -1
- package/dist/{filesystem-versioned-Bijb_p9l.js → filesystem-versioned-BL1ojJLo.js} +1 -1
- package/dist/{filesystem-versioned-DZGyPbNC.cjs → filesystem-versioned-BavRtYWJ.cjs} +1 -1
- package/dist/harness/index.cjs +1 -1
- package/dist/harness/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/knowledge/config.d.ts +10 -0
- package/dist/knowledge/host-writes.d.ts +10 -0
- package/dist/knowledge/importers/conformance.d.ts +25 -0
- package/dist/knowledge/importers/define.d.ts +204 -0
- package/dist/knowledge/importers/host.d.ts +143 -0
- package/dist/knowledge/importers/index.d.ts +12 -0
- package/dist/knowledge/importers/local-host.d.ts +106 -0
- package/dist/knowledge/importers/manifest.d.ts +25 -0
- package/dist/knowledge/importers/runner.d.ts +61 -0
- package/dist/knowledge/importers/sink.d.ts +105 -0
- package/dist/knowledge/importers/types.d.ts +144 -0
- package/dist/knowledge/index.cjs +2715 -8
- package/dist/knowledge/index.d.ts +54 -4
- package/dist/knowledge/index.js +2692 -9
- package/dist/knowledge/instructions.d.ts +1 -1
- package/dist/knowledge/links.d.ts +8 -0
- package/dist/knowledge/pinned-state-processor.d.ts +5 -0
- package/dist/knowledge/pinned.d.ts +4 -1
- package/dist/knowledge/scope-runtime.d.ts +10 -0
- package/dist/llm/index.cjs +3 -3
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/provider-types.generated.d.ts +7812 -7831
- package/dist/llm/model/shared.types.d.ts +31 -0
- package/dist/{llm-CsQuqKPc.cjs → llm-8Av3mSjD.cjs} +2 -2
- package/dist/{llm-DnXK3Pmw.js → llm-B5A5cwJr.js} +2 -2
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +2 -2
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +2 -2
- package/dist/{manager-BsghM-UL.js → manager-DfWQCJUK.js} +460 -94
- package/dist/{manager-DwFnIrI6.cjs → manager-sv35JY-z.cjs} +476 -92
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.d.ts +13 -0
- package/dist/mastra/index.js +1 -1
- package/dist/mastra/resolve-agent.d.ts +3 -1
- package/dist/{mastra-B8i1UDZs.js → mastra-CigBrT7X.js} +32 -23
- package/dist/{mastra-Cn5NC6Es.cjs → mastra-D4hvfuxX.cjs} +34 -25
- package/dist/memory/index.cjs +3 -3
- package/dist/memory/index.js +3 -3
- package/dist/{message-list-DPXPXvin.cjs → message-list-Cj0Sq_JP.cjs} +63 -8
- package/dist/{message-list-DEuRl82K.js → message-list-KRbg-TnI.js} +63 -8
- package/dist/{model-CNPfry_X.cjs → model-BK93CMtl.cjs} +1 -1
- package/dist/{model-CsOcWMUt.js → model-CYtXw861.js} +1 -1
- package/dist/{netlify-C-83Fxus.cjs → netlify-BAnn3ouY.cjs} +1 -1
- package/dist/{netlify-C-OpNSGp.js → netlify-CuI1ZrwR.js} +1 -1
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/{output-helpers-JL-HeCbT.cjs → output-helpers-1Zu4Vt9C.cjs} +68 -25
- package/dist/{output-helpers-D4II19No.js → output-helpers-CedRCE17.js} +69 -26
- package/dist/processor-provider/index.cjs +1 -1
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/abort-signal-scope.d.ts +6 -0
- package/dist/processors/index.cjs +2 -2
- package/dist/processors/index.js +2 -2
- package/dist/{provider-registry-9O-H9osy.cjs → provider-registry-BwuI_IpT.cjs} +21690 -21811
- package/dist/{provider-registry-RZ8EgSe8.js → provider-registry-CmQLzLF_.js} +21690 -21811
- package/dist/provider-registry.json +22113 -22215
- package/dist/{registry-generator-e8sltJls.js → registry-generator-C17V4WfG.js} +1 -1
- package/dist/{registry-generator-DxCX-FiO.cjs → registry-generator-C_0ae7Ce.cjs} +1 -1
- package/dist/{rehydrate-B-wrAN7C.cjs → rehydrate-CDQ4dOYj.cjs} +2 -2
- package/dist/{rehydrate-D3fPgJwp.js → rehydrate-PnaVawGX.js} +2 -2
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +2 -2
- package/dist/{run-registry-5_LQBGn_.cjs → run-registry-BmckDVBk.cjs} +1698 -497
- package/dist/{run-registry-DC03XLeZ.js → run-registry-BwEcwYlU.js} +1614 -467
- package/dist/{source-DDwx-87N.cjs → source-BVOi8Xhp.cjs} +1 -1
- package/dist/{source-Did_2XQc.js → source-fNa6u1kH.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/knowledge/base.d.ts +72 -0
- package/dist/storage/domains/knowledge/importers-inmemory.d.ts +146 -0
- package/dist/storage/domains/knowledge/importers.d.ts +287 -0
- package/dist/storage/domains/knowledge/index.d.ts +1 -0
- package/dist/storage/domains/knowledge/inmemory.d.ts +12 -0
- package/dist/storage/domains/knowledge/pages-inmemory.d.ts +12 -1
- package/dist/storage/domains/knowledge/pages.d.ts +25 -7
- 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/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 +15 -10
- package/dist/storage/index.js +11 -11
- package/dist/stream/base/output.d.ts +59 -15
- package/dist/stream/index.cjs +2 -2
- package/dist/stream/index.js +2 -2
- package/dist/stream/types.d.ts +24 -2
- package/dist/{stream-4aNIw_TQ.cjs → stream-0kdqBOOn.cjs} +64 -9
- package/dist/{stream-CJUm6EAH.js → stream-D1y9GzoD.js} +29 -10
- 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-FEEwHfmg.js → tool-loop-agent-BdjWGVIb.js} +4 -4
- package/dist/{tool-loop-agent-Dn0QCB9n.cjs → tool-loop-agent-kWaZAT6Q.cjs} +4 -4
- package/dist/tools/types.d.ts +27 -1
- package/dist/{utils-DY01hxVd.cjs → utils-BKUCaZ12.cjs} +1 -1
- package/dist/{utils-Bd_y1_a-.js → utils-GHY3hmLx.js} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{validate-CX0yQo_q.js → validate-CB-q-R2F.js} +1 -1
- package/dist/{validate-CuB_1Zd3.cjs → validate-De92squ7.cjs} +1 -1
- package/dist/vector/index.cjs +2 -2
- package/dist/vector/index.js +2 -2
- package/dist/worker/index.cjs +1 -1
- package/dist/worker/index.js +1 -1
- package/dist/{worker-CbaSmip-.cjs → worker-BbWPQuPR.cjs} +2 -2
- package/dist/{worker-B80xkcKG.js → worker-C3u_xzY2.js} +2 -2
- package/dist/{worker-GsGIxPMa.cjs → worker-CAKvQj9_.cjs} +2 -2
- package/dist/{worker-DSEfMPmq.js → worker-Kwm8EKcj.js} +2 -2
- package/dist/{workflow-CnBPXTpv.cjs → workflow-CSjXeNcR.cjs} +4 -4
- package/dist/{workflow-CZHY_C85.js → workflow-CVmI1Sw-.js} +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/setup-warning.d.ts +18 -0
- package/dist/workflows/evented/workflow-event-processor/run-status.d.ts +37 -0
- package/dist/workflows/evented/workflow.d.ts +10 -0
- package/dist/workflows/index.cjs +4 -4
- package/dist/workflows/index.js +4 -4
- package/dist/workflows/workflow.d.ts +6 -1
- package/dist/workspace/filesystem/filesystem.d.ts +5 -0
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/sandbox/local-sandbox.d.ts +16 -7
- package/dist/workspace/sandbox/native-sandbox/types.d.ts +11 -1
- package/dist/{workspace-D7TIleIt.js → workspace-DY2Nxiyi.js} +235 -34
- package/dist/{workspace-D2drutNg.cjs → workspace-X2RHJZU9.cjs} +235 -34
- package/package.json +7 -7
- package/src/llm/model/provider-types.generated.d.ts +7812 -7831
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as resolveDurableToolCallConcurrency, $s as publishAbortRequest, At as readRunDeadline, B as createDurableGoalStep, Ct as runDurableStreamUntilIdle, Dt as DurableStepIds, Et as DurableAgentDefaults, F as prepareForDurableExecution, Ft as pruneAgentLoopSnapshot, G as serializeDurableOptions, Gs as emitAbortEvent, H as createDurableLLMMappingStep, I as applyReservedMemoryContextKeys, J as serializeToolsMetadata, Js as emitFinishEvent, K as serializeDurableState, Ks as emitChunkEvent, L as persistDurableRunInput, Mt as getRunStreamSlot, N as Agent, Nt as getScopeStreamSlot, Ot as RUN_DEADLINE_KEY, P as normalizeResumeGenerateArgs, Pt as untilIdleHandlesBackgroundTask, Q as createDurableBackgroundTaskCheckStep, Qs as AgentStreamBus, R as detachFullStreamOnEnd, St as createDurableAgentStream, Tt as DURABLE_STOP_WHEN_ERROR_ID, U as createDurableToolCallStep, Us as __resetExecutionFencesForTests, V as createDurableIsTaskCompleteStep, W as createWorkflowInput, Ws as diffResponseMessages, Xs as emitStepStartEvent, Y as createDurableLLMExecutionStep, Ys as emitStepFinishEvent, Zs as emitSuspendedEvent, Zt as validateModelTimeoutSettings, _t as toolRequiresApproval, a as endRunSpansWithError, ac as AgentControlEventTypes, at as baseIterationStateSchema, bt as liveSegmentSpan, c as globalRunRegistry, ct as modelListEntrySchema, d as takeRunScorerInstances, dt as loadRunStoredMessages, ec as requestAcknowledgedAbort, et as buildStepRecord, ft as rebuildRunToolsFromMastra, gt as resolveTool, ht as resolveRuntimeDependencies, i as deleteRunRegistryEntry, ic as AGENT_STREAM_TOPIC, it as baseDurableAgenticInputSchema, kt as ensureRemoteAbortListener, lt as executeDurableAgentScorers, mt as resolveModel, n as RunRegistry, nc as createRunAbortController, nt as createBaseIterationStateUpdate, oc as AgentStreamEventTypes, ot as durableAgenticOutputSchema, p as agentThreadStreamRuntime, pt as resolveInternalState, q as serializeModelConfig, qs as emitErrorEvent, rc as AGENT_CONTROL_TOPIC, rt as accumulatedUsageSchema, s as getRunRegistryEntry, st as modelConfigSchema, t as ExtendedRunRegistry, tc as subscribeToAbortRequests, tt as calculateAccumulatedUsage, u as setRunRegistryEntry, ut as runDurableFinishSideEffects, wt as runResumeDurableStreamUntilIdle, xt as segmentSpanData, yt as carrySegmentSpans, z as createDurableAgenticWorkflow } from "../../run-registry-BwEcwYlU.js";
|
|
2
2
|
import { D as agentLoopTermination, O as executionFailureTermination } from "../../observability-D7RNOAPx.js";
|
|
3
3
|
// src/agent/durable/durable-agent.ts
|
|
4
4
|
var DurableAgent = class extends Agent {
|
|
@@ -397,36 +397,11 @@ var DurableAgent = class extends Agent {
|
|
|
397
397
|
return this.#storageVersion === 2;
|
|
398
398
|
}
|
|
399
399
|
/**
|
|
400
|
-
* Warns once when `storageVersion: 2` is set but the registered store can't
|
|
401
|
-
* store version 2 runs. The loop workflow's `autoStorageVersion` then stores
|
|
402
|
-
* new runs as version 1. An agent with no registered store isn't warned.
|
|
403
|
-
*/
|
|
404
|
-
#warnIfStorageVersionUnsupported() {
|
|
405
|
-
if (this.#storageVersion !== 2) return;
|
|
406
|
-
const storage = this.#mastra?.getStorage();
|
|
407
|
-
const workflowsStore = storage?.stores?.workflows;
|
|
408
|
-
if (workflowsStore && !workflowsStore.supportsRunJournal()) this.guardrailLogger?.warn(`DurableAgent '${this.id}' sets storageVersion: 2, which ${storage?.name ?? "the configured"} storage doesn't support yet; storing new runs as version 1.`);
|
|
409
|
-
}
|
|
410
|
-
/**
|
|
411
|
-
* Subscribe to a run's raw AgentStreamEvents, filtering out events from
|
|
412
|
-
* executions that lost ownership and takeover markers. Callers must map
|
|
413
|
-
* these events to the public frame contract produced by stream-adapter.ts's
|
|
414
|
-
* createDurableAgentStream before sending them to clients; raw event
|
|
415
|
-
* envelopes are not public stream frames. Resolves once subscribed, with
|
|
416
|
-
* a function that unsubscribes.
|
|
417
|
-
*
|
|
418
|
-
* @internal
|
|
419
|
-
*/
|
|
420
|
-
__subscribeToRunStream(runId, options, onEvent) {
|
|
421
|
-
return this.subscribeToDurableRunStream(runId, options, onEvent);
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
400
|
* Get the workflow instance for direct execution.
|
|
425
401
|
* Lazily creates the workflow and registers Mastra on it (needed for
|
|
426
402
|
* getAgentById in execution steps).
|
|
427
403
|
*/
|
|
428
404
|
getWorkflow() {
|
|
429
|
-
if (!this.executionEngine.workflow) this.#warnIfStorageVersionUnsupported();
|
|
430
405
|
return this.executionEngine.workflow ?? this.executionEngine.getWorkflow({
|
|
431
406
|
maxSteps: this.#maxSteps,
|
|
432
407
|
workflowEngine: this.workflowEngine,
|
|
@@ -628,6 +603,12 @@ function isEventedAgentClass(obj) {
|
|
|
628
603
|
* death: over the same storage, a fresh process can resume in-flight runs via
|
|
629
604
|
* `recover(runId)` / `recoverActiveRuns()`.
|
|
630
605
|
*
|
|
606
|
+
* In one process it runs on any pubsub, including the default one. Running its
|
|
607
|
+
* steps on several processes needs a pubsub that redelivers unacknowledged
|
|
608
|
+
* events and a workflows store with step guards.
|
|
609
|
+
*
|
|
610
|
+
* @see https://mastra.ai/docs/server/pubsub#evented-workflows-and-agents
|
|
611
|
+
*
|
|
631
612
|
* @param options - Configuration options
|
|
632
613
|
* @returns An EventedAgent instance (register it on a `Mastra` host before use)
|
|
633
614
|
*
|
|
@@ -71,6 +71,8 @@ export interface PreparationOptions<OUTPUT = undefined> {
|
|
|
71
71
|
runId?: string;
|
|
72
72
|
/** Request context */
|
|
73
73
|
requestContext?: RequestContext;
|
|
74
|
+
/** @internal Called when a non-reserved context entry cannot be snapshotted. */
|
|
75
|
+
onRequestContextEntryOmitted?: () => void;
|
|
74
76
|
/** Logger */
|
|
75
77
|
logger?: IMastraLogger;
|
|
76
78
|
/** Mastra instance (for version overrides, background tasks, etc.) */
|
|
@@ -81,6 +81,14 @@ export declare function restoreCustomContext(entries?: Record<string, unknown>,
|
|
|
81
81
|
export declare class DurableProcessorRebuildError extends Error {
|
|
82
82
|
constructor(agentId: string, cause: unknown);
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* The process running a step could not find the run's agent in its registry
|
|
86
|
+
* or editor. Running on would execute the step with no tools, memory or
|
|
87
|
+
* processors, so the step fails instead.
|
|
88
|
+
*/
|
|
89
|
+
export declare class DurableAgentNotFoundError extends Error {
|
|
90
|
+
constructor(agentId: string, runId: string, cause?: unknown);
|
|
91
|
+
}
|
|
84
92
|
/**
|
|
85
93
|
* Resolve all runtime dependencies needed for durable step execution.
|
|
86
94
|
*
|
|
@@ -141,6 +149,7 @@ export declare function rebuildRunToolsFromMastra(options: {
|
|
|
141
149
|
mastra?: Mastra;
|
|
142
150
|
runId: string;
|
|
143
151
|
agentId: string;
|
|
152
|
+
agentVersionId?: string;
|
|
144
153
|
state: SerializableDurableState;
|
|
145
154
|
options?: SerializableDurableOptions;
|
|
146
155
|
/** JSON-safe request-context snapshot from the workflow input (see preparation.ts). */
|
|
@@ -125,6 +125,7 @@ export declare class DurableAgenticLoopBuilder extends BaseAgenticLoopBuilder {
|
|
|
125
125
|
protected llmExecutionStep(): import("../../../workflows").Step<"durable-llm-execution", unknown, {
|
|
126
126
|
runId: string;
|
|
127
127
|
agentId: string;
|
|
128
|
+
agentVersionId?: string | undefined;
|
|
128
129
|
agentName?: string | undefined;
|
|
129
130
|
messageListState: any;
|
|
130
131
|
initialUntaggedSystemMessages?: any[] | undefined;
|
|
@@ -415,6 +416,7 @@ export declare class DurableAgenticLoopBuilder extends BaseAgenticLoopBuilder {
|
|
|
415
416
|
tracingStopCause?: "delegation" | "feedback_complete" | "iteration_hook" | "max_steps" | "model_finished" | "stop_condition" | undefined;
|
|
416
417
|
tracingTermination?: import("../../../observability").SpanTermination | undefined;
|
|
417
418
|
tracingDelegationFailure?: import("../../../observability").SpanTermination | undefined;
|
|
419
|
+
agentVersionId?: string | undefined;
|
|
418
420
|
modelList?: any[] | undefined;
|
|
419
421
|
}, {
|
|
420
422
|
runId: string;
|
|
@@ -466,6 +468,7 @@ export declare class DurableAgenticLoopBuilder extends BaseAgenticLoopBuilder {
|
|
|
466
468
|
tracingStopCause?: "delegation" | "feedback_complete" | "iteration_hook" | "max_steps" | "model_finished" | "stop_condition" | undefined;
|
|
467
469
|
tracingTermination?: import("../../../observability").SpanTermination | undefined;
|
|
468
470
|
tracingDelegationFailure?: import("../../../observability").SpanTermination | undefined;
|
|
471
|
+
agentVersionId?: string | undefined;
|
|
469
472
|
modelList?: any[] | undefined;
|
|
470
473
|
}, {
|
|
471
474
|
runId: string;
|
|
@@ -517,6 +520,7 @@ export declare class DurableAgenticLoopBuilder extends BaseAgenticLoopBuilder {
|
|
|
517
520
|
tracingStopCause?: "delegation" | "feedback_complete" | "iteration_hook" | "max_steps" | "model_finished" | "stop_condition" | undefined;
|
|
518
521
|
tracingTermination?: import("../../../observability").SpanTermination | undefined;
|
|
519
522
|
tracingDelegationFailure?: import("../../../observability").SpanTermination | undefined;
|
|
523
|
+
agentVersionId?: string | undefined;
|
|
520
524
|
modelList?: any[] | undefined;
|
|
521
525
|
}, unknown, 1>;
|
|
522
526
|
/**
|
|
@@ -7,7 +7,7 @@ import { RequestContext } from '../../../request-context/index.js';
|
|
|
7
7
|
import type { ChunkType } from '../../../stream/types.js';
|
|
8
8
|
import type { Agent } from '../../agent.js';
|
|
9
9
|
import type { SerializedMessageListState } from '../../message-list/state/index.js';
|
|
10
|
-
import type { DurableAgenticWorkflowInput, RunRegistryEntry } from '../types.js';
|
|
10
|
+
import type { AgentFinishEventData, DurableAgenticWorkflowInput, RunRegistryEntry } from '../types.js';
|
|
11
11
|
type GenerateThreadTitleArgs = Parameters<NonNullable<RunRegistryEntry['generateThreadTitle']>>[0];
|
|
12
12
|
type AnyAgent = Agent<any, any, any, any>;
|
|
13
13
|
export interface DurableFinishSideEffectsOptions {
|
|
@@ -27,6 +27,8 @@ export interface DurableFinishSideEffectsOptions {
|
|
|
27
27
|
}
|
|
28
28
|
export interface DurableFinishSideEffectsResult {
|
|
29
29
|
messageListState: SerializedMessageListState;
|
|
30
|
+
finishMessages?: AgentFinishEventData['messages'];
|
|
31
|
+
rewrittenStepTexts?: string[];
|
|
30
32
|
outputText: string;
|
|
31
33
|
/**
|
|
32
34
|
* True when processOutputResult changed `outputText`, including emptying it. Only then should
|
|
@@ -22,6 +22,7 @@ export interface DurableLLMExecutionStepOptions {
|
|
|
22
22
|
export declare function createDurableLLMExecutionStep(_options?: DurableLLMExecutionStepOptions): import("../../../../workflows").Step<"durable-llm-execution", unknown, {
|
|
23
23
|
runId: string;
|
|
24
24
|
agentId: string;
|
|
25
|
+
agentVersionId?: string | undefined;
|
|
25
26
|
agentName?: string | undefined;
|
|
26
27
|
messageListState: any;
|
|
27
28
|
initialUntaggedSystemMessages?: any[] | undefined;
|
package/dist/agent/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const require_message_list = require("../message-list-
|
|
2
|
+
const require_run_registry = require("../run-registry-BmckDVBk.cjs");
|
|
3
|
+
const require_stream = require("../stream-0kdqBOOn.cjs");
|
|
4
|
+
const require_message_list = require("../message-list-Cj0Sq_JP.cjs");
|
|
5
5
|
const require_signals = require("../signals-CWxAMEmE.cjs");
|
|
6
6
|
const require_to_prompt = require("../to-prompt-B9eZo2U5.cjs");
|
|
7
7
|
const require_schedules = require("../schedules-BZS8McF7.cjs");
|
package/dist/agent/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Q as TypeDetector, n as MessageList, t as convertMessages } from "../message-list-
|
|
1
|
+
import { A as assembleAgentFromFsEntry, Bl as isAgentCompatible, Ds as getGoalActivityDurationMs, It as DEFAULT_TOOL_DECLINE_REASON, Lt as resolveDeclineReason, M as AGENT_RESUME_CLAIM_STALE_MS, N as Agent, O as agentConfig, bl as isDurableAgentLike, j as MAX_FS_SUBAGENT_DEPTH, k as agentInstructions, yl as hasResumableStreams } from "../run-registry-BwEcwYlU.js";
|
|
2
|
+
import { dn as resolveThreadIdFromArgs, fn as supportedLanguageModelSpecifications, l as TripWire, ln as isSupportedLanguageModel, mn as tryStreamWithJsonFallback, pn as tryGenerateWithJsonFallback, un as resolveSuspendedToolRunId } from "../stream-D1y9GzoD.js";
|
|
3
|
+
import { Q as TypeDetector, n as MessageList, t as convertMessages } from "../message-list-KRbg-TnI.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
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";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_message_list = require("../../message-list-
|
|
2
|
+
const require_message_list = require("../../message-list-Cj0Sq_JP.cjs");
|
|
3
3
|
const require_to_prompt = require("../../to-prompt-B9eZo2U5.cjs");
|
|
4
4
|
exports.AIV4Adapter = require_message_list.AIV4Adapter;
|
|
5
5
|
exports.AIV5Adapter = require_message_list.AIV5Adapter;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { B as getResponseProviderItemIdFromPart, F as AIV4Adapter, H as hasResponseProviderItemId, I as dropCrossProviderExecutedParts, J as getResponseProviderItemIds, L as ensureAnthropicCompatibleMessages, M as AIV5Adapter, Q as TypeDetector, R as findToolCallArgs, U as pairOrphanedToolCalls, V as hasOpenAIReasoningItemId, W as sanitizeOrphanedToolPairs, X as getResponseProviderItemKeys, Y as getResponseProviderItemKey, f as coreContentToString, j as AIV6Adapter, k as CacheKeyGenerator, n as MessageList, o as MessageStateManager, p as messagesAreEqual, q as getResponseProviderItemId, t as convertMessages, u as MessageMerger, z as getOpenAIReasoningItemId } from "../../message-list-
|
|
1
|
+
import { B as getResponseProviderItemIdFromPart, F as AIV4Adapter, H as hasResponseProviderItemId, I as dropCrossProviderExecutedParts, J as getResponseProviderItemIds, L as ensureAnthropicCompatibleMessages, M as AIV5Adapter, Q as TypeDetector, R as findToolCallArgs, U as pairOrphanedToolCalls, V as hasOpenAIReasoningItemId, W as sanitizeOrphanedToolPairs, X as getResponseProviderItemKeys, Y as getResponseProviderItemKey, f as coreContentToString, j as AIV6Adapter, k as CacheKeyGenerator, n as MessageList, o as MessageStateManager, p as messagesAreEqual, q as getResponseProviderItemId, t as convertMessages, u as MessageMerger, z as getOpenAIReasoningItemId } from "../../message-list-KRbg-TnI.js";
|
|
2
2
|
import { n as aiV5ModelMessageToV2PromptMessage, t as aiV4CoreMessageToV1PromptMessage } from "../../to-prompt-BsDtVXrf.js";
|
|
3
3
|
export { AIV4Adapter, AIV5Adapter, AIV6Adapter, CacheKeyGenerator, MessageList, MessageMerger, MessageStateManager, TypeDetector, aiV4CoreMessageToV1PromptMessage, aiV5ModelMessageToV2PromptMessage, convertMessages, coreContentToString, dropCrossProviderExecutedParts, ensureAnthropicCompatibleMessages, findToolCallArgs, getOpenAIReasoningItemId, getResponseProviderItemId, getResponseProviderItemIdFromPart, getResponseProviderItemIds, getResponseProviderItemKey, getResponseProviderItemKeys, hasOpenAIReasoningItemId, hasResponseProviderItemId, messagesAreEqual, pairOrphanedToolCalls, sanitizeOrphanedToolPairs };
|
|
@@ -429,6 +429,17 @@ export declare class MessageList {
|
|
|
429
429
|
messageId: string;
|
|
430
430
|
urls: string[];
|
|
431
431
|
}[];
|
|
432
|
+
/**
|
|
433
|
+
* Mark a message already in this list as changed after it was loaded, so the next save writes it
|
|
434
|
+
* again through the normal whole-message save. It is not reported as new input, output or source.
|
|
435
|
+
* Messages that are not in the list are ignored.
|
|
436
|
+
*/
|
|
437
|
+
markForResave(message: MastraDBMessage): void;
|
|
438
|
+
/**
|
|
439
|
+
* The messages marked with {@link markForResave} and not yet drained. For save paths that read the
|
|
440
|
+
* list instead of draining it; they pick these up next to the new input and response.
|
|
441
|
+
*/
|
|
442
|
+
getMessagesToResave(): MastraDBMessage[];
|
|
432
443
|
drainUnsavedMessages(): MastraDBMessage[];
|
|
433
444
|
/**
|
|
434
445
|
* Same as {@link drainUnsavedMessages}, plus `restore`, which marks the drained
|
|
@@ -111,6 +111,7 @@ export declare function getResponseProviderItemIdFromPart(part: unknown): {
|
|
|
111
111
|
provider: ResponseItemIdProvider;
|
|
112
112
|
itemId: string;
|
|
113
113
|
} | undefined;
|
|
114
|
+
export declare function createToolCallArgsLookup(messages: MastraDBMessage[]): (toolCallId: string) => Record<string, unknown>;
|
|
114
115
|
/**
|
|
115
116
|
* Finds the tool call args for a given toolCallId by searching through messages.
|
|
116
117
|
* This is used to reconstruct the input field when converting tool-result parts to StaticToolResult.
|
|
@@ -17,7 +17,7 @@ export declare const MASTRA_DURABLE_SEGMENTS_KEY = "mastra__durableSegments";
|
|
|
17
17
|
* round-trip are skipped so a single non-serializable value can't break the
|
|
18
18
|
* snapshot.
|
|
19
19
|
*/
|
|
20
|
-
export declare function snapshotRequestContextEntries(requestContext: RequestContext | undefined): Record<string, unknown> | undefined;
|
|
20
|
+
export declare function snapshotRequestContextEntries(requestContext: RequestContext | undefined, onEntryOmitted?: () => void): Record<string, unknown> | undefined;
|
|
21
21
|
/**
|
|
22
22
|
* Restore a RequestContext from a `snapshotRequestContextEntries` snapshot.
|
|
23
23
|
*
|
|
@@ -40,6 +40,16 @@ export interface AgentStreamEvent<T = unknown> {
|
|
|
40
40
|
export interface AgentStreamsConfig {
|
|
41
41
|
/** Select the default (in-process) or evented durable engine, or false for the plain Agent loop. */
|
|
42
42
|
executionEngine?: 'default' | 'evented' | false;
|
|
43
|
+
/** Maximum steps for the durable loop when neither defaultOptions nor the call sets a limit. */
|
|
44
|
+
maxSteps?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Storage version for new durable runs. Version 2 uses the run journal when supported,
|
|
47
|
+
* otherwise the agent logs a warning and stores new runs as version 1.
|
|
48
|
+
* Existing runs keep their stored version.
|
|
49
|
+
* @default 1
|
|
50
|
+
* @experimental
|
|
51
|
+
*/
|
|
52
|
+
storageVersion?: 1 | 2;
|
|
43
53
|
/** Snapshot persistence policy for durable execution. */
|
|
44
54
|
shouldPersistSnapshot?: ShouldPersistSnapshotFn;
|
|
45
55
|
/**
|
|
@@ -243,6 +243,11 @@ export declare class AgentThreadStreamRuntime {
|
|
|
243
243
|
/** Same predicate as {@link getActiveThreadRunId}, over every tracked thread. */
|
|
244
244
|
listActiveThreadRuns(pubsub?: PubSub): ActiveThreadRun[];
|
|
245
245
|
hasThreadRun(runId: string, pubsub?: PubSub): boolean;
|
|
246
|
+
/** The resource and thread a `runId`-only signal or message target resolves to in this process. */
|
|
247
|
+
getThreadRunTarget(runId: string, pubsub?: PubSub): {
|
|
248
|
+
resourceId?: string;
|
|
249
|
+
threadId: string;
|
|
250
|
+
} | undefined;
|
|
246
251
|
/** Whether the run's original stream is still live and carries its resumed segments. */
|
|
247
252
|
hasRunContinuation(runId: string, pubsub?: PubSub): boolean;
|
|
248
253
|
/** Capture whether the currently registered continuation publishes its terminal stream part. */
|
package/dist/agent/types.d.ts
CHANGED
|
@@ -953,6 +953,31 @@ type AgentEditableFieldConfig<TTools extends ToolsInput, TRequestContext extends
|
|
|
953
953
|
} : {
|
|
954
954
|
tools?: DynamicArgument<TTools, TRequestContext>;
|
|
955
955
|
});
|
|
956
|
+
/**
|
|
957
|
+
* Options for `new Agent(config)`.
|
|
958
|
+
*
|
|
959
|
+
* - Required: `id`, `name`, `model`, and `instructions` (unless Studio owns instructions via
|
|
960
|
+
* `editor`).
|
|
961
|
+
* - Common optional fields: `tools`, `memory`, `agents` (sub-agents), `workflows`,
|
|
962
|
+
* `defaultOptions` (default per-call options such as `maxSteps`), `inputProcessors`,
|
|
963
|
+
* `outputProcessors`, `maxRetries`.
|
|
964
|
+
* - `model`, `instructions`, `tools`, and most other fields also accept a function of
|
|
965
|
+
* `{ requestContext }` resolved per call. `model` also accepts an array of fallbacks.
|
|
966
|
+
*
|
|
967
|
+
* @example
|
|
968
|
+
* ```ts
|
|
969
|
+
* const agent = new Agent({
|
|
970
|
+
* id: 'weather-agent',
|
|
971
|
+
* name: 'Weather Agent',
|
|
972
|
+
* instructions: 'You answer weather questions.',
|
|
973
|
+
* model: 'openai/gpt-5.6-sol',
|
|
974
|
+
* tools: { weatherTool },
|
|
975
|
+
* defaultOptions: { maxSteps: 5 },
|
|
976
|
+
* });
|
|
977
|
+
* ```
|
|
978
|
+
*
|
|
979
|
+
* @see [Agent constructor reference](https://mastra.ai/reference/agents/agent)
|
|
980
|
+
*/
|
|
956
981
|
export type AgentConfig<TAgentId extends string = string, TTools extends ToolsInput = ToolsInput, TOutput = undefined, TRequestContext extends Record<string, any> | unknown = unknown, TEditor extends AgentEditorConfig | undefined = AgentEditorConfig | undefined> = Omit<AgentConfigBase<TAgentId, TTools, TOutput, TRequestContext>, 'instructions' | 'tools' | 'editor'> & {
|
|
957
982
|
editor?: TEditor;
|
|
958
983
|
} & AgentEditableFieldConfig<TTools, TRequestContext, TEditor>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_provider_registry = require("../../provider-registry-
|
|
2
|
+
const require_provider_registry = require("../../provider-registry-BwuI_IpT.cjs");
|
|
3
3
|
// src/agent-builder/ee/types.ts
|
|
4
4
|
/**
|
|
5
5
|
* Default-on values for {@link AgentFeatures}. `browser` is defaulted
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getRegisteredProviders, o as isProviderRegistered, u as parseModelString } from "../../provider-registry-
|
|
1
|
+
import { a as getRegisteredProviders, o as isProviderRegistered, u as parseModelString } from "../../provider-registry-CmQLzLF_.js";
|
|
2
2
|
// src/agent-builder/ee/types.ts
|
|
3
3
|
/**
|
|
4
4
|
* Default-on values for {@link AgentFeatures}. `browser` is defaulted
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_state_processor = require("../state-processor-kRNZ38Nf.cjs");
|
|
3
3
|
const require_tools = require("../tools-CGF5Ik6j.cjs");
|
|
4
|
-
const require_agent_controller = require("../agent-controller-
|
|
4
|
+
const require_agent_controller = require("../agent-controller-CrQ9OF80.cjs");
|
|
5
5
|
exports.AgentController = require_agent_controller.AgentController;
|
|
6
6
|
exports.MODEL_PERSISTENCE_VERSION = require_agent_controller.MODEL_PERSISTENCE_VERSION;
|
|
7
7
|
exports.MODEL_PERSISTENCE_VERSION_KEY = require_agent_controller.MODEL_PERSISTENCE_VERSION_KEY;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { f as taskCheckTool, h as taskWriteTool, m as taskUpdateTool, o as assignTaskIds, p as taskCompleteTool } from "../state-processor-B9kxpM53.js";
|
|
2
2
|
import { s as askUserTool, t as submitPlanTool } from "../tools-CDfyMpzN.js";
|
|
3
|
-
import { a as Session, c as defaultDisplayState, d as SessionStartupCancelledError, f as isSessionNotStartedError, i as MODEL_PERSISTENCE_VERSION_KEY, l as defaultOMProgressState, n as parseSubagentMeta, o as getSuspensionAddressKey, p as isSessionStartupCancelledError, r as MODEL_PERSISTENCE_VERSION, s as migratePersistedModelSelection, t as AgentController, u as SessionNotStartedError } from "../agent-controller-
|
|
3
|
+
import { a as Session, c as defaultDisplayState, d as SessionStartupCancelledError, f as isSessionNotStartedError, i as MODEL_PERSISTENCE_VERSION_KEY, l as defaultOMProgressState, n as parseSubagentMeta, o as getSuspensionAddressKey, p as isSessionStartupCancelledError, r as MODEL_PERSISTENCE_VERSION, s as migratePersistedModelSelection, t as AgentController, u as SessionNotStartedError } from "../agent-controller-SSlKzE6A.js";
|
|
4
4
|
export { AgentController, MODEL_PERSISTENCE_VERSION, MODEL_PERSISTENCE_VERSION_KEY, Session, SessionNotStartedError, SessionStartupCancelledError, askUserTool, assignTaskIds, defaultDisplayState, defaultOMProgressState, getSuspensionAddressKey, isSessionNotStartedError, isSessionStartupCancelledError, migratePersistedModelSelection, parseSubagentMeta, submitPlanTool, taskCheckTool, taskCompleteTool, taskUpdateTool, taskWriteTool };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
const require_run_registry = require("./run-registry-
|
|
2
|
-
const require_message_list = require("./message-list-
|
|
1
|
+
const require_run_registry = require("./run-registry-BmckDVBk.cjs");
|
|
2
|
+
const require_message_list = require("./message-list-Cj0Sq_JP.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-DQg4v_gm.cjs");
|
|
6
|
+
const require_llm = require("./llm-8Av3mSjD.cjs");
|
|
7
|
+
const require_mastra = require("./mastra-D4hvfuxX.cjs");
|
|
8
|
+
const require_stream = require("./stream-0kdqBOOn.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-X2RHJZU9.cjs");
|
|
14
|
+
const require_output_helpers = require("./output-helpers-1Zu4Vt9C.cjs");
|
|
15
15
|
const require_payload_transform = require("./payload-transform-CWgnsO9w.cjs");
|
|
16
16
|
const require_tools = require("./tools-CGF5Ik6j.cjs");
|
|
17
17
|
const require_tool = require("./tool-CYlT2UA-.cjs");
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Dt as DurableStepIds,
|
|
2
|
-
import { n as MessageList } from "./message-list-
|
|
1
|
+
import { $r as InMemoryMemory, Dt as DurableStepIds, N as Agent, Pn as CHAT_CHANNEL_RENDER_CONTEXT_KEY, Rt as getServerSideFallbackInfo, Ta as validateStorageMetadataFilter, X as MessagePartSpans, Z as isSpanChunk, f as AgentThreadLeaseLostError, g as describeNonSuccessFinishReason, h as AGENTIC_LOOP_WORKFLOW_ID, m as AGENTIC_EXECUTION_WORKFLOW_ID, p as agentThreadStreamRuntime } from "./run-registry-BwEcwYlU.js";
|
|
2
|
+
import { n as MessageList } from "./message-list-KRbg-TnI.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 { t 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 { t as AgentControllerChannels } from "./channels-Cz1y3W6u.js";
|
|
6
|
+
import { a as ModelRouterLanguageModel, l as defaultGateways, s as GatewayManager } from "./llm-B5A5cwJr.js";
|
|
7
|
+
import { t as Mastra } from "./mastra-CigBrT7X.js";
|
|
8
|
+
import { Kt as TITLE_PINNED_THREAD_METADATA_KEY, Mn as createRunScopeKey } from "./stream-D1y9GzoD.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 { o as Workspace, p as createWorkspaceTools } from "./workspace-
|
|
15
|
-
import {
|
|
14
|
+
import { o as Workspace, p as createWorkspaceTools } from "./workspace-DY2Nxiyi.js";
|
|
15
|
+
import { v as isLeaseProvider } from "./output-helpers-CedRCE17.js";
|
|
16
16
|
import { n as hasTransformedToolPayload, t as getTransformedToolPayload } from "./payload-transform-Dj3HUeD4.js";
|
|
17
17
|
import { s as askUserTool, t as submitPlanTool } from "./tools-CDfyMpzN.js";
|
|
18
18
|
import { r as createTool, s as isValidationError } from "./tool-Z3bykc1m.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_background_tasks = require("../background-tasks-
|
|
2
|
+
const require_background_tasks = require("../background-tasks-BDrYBis-.cjs");
|
|
3
3
|
exports.BACKGROUND_TASK_WORKFLOW_ID = require_background_tasks.BACKGROUND_TASK_WORKFLOW_ID;
|
|
4
4
|
exports.BackgroundTaskManager = require_background_tasks.BackgroundTaskManager;
|
|
5
5
|
exports.backgroundOverrideJsonSchema = require_background_tasks.backgroundOverrideJsonSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { c as BACKGROUND_TASK_WORKFLOW_ID, s as BackgroundTaskManager, n as backgroundOverrideJsonSchema, r as backgroundOverrideZodSchema, o as createBackgroundTask, t as generateBackgroundTaskSystemPrompt, i as isToolBackgroundEligible, a as resolveBackgroundConfig } from "../background-tasks-
|
|
1
|
+
export { c as BACKGROUND_TASK_WORKFLOW_ID, s as BackgroundTaskManager, n as backgroundOverrideJsonSchema, r as backgroundOverrideZodSchema, o as createBackgroundTask, t as generateBackgroundTaskSystemPrompt, i as isToolBackgroundEligible, a as resolveBackgroundConfig } from "../background-tasks-BnJfNLFo.js";
|
|
@@ -178,7 +178,7 @@ var BackgroundTaskManager = class {
|
|
|
178
178
|
if (handled) await ack?.();
|
|
179
179
|
};
|
|
180
180
|
if (this.#mastra) {
|
|
181
|
-
const { buildBackgroundTaskWorkflow } = await Promise.resolve().then(() => require("./workflow-
|
|
181
|
+
const { buildBackgroundTaskWorkflow } = await Promise.resolve().then(() => require("./workflow-CSjXeNcR.cjs"));
|
|
182
182
|
const workflow = buildBackgroundTaskWorkflow(this);
|
|
183
183
|
if (!this.#mastra.__hasInternalWorkflow("__background-task")) this.#mastra.__registerInternalWorkflow(workflow);
|
|
184
184
|
}
|
|
@@ -969,7 +969,7 @@ var BackgroundTaskManager = class {
|
|
|
969
969
|
if (isRunningRedelivery && task.leaseExpiresAt && task.leaseExpiresAt.getTime() > Date.now()) return task.ownerId === this.workerId;
|
|
970
970
|
if (task.status === "pending" && task.ownerId && task.ownerId !== this.workerId) return true;
|
|
971
971
|
const pinnedHere = task.status === "pending" && task.ownerId === this.workerId;
|
|
972
|
-
const retryCount = task.status === "running" ? deliveryAttempt - 1 : task.retryCount;
|
|
972
|
+
const retryCount = task.status === "running" ? Math.max(task.retryCount, deliveryAttempt - 1) : task.retryCount;
|
|
973
973
|
const now = /* @__PURE__ */ new Date();
|
|
974
974
|
if (!await storage.updateTask(taskId, {
|
|
975
975
|
status: "running",
|
|
@@ -1602,8 +1602,10 @@ var BackgroundTaskManager = class {
|
|
|
1602
1602
|
expectedOwnerId: task.ownerId ?? null,
|
|
1603
1603
|
expectedLeaseExpiresAt: task.leaseExpiresAt ?? null
|
|
1604
1604
|
};
|
|
1605
|
-
|
|
1605
|
+
const handedBack = !task.ownerId && task.maxRetries > 0;
|
|
1606
|
+
if (handedBack || task.retryCount < task.maxRetries) await storage.updateTask(task.id, {
|
|
1606
1607
|
status: "pending",
|
|
1608
|
+
retryCount: handedBack ? task.retryCount : task.retryCount + 1,
|
|
1607
1609
|
startedAt: void 0,
|
|
1608
1610
|
ownerId: void 0,
|
|
1609
1611
|
leaseExpiresAt: void 0
|
|
@@ -178,7 +178,7 @@ var BackgroundTaskManager = class {
|
|
|
178
178
|
if (handled) await ack?.();
|
|
179
179
|
};
|
|
180
180
|
if (this.#mastra) {
|
|
181
|
-
const { buildBackgroundTaskWorkflow } = await import("./workflow-
|
|
181
|
+
const { buildBackgroundTaskWorkflow } = await import("./workflow-CVmI1Sw-.js");
|
|
182
182
|
const workflow = buildBackgroundTaskWorkflow(this);
|
|
183
183
|
if (!this.#mastra.__hasInternalWorkflow("__background-task")) this.#mastra.__registerInternalWorkflow(workflow);
|
|
184
184
|
}
|
|
@@ -969,7 +969,7 @@ var BackgroundTaskManager = class {
|
|
|
969
969
|
if (isRunningRedelivery && task.leaseExpiresAt && task.leaseExpiresAt.getTime() > Date.now()) return task.ownerId === this.workerId;
|
|
970
970
|
if (task.status === "pending" && task.ownerId && task.ownerId !== this.workerId) return true;
|
|
971
971
|
const pinnedHere = task.status === "pending" && task.ownerId === this.workerId;
|
|
972
|
-
const retryCount = task.status === "running" ? deliveryAttempt - 1 : task.retryCount;
|
|
972
|
+
const retryCount = task.status === "running" ? Math.max(task.retryCount, deliveryAttempt - 1) : task.retryCount;
|
|
973
973
|
const now = /* @__PURE__ */ new Date();
|
|
974
974
|
if (!await storage.updateTask(taskId, {
|
|
975
975
|
status: "running",
|
|
@@ -1602,8 +1602,10 @@ var BackgroundTaskManager = class {
|
|
|
1602
1602
|
expectedOwnerId: task.ownerId ?? null,
|
|
1603
1603
|
expectedLeaseExpiresAt: task.leaseExpiresAt ?? null
|
|
1604
1604
|
};
|
|
1605
|
-
|
|
1605
|
+
const handedBack = !task.ownerId && task.maxRetries > 0;
|
|
1606
|
+
if (handedBack || task.retryCount < task.maxRetries) await storage.updateTask(task.id, {
|
|
1606
1607
|
status: "pending",
|
|
1608
|
+
retryCount: handedBack ? task.retryCount : task.retryCount + 1,
|
|
1607
1609
|
startedAt: void 0,
|
|
1608
1610
|
ownerId: void 0,
|
|
1609
1611
|
leaseExpiresAt: void 0
|
package/dist/browser/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_base = require("../base-BIzR1D3_.cjs");
|
|
3
3
|
const require_logger = require("../logger-CvzZYuJd.cjs");
|
|
4
|
-
const require_stream = require("../stream-
|
|
4
|
+
const require_stream = require("../stream-0kdqBOOn.cjs");
|
|
5
5
|
const require_tool = require("../tool-CYlT2UA-.cjs");
|
|
6
|
-
const require_workspace = require("../workspace-
|
|
6
|
+
const require_workspace = require("../workspace-X2RHJZU9.cjs");
|
|
7
7
|
let events = require("events");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
let fs = require("fs");
|
package/dist/browser/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as MastraBase } from "../base-CKLWBhDo.js";
|
|
2
2
|
import { a as RegisteredLogger } from "../logger-BwbmRqfc.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn as isProcessorWorkflow } from "../stream-D1y9GzoD.js";
|
|
4
4
|
import { r as createTool } from "../tool-Z3bykc1m.js";
|
|
5
|
-
import { E as browserCliHandler, T as BrowserCliHandler } from "../workspace-
|
|
5
|
+
import { E as browserCliHandler, T as BrowserCliHandler } from "../workspace-DY2Nxiyi.js";
|
|
6
6
|
import { EventEmitter } from "events";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { closeSync, existsSync, fstatSync, lstatSync, mkdirSync, openSync, readdirSync, readlinkSync, unlinkSync, writeSync } from "fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as validateDynamicWorkflow, s as inferGraphSchemas, u as schemaCompatibility } from "./validate-
|
|
1
|
+
import { n as validateDynamicWorkflow, s as inferGraphSchemas, u as schemaCompatibility } from "./validate-CB-q-R2F.js";
|
|
2
2
|
import { _ as validateCron } from "./schedules-DZfSx-7P.js";
|
|
3
|
-
import {
|
|
3
|
+
import { N as Agent } from "./run-registry-BwEcwYlU.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
// src/workflows/builder/authoring-playbook.ts
|
|
6
6
|
const WORKFLOW_BUILDER_AUTHORING_CONSTRAINTS = `# Persisted workflow authoring contract
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_validate = require("./validate-
|
|
1
|
+
const require_validate = require("./validate-De92squ7.cjs");
|
|
2
2
|
const require_schedules = require("./schedules-BZS8McF7.cjs");
|
|
3
|
-
const require_run_registry = require("./run-registry-
|
|
3
|
+
const require_run_registry = require("./run-registry-BmckDVBk.cjs");
|
|
4
4
|
let zod = require("zod");
|
|
5
5
|
// src/workflows/builder/authoring-playbook.ts
|
|
6
6
|
const WORKFLOW_BUILDER_AUTHORING_CONSTRAINTS = `# Persisted workflow authoring contract
|