@mastra/core 1.87.0-alpha.12 → 1.87.0-alpha.14
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/agent/active-run-signal-queues.d.ts +49 -0
- package/dist/agent/agent.d.ts +17 -1
- package/dist/agent/durable/abort-transport.d.ts +1 -1
- package/dist/agent/durable/durable-agent.d.ts +1 -0
- package/dist/agent/durable/execution-engine.d.ts +12 -0
- package/dist/agent/durable/index.cjs +1 -1
- package/dist/agent/durable/index.js +1 -1
- package/dist/agent/durable/preparation.d.ts +17 -0
- package/dist/agent/durable/stored-signal-drain.d.ts +100 -0
- package/dist/agent/durable/types.d.ts +37 -0
- package/dist/agent/durable/utils/resolve-runtime.d.ts +11 -0
- package/dist/agent/durable/utils/serialize-state.d.ts +1 -0
- package/dist/agent/durable/workflows/create-durable-agentic-workflow.d.ts +1 -0
- package/dist/agent/durable/workflows/durable-loop-builder.d.ts +5 -0
- package/dist/agent/durable/workflows/finalize-run.d.ts +6 -0
- package/dist/agent/durable/workflows/shared/message-list-state.d.ts +6 -2
- package/dist/agent/durable/workflows/shared/schemas.d.ts +2 -0
- package/dist/agent/durable/workflows/steps/llm-execution.d.ts +1 -0
- package/dist/agent/index.cjs +2 -2
- package/dist/agent/index.js +2 -2
- package/dist/agent/signals.d.ts +7 -3
- package/dist/agent/stored-run-signals.d.ts +93 -0
- package/dist/agent/stored-signals.d.ts +40 -0
- package/dist/agent/streams/abort-transport.d.ts +10 -1
- package/dist/agent/streams/constants.d.ts +9 -0
- package/dist/agent/streams/publisher.d.ts +3 -1
- package/dist/agent/thread-stream-runtime.d.ts +46 -4
- package/dist/agent/tool-name.d.ts +21 -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/types.d.ts +6 -0
- package/dist/{agent-controller-DfeTRuBc.js → agent-controller-FSjSZ_iD.js} +11 -9
- package/dist/{agent-controller-BcN7r3yI.cjs → agent-controller-k4B293tu.cjs} +11 -9
- package/dist/background-tasks/index.cjs +1 -1
- package/dist/background-tasks/index.js +1 -1
- package/dist/background-tasks/manager.d.ts +3 -1
- package/dist/background-tasks/workflow-id.d.ts +42 -0
- package/dist/{background-tasks-BcU--rXL.js → background-tasks-ClI6oF60.js} +239 -28
- package/dist/{background-tasks-DRUHnQOk.cjs → background-tasks-D40Y_iLc.cjs} +262 -27
- package/dist/browser/index.cjs +2 -2
- package/dist/browser/index.js +2 -2
- package/dist/{builder-Bufqrcz3.cjs → builder-C_I6l0US.cjs} +2 -2
- package/dist/{builder-TuIc5l7X.js → builder-D00XMm41.js} +2 -2
- package/dist/capabilities/302ai.json +197 -197
- package/dist/capabilities/abliteratedllm.json +33 -33
- package/dist/capabilities/abliteration-ai.json +10 -10
- package/dist/capabilities/above.json +22 -22
- package/dist/capabilities/adaption.json +7 -7
- package/dist/capabilities/adzuki.json +31 -31
- package/dist/capabilities/agentrouter.json +4 -4
- package/dist/capabilities/agnes.json +4 -4
- package/dist/capabilities/ai-router.json +6 -6
- package/dist/capabilities/aiand.json +22 -22
- package/dist/capabilities/aigrow.json +11 -11
- package/dist/capabilities/aimlapi.json +146 -146
- package/dist/capabilities/aipg.json +2 -2
- package/dist/capabilities/aixy.json +20 -20
- package/dist/capabilities/aki-io.json +13 -13
- package/dist/capabilities/alibaba-cn.json +126 -90
- package/dist/capabilities/alibaba-coding-plan-cn.json +6 -11
- package/dist/capabilities/alibaba-coding-plan.json +6 -11
- package/dist/capabilities/alibaba-token-plan-cn.json +49 -49
- package/dist/capabilities/alibaba-token-plan.json +54 -54
- package/dist/capabilities/alibaba.json +87 -61
- package/dist/capabilities/ambient.json +14 -14
- package/dist/capabilities/amd.json +8 -8
- package/dist/capabilities/anthropic.json +42 -42
- package/dist/capabilities/anyapi.json +16 -16
- package/dist/capabilities/apiko.json +5 -5
- package/dist/capabilities/arcee.json +11 -11
- package/dist/capabilities/auriko.json +15 -15
- package/dist/capabilities/bailing.json +5 -5
- package/dist/capabilities/baseten.json +35 -35
- package/dist/capabilities/bee.json +3 -3
- package/dist/capabilities/berget.json +8 -8
- package/dist/capabilities/bothub.json +16 -16
- package/dist/capabilities/boundless.json +34 -34
- package/dist/capabilities/bumo.json +37 -37
- package/dist/capabilities/byteplus.json +29 -29
- package/dist/capabilities/cerebras.json +4 -4
- package/dist/capabilities/cheapaimodel.json +10 -10
- package/dist/capabilities/cheapest-token.json +29 -29
- package/dist/capabilities/chutes.json +58 -10
- package/dist/capabilities/cline-pass.json +38 -38
- package/dist/capabilities/cloudcode.json +6 -6
- package/dist/capabilities/cloudferro-sherlock.json +4 -4
- package/dist/capabilities/cloudflare-workers-ai.json +16 -16
- package/dist/capabilities/commandcode.json +147 -147
- package/dist/capabilities/concentrate.json +277 -277
- package/dist/capabilities/cortecs.json +102 -102
- package/dist/capabilities/crossmodel.json +183 -183
- package/dist/capabilities/crusoe.json +17 -17
- package/dist/capabilities/daoxe.json +8 -8
- package/dist/capabilities/databricks.json +124 -124
- package/dist/capabilities/deepinfra.json +101 -101
- package/dist/capabilities/deepseek.json +3 -3
- package/dist/capabilities/digitalocean.json +116 -116
- package/dist/capabilities/dothoosh.json +32 -32
- package/dist/capabilities/doubleword.json +30 -30
- package/dist/capabilities/edenai.json +290 -290
- package/dist/capabilities/empiriolabs.json +162 -162
- package/dist/capabilities/engy.json +19 -19
- package/dist/capabilities/entrim.json +8 -8
- package/dist/capabilities/evroc.json +13 -13
- package/dist/capabilities/ezkielyna.json +12 -12
- package/dist/capabilities/fastrouter.json +86 -86
- package/dist/capabilities/fireworks-ai.json +99 -99
- package/dist/capabilities/fortytwo.json +4 -4
- package/dist/capabilities/freemodel.json +14 -14
- package/dist/capabilities/friendli.json +12 -12
- package/dist/capabilities/frogbot.json +91 -91
- package/dist/capabilities/gisoo.json +18 -18
- package/dist/capabilities/gmicloud.json +19 -19
- package/dist/capabilities/google.json +52 -52
- package/dist/capabilities/graphn.json +12 -12
- package/dist/capabilities/greenpt.json +34 -34
- package/dist/capabilities/groq.json +6 -6
- package/dist/capabilities/helicone.json +87 -87
- package/dist/capabilities/hetzner.json +4 -4
- package/dist/capabilities/hopper.json +2 -2
- package/dist/capabilities/hostinger-router.json +13 -20
- package/dist/capabilities/hpc-ai.json +10 -10
- package/dist/capabilities/huawei-maas.json +11 -11
- package/dist/capabilities/hubris.json +28 -28
- package/dist/capabilities/huggingface.json +92 -85
- package/dist/capabilities/hyper.json +18 -18
- package/dist/capabilities/impossibl.json +146 -146
- package/dist/capabilities/inception.json +2 -2
- package/dist/capabilities/inceptron.json +8 -8
- package/dist/capabilities/inco.json +4 -4
- package/dist/capabilities/infer.json +14 -14
- package/dist/capabilities/inferall.json +6 -6
- package/dist/capabilities/inference-coop.json +12 -12
- package/dist/capabilities/inferenceapis.json +26 -26
- package/dist/capabilities/inferris.json +4 -4
- package/dist/capabilities/infersia.json +10 -10
- package/dist/capabilities/inferx.json +3 -3
- package/dist/capabilities/infomaniak.json +3 -3
- package/dist/capabilities/io-net.json +4 -4
- package/dist/capabilities/isoquant.json +4 -4
- package/dist/capabilities/iteracompute.json +55 -55
- package/dist/capabilities/jad-ai.json +2 -2
- package/dist/capabilities/jalapeno.json +10 -10
- package/dist/capabilities/jiekou.json +58 -58
- package/dist/capabilities/joingonka.json +4 -4
- package/dist/capabilities/jzstoken.json +51 -51
- package/dist/capabilities/keln.json +22 -22
- package/dist/capabilities/kenari.json +141 -116
- package/dist/capabilities/kilo.json +629 -645
- package/dist/capabilities/kimi-code-plan-cn.json +6 -6
- package/dist/capabilities/kimi-code-plan-global.json +6 -6
- package/dist/capabilities/kitani.json +6 -6
- package/dist/capabilities/klavo.json +26 -26
- package/dist/capabilities/korouter.json +27 -27
- package/dist/capabilities/kunavo.json +9 -9
- package/dist/capabilities/liquid.json +12 -12
- package/dist/capabilities/lithosai.json +3 -3
- package/dist/capabilities/llmgateway-providers.json +920 -928
- package/dist/capabilities/llmgateway.json +357 -349
- package/dist/capabilities/llmtr.json +32 -32
- package/dist/capabilities/logits.json +2 -2
- package/dist/capabilities/lowrouter.json +48 -48
- package/dist/capabilities/lyceum.json +14 -14
- package/dist/capabilities/melious.json +9 -9
- package/dist/capabilities/merge-gateway.json +276 -276
- package/dist/capabilities/meta.json +10 -10
- package/dist/capabilities/minimax-cn-coding-plan.json +5 -5
- package/dist/capabilities/minimax-cn.json +5 -5
- package/dist/capabilities/minimax-coding-plan.json +5 -5
- package/dist/capabilities/minimax.json +5 -5
- package/dist/capabilities/mistral.json +19 -19
- package/dist/capabilities/mixlayer.json +4 -4
- package/dist/capabilities/modal.json +14 -14
- package/dist/capabilities/model-oracle-ai.json +26 -26
- package/dist/capabilities/modelis.json +17 -17
- package/dist/capabilities/modular.json +13 -13
- package/dist/capabilities/moneo.json +16 -16
- package/dist/capabilities/moonshotai-cn.json +6 -6
- package/dist/capabilities/moonshotai.json +6 -6
- package/dist/capabilities/morph.json +17 -17
- package/dist/capabilities/munito-eu.json +6 -6
- package/dist/capabilities/munito.json +10 -10
- package/dist/capabilities/nan.json +30 -30
- package/dist/capabilities/nano-gpt.json +595 -596
- package/dist/capabilities/nearai.json +99 -99
- package/dist/capabilities/nebius.json +31 -31
- package/dist/capabilities/neon.json +126 -126
- package/dist/capabilities/neuralwatt.json +43 -43
- package/dist/capabilities/nokeep.json +4 -4
- package/dist/capabilities/novita-ai.json +123 -123
- package/dist/capabilities/nvidia.json +33 -33
- package/dist/capabilities/oathbreaker.json +4 -4
- package/dist/capabilities/obscurify.json +29 -29
- package/dist/capabilities/oci.json +9 -9
- package/dist/capabilities/ofox.json +243 -607
- package/dist/capabilities/ollama-cloud.json +55 -55
- package/dist/capabilities/openai.json +55 -55
- package/dist/capabilities/opencode-go.json +96 -94
- package/dist/capabilities/openreason.json +4 -4
- package/dist/capabilities/openrouter.json +529 -543
- package/dist/capabilities/opper.json +29 -29
- package/dist/capabilities/orcarouter.json +436 -178
- package/dist/capabilities/outerlabs.json +28 -28
- package/dist/capabilities/ovhcloud.json +21 -22
- package/dist/capabilities/pareto.json +6 -6
- package/dist/capabilities/perplexity-agent.json +63 -63
- package/dist/capabilities/phala.json +30 -30
- package/dist/capabilities/pioneer.json +23 -23
- package/dist/capabilities/poe.json +140 -140
- package/dist/capabilities/poolside.json +3 -3
- package/dist/capabilities/powerspring.json +14 -14
- package/dist/capabilities/primalabs.json +7 -7
- package/dist/capabilities/prime.json +119 -119
- package/dist/capabilities/privatemode-ai.json +10 -10
- package/dist/capabilities/proxystacks.json +7 -7
- package/dist/capabilities/qiniu-ai.json +15 -15
- package/dist/capabilities/refuseless.json +5 -5
- package/dist/capabilities/regolo-ai.json +8 -8
- package/dist/capabilities/requesty.json +204 -204
- package/dist/capabilities/ruapi.json +24 -24
- package/dist/capabilities/runcrate.json +15 -15
- package/dist/capabilities/runinfra.json +16 -16
- package/dist/capabilities/sakana.json +5 -5
- package/dist/capabilities/sambanova.json +7 -7
- package/dist/capabilities/sandbase.json +21 -21
- package/dist/capabilities/sarvam.json +11 -11
- package/dist/capabilities/scaleway.json +15 -15
- package/dist/capabilities/scnet-token-plan.json +14 -14
- package/dist/capabilities/scx-ai.json +26 -26
- package/dist/capabilities/sensenova.json +12 -12
- package/dist/capabilities/siliconflow-cn.json +54 -54
- package/dist/capabilities/siliconflow.json +66 -66
- package/dist/capabilities/snowflake-cortex.json +22 -22
- package/dist/capabilities/sokkan.json +7 -7
- package/dist/capabilities/sparrowcodes.json +23 -23
- package/dist/capabilities/standardcompute.json +96 -96
- package/dist/capabilities/steadyrouter.json +38 -38
- package/dist/capabilities/stepfun-ai-step-plan.json +15 -9
- package/dist/capabilities/stepfun-ai.json +22 -8
- package/dist/capabilities/stepfun-step-plan.json +15 -8
- package/dist/capabilities/stepfun.json +22 -8
- package/dist/capabilities/stepping-stone.json +25 -25
- package/dist/capabilities/synthetic.json +10 -10
- package/dist/capabilities/synthorai.json +24 -24
- package/dist/capabilities/teamorouter.json +18 -18
- package/dist/capabilities/teapot-router.json +12 -12
- package/dist/capabilities/tencent-token-plan-intl.json +20 -20
- package/dist/capabilities/tencent-token-plan.json +38 -38
- package/dist/capabilities/tencent-tokenhub.json +46 -46
- package/dist/capabilities/tensorx.json +52 -52
- package/dist/capabilities/tenstorrent.json +8 -8
- package/dist/capabilities/the-grid-ai.json +35 -35
- package/dist/capabilities/thinkingmachines.json +78 -78
- package/dist/capabilities/tinfoil.json +5 -5
- package/dist/capabilities/toapis.json +2 -2
- package/dist/capabilities/togetherai.json +53 -61
- package/dist/capabilities/tokengo.json +23 -23
- package/dist/capabilities/tokenify.json +9 -9
- package/dist/capabilities/trustedrouter.json +5 -5
- package/dist/capabilities/trustedtokens.json +19 -19
- package/dist/capabilities/umans-ai-coding-plan.json +15 -15
- package/dist/capabilities/umans-ai.json +11 -11
- package/dist/capabilities/unrestricted.json +8 -8
- package/dist/capabilities/uplinkswitch.json +22 -22
- package/dist/capabilities/upstage.json +4 -4
- package/dist/capabilities/vancine.json +19 -19
- package/dist/capabilities/vercel.json +520 -513
- package/dist/capabilities/verda.json +8 -1
- package/dist/capabilities/vivgrid.json +81 -81
- package/dist/capabilities/volcengine-coding-plan.json +29 -29
- package/dist/capabilities/volcengine.json +21 -21
- package/dist/capabilities/vultr.json +26 -26
- package/dist/capabilities/wafer.ai.json +13 -13
- package/dist/capabilities/wallaby.json +4 -4
- package/dist/capabilities/wally.json +13 -13
- package/dist/capabilities/wandb.json +17 -17
- package/dist/capabilities/watt.json +24 -24
- package/dist/capabilities/xai.json +4 -4
- package/dist/capabilities/xiaomi-token-plan-ams.json +2 -2
- package/dist/capabilities/xiaomi-token-plan-cn.json +2 -2
- package/dist/capabilities/xiaomi-token-plan-sgp.json +2 -2
- package/dist/capabilities/xiaomi.json +2 -2
- package/dist/capabilities/xpersona.json +10 -10
- package/dist/capabilities/xxapi.json +28 -28
- package/dist/capabilities/zai-coding-plan.json +13 -13
- package/dist/capabilities/zai.json +28 -28
- package/dist/capabilities/zenifra.json +29 -29
- package/dist/capabilities/zenmux.json +178 -178
- package/dist/capabilities/zerogpu.json +15 -15
- package/dist/capabilities/zhipuai-coding-plan.json +6 -6
- package/dist/capabilities/zhipuai.json +25 -25
- package/dist/capabilities/zro.json +5 -5
- package/dist/channels/index.cjs +2 -2
- package/dist/channels/index.js +2 -2
- package/dist/{channels-MsOnUvU6.cjs → channels-BU5_kAUO.cjs} +1 -1
- package/dist/{channels-Cdsqdajh.js → channels-DMSae7xD.js} +1 -1
- package/dist/coding-agent/index.cjs +3 -3
- package/dist/coding-agent/index.js +3 -3
- package/dist/{constants-Bou0hEgY.cjs → constants-CFO8w780.cjs} +8 -0
- package/dist/{constants-CFWgIaqA.js → constants-CUv0mU2y.js} +8 -0
- package/dist/datasets/index.cjs +2 -2
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +2 -1
- package/dist/docs/assets/SOURCE_MAP.json +1044 -1009
- package/dist/docs/references/docs-agents-code-mode.md +2 -2
- package/dist/docs/references/docs-agents-human-in-the-loop.md +2 -2
- package/dist/docs/references/docs-agents-networks.md +1 -1
- package/dist/docs/references/docs-agents-overview.md +6 -6
- package/dist/docs/references/docs-agents-processors.md +9 -9
- package/dist/docs/references/docs-agents-resumable-streams.md +2 -2
- package/dist/docs/references/docs-agents-structured-output.md +6 -6
- package/dist/docs/references/docs-agents-tools.md +9 -9
- package/dist/docs/references/docs-browser.md +1 -1
- package/dist/docs/references/docs-channels.md +5 -5
- package/dist/docs/references/docs-classifier.md +1 -1
- package/dist/docs/references/docs-connections-a2a.md +1 -1
- package/dist/docs/references/docs-connections-acp.md +2 -2
- package/dist/docs/references/docs-connections-overview.md +1 -1
- package/dist/docs/references/docs-connections-sdk-agents.md +6 -6
- package/dist/docs/references/docs-deployment-workers.md +1 -1
- package/dist/docs/references/docs-develop.md +1 -1
- package/dist/docs/references/docs-evals-custom-scorers.md +1 -1
- package/dist/docs/references/docs-evals-multi-turn.md +2 -2
- package/dist/docs/references/docs-guides-build-an-eval-loop.md +2 -2
- package/dist/docs/references/docs-guides-context-engineering.md +3 -3
- package/dist/docs/references/docs-guides-streaming.md +1 -1
- package/dist/docs/references/docs-harness-agent-controller.md +6 -3
- package/dist/docs/references/docs-harness-background-tasks.md +2 -2
- package/dist/docs/references/docs-harness-durable-agents.md +5 -5
- package/dist/docs/references/docs-harness-goals.md +2 -2
- package/dist/docs/references/docs-harness-schedules.md +35 -1
- package/dist/docs/references/docs-knowledge-agents-and-tools.md +2 -2
- package/dist/docs/references/docs-knowledge-importers.md +22 -1
- package/dist/docs/references/docs-knowledge-overview.md +1 -1
- package/dist/docs/references/docs-knowledge-scopes-and-access.md +1 -1
- package/dist/docs/references/docs-memory-memory-processors.md +8 -8
- package/dist/docs/references/docs-memory-message-history.md +3 -3
- package/dist/docs/references/docs-memory-observational-memory.md +1 -1
- package/dist/docs/references/docs-memory-semantic-recall.md +2 -2
- package/dist/docs/references/docs-memory-working-memory.md +3 -2
- package/dist/docs/references/docs-sandbox-overview.md +2 -2
- package/dist/docs/references/docs-sandbox-skills.md +1 -1
- package/dist/docs/references/docs-server-mastra-client.md +1 -1
- package/dist/docs/references/docs-server-mcp.md +23 -0
- package/dist/docs/references/docs-server-pubsub.md +21 -1
- package/dist/docs/references/docs-server-request-context.md +4 -4
- package/dist/docs/references/docs-signals-notifications.md +2 -2
- package/dist/docs/references/docs-signals-overview.md +1 -1
- package/dist/docs/references/docs-signals-running-across-processes.md +3 -0
- package/dist/docs/references/docs-signals-sending-signals.md +7 -7
- package/dist/docs/references/docs-signals-signal-providers.md +18 -2
- package/dist/docs/references/docs-signals-state-signals.md +1 -0
- package/dist/docs/references/docs-signals-thread-streams.md +12 -0
- package/dist/docs/references/docs-skills.md +4 -4
- package/dist/docs/references/docs-storage.md +12 -12
- package/dist/docs/references/docs-studio-editor.md +2 -2
- package/dist/docs/references/docs-subagents.md +26 -3
- package/dist/docs/references/integrations-agentic-ui-copilotkit.md +1 -1
- package/dist/docs/references/integrations-agentic-ui-openui.md +1 -1
- package/dist/docs/references/integrations-channels-discord.md +1 -1
- package/dist/docs/references/integrations-channels-github.md +1 -1
- package/dist/docs/references/integrations-channels-imessage.md +2 -2
- package/dist/docs/references/integrations-channels-ring.md +2 -2
- package/dist/docs/references/integrations-channels-slack.md +1 -1
- package/dist/docs/references/integrations-channels-teams.md +1 -1
- package/dist/docs/references/integrations-channels-telegram.md +1 -1
- package/dist/docs/references/integrations-channels-whatsapp.md +1 -1
- package/dist/docs/references/integrations-tools-firecrawl.md +1 -1
- package/dist/docs/references/reference-acp-acp-agent.md +1 -1
- package/dist/docs/references/reference-acp-create-acp-tool.md +1 -1
- package/dist/docs/references/reference-agent-controller-agent-controller-class.md +3 -1
- package/dist/docs/references/reference-agent-controller-session.md +5 -5
- package/dist/docs/references/reference-agents-agent.md +40 -14
- package/dist/docs/references/reference-agents-channels.md +11 -11
- package/dist/docs/references/reference-agents-durable-agent.md +2 -2
- package/dist/docs/references/reference-agents-getLLM.md +2 -2
- package/dist/docs/references/reference-agents-getMetadata.md +2 -2
- package/dist/docs/references/reference-agents-network.md +2 -2
- package/dist/docs/references/reference-browser-mastra-browser.md +1 -1
- package/dist/docs/references/reference-channels-thread-link.md +1 -1
- package/dist/docs/references/reference-classifier-classifier.md +2 -0
- package/dist/docs/references/reference-coding-agent-build-base-prompt.md +1 -1
- package/dist/docs/references/reference-coding-agent-create-coding-agent.md +7 -7
- package/dist/docs/references/reference-configuration.md +15 -14
- package/dist/docs/references/reference-core-getAgentById.md +1 -1
- package/dist/docs/references/reference-core-mastra-model-gateway.md +1 -1
- package/dist/docs/references/reference-datasets-startExperiment.md +1 -1
- package/dist/docs/references/reference-editor-mastra-editor.md +2 -2
- package/dist/docs/references/reference-file-based-agents-config.md +3 -3
- package/dist/docs/references/reference-file-based-agents-schedules.md +1 -1
- package/dist/docs/references/reference-file-based-agents-subagents.md +3 -3
- package/dist/docs/references/reference-file-based-agents-workspace.md +1 -1
- package/dist/docs/references/reference-knowledge-knowledge-class.md +12 -0
- package/dist/docs/references/reference-manual-install.md +1 -1
- package/dist/docs/references/reference-memory-memory-class.md +3 -3
- package/dist/docs/references/reference-memory-observational-memory.md +3 -3
- package/dist/docs/references/reference-observability-tracing-bridges-datadog.md +12 -11
- package/dist/docs/references/reference-observability-tracing-configuration.md +2 -2
- package/dist/docs/references/reference-observability-tracing-exporters-datadog.md +14 -12
- package/dist/docs/references/reference-processors-batch-parts-processor.md +1 -1
- package/dist/docs/references/reference-processors-classifier-processor.md +2 -2
- package/dist/docs/references/reference-processors-cyber-refusal-handler.md +1 -1
- package/dist/docs/references/reference-processors-language-detector.md +1 -1
- package/dist/docs/references/reference-processors-message-history-processor.md +1 -1
- package/dist/docs/references/reference-processors-model-selection-processor.md +3 -3
- package/dist/docs/references/reference-processors-moderation-processor.md +4 -4
- package/dist/docs/references/reference-processors-pii-detector.md +2 -2
- package/dist/docs/references/reference-processors-prefill-error-handler.md +2 -2
- package/dist/docs/references/reference-processors-processor-interface.md +19 -8
- package/dist/docs/references/reference-processors-prompt-injection-detector.md +1 -1
- package/dist/docs/references/reference-processors-provider-history-compat.md +1 -1
- package/dist/docs/references/reference-processors-response-cache.md +1 -1
- package/dist/docs/references/reference-processors-semantic-recall-processor.md +1 -1
- package/dist/docs/references/reference-processors-skill-search-processor.md +1 -1
- package/dist/docs/references/reference-processors-skills-processor.md +1 -1
- package/dist/docs/references/reference-processors-stream-error-retry-processor.md +3 -3
- package/dist/docs/references/reference-processors-system-prompt-scrubber.md +1 -1
- package/dist/docs/references/reference-processors-token-limiter-processor.md +3 -3
- package/dist/docs/references/reference-processors-tool-call-filter.md +2 -2
- package/dist/docs/references/reference-processors-tool-search-processor.md +3 -3
- package/dist/docs/references/reference-processors-unicode-normalizer.md +1 -1
- package/dist/docs/references/reference-processors-working-memory-processor.md +1 -1
- package/dist/docs/references/reference-rag-chunking-and-embedding.md +1 -1
- package/dist/docs/references/reference-rag-graph-rag-guide.md +2 -2
- package/dist/docs/references/reference-rag-retrieval.md +13 -13
- package/dist/docs/references/reference-signals-create-notification-inbox-tool.md +1 -1
- package/dist/docs/references/reference-signals-time-signal-provider.md +102 -0
- package/dist/docs/references/reference-storage-composite.md +4 -0
- package/dist/docs/references/reference-storage-overview.md +29 -29
- package/dist/docs/references/reference-tools-create-code-mode.md +1 -1
- package/dist/docs/references/reference-tools-vector-query-tool.md +3 -3
- package/dist/docs/references/reference-voice-overview.md +28 -28
- package/dist/docs/references/reference-voice-speech-to-speech.md +10 -10
- package/dist/docs/references/reference-voice-speech-to-text.md +1 -1
- package/dist/docs/references/reference-voice-text-to-speech.md +1 -1
- package/dist/docs/references/reference-voice-voice.addInstructions.md +1 -1
- package/dist/docs/references/reference-voice-voice.listen.md +1 -1
- package/dist/docs/references/reference-workers-overview.md +3 -1
- package/dist/docs/references/reference-workflows-step.md +1 -1
- package/dist/docs/references/reference-workflows-workflow-methods-map.md +1 -1
- package/dist/docs/references/reference-workflows-workflow.md +1 -1
- package/dist/docs/references/reference-workspace-factory-sandbox.md +2 -0
- package/dist/docs/references/reference-workspace-local-filesystem.md +1 -1
- package/dist/docs/references/reference-workspace-local-sandbox.md +1 -1
- package/dist/docs/references/reference.md +1 -0
- 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/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/importers/overlay.d.ts +32 -0
- package/dist/knowledge/importers/sink.d.ts +11 -1
- package/dist/knowledge/importers/types.d.ts +9 -0
- package/dist/knowledge/index.cjs +551 -87
- package/dist/knowledge/index.d.ts +6 -0
- package/dist/knowledge/index.js +551 -87
- package/dist/knowledge/page-tools.d.ts +2 -0
- package/dist/llm/index.cjs +3 -3
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/provider-types.generated.d.ts +7865 -7877
- package/dist/{llm-CS6YY_IV.cjs → llm-C1aiWB6O.cjs} +2 -2
- package/dist/{llm-zjtMQn7M.js → llm-D5rGQSnS.js} +2 -2
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +2 -2
- package/dist/loop/loop-runtime.d.ts +1 -1
- package/dist/loop/shared/signal-outcome.d.ts +1 -1
- package/dist/loop/shared/steps/signal-drain-core.d.ts +9 -3
- package/dist/{manager-BU_lY6kl.cjs → manager-B2z5f39G.cjs} +3 -3
- package/dist/{manager-Do0MENhH.js → manager-DxwPLhYJ.js} +3 -3
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/{mastra-C-1zIyS5.js → mastra-CHd7UnbI.js} +17 -17
- package/dist/{mastra-DYVjsXTO.cjs → mastra-WMuI7TZD.cjs} +17 -17
- package/dist/memory/index.cjs +2 -2
- package/dist/memory/index.js +2 -2
- package/dist/{model-DIzIjDej.js → model-B8DlLHex.js} +1 -1
- package/dist/{model-DGFc1hw3.cjs → model-C2CTzjMk.cjs} +1 -1
- package/dist/{netlify-CyL6FNsw.cjs → netlify-Dhs0UJul.cjs} +1 -1
- package/dist/{netlify-B9mLgxJs.js → netlify-xQFmVbr4.js} +1 -1
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.js +1 -1
- 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/{provider-registry-g9m_fyV8.cjs → provider-registry-CSQPAFzz.cjs} +22244 -22307
- package/dist/{provider-registry-DdQoO_jd.js → provider-registry-FxVHWmht.js} +22244 -22307
- package/dist/provider-registry.json +22283 -22350
- package/dist/{registry-generator-CX6Ev697.js → registry-generator-BzsrHxrr.js} +1 -1
- package/dist/{registry-generator-At8J4ZOR.cjs → registry-generator-Dsh7xcz9.cjs} +1 -1
- package/dist/{rehydrate-BzD6UX8f.cjs → rehydrate-8q7KX4rD.cjs} +2 -2
- package/dist/{rehydrate-DEDxsr6E.js → rehydrate-DV1iO9eZ.js} +2 -2
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +2 -2
- package/dist/{run-registry-PiQTSx2Y.cjs → run-registry-DOlZccsr.cjs} +4703 -2233
- package/dist/{run-registry-D22IF5SK.js → run-registry-sTm40Ecv.js} +4704 -2234
- package/dist/{scheduler-B-VZUvv_.js → scheduler-0ShtMM1I.js} +71 -21
- package/dist/{scheduler-D00X03jQ.cjs → scheduler-CMjK0LoQ.cjs} +82 -20
- package/dist/server/types.d.ts +6 -0
- package/dist/signals/index.cjs +2 -1
- package/dist/signals/index.d.ts +1 -0
- package/dist/signals/index.js +2 -2
- package/dist/signals/time-signal-provider.d.ts +62 -0
- package/dist/signals-BTfT-6DE.js +280 -0
- package/dist/signals-CIwzgkvN.cjs +291 -0
- package/dist/{source-BVOi8Xhp.cjs → source-BC8Et5qZ.cjs} +7 -0
- package/dist/{source-fNa6u1kH.js → source-DYZMfjv3.js} +7 -0
- package/dist/storage/constants.cjs +1 -1
- package/dist/storage/constants.js +1 -1
- package/dist/storage/domains/agents/index.cjs +1 -1
- package/dist/storage/domains/agents/index.js +1 -1
- package/dist/storage/domains/inmemory-db.d.ts +6 -0
- package/dist/storage/domains/knowledge/base.d.ts +22 -4
- package/dist/storage/domains/knowledge/inmemory.d.ts +2 -0
- package/dist/storage/domains/knowledge/pages.d.ts +8 -0
- package/dist/storage/domains/memory/base.d.ts +107 -0
- package/dist/storage/domains/memory/index.d.ts +1 -0
- package/dist/storage/domains/memory/inmemory.d.ts +36 -0
- package/dist/storage/domains/memory/queue-thread.d.ts +36 -0
- package/dist/storage/domains/schedules/base.d.ts +31 -2
- package/dist/storage/domains/schedules/inmemory.d.ts +9 -2
- package/dist/storage/domains/workflows/base.d.ts +14 -0
- package/dist/storage/domains/workflows/inmemory.d.ts +4 -1
- package/dist/storage/index.cjs +9 -4
- package/dist/storage/index.js +5 -5
- package/dist/stream/index.cjs +2 -2
- package/dist/stream/index.js +2 -2
- package/dist/{stream-BbPZavop.cjs → stream-aGuW9AL8.cjs} +88 -2
- package/dist/{stream-CoQTdzLm.js → stream-k-Q1NLUs.js} +59 -3
- 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-DhQkNDaR.js → tool-loop-agent-CJrysPOR.js} +3 -3
- package/dist/{tool-loop-agent-8lyD6O4o.cjs → tool-loop-agent-WcRtGJHn.cjs} +3 -3
- package/dist/{utils-DtmyBuBT.cjs → utils-DEzQLxWP.cjs} +1 -1
- package/dist/{utils-B-3lET9S.js → utils-DamF4CfD.js} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{validate-vucjWXcz.cjs → validate-CDlONK0o.cjs} +1 -1
- package/dist/{validate-CO4rWYyH.js → validate-rum3NMFA.js} +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-BgifMkOw.cjs → worker-6MiKMAqB.cjs} +3 -3
- package/dist/{worker-B6CpapAF.js → worker-BnXipQth.js} +2 -2
- package/dist/{worker-eUT7GgQ9.cjs → worker-rwal1zI8.cjs} +2 -2
- package/dist/{worker-CCpSrXBY.js → worker-st16x0my.js} +3 -3
- package/dist/{workflow-B4Tn58DD.js → workflow-BzhYKgc_.js} +25 -33
- package/dist/{workflow-BJSrGEEL.cjs → workflow-D2-gn0U0.cjs} +25 -33
- package/dist/workflows/builder/index.cjs +1 -1
- package/dist/workflows/builder/index.js +1 -1
- package/dist/workflows/evented/execution-engine.d.ts +3 -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 +11 -0
- package/dist/workflows/evented/workflow-event-processor/index.d.ts +10 -2
- package/dist/workflows/evented/workflow-event-processor/loop.d.ts +1 -1
- package/dist/workflows/evented/workflow-event-processor/parallel.d.ts +2 -2
- package/dist/workflows/evented/workflow-event-processor/sleep.d.ts +2 -2
- package/dist/workflows/evented/workflow.d.ts +6 -2
- package/dist/workflows/handlers/entry.d.ts +8 -0
- package/dist/workflows/index.cjs +7 -5
- package/dist/workflows/index.js +6 -6
- package/dist/workflows/run-storage.d.ts +11 -2
- package/dist/workflows/scheduler/claim.d.ts +51 -0
- package/dist/workflows/scheduler/index.d.ts +2 -0
- package/dist/workflows/types.d.ts +6 -0
- package/dist/workflows/workflow.d.ts +85 -10
- package/dist/workspace/filesystem/local-filesystem.d.ts +13 -0
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/{workspace-CnmmMou8.js → workspace-Ct2kAiDv.js} +50 -11
- package/dist/{workspace-C5lXteRU.cjs → workspace-CzzrnE6Q.cjs} +50 -11
- package/package.json +7 -7
- package/src/llm/model/provider-types.generated.d.ts +7865 -7877
- package/dist/signals-B1JSj-Ew.cjs +0 -58
- package/dist/signals-De9VnwL2.js +0 -53
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as __exportAll } from "./rolldown-runtime-tIEjjQTE.js";
|
|
2
|
-
import { d as attachModelStreamTransport, f as isDataChunk, i as resolveModelConfig, p as readModelStreamTransport } from "./llm-
|
|
2
|
+
import { d as attachModelStreamTransport, f as isDataChunk, i as resolveModelConfig, p as readModelStreamTransport } from "./llm-D5rGQSnS.js";
|
|
3
3
|
import { B as getResponseProviderItemIdFromPart, G as RESPONSE_ITEM_ID_PROVIDERS, K as RESPONSE_RESULT_ITEM_ID_KEY, f as coreContentToString, n as MessageList, p as messagesAreEqual, t as convertMessages } from "./message-list-RgFlLrxG.js";
|
|
4
4
|
import { S as resolveObservabilityContext, x as createObservabilityContext } from "./observability-D7RNOAPx.js";
|
|
5
5
|
import { t as MastraBase } from "./base-CKLWBhDo.js";
|
|
@@ -494,6 +494,62 @@ function raceAgainstAbort(promise, signal) {
|
|
|
494
494
|
});
|
|
495
495
|
});
|
|
496
496
|
}
|
|
497
|
+
// src/storage/domains/memory/queue-thread.ts
|
|
498
|
+
/**
|
|
499
|
+
* Prefix of the reserved thread ids under which a store keeps a thread's queued messages. A row
|
|
500
|
+
* under one of them has no `resourceId` and is not part of any thread. The ids are persisted, so
|
|
501
|
+
* the prefix cannot change without a migration.
|
|
502
|
+
*
|
|
503
|
+
* The prefix is reserved without a migration and nothing checks for a collision at `init()`. A
|
|
504
|
+
* thread stored earlier under an id with the prefix is rejected by the entry points, and messages
|
|
505
|
+
* stored under `pendingQueueThreadId(T)` or `takenQueueThreadId(T)` count as T's queue, so
|
|
506
|
+
* `deleteThread(T)` deletes them. The prefix is namespaced so that no existing id is expected to
|
|
507
|
+
* collide.
|
|
508
|
+
* @experimental
|
|
509
|
+
*/
|
|
510
|
+
const QUEUE_THREAD_PREFIX = "mastra-queue:";
|
|
511
|
+
const PENDING_QUEUE_THREAD_PREFIX = `${QUEUE_THREAD_PREFIX}pending:`;
|
|
512
|
+
const TAKEN_QUEUE_THREAD_PREFIX = `${QUEUE_THREAD_PREFIX}taken:`;
|
|
513
|
+
/**
|
|
514
|
+
* The thread id that holds the signals sent to `threadId` and not yet taken by a run.
|
|
515
|
+
* @experimental
|
|
516
|
+
*/
|
|
517
|
+
function pendingQueueThreadId(threadId) {
|
|
518
|
+
return PENDING_QUEUE_THREAD_PREFIX + threadId;
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* The thread id that holds the signals a run of `threadId` took, until a run saves them or a close
|
|
522
|
+
* gives them back.
|
|
523
|
+
* @experimental
|
|
524
|
+
*/
|
|
525
|
+
function takenQueueThreadId(threadId) {
|
|
526
|
+
return TAKEN_QUEUE_THREAD_PREFIX + threadId;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Whether `threadId` is one of the reserved queue thread ids.
|
|
530
|
+
* @experimental
|
|
531
|
+
*/
|
|
532
|
+
function isQueueThreadId(threadId) {
|
|
533
|
+
return typeof threadId === "string" && threadId.startsWith("mastra-queue:");
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Rejects a caller-chosen thread id that starts with `QUEUE_THREAD_PREFIX`, so no thread and no
|
|
537
|
+
* message can be stored or read under it.
|
|
538
|
+
* @experimental
|
|
539
|
+
*/
|
|
540
|
+
function assertNotQueueThreadId(threadId, operation) {
|
|
541
|
+
if (!isQueueThreadId(threadId)) return;
|
|
542
|
+
throw new MastraError({
|
|
543
|
+
id: "STORAGE_RESERVED_THREAD_ID",
|
|
544
|
+
domain: "STORAGE",
|
|
545
|
+
category: "USER",
|
|
546
|
+
text: `${operation}: thread ids starting with "${QUEUE_THREAD_PREFIX}" are reserved`,
|
|
547
|
+
details: {
|
|
548
|
+
threadId,
|
|
549
|
+
operation
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
}
|
|
497
553
|
// src/agent/state-signals.ts
|
|
498
554
|
function isPlainObject$2(value) {
|
|
499
555
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -531,7 +587,7 @@ function sortStateSignals(signals) {
|
|
|
531
587
|
})).sort((left, right) => signalCreatedAt(left.signal) - signalCreatedAt(right.signal) || left.index - right.index).map(({ signal }) => signal);
|
|
532
588
|
}
|
|
533
589
|
function dbMessagesToStateSignals(messages, stateId, threadId) {
|
|
534
|
-
return sortStateSignals(messages.filter((message) => message.role === "signal").map((message) => {
|
|
590
|
+
return sortStateSignals(messages.filter((message) => message.role === "signal" && !isQueueThreadId(message.threadId)).map((message) => {
|
|
535
591
|
try {
|
|
536
592
|
return mastraDBMessageToSignal(message);
|
|
537
593
|
} catch {
|
|
@@ -10326,4 +10382,4 @@ function smoothStream({ delayInMs = 10, chunking = "word" } = {}) {
|
|
|
10326
10382
|
}
|
|
10327
10383
|
});
|
|
10328
10384
|
}
|
|
10329
|
-
export { summarizeToolChoiceForSpan as $, commitToolResult as $t, isSignalChunkExcluded as A,
|
|
10385
|
+
export { summarizeToolChoiceForSpan as $, commitToolResult as $t, isSignalChunkExcluded as A, raceAgainstAbort as An, getSnapshotMemoryInfo as At, removeTrailingAssistantGuardContinuations as B, stateColumnsWrite as Bt, stampChunkProducedAt as C, DEADLINE_SAVE_WAIT_MS as Cn, collectTemplateStepIds as Ct, isStructuredOutputError as D, guardStreamUntilMatch as Dn, validateTemplate as Dt, escapeUnescapedControlCharsInJsonStrings as E, getAbortReason as En, traverseMappingPath as Et, endOutputStreamSpanOutsideStep as F, safeEnqueue as Fn, latestStepResults as Ft, FLUSH_HELD_PARTS_KEY as G, diffStateAsJson as Gt, anthropicToolIdFormat as H, unusedStateEntries as Ht, findOwnModelStepSpan as I, safeError as In, materializeState as It, withoutHeldContent as J, getThreadOMMetadata as Jt, REPROCESS_PART_KEY as K, patchState as Kt, runner_exports as L, createRunScope as Ln, materializeWorkflowRun as Lt, ProcessorRunner as M, convertFullStreamChunkToUIMessageStream as Mn, STEP_RESULT_SUMMARY_FIELDS as Mt, ProcessorState as N, MastraModelInput as Nn, applyStateColumnsWrite as Nt, asJsonSchema as O, guardStreamWithAbort as On, getStepResult as Ot, endOutputStreamSpanAtStepEnd as P, safeClose as Pn, isStateCheckpointDue as Pt, summarizeProcessorToolsForSpan as Q, setThreadOMMetadata as Qt, isTrailingAssistantGuardContinuation as R, createRunScopeKey as Rn, pickStateKeys as Rt, getChunkProducedAt as S, DEADLINE_SAVE_CLAIM_HOLD_MS as Sn, stepRefId as St, createOutputHandler as T, createTimeoutAbortSignal as Tn, templateReadsState as Tt, cerebrasStripReasoningContent as U, applyStatePatch as Ut, ProviderHistoryCompat as V, summarizeStepResult as Vt, openaiOrphanItemId as W, diffState as Wt, summarizeProcessorModelForSpan as X, isThreadTitlePinned as Xt, summarizeActiveToolsForSpan as Y, isObservationalMemoryEnabled as Yt, summarizeProcessorResultForSpan as Z, parseMemoryRequestContext as Zt, persistProcessorDataChunk as _, QUEUE_THREAD_PREFIX as _n, stubStepResult as _t, convertFullStreamChunkToMastra as a, snapshotToolResult as an, PROCESSOR_ABORT_SIGNAL as at, resolveOutputMessageSkippingCompletionChecks as b, pendingQueueThreadId as bn, predicateReadsState as bt, WorkflowRunOutput as c, validationErrorModelOutput as cn, getHydratedStepResult as ct, MastraModelOutput as d, resolveSuspendedToolRunId as dn, lazyStepResults as dt, computeModelOutputProviderMetadata as en, resolveProcessorSpanAttributes as et, clearStepPartIndexes as f, resolveThreadIdFromArgs as fn, loadStepResults as ft, isFeedbackContinuation as g, applyStateSignal as gn, storageV2StepResultAccessors as gt, findStepPartBoundaries as h, tryStreamWithJsonFallback as hn, residentStepResultsLoader as ht, withStreamCaching as i, resolveModelOutputAfterToolResultProcessors as in, createProcessorSendSignal as it, OUTPUT_STREAM_HOOK_DURATION_KEY_PREFIX as j, settledOrElapsed as jn, STATE_CHECKPOINT_PATCHES as jt, getResponseFormat as k, isMastraTimeoutError as kn, getStepResultAsync as kt, TripWire as l, isProcessorWorkflow as ln, hydrateStepResults as lt, findIterationOffsetInParts as m, tryGenerateWithJsonFallback as mn, residentStepResults as mt, createCachingTransformStream as n, latestProcessedModelOutput as nn, toProcessorSpanPhase as nt, convertMastraChunkToAISDKv5 as o, withAgentWorkflowToolMarker as on, RunJournal as ot, createDestructurableOutput as p, supportedLanguageModelSpecifications as pn, loadedStepResults as pt, takeHeldParts as q, TITLE_PINNED_THREAD_METADATA_KEY as qt, createReplayStream as r, readModelOutput as rn, PROCESSOR_LATE_SIGNAL_SINK as rt, MastraAgentNetworkStream as s, normalizeModelOutput as sn, buildStepResultAccessors as st, smoothStream as t, hasToolResultProcessor as tn, resolveProcessorSpanName as tt, getModelOutputForTripwire as u, isSupportedLanguageModel as un, isStepResultStub as ut, reconcileBufferedStepTexts as v, assertNotQueueThreadId as vn, collectMappingStepRefs as vt, markChunkOutputProcessed as w, MastraTimeoutError as wn, resolveTemplate as wt, resolveProcessorWriterMessageId as x, takenQueueThreadId as xn, resolveStepOutputs as xt, resolveMessageText as y, isQueueThreadId as yn, collectPredicateStepRefs as yt, needsTrailingAssistantGuard as z, stateBaseOf as zt };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("../rolldown-runtime-BrhgMLW6.cjs");
|
|
3
3
|
const require_dist = require("../dist-CXeCeeW7.cjs");
|
|
4
|
-
const require_model = require("../model-
|
|
4
|
+
const require_model = require("../model-C2CTzjMk.cjs");
|
|
5
5
|
const require_model$1 = require("../model-jBymoqGa.cjs");
|
|
6
6
|
let stream = require("stream");
|
|
7
7
|
let module$1 = require("module");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as simulateReadableStream } from "../dist-D3cKCUe-.js";
|
|
2
|
-
import { t as MastraLLMV1 } from "../model-
|
|
2
|
+
import { t as MastraLLMV1 } from "../model-B8DlLHex.js";
|
|
3
3
|
import { t as AISDKV5LanguageModel } from "../model-DS-b2R-R.js";
|
|
4
4
|
import { createRequire } from "module";
|
|
5
5
|
import { Readable } from "stream";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_tool_loop_agent = require("../tool-loop-agent-
|
|
2
|
+
const require_tool_loop_agent = require("../tool-loop-agent-WcRtGJHn.cjs");
|
|
3
3
|
exports.getSettings = require_tool_loop_agent.getSettings;
|
|
4
4
|
exports.isToolLoopAgentLike = require_tool_loop_agent.isToolLoopAgentLike;
|
|
5
5
|
exports.toolLoopAgentToMastraAgent = require_tool_loop_agent.toolLoopAgentToMastraAgent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as getSettings, r as isToolLoopAgentLike, t as toolLoopAgentToMastraAgent } from "../tool-loop-agent-
|
|
1
|
+
export { n as getSettings, r as isToolLoopAgentLike, t as toolLoopAgentToMastraAgent } from "../tool-loop-agent-CJrysPOR.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { m as generateId } from "./dist-TPVqg8oV.js";
|
|
2
|
-
import { F as Agent } from "./run-registry-
|
|
3
|
-
import { un as isSupportedLanguageModel } from "./stream-
|
|
4
|
-
import { i as resolveModelConfig } from "./llm-
|
|
2
|
+
import { F as Agent } from "./run-registry-sTm40Ecv.js";
|
|
3
|
+
import { un as isSupportedLanguageModel } from "./stream-k-Q1NLUs.js";
|
|
4
|
+
import { i as resolveModelConfig } from "./llm-D5rGQSnS.js";
|
|
5
5
|
import { N as ToolLoopAgent } from "./message-list-RgFlLrxG.js";
|
|
6
6
|
// src/tool-loop-agent/utils.ts
|
|
7
7
|
function isToolLoopAgentLike(obj) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_dist = require("./dist-P2rjrlmj.cjs");
|
|
2
|
-
const require_run_registry = require("./run-registry-
|
|
3
|
-
const require_stream = require("./stream-
|
|
4
|
-
const require_llm = require("./llm-
|
|
2
|
+
const require_run_registry = require("./run-registry-DOlZccsr.cjs");
|
|
3
|
+
const require_stream = require("./stream-aGuW9AL8.cjs");
|
|
4
|
+
const require_llm = require("./llm-C1aiWB6O.cjs");
|
|
5
5
|
const require_message_list = require("./message-list-C0F2sDNC.cjs");
|
|
6
6
|
// src/tool-loop-agent/utils.ts
|
|
7
7
|
function isToolLoopAgentLike(obj) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_error = require("./error-D90lJ6M7.cjs");
|
|
2
2
|
const require_tool = require("./tool-CYlT2UA-.cjs");
|
|
3
3
|
const require_ee_iTj2bRDt = require("./ee-iTj2bRDt-D3-QLGDF.cjs");
|
|
4
|
-
const require_background_tasks = require("./background-tasks-
|
|
4
|
+
const require_background_tasks = require("./background-tasks-D40Y_iLc.cjs");
|
|
5
5
|
const require_base = require("./base-BIzR1D3_.cjs");
|
|
6
6
|
const require_observability = require("./observability-B0R_D1PZ.cjs");
|
|
7
7
|
const require_utils = require("./utils-D-eNsgDM.cjs");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as MastraError, n as ErrorDomain, o as getErrorFromUnknown, t as ErrorCategory } from "./error-oh2DLsP2.js";
|
|
2
2
|
import { c as registerToolOutputValidationSchema, d as validateToolOutput, f as validateToolSuspendData, h as markBuilderValidatedInput, i as createStandardSchemaIssuesError, n as Tool, o as getValidationIssuePaths, p as createToolObserve, s as isValidationError, u as validateToolInput } from "./tool-Z3bykc1m.js";
|
|
3
3
|
import { i as MastraFGAPermissions } from "./ee-iTj2bRDt-By_B9ngH.js";
|
|
4
|
-
import { a as isToolBackgroundEligible, i as isModelBackgroundOverrideAllowed, n as backgroundOverrideJsonSchema, r as backgroundOverrideZodSchema } from "./background-tasks-
|
|
4
|
+
import { a as isToolBackgroundEligible, i as isModelBackgroundOverrideAllowed, n as backgroundOverrideJsonSchema, r as backgroundOverrideZodSchema } from "./background-tasks-ClI6oF60.js";
|
|
5
5
|
import { t as MastraBase } from "./base-CKLWBhDo.js";
|
|
6
6
|
import { O as executionFailureTermination, b as wrapMastra, x as createObservabilityContext } from "./observability-D7RNOAPx.js";
|
|
7
7
|
import { a as getOrCreateSpan, t as executeWithContext } from "./utils-DU_pU5SK.js";
|
package/dist/utils.cjs
CHANGED
|
@@ -4,7 +4,7 @@ const require_deep_equal = require("./deep-equal-TMDmByBC.cjs");
|
|
|
4
4
|
const require_zod_utils = require("./zod-utils-Cl5jw5N_.cjs");
|
|
5
5
|
const require_fetchWithRetry = require("./fetchWithRetry-f5k4p7_1.cjs");
|
|
6
6
|
const require_dynamic_argument = require("./dynamic-argument-CUc1BBOS.cjs");
|
|
7
|
-
const require_utils = require("./utils-
|
|
7
|
+
const require_utils = require("./utils-DEzQLxWP.cjs");
|
|
8
8
|
exports.boundedStringify = require_utils_safe_stringify.boundedStringify;
|
|
9
9
|
exports.checkEvalStorageFields = require_utils.checkEvalStorageFields;
|
|
10
10
|
exports.createMastraProxy = require_utils.createMastraProxy;
|
package/dist/utils.js
CHANGED
|
@@ -3,5 +3,5 @@ import { t as deepEqual } from "./deep-equal-d1xU02ag.js";
|
|
|
3
3
|
import { a as isZodObject, i as isZodArray, r as getZodTypeName, t as getZodDef } from "./zod-utils-BDDS_mxU.js";
|
|
4
4
|
import { t as fetchWithRetry } from "./fetchWithRetry-DFSvpYDT.js";
|
|
5
5
|
import { n as resolveDynamicArgument, t as getRequestUser } from "./dynamic-argument-BzPK3qPN.js";
|
|
6
|
-
import { C as setNestedValue, S as selectFields, _ as parseSqlIdentifier, a as ensureToolProperties, b as removeUndefinedValues, c as isCoreMessage, d as makeCoreTool, f as makeCoreToolV5, g as parseFieldKey, h as omitKeys, i as delay, l as isUiMessage, m as maskStreamTags, n as createMastraProxy, o as generateEmptyFromSchema, p as makeProcessorCoreTool, r as deepMerge, s as getNestedValue, t as checkEvalStorageFields, u as isZodType, v as readPositiveIntEnv, x as resolveSerializedZodOutput, y as rebindProcessorTools } from "./utils-
|
|
6
|
+
import { C as setNestedValue, S as selectFields, _ as parseSqlIdentifier, a as ensureToolProperties, b as removeUndefinedValues, c as isCoreMessage, d as makeCoreTool, f as makeCoreToolV5, g as parseFieldKey, h as omitKeys, i as delay, l as isUiMessage, m as maskStreamTags, n as createMastraProxy, o as generateEmptyFromSchema, p as makeProcessorCoreTool, r as deepMerge, s as getNestedValue, t as checkEvalStorageFields, u as isZodType, v as readPositiveIntEnv, x as resolveSerializedZodOutput, y as rebindProcessorTools } from "./utils-DamF4CfD.js";
|
|
7
7
|
export { boundedStringify, checkEvalStorageFields, createMastraProxy, deepEqual, deepMerge, delay, ensureSerializable, ensureToolProperties, fetchWithRetry, generateEmptyFromSchema, getNestedValue, getRequestUser, getZodDef, getZodTypeName, isBoundedSerializable, isCoreMessage, isUiMessage, isZodArray, isZodObject, isZodType, makeCoreTool, makeCoreToolV5, makeProcessorCoreTool, maskStreamTags, omitKeys, parseFieldKey, parseSqlIdentifier, readPositiveIntEnv, rebindProcessorTools, removeUndefinedValues, resolveDynamicArgument, resolveSerializedZodOutput, safeStringify, selectFields, setNestedValue };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { standardSchemaToJSONSchema, toStandardSchema } from "./schema/index.js";
|
|
2
|
-
import { Ct as collectTemplateStepIds, Dt as validateTemplate } from "./stream-
|
|
2
|
+
import { Ct as collectTemplateStepIds, Dt as validateTemplate } from "./stream-k-Q1NLUs.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
// src/workflows/dynamic/graph.ts
|
|
5
5
|
/**
|
package/dist/vector/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_base = require("../base-BIzR1D3_.cjs");
|
|
3
3
|
const require_error = require("../error-D90lJ6M7.cjs");
|
|
4
|
-
const require_run_registry = require("../run-registry-
|
|
4
|
+
const require_run_registry = require("../run-registry-DOlZccsr.cjs");
|
|
5
5
|
const require_message_list = require("../message-list-C0F2sDNC.cjs");
|
|
6
6
|
const require_dist = require("../dist-P2rjrlmj.cjs");
|
|
7
7
|
const require_dist$1 = require("../dist-CXeCeeW7.cjs");
|
package/dist/vector/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as MastraBase } from "../base-CKLWBhDo.js";
|
|
2
2
|
import { i as MastraError, n as ErrorDomain, t as ErrorCategory } from "../error-oh2DLsP2.js";
|
|
3
|
-
import { Oa as createVectorErrorId, hn as embed$3 } from "../run-registry-
|
|
3
|
+
import { Oa as createVectorErrorId, hn as embed$3 } from "../run-registry-sTm40Ecv.js";
|
|
4
4
|
import { P as embed$2 } from "../message-list-RgFlLrxG.js";
|
|
5
5
|
import { r as embed$1 } from "../dist-TPVqg8oV.js";
|
|
6
6
|
import { n as embed } from "../dist-D3cKCUe-.js";
|
package/dist/worker/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_worker = require("../worker-
|
|
2
|
+
const require_worker = require("../worker-6MiKMAqB.cjs");
|
|
3
3
|
exports.BackgroundTaskWorker = require_worker.BackgroundTaskWorker;
|
|
4
4
|
exports.HttpRemoteStrategy = require_worker.HttpRemoteStrategy;
|
|
5
5
|
exports.InProcessStrategy = require_worker.InProcessStrategy;
|
package/dist/worker/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as BackgroundTaskWorker, s as HttpRemoteStrategy, t as InProcessStrategy, l as MastraWorker, a as OrchestrationWorker, o as PullTransport, r as SchedulerWorker, c as StepExecutionError } from "../worker-
|
|
1
|
+
export { n as BackgroundTaskWorker, s as HttpRemoteStrategy, t as InProcessStrategy, l as MastraWorker, a as OrchestrationWorker, o as PullTransport, r as SchedulerWorker, c as StepExecutionError } from "../worker-st16x0my.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_run_registry = require("./run-registry-
|
|
2
|
-
const require_scheduler = require("./scheduler-
|
|
3
|
-
const require_background_tasks = require("./background-tasks-
|
|
1
|
+
const require_run_registry = require("./run-registry-DOlZccsr.cjs");
|
|
2
|
+
const require_scheduler = require("./scheduler-CMjK0LoQ.cjs");
|
|
3
|
+
const require_background_tasks = require("./background-tasks-D40Y_iLc.cjs");
|
|
4
4
|
const require_request_context = require("./request-context-D9RXYCy8.cjs");
|
|
5
5
|
// src/worker/worker.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { xt as resolveAgentById } from "./run-registry-sTm40Ecv.js";
|
|
2
2
|
import { u as RequestContext } from "./request-context-COnZHt2-.js";
|
|
3
|
-
import { l as MastraWorker, o as PullTransport } from "./worker-
|
|
3
|
+
import { l as MastraWorker, o as PullTransport } from "./worker-st16x0my.js";
|
|
4
4
|
import { l as parseFsAgentScheduleRowId } from "./schedules-DZfSx-7P.js";
|
|
5
5
|
// src/schedules/worker.ts
|
|
6
6
|
/** PubSub topic on which the scheduler publishes `agent-schedule.fire` events. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_run_registry = require("./run-registry-
|
|
1
|
+
const require_run_registry = require("./run-registry-DOlZccsr.cjs");
|
|
2
2
|
const require_request_context = require("./request-context-D9RXYCy8.cjs");
|
|
3
|
-
const require_worker = require("./worker-
|
|
3
|
+
const require_worker = require("./worker-6MiKMAqB.cjs");
|
|
4
4
|
const require_schedules = require("./schedules-BZS8McF7.cjs");
|
|
5
5
|
// src/schedules/worker.ts
|
|
6
6
|
/** PubSub topic on which the scheduler publishes `agent-schedule.fire` events. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $s as WorkflowEventProcessor, Dc as getStepEntry, Ec as getNestedWorkflow, Fl as waitMs, Pl as assertDrainTimeout,
|
|
2
|
-
import { t as Scheduler } from "./scheduler-
|
|
3
|
-
import { l as BackgroundTaskManager } from "./background-tasks-
|
|
1
|
+
import { $s as WorkflowEventProcessor, Dc as getStepEntry, Ec as getNestedWorkflow, Fl as waitMs, Pl as assertDrainTimeout, ec as StepExecutor, tc as computeScheduleDefinitionHash, xt as resolveAgentById } from "./run-registry-sTm40Ecv.js";
|
|
2
|
+
import { t as Scheduler } from "./scheduler-0ShtMM1I.js";
|
|
3
|
+
import { l as BackgroundTaskManager } from "./background-tasks-ClI6oF60.js";
|
|
4
4
|
import { u as RequestContext } from "./request-context-COnZHt2-.js";
|
|
5
5
|
// src/worker/worker.ts
|
|
6
6
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { dn as resolveSuspendedToolRunId } from "./stream-
|
|
1
|
+
import { dn as resolveSuspendedToolRunId } from "./stream-k-Q1NLUs.js";
|
|
2
2
|
import "./utils-DU_pU5SK.js";
|
|
3
3
|
import { m as slimProgressChunk } from "./output-helpers-CVzhy1Y0.js";
|
|
4
|
-
import { Ks as createWorkflow, jc as createStep } from "./run-registry-
|
|
5
|
-
import { u as BACKGROUND_TASK_WORKFLOW_ID } from "./background-tasks-
|
|
4
|
+
import { Ks as createWorkflow, jc as createStep } from "./run-registry-sTm40Ecv.js";
|
|
5
|
+
import { d as nextAttemptStart, f as suspendEnvelope, m as unwrapSuspendData, p as toolSuspendPayload, u as BACKGROUND_TASK_WORKFLOW_ID } from "./background-tasks-ClI6oF60.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
// src/background-tasks/workflow.ts
|
|
8
8
|
const inputSchema = z.object({ taskId: z.string() });
|
|
@@ -119,36 +119,34 @@ function buildBackgroundTaskWorkflow(manager) {
|
|
|
119
119
|
}, task.timeoutMs);
|
|
120
120
|
let pendingSuspend;
|
|
121
121
|
const wrappedSuspend = async (data, suspendOptions) => {
|
|
122
|
-
if (!await storage.updateTask(taskId, {
|
|
123
|
-
status: "suspended",
|
|
124
|
-
suspendPayload: data,
|
|
125
|
-
suspendedAt: /* @__PURE__ */ new Date(),
|
|
126
|
-
ownerId: void 0,
|
|
127
|
-
leaseExpiresAt: void 0
|
|
128
|
-
}, {
|
|
129
|
-
expectedStatus: "running",
|
|
130
|
-
expectedOwnerId: manager.ownerId
|
|
131
|
-
})) return;
|
|
132
|
-
const suspendedTask = await storage.getTask(taskId);
|
|
133
|
-
if (suspendedTask) {
|
|
134
|
-
await manager.runLocalSuspendHooks(suspendedTask);
|
|
135
|
-
await manager.publishLifecycleEvent("task.suspended", suspendedTask);
|
|
136
|
-
}
|
|
137
122
|
pendingSuspend = {
|
|
138
123
|
data,
|
|
139
124
|
suspendOptions
|
|
140
125
|
};
|
|
126
|
+
manager.noteSuspendRequested(taskId, data);
|
|
127
|
+
};
|
|
128
|
+
const suspendRun = async ({ data, suspendOptions }) => {
|
|
129
|
+
const current = await storage.getTask(taskId);
|
|
130
|
+
if (current?.status !== "running" || current.ownerId !== manager.ownerId) return {
|
|
131
|
+
taskId,
|
|
132
|
+
outcome: "cancelled"
|
|
133
|
+
};
|
|
134
|
+
const agentRunId = suspendOptions?.isAgentSuspend && typeof suspendOptions.runId === "string" ? suspendOptions.runId : void 0;
|
|
135
|
+
const engineData = !agentRunId ? data : data && typeof data === "object" ? {
|
|
136
|
+
...data,
|
|
137
|
+
suspendedToolRunId: agentRunId
|
|
138
|
+
} : { suspendedToolRunId: agentRunId };
|
|
139
|
+
return suspend(suspendEnvelope(engineData, {
|
|
140
|
+
ownerId: manager.ownerId,
|
|
141
|
+
startedAt: task.startedAt?.getTime() ?? 0
|
|
142
|
+
}), suspendOptions);
|
|
141
143
|
};
|
|
142
144
|
try {
|
|
143
145
|
const args = { ...task.args };
|
|
144
146
|
delete args.suspendedToolRunId;
|
|
145
|
-
const suspendedToolRunId = resolveSuspendedToolRunId(suspendData?.suspendedToolRunId);
|
|
147
|
+
const suspendedToolRunId = resolveSuspendedToolRunId(unwrapSuspendData(suspendData)?.suspendedToolRunId);
|
|
146
148
|
if (resumeData !== void 0 && suspendedToolRunId) args.suspendedToolRunId = suspendedToolRunId;
|
|
147
|
-
|
|
148
|
-
if (suspendPayload && typeof suspendPayload === "object" && "suspendedToolRunId" in suspendPayload) {
|
|
149
|
-
const { suspendedToolRunId: _bridge, ...rest } = suspendPayload;
|
|
150
|
-
suspendPayload = Object.keys(rest).length > 0 ? rest : void 0;
|
|
151
|
-
}
|
|
149
|
+
const suspendPayload = toolSuspendPayload(suspendData);
|
|
152
150
|
const result = await executor.execute(args, {
|
|
153
151
|
abortSignal: abortController.signal,
|
|
154
152
|
onProgress,
|
|
@@ -157,14 +155,7 @@ function buildBackgroundTaskWorkflow(manager) {
|
|
|
157
155
|
suspendedToolRunId: resumeData !== void 0 ? suspendedToolRunId : void 0,
|
|
158
156
|
suspendPayload: resumeData !== void 0 ? suspendPayload : void 0
|
|
159
157
|
});
|
|
160
|
-
if (pendingSuspend)
|
|
161
|
-
const opts = pendingSuspend.suspendOptions;
|
|
162
|
-
const agentRunId = opts?.isAgentSuspend && typeof opts.runId === "string" ? opts.runId : void 0;
|
|
163
|
-
return suspend(!agentRunId ? pendingSuspend.data : pendingSuspend.data && typeof pendingSuspend.data === "object" ? {
|
|
164
|
-
...pendingSuspend.data,
|
|
165
|
-
suspendedToolRunId: agentRunId
|
|
166
|
-
} : { suspendedToolRunId: agentRunId }, opts);
|
|
167
|
-
}
|
|
158
|
+
if (pendingSuspend) return suspendRun(pendingSuspend);
|
|
168
159
|
return {
|
|
169
160
|
taskId,
|
|
170
161
|
outcome: "success",
|
|
@@ -180,6 +171,7 @@ function buildBackgroundTaskWorkflow(manager) {
|
|
|
180
171
|
};
|
|
181
172
|
}
|
|
182
173
|
if (manager.isShuttingDown()) {
|
|
174
|
+
if (pendingSuspend) return suspendRun(pendingSuspend);
|
|
183
175
|
manager.deregisterTaskContext(taskId);
|
|
184
176
|
return {
|
|
185
177
|
taskId,
|
|
@@ -289,7 +281,7 @@ function buildBackgroundTaskWorkflow(manager) {
|
|
|
289
281
|
if (!await storage.updateTask(taskId, {
|
|
290
282
|
retryCount: task.retryCount + 1,
|
|
291
283
|
error: void 0,
|
|
292
|
-
startedAt:
|
|
284
|
+
startedAt: nextAttemptStart(task.startedAt)
|
|
293
285
|
}, {
|
|
294
286
|
expectedStatus: "running",
|
|
295
287
|
expectedOwnerId: manager.ownerId
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_stream = require("./stream-
|
|
1
|
+
const require_stream = require("./stream-aGuW9AL8.cjs");
|
|
2
2
|
require("./utils-D-eNsgDM.cjs");
|
|
3
3
|
const require_output_helpers = require("./output-helpers-DgsH4aTb.cjs");
|
|
4
|
-
const require_run_registry = require("./run-registry-
|
|
5
|
-
const require_background_tasks = require("./background-tasks-
|
|
4
|
+
const require_run_registry = require("./run-registry-DOlZccsr.cjs");
|
|
5
|
+
const require_background_tasks = require("./background-tasks-D40Y_iLc.cjs");
|
|
6
6
|
let zod = require("zod");
|
|
7
7
|
// src/background-tasks/workflow.ts
|
|
8
8
|
const inputSchema = zod.z.object({ taskId: zod.z.string() });
|
|
@@ -119,36 +119,34 @@ function buildBackgroundTaskWorkflow(manager) {
|
|
|
119
119
|
}, task.timeoutMs);
|
|
120
120
|
let pendingSuspend;
|
|
121
121
|
const wrappedSuspend = async (data, suspendOptions) => {
|
|
122
|
-
if (!await storage.updateTask(taskId, {
|
|
123
|
-
status: "suspended",
|
|
124
|
-
suspendPayload: data,
|
|
125
|
-
suspendedAt: /* @__PURE__ */ new Date(),
|
|
126
|
-
ownerId: void 0,
|
|
127
|
-
leaseExpiresAt: void 0
|
|
128
|
-
}, {
|
|
129
|
-
expectedStatus: "running",
|
|
130
|
-
expectedOwnerId: manager.ownerId
|
|
131
|
-
})) return;
|
|
132
|
-
const suspendedTask = await storage.getTask(taskId);
|
|
133
|
-
if (suspendedTask) {
|
|
134
|
-
await manager.runLocalSuspendHooks(suspendedTask);
|
|
135
|
-
await manager.publishLifecycleEvent("task.suspended", suspendedTask);
|
|
136
|
-
}
|
|
137
122
|
pendingSuspend = {
|
|
138
123
|
data,
|
|
139
124
|
suspendOptions
|
|
140
125
|
};
|
|
126
|
+
manager.noteSuspendRequested(taskId, data);
|
|
127
|
+
};
|
|
128
|
+
const suspendRun = async ({ data, suspendOptions }) => {
|
|
129
|
+
const current = await storage.getTask(taskId);
|
|
130
|
+
if (current?.status !== "running" || current.ownerId !== manager.ownerId) return {
|
|
131
|
+
taskId,
|
|
132
|
+
outcome: "cancelled"
|
|
133
|
+
};
|
|
134
|
+
const agentRunId = suspendOptions?.isAgentSuspend && typeof suspendOptions.runId === "string" ? suspendOptions.runId : void 0;
|
|
135
|
+
const engineData = !agentRunId ? data : data && typeof data === "object" ? {
|
|
136
|
+
...data,
|
|
137
|
+
suspendedToolRunId: agentRunId
|
|
138
|
+
} : { suspendedToolRunId: agentRunId };
|
|
139
|
+
return suspend(require_background_tasks.suspendEnvelope(engineData, {
|
|
140
|
+
ownerId: manager.ownerId,
|
|
141
|
+
startedAt: task.startedAt?.getTime() ?? 0
|
|
142
|
+
}), suspendOptions);
|
|
141
143
|
};
|
|
142
144
|
try {
|
|
143
145
|
const args = { ...task.args };
|
|
144
146
|
delete args.suspendedToolRunId;
|
|
145
|
-
const suspendedToolRunId = require_stream.resolveSuspendedToolRunId(suspendData?.suspendedToolRunId);
|
|
147
|
+
const suspendedToolRunId = require_stream.resolveSuspendedToolRunId(require_background_tasks.unwrapSuspendData(suspendData)?.suspendedToolRunId);
|
|
146
148
|
if (resumeData !== void 0 && suspendedToolRunId) args.suspendedToolRunId = suspendedToolRunId;
|
|
147
|
-
|
|
148
|
-
if (suspendPayload && typeof suspendPayload === "object" && "suspendedToolRunId" in suspendPayload) {
|
|
149
|
-
const { suspendedToolRunId: _bridge, ...rest } = suspendPayload;
|
|
150
|
-
suspendPayload = Object.keys(rest).length > 0 ? rest : void 0;
|
|
151
|
-
}
|
|
149
|
+
const suspendPayload = require_background_tasks.toolSuspendPayload(suspendData);
|
|
152
150
|
const result = await executor.execute(args, {
|
|
153
151
|
abortSignal: abortController.signal,
|
|
154
152
|
onProgress,
|
|
@@ -157,14 +155,7 @@ function buildBackgroundTaskWorkflow(manager) {
|
|
|
157
155
|
suspendedToolRunId: resumeData !== void 0 ? suspendedToolRunId : void 0,
|
|
158
156
|
suspendPayload: resumeData !== void 0 ? suspendPayload : void 0
|
|
159
157
|
});
|
|
160
|
-
if (pendingSuspend)
|
|
161
|
-
const opts = pendingSuspend.suspendOptions;
|
|
162
|
-
const agentRunId = opts?.isAgentSuspend && typeof opts.runId === "string" ? opts.runId : void 0;
|
|
163
|
-
return suspend(!agentRunId ? pendingSuspend.data : pendingSuspend.data && typeof pendingSuspend.data === "object" ? {
|
|
164
|
-
...pendingSuspend.data,
|
|
165
|
-
suspendedToolRunId: agentRunId
|
|
166
|
-
} : { suspendedToolRunId: agentRunId }, opts);
|
|
167
|
-
}
|
|
158
|
+
if (pendingSuspend) return suspendRun(pendingSuspend);
|
|
168
159
|
return {
|
|
169
160
|
taskId,
|
|
170
161
|
outcome: "success",
|
|
@@ -180,6 +171,7 @@ function buildBackgroundTaskWorkflow(manager) {
|
|
|
180
171
|
};
|
|
181
172
|
}
|
|
182
173
|
if (manager.isShuttingDown()) {
|
|
174
|
+
if (pendingSuspend) return suspendRun(pendingSuspend);
|
|
183
175
|
manager.deregisterTaskContext(taskId);
|
|
184
176
|
return {
|
|
185
177
|
taskId,
|
|
@@ -289,7 +281,7 @@ function buildBackgroundTaskWorkflow(manager) {
|
|
|
289
281
|
if (!await storage.updateTask(taskId, {
|
|
290
282
|
retryCount: task.retryCount + 1,
|
|
291
283
|
error: void 0,
|
|
292
|
-
startedAt:
|
|
284
|
+
startedAt: require_background_tasks.nextAttemptStart(task.startedAt)
|
|
293
285
|
}, {
|
|
294
286
|
expectedStatus: "running",
|
|
295
287
|
expectedOwnerId: manager.ownerId
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_builder = require("../../builder-
|
|
2
|
+
const require_builder = require("../../builder-C_I6l0US.cjs");
|
|
3
3
|
exports.WORKFLOW_BUILDER_AUTHORING_CONSTRAINTS = require_builder.WORKFLOW_BUILDER_AUTHORING_CONSTRAINTS;
|
|
4
4
|
exports.WORKFLOW_BUILDER_AUTHORING_PLAYBOOK = require_builder.WORKFLOW_BUILDER_AUTHORING_PLAYBOOK;
|
|
5
5
|
exports.WORKFLOW_BUILDER_MAPPING_CONFIG_DESCRIPTION = require_builder.WORKFLOW_BUILDER_MAPPING_CONFIG_DESCRIPTION;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { U as WORKFLOW_BUILDER_AUTHORING_CONSTRAINTS, W as WORKFLOW_BUILDER_AUTHORING_PLAYBOOK, i as WORKFLOW_BUILDER_MAPPING_CONFIG_DESCRIPTION, t as WORKFLOW_BUILDER_SUPPORTED_STEP_TYPES, B as compareWorkflowBuilderSchemas, r as createWorkflowBuilderAgent, a as deleteStoredWorkflowResponseSchema, V as inspectWorkflowBuilderSchemas, o as listStoredWorkflowsResponseSchema, n as normalizeWorkflowBuilderDefinition, H as preflightWorkflowDefinition, s as storedWorkflowDefinitionSchema, c as upsertStoredWorkflowResponseSchema, l as workflowBuilderAgentEntryInputSchema, u as workflowBuilderAgentEntrySchema, d as workflowBuilderClassifierEntryInputSchema, f as workflowBuilderClassifierEntrySchema, p as workflowBuilderConditionalEntryInputSchema, m as workflowBuilderConditionalEntrySchema, h as workflowBuilderDefinitionInputSchema, g as workflowBuilderDefinitionSchema, _ as workflowBuilderForeachEntryInputSchema, v as workflowBuilderForeachEntrySchema, y as workflowBuilderGraphEntryInputSchema, b as workflowBuilderGraphEntrySchema, x as workflowBuilderLoopEntryInputSchema, S as workflowBuilderLoopEntrySchema, C as workflowBuilderMappingConfigSchema, w as workflowBuilderMappingDescriptorSchema, T as workflowBuilderMappingEntryInputSchema, E as workflowBuilderMappingEntrySchema, D as workflowBuilderNestedWorkflowEntryInputSchema, O as workflowBuilderNestedWorkflowEntrySchema, k as workflowBuilderParallelEntryInputSchema, A as workflowBuilderParallelEntrySchema, j as workflowBuilderPredicateSchema, M as workflowBuilderScheduleConfigSchema, N as workflowBuilderScheduleSchema, P as workflowBuilderSleepEntryInputSchema, F as workflowBuilderSleepEntrySchema, I as workflowBuilderSleepUntilEntryInputSchema, L as workflowBuilderSleepUntilEntrySchema, R as workflowBuilderToolEntryInputSchema, z as workflowBuilderToolEntrySchema } from "../../builder-
|
|
1
|
+
export { U as WORKFLOW_BUILDER_AUTHORING_CONSTRAINTS, W as WORKFLOW_BUILDER_AUTHORING_PLAYBOOK, i as WORKFLOW_BUILDER_MAPPING_CONFIG_DESCRIPTION, t as WORKFLOW_BUILDER_SUPPORTED_STEP_TYPES, B as compareWorkflowBuilderSchemas, r as createWorkflowBuilderAgent, a as deleteStoredWorkflowResponseSchema, V as inspectWorkflowBuilderSchemas, o as listStoredWorkflowsResponseSchema, n as normalizeWorkflowBuilderDefinition, H as preflightWorkflowDefinition, s as storedWorkflowDefinitionSchema, c as upsertStoredWorkflowResponseSchema, l as workflowBuilderAgentEntryInputSchema, u as workflowBuilderAgentEntrySchema, d as workflowBuilderClassifierEntryInputSchema, f as workflowBuilderClassifierEntrySchema, p as workflowBuilderConditionalEntryInputSchema, m as workflowBuilderConditionalEntrySchema, h as workflowBuilderDefinitionInputSchema, g as workflowBuilderDefinitionSchema, _ as workflowBuilderForeachEntryInputSchema, v as workflowBuilderForeachEntrySchema, y as workflowBuilderGraphEntryInputSchema, b as workflowBuilderGraphEntrySchema, x as workflowBuilderLoopEntryInputSchema, S as workflowBuilderLoopEntrySchema, C as workflowBuilderMappingConfigSchema, w as workflowBuilderMappingDescriptorSchema, T as workflowBuilderMappingEntryInputSchema, E as workflowBuilderMappingEntrySchema, D as workflowBuilderNestedWorkflowEntryInputSchema, O as workflowBuilderNestedWorkflowEntrySchema, k as workflowBuilderParallelEntryInputSchema, A as workflowBuilderParallelEntrySchema, j as workflowBuilderPredicateSchema, M as workflowBuilderScheduleConfigSchema, N as workflowBuilderScheduleSchema, P as workflowBuilderSleepEntryInputSchema, F as workflowBuilderSleepEntrySchema, I as workflowBuilderSleepUntilEntryInputSchema, L as workflowBuilderSleepUntilEntrySchema, R as workflowBuilderToolEntryInputSchema, z as workflowBuilderToolEntrySchema } from "../../builder-D00XMm41.js";
|
|
@@ -21,7 +21,9 @@ export declare class EventedExecutionEngine extends ExecutionEngine {
|
|
|
21
21
|
* are resolvable from the workflow event processor but `Mastra.getWorkflow`
|
|
22
22
|
* intentionally only sees public ones. The `execute` resume/time-travel
|
|
23
23
|
* branches need access to the workflow's step graph by id, so prefer the
|
|
24
|
-
* internal registry when present.
|
|
24
|
+
* internal registry when present. Public workflows are looked up by id:
|
|
25
|
+
* `workflowId` is the workflow's `id`, which can differ from the key it is
|
|
26
|
+
* registered under in `new Mastra({ workflows })`.
|
|
25
27
|
*/
|
|
26
28
|
private resolveWorkflow;
|
|
27
29
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_run_registry = require("../../run-registry-
|
|
2
|
+
const require_run_registry = require("../../run-registry-DOlZccsr.cjs");
|
|
3
3
|
exports.EventedExecutionEngine = require_run_registry.EventedExecutionEngine;
|
|
4
4
|
exports.EventedRun = require_run_registry.EventedRun;
|
|
5
5
|
exports.EventedWorkflow = require_run_registry.EventedWorkflow;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Tc as EventedExecutionEngine, qs as EventedRun, Js as EventedWorkflow, ec as StepExecutor, $s as WorkflowEventProcessor, Ys as cloneStep, Xs as cloneWorkflow, Zs as createStep, Qs as createWorkflow } from "../../run-registry-
|
|
1
|
+
export { Tc as EventedExecutionEngine, qs as EventedRun, Js as EventedWorkflow, ec as StepExecutor, $s as WorkflowEventProcessor, Ys as cloneStep, Xs as cloneWorkflow, Zs as createStep, Qs as createWorkflow } from "../../run-registry-sTm40Ecv.js";
|
|
@@ -15,4 +15,15 @@ import type { WorkflowsStorage } from '../../storage/domains/workflows/base.js';
|
|
|
15
15
|
* the one place that lists them.
|
|
16
16
|
*/
|
|
17
17
|
export declare function warnUnsupportedEventedSetup(mastra: Mastra, workflowsStore?: WorkflowsStorage): void;
|
|
18
|
+
/** Why the signals of an evented agent's run are not kept where every process reads them. */
|
|
19
|
+
export type UnsharedAgentSignalsReason = 'no-memory-thread' | 'unsupported-memory-storage' | 'unshared-memory-storage';
|
|
20
|
+
/**
|
|
21
|
+
* Signals sent to a running evented agent reach steps in another process only
|
|
22
|
+
* through memory storage that every process shares. Logs once per Mastra
|
|
23
|
+
* instance, apart from {@link warnUnsupportedEventedSetup} so that one does
|
|
24
|
+
* not hide this, when the pubsub reaches other processes and a run keeps its
|
|
25
|
+
* signals in this process. Such a signal only reaches the run when the
|
|
26
|
+
* process holding it runs the step.
|
|
27
|
+
*/
|
|
28
|
+
export declare function warnUnsharedAgentSignals(mastra: Mastra, reason: UnsharedAgentSignalsReason): void;
|
|
18
29
|
//# sourceMappingURL=setup-warning.d.ts.map
|
|
@@ -46,6 +46,11 @@ export type ProcessorArgs = {
|
|
|
46
46
|
* from) so the persisted run snapshot records the schedule's `resourceId`.
|
|
47
47
|
*/
|
|
48
48
|
resourceId?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Set by the start of an execution that stores a guarded-only running record, to the id that
|
|
51
|
+
* record carries; its suspend deletes the record only while it still carries this id.
|
|
52
|
+
*/
|
|
53
|
+
guardedOnlySnapshotId?: string;
|
|
49
54
|
};
|
|
50
55
|
export type ParentWorkflow = {
|
|
51
56
|
workflowId: string;
|
|
@@ -62,6 +67,8 @@ export type ParentWorkflow = {
|
|
|
62
67
|
resumeSteps: string[];
|
|
63
68
|
resumeData: any;
|
|
64
69
|
input: any;
|
|
70
|
+
/** The parent execution's {@link ProcessorArgs.guardedOnlySnapshotId}, handed back when the child reports. */
|
|
71
|
+
guardedOnlySnapshotId?: string;
|
|
65
72
|
parentContext?: {
|
|
66
73
|
workflowId: string;
|
|
67
74
|
input: any;
|
|
@@ -303,7 +310,7 @@ export declare class WorkflowEventProcessor extends EventProcessor {
|
|
|
303
310
|
* - otherwise → emit `workflow.step.end` for the parallel/conditional entry with the
|
|
304
311
|
* merged branch outputs (the existing behaviour).
|
|
305
312
|
*/
|
|
306
|
-
protected aggregateBranchResults({ workflow, workflowId, runId, branchEntry, branchExecutionPath, latestBranchResult, resumeSteps, timeTravel, restart, parentWorkflow, stepResults, activeStepsPath, requestContext, actor, state, outputOptions, }: {
|
|
313
|
+
protected aggregateBranchResults({ workflow, workflowId, runId, branchEntry, branchExecutionPath, latestBranchResult, resumeSteps, timeTravel, restart, parentWorkflow, stepResults, activeStepsPath, requestContext, actor, state, outputOptions, guardedOnlySnapshotId, }: {
|
|
307
314
|
workflow: Workflow;
|
|
308
315
|
workflowId: string;
|
|
309
316
|
runId: string;
|
|
@@ -331,8 +338,9 @@ export declare class WorkflowEventProcessor extends EventProcessor {
|
|
|
331
338
|
includeState?: boolean;
|
|
332
339
|
includeResumeLabels?: boolean;
|
|
333
340
|
};
|
|
341
|
+
guardedOnlySnapshotId?: string;
|
|
334
342
|
}): Promise<void>;
|
|
335
|
-
protected processWorkflowStepEnd({ workflow, workflowId, runId, executionPath, resumeSteps, timeTravel, restart, prevResult, parentWorkflow, stepResults, activeStepsPath, parentContext, requestContext, actor, perStep, state, outputOptions, forEachIndex, nestedRunId, }: ProcessorArgs): Promise<void>;
|
|
343
|
+
protected processWorkflowStepEnd({ workflow, workflowId, runId, executionPath, resumeSteps, timeTravel, restart, prevResult, parentWorkflow, stepResults, activeStepsPath, parentContext, requestContext, actor, perStep, state, outputOptions, guardedOnlySnapshotId, forEachIndex, nestedRunId, }: ProcessorArgs): Promise<void>;
|
|
336
344
|
loadData({ workflowId, runId, }: {
|
|
337
345
|
workflowId: string;
|
|
338
346
|
runId: string;
|
|
@@ -13,7 +13,7 @@ export declare function evaluateLoopCondition(args: Omit<ProcessorArgs, 'workflo
|
|
|
13
13
|
}>, stepExecutor: StepExecutor, stepResult: StepResult<any, any, any, any>): Promise<boolean>;
|
|
14
14
|
/** The loop step's result when its condition throws. */
|
|
15
15
|
export declare function failedLoopStep(result: StepResult<any, any, any, any>, error: Error): StepResult<any, any, any, any>;
|
|
16
|
-
export declare function processWorkflowLoop({ workflowId, prevResult, runId, executionPath, stepResults, activeStepsPath, resumeSteps, resumeData, parentWorkflow, requestContext, actor, retryCount, perStep, state, outputOptions, }: ProcessorArgs, { pubsub, runStorage, stepExecutor, step, stepResult, savedCondition, replayedIterationCount, }: {
|
|
16
|
+
export declare function processWorkflowLoop({ workflowId, prevResult, runId, executionPath, stepResults, activeStepsPath, resumeSteps, resumeData, parentWorkflow, requestContext, actor, retryCount, perStep, state, outputOptions, guardedOnlySnapshotId, }: ProcessorArgs, { pubsub, runStorage, stepExecutor, step, stepResult, savedCondition, replayedIterationCount, }: {
|
|
17
17
|
pubsub: PubSub;
|
|
18
18
|
runStorage: RunStorage;
|
|
19
19
|
stepExecutor: StepExecutor;
|
|
@@ -2,13 +2,13 @@ import type { StepFlowEntry } from '../../index.js';
|
|
|
2
2
|
import type { PubSub } from '../../../events/index.js';
|
|
3
3
|
import type { StepExecutor } from '../step-executor.js';
|
|
4
4
|
import type { ProcessorArgs } from '.';
|
|
5
|
-
export declare function processWorkflowParallel({ workflowId, runId, executionPath, stepResults, activeStepsPath, resumeSteps, timeTravel, restart, prevResult, resumeData, parentWorkflow, requestContext, actor, perStep, state, outputOptions, }: ProcessorArgs, { pubsub, step, }: {
|
|
5
|
+
export declare function processWorkflowParallel({ workflowId, runId, executionPath, stepResults, activeStepsPath, resumeSteps, timeTravel, restart, prevResult, resumeData, parentWorkflow, requestContext, actor, perStep, state, outputOptions, guardedOnlySnapshotId, }: ProcessorArgs, { pubsub, step, }: {
|
|
6
6
|
pubsub: PubSub;
|
|
7
7
|
step: Extract<StepFlowEntry, {
|
|
8
8
|
type: 'parallel';
|
|
9
9
|
}>;
|
|
10
10
|
}): Promise<void>;
|
|
11
|
-
export declare function processWorkflowConditional({ workflowId, runId, executionPath, stepResults, activeStepsPath, resumeSteps, timeTravel, restart, prevResult, resumeData, parentWorkflow, requestContext, actor, perStep, state, outputOptions, }: ProcessorArgs, { pubsub, stepExecutor, step, }: {
|
|
11
|
+
export declare function processWorkflowConditional({ workflowId, runId, executionPath, stepResults, activeStepsPath, resumeSteps, timeTravel, restart, prevResult, resumeData, parentWorkflow, requestContext, actor, perStep, state, outputOptions, guardedOnlySnapshotId, }: ProcessorArgs, { pubsub, stepExecutor, step, }: {
|
|
12
12
|
pubsub: PubSub;
|
|
13
13
|
stepExecutor: StepExecutor;
|
|
14
14
|
step: Extract<StepFlowEntry, {
|