@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
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { CreatedAgentSignal } from './signals.js';
|
|
2
|
+
type ActiveRunSignalScope = 'pending' | 'pre-run';
|
|
3
|
+
/**
|
|
4
|
+
* Signals waiting for a thread's active run, keyed by thread key.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createActiveRunSignalQueues(): {
|
|
7
|
+
/** Appends to the thread's queue for `scope`. */
|
|
8
|
+
enqueue(scope: ActiveRunSignalScope, key: string, signal: CreatedAgentSignal): void;
|
|
9
|
+
/** Whether either of the thread's queues holds a signal with this id. */
|
|
10
|
+
includes(key: string, signalId: string): boolean;
|
|
11
|
+
/** Whether either of the thread's queues is non-empty. */
|
|
12
|
+
hasSignals(key: string): boolean;
|
|
13
|
+
/** Removes and returns the thread's whole queue for `scope`. */
|
|
14
|
+
take(scope: ActiveRunSignalScope, key: string): CreatedAgentSignal[];
|
|
15
|
+
/** The thread's queued signals, pre-run first, iterated without copying the queues. */
|
|
16
|
+
queued(key: string): Generator<CreatedAgentSignal>;
|
|
17
|
+
/** Passes each queued signal to `forward`, pre-run first, then drops the thread's queues. */
|
|
18
|
+
handOff(key: string, forward: (signal: CreatedAgentSignal, preRun: boolean) => void): void;
|
|
19
|
+
/** Puts pre-run signals a finished run never took in front of the thread's follow-ups. */
|
|
20
|
+
foldPreRunIntoPending(key: string): void;
|
|
21
|
+
/** Removes the oldest follow-up, dropping the queue once it is empty. */
|
|
22
|
+
takeNextPending(key: string): CreatedAgentSignal | undefined;
|
|
23
|
+
/** Puts a follow-up back at the front of the thread's queue. */
|
|
24
|
+
returnToFront(key: string, signal: CreatedAgentSignal): void;
|
|
25
|
+
/**
|
|
26
|
+
* Moves the remaining follow-ups in front of the thread's pre-run signals,
|
|
27
|
+
* for a follow-up run's first model request, and returns them.
|
|
28
|
+
*/
|
|
29
|
+
batchPendingIntoPreRun(key: string): CreatedAgentSignal[];
|
|
30
|
+
/**
|
|
31
|
+
* Requeues after a follow-up run failed to start: `signal`, then whatever
|
|
32
|
+
* was batched into its pre-run queue, then the follow-ups queued since.
|
|
33
|
+
*/
|
|
34
|
+
restoreAfterFailedStart(key: string, signal: CreatedAgentSignal | undefined): void;
|
|
35
|
+
/**
|
|
36
|
+
* Removes matching signals from both of the thread's queues and returns
|
|
37
|
+
* their ids, pre-run first. Each queue is replaced by a new array, or
|
|
38
|
+
* dropped when nothing is left.
|
|
39
|
+
*/
|
|
40
|
+
cancel(key: string, matches: (signal: CreatedAgentSignal) => boolean): string[];
|
|
41
|
+
/** Removes one pre-run signal in place, dropping the queue once it is empty. */
|
|
42
|
+
discardPreRunSignal(key: string, signalId: string): void;
|
|
43
|
+
/** Drops the thread's pre-run queue. */
|
|
44
|
+
discardPreRunQueue(key: string): void;
|
|
45
|
+
clear(): void;
|
|
46
|
+
};
|
|
47
|
+
export type ActiveRunSignalQueues = ReturnType<typeof createActiveRunSignalQueues>;
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=active-run-signal-queues.d.ts.map
|
package/dist/agent/agent.d.ts
CHANGED
|
@@ -1682,6 +1682,8 @@ TRequestContext extends Record<string, any> | unknown = any, TEditor extends Age
|
|
|
1682
1682
|
* @internal Used by the server's run abort route.
|
|
1683
1683
|
*/
|
|
1684
1684
|
__abortRunAcknowledged(runId: string): Promise<boolean>;
|
|
1685
|
+
/** @internal Close the stored signals of a parked run that an abort requested by another process releases here. */
|
|
1686
|
+
__closeParkedRunSignals(runId: string): Promise<void> | undefined;
|
|
1685
1687
|
sendMessage<OUTPUT = TOutput>(message: AgentMessageInput, target: SendAgentMessageOptions<OUTPUT>): SendAgentMessageResult<OUTPUT>;
|
|
1686
1688
|
queueMessage<OUTPUT = TOutput>(message: AgentMessageInput, target: QueueAgentMessageOptions<OUTPUT>): QueueAgentMessageResult<OUTPUT>;
|
|
1687
1689
|
/**
|
|
@@ -1689,7 +1691,14 @@ TRequestContext extends Record<string, any> | unknown = any, TEditor extends Age
|
|
|
1689
1691
|
* the thread immediately when it is idle. Shares the queue used by `queueMessage()`.
|
|
1690
1692
|
*/
|
|
1691
1693
|
queueSignal<OUTPUT = TOutput>(signal: AgentSignal, target: QueueAgentSignalOptions<OUTPUT>): QueueAgentSignalResult<OUTPUT>;
|
|
1692
|
-
|
|
1694
|
+
/**
|
|
1695
|
+
* Cancels queued input of a thread: signals sent to its active run that no
|
|
1696
|
+
* model request took yet, and messages queued for its next run. Resolves
|
|
1697
|
+
* with every cancelled id once the cancellation settled, including signals
|
|
1698
|
+
* kept in memory storage. A signal a run already took into its transcript is
|
|
1699
|
+
* not cancelled.
|
|
1700
|
+
*/
|
|
1701
|
+
cancelQueuedMessages(target: CancelQueuedAgentMessagesOptions): Promise<CancelQueuedAgentMessagesResult>;
|
|
1693
1702
|
subscribeThreadEvents(scope: SubscribeAgentThreadEventsOptions, listener: AgentThreadEventListener): () => void;
|
|
1694
1703
|
sendStateSignal<OUTPUT = TOutput>(state: AgentStateSignalInput, target: SendAgentStateSignalOptions<OUTPUT>): Promise<SendAgentStateSignalResult<OUTPUT>>;
|
|
1695
1704
|
/**
|
|
@@ -2173,6 +2182,12 @@ TRequestContext extends Record<string, any> | unknown = any, TEditor extends Age
|
|
|
2173
2182
|
* segment that lost its lease without being replaced still reports its error
|
|
2174
2183
|
* but keeps the snapshots so the run stays recoverable.
|
|
2175
2184
|
*
|
|
2185
|
+
* A total deadline also closes the stored signals of a run that keeps them in
|
|
2186
|
+
* storage, with the signals of the transcript it saves. When the run's steps
|
|
2187
|
+
* execute in another process, this process holds no transcript of them and
|
|
2188
|
+
* saves only the turn's input, so the signals those steps took and memory
|
|
2189
|
+
* did not save yet are pending again for the thread's next run.
|
|
2190
|
+
*
|
|
2176
2191
|
* Never rejects: a pubsub that is already closing (for example during
|
|
2177
2192
|
* shutdown) must not turn a run's own failure into an unhandledRejection.
|
|
2178
2193
|
*
|
|
@@ -2181,6 +2196,7 @@ TRequestContext extends Record<string, any> | unknown = any, TEditor extends Age
|
|
|
2181
2196
|
protected settleExecution(runId: string, fence: ExecutionFence | undefined, outcome: {
|
|
2182
2197
|
status?: string;
|
|
2183
2198
|
error?: Error;
|
|
2199
|
+
state?: unknown;
|
|
2184
2200
|
}): Promise<void>;
|
|
2185
2201
|
private redeliverDeadlineError;
|
|
2186
2202
|
/**
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import type { PubSub } from '../../events/index.js';
|
|
16
16
|
import type { Mastra } from '../../mastra/index.js';
|
|
17
|
-
export { publishAbortRequest, requestAcknowledgedAbort, subscribeToAbortRequests } from '../streams/abort-transport.js';
|
|
17
|
+
export { publishAbortRequest, publishSignalAvailable, requestAcknowledgedAbort, subscribeToAbortRequests, } from '../streams/abort-transport.js';
|
|
18
18
|
/**
|
|
19
19
|
* Make the current process responsive to abort requests for `runId`.
|
|
20
20
|
*
|
|
@@ -345,6 +345,7 @@ export declare class DurableAgent<TAgentId extends string = string, TTools exten
|
|
|
345
345
|
runId: string;
|
|
346
346
|
agentId: string;
|
|
347
347
|
agentName?: string | undefined;
|
|
348
|
+
signalsStored?: boolean | undefined;
|
|
348
349
|
agentVersionId?: string | undefined;
|
|
349
350
|
messageListState: any;
|
|
350
351
|
toolsMetadata: any[];
|
|
@@ -20,6 +20,8 @@ export type ExecutionOutcome = {
|
|
|
20
20
|
owner: 'agent';
|
|
21
21
|
status?: string;
|
|
22
22
|
error?: Error;
|
|
23
|
+
/** The run's workflow state when it ended. */
|
|
24
|
+
state?: unknown;
|
|
23
25
|
} | {
|
|
24
26
|
owner: 'workers';
|
|
25
27
|
error?: Error;
|
|
@@ -95,6 +97,12 @@ export declare class DefaultAgentExecutionEngine {
|
|
|
95
97
|
* another server from resuming the run.
|
|
96
98
|
*/
|
|
97
99
|
cancelParkedRun(runId: string): Promise<boolean>;
|
|
100
|
+
/**
|
|
101
|
+
* Close the stored signals of a parked run that was aborted. Call it before
|
|
102
|
+
* the snapshot is deleted and before the abort terminal is published.
|
|
103
|
+
* Returns nothing to wait for when this engine's runs never store signals.
|
|
104
|
+
*/
|
|
105
|
+
closeParkedRunSignals(_runId: string): Promise<void> | undefined;
|
|
98
106
|
/**
|
|
99
107
|
* Publish the abort terminal for a parked run this call just canceled. The bus is
|
|
100
108
|
* shared, so observers on every server close now, whichever server later refuses
|
|
@@ -123,6 +131,7 @@ export declare class DefaultAgentExecutionEngine {
|
|
|
123
131
|
runId: string;
|
|
124
132
|
agentId: string;
|
|
125
133
|
agentName?: string | undefined;
|
|
134
|
+
signalsStored?: boolean | undefined;
|
|
126
135
|
agentVersionId?: string | undefined;
|
|
127
136
|
messageListState: any;
|
|
128
137
|
toolsMetadata: any[];
|
|
@@ -203,6 +212,7 @@ export declare class DefaultAgentExecutionEngine {
|
|
|
203
212
|
runId: string;
|
|
204
213
|
agentId: string;
|
|
205
214
|
agentName?: string | undefined;
|
|
215
|
+
signalsStored?: boolean | undefined;
|
|
206
216
|
agentVersionId?: string | undefined;
|
|
207
217
|
messageListState: any;
|
|
208
218
|
toolsMetadata: any[];
|
|
@@ -279,6 +289,7 @@ export declare class DefaultAgentExecutionEngine {
|
|
|
279
289
|
runId: string;
|
|
280
290
|
agentId: string;
|
|
281
291
|
agentName?: string | undefined;
|
|
292
|
+
signalsStored?: boolean | undefined;
|
|
282
293
|
agentVersionId?: string | undefined;
|
|
283
294
|
messageListState: any;
|
|
284
295
|
toolsMetadata: any[];
|
|
@@ -344,6 +355,7 @@ export declare class EventedAgentExecutionEngine extends DefaultAgentExecutionEn
|
|
|
344
355
|
#private;
|
|
345
356
|
get executionMode(): 'blocking' | 'background';
|
|
346
357
|
get suspendPersistedOnReturn(): boolean;
|
|
358
|
+
closeParkedRunSignals(runId: string): Promise<void> | undefined;
|
|
347
359
|
get executesStepsLocally(): boolean;
|
|
348
360
|
prepareExecution(pubsub: PubSub | undefined, fence: ExecutionFence | undefined, workflowEngine: 'default' | 'evented', logger: IMastraLogger, guardrailLogger: IMastraLogger | undefined): {
|
|
349
361
|
sharedExecution: boolean;
|
|
@@ -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
|
const require_observability = require("../../observability-B0R_D1PZ.cjs");
|
|
4
4
|
// src/agent/durable/durable-agent.ts
|
|
5
5
|
var DurableAgent = class extends require_run_registry.Agent {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as ensureRemoteAbortListener, B as detachFullStreamOnEnd, Ct as endFailedSegmentSpans, Dt as runDurableStreamUntilIdle, Et as segmentSpanData, F as Agent, Ft as untilIdleHandlesBackgroundTask, G as createDurableToolCallStep, H as createDurableGoalStep, I as normalizeResumeGenerateArgs, It as pruneAgentLoopSnapshot, J as serializeDurableState, K as createWorkflowInput, L as prepareForDurableExecution, Nt as getRunStreamSlot, Ot as runResumeDurableStreamUntilIdle, Pt as getScopeStreamSlot, Qt as validateModelTimeoutSettings, R as applyReservedMemoryContextKeys, Sc as AgentStreamEventTypes, St as carrySegmentSpans, Tt as segmentEndedBySuspension, U as createDurableIsTaskCompleteStep, V as createDurableAgenticWorkflow, W as createDurableLLMMappingStep, X as serializeToolsMetadata, Y as serializeModelConfig, Z as createDurableLLMExecutionStep, _c as DurableAgentDefaults, _t as
|
|
1
|
+
import { At as ensureRemoteAbortListener, B as detachFullStreamOnEnd, Ct as endFailedSegmentSpans, Dt as runDurableStreamUntilIdle, Et as segmentSpanData, F as Agent, Ft as untilIdleHandlesBackgroundTask, G as createDurableToolCallStep, H as createDurableGoalStep, I as normalizeResumeGenerateArgs, It as pruneAgentLoopSnapshot, J as serializeDurableState, K as createWorkflowInput, L as prepareForDurableExecution, Nt as getRunStreamSlot, Ot as runResumeDurableStreamUntilIdle, Pt as getScopeStreamSlot, Qt as validateModelTimeoutSettings, R as applyReservedMemoryContextKeys, Sc as AgentStreamEventTypes, St as carrySegmentSpans, Tt as segmentEndedBySuspension, U as createDurableIsTaskCompleteStep, V as createDurableAgenticWorkflow, W as createDurableLLMMappingStep, X as serializeToolsMetadata, Y as serializeModelConfig, Z as createDurableLLMExecutionStep, _c as DurableAgentDefaults, _t as resolveModel, a as deleteRunRegistryEntry, ac as emitChunkEvent, at as accumulatedUsageSchema, bc as AGENT_STREAM_TOPIC, bt as toolRequiresApproval, c as getRunRegistryEntry, cc as emitStepFinishEvent, ct as durableAgenticOutputSchema, d as setRunRegistryEntry, dc as AgentStreamBus, dt as executeDurableAgentScorers, et as createDurableBackgroundTaskCheckStep, f as takeRunScorerInstances, fc as publishAbortRequest, ft as runDurableFinishSideEffects, gc as DURABLE_STOP_WHEN_ERROR_ID, gt as resolveInternalState, hc as createRunAbortController, ht as rebuildRunToolsFromMastra, ic as emitAbortEvent, it as createBaseIterationStateUpdate, jt as readRunDeadline, kt as RUN_DEADLINE_KEY, l as globalRunRegistry, lc as emitStepStartEvent, lt as modelConfigSchema, m as agentThreadStreamRuntime, mc as subscribeToAbortRequests, mt as createDurableAgentStream, n as ExtendedRunRegistry, nc as __resetExecutionFencesForTests, nt as buildStepRecord, o as endRunSpansWithError, oc as emitErrorEvent, ot as baseDurableAgenticInputSchema, pc as requestAcknowledgedAbort, pt as loadRunStoredMessages, q as serializeDurableOptions, r as RunRegistry, rc as diffResponseMessages, rt as calculateAccumulatedUsage, sc as emitFinishEvent, st as baseIterationStateSchema, t as DURABLE_CONTEXT_SEGMENT_KEY, tt as resolveDurableToolCallConcurrency, uc as emitSuspendedEvent, ut as modelListEntrySchema, vc as DurableStepIds, vt as resolveRuntimeDependencies, wt as liveSegmentSpan, xc as AgentControlEventTypes, yc as AGENT_CONTROL_TOPIC, yt as resolveTool, z as persistDurableRunInput } from "../../run-registry-sTm40Ecv.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 {
|
|
@@ -11,6 +11,8 @@ import type { DurableAgenticWorkflowInput, RunRegistryEntry } from './types.js';
|
|
|
11
11
|
export declare const SCOPES_ALREADY_APPLIED: unique symbol;
|
|
12
12
|
/** Carries the persisted spans a resume rebuilt from storage reattaches to into `prepare()`. */
|
|
13
13
|
export declare const RESUMED_SPAN_DATA: unique symbol;
|
|
14
|
+
/** Carries where a resume rebuilt from storage keeps its run's signals, as the run decided when it started. */
|
|
15
|
+
export declare const RESUMED_SIGNALS_STORED: unique symbol;
|
|
14
16
|
/**
|
|
15
17
|
* Result from the preparation phase
|
|
16
18
|
*/
|
|
@@ -91,6 +93,21 @@ export interface PreparationOptions<OUTPUT = undefined> {
|
|
|
91
93
|
* Falls back to `agent.name` if not provided.
|
|
92
94
|
*/
|
|
93
95
|
durableAgentName?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Whether the run may keep signals sent to it in its memory storage: its
|
|
98
|
+
* agent runs on the evented engine and the run holds its thread. It does
|
|
99
|
+
* when the run also has memory, a thread and a resource, and that storage
|
|
100
|
+
* keeps pending signals; the run's input carries the outcome.
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
signalsStored?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* For a run rebuilt from storage, the outcome it started with, carried
|
|
106
|
+
* through `RESUMED_SIGNALS_STORED`. The run keeps it and leaves its thread's
|
|
107
|
+
* signal run as it is.
|
|
108
|
+
* @internal
|
|
109
|
+
*/
|
|
110
|
+
resumedSignalsStored?: boolean;
|
|
94
111
|
}
|
|
95
112
|
/**
|
|
96
113
|
* Prepare for durable agent execution.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { IMastraLogger } from '../../logger/index.js';
|
|
2
|
+
import type { Mastra } from '../../mastra/index.js';
|
|
3
|
+
import type { RequestContext } from '../../request-context/index.js';
|
|
4
|
+
import type { MessageList } from '../message-list/index.js';
|
|
5
|
+
import type { CreatedAgentSignal } from '../signals.js';
|
|
6
|
+
import type { ThreadSignalsStore } from '../stored-signals.js';
|
|
7
|
+
import type { DurableAgenticWorkflowInput } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Workflow-state key of the ids of every signal a storage-backed run took into
|
|
10
|
+
* its transcript, saved in the same state write as that transcript. A claim
|
|
11
|
+
* skips them, and the run's close deletes the ones that never reached memory.
|
|
12
|
+
*/
|
|
13
|
+
export declare const CONSUMED_SIGNAL_IDS_KEY = "consumedSignalIds";
|
|
14
|
+
/** The consumed set in workflow state. A run started before the set existed has consumed nothing. */
|
|
15
|
+
export declare function readConsumedSignalIds(state: unknown): string[];
|
|
16
|
+
/** Ids of the signals the run was started with. They reach the transcript as input, not through a drain. */
|
|
17
|
+
export declare function inputSignalIds(messageList: MessageList): string[];
|
|
18
|
+
type DurableRunInput = Partial<Pick<DurableAgenticWorkflowInput, 'agentId' | 'agentVersionId' | 'requestContextEntries' | 'signalsStored'>> & {
|
|
19
|
+
state?: {
|
|
20
|
+
threadId?: string;
|
|
21
|
+
resourceId?: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Where a durable run's pending signals are read and settled in this process,
|
|
26
|
+
* or `undefined` when the run keeps them in the thread runtime's queues. The
|
|
27
|
+
* run carries the decision in its input, made once when it was prepared. The
|
|
28
|
+
* store comes from the memory this process holds for the run or from the agent
|
|
29
|
+
* and the request context entries the run carries, and is kept on the run's
|
|
30
|
+
* registry entry once resolved. A resolution that fails or finds no store is
|
|
31
|
+
* tried again at the next site. A run whose memory resolves here to no store,
|
|
32
|
+
* or to a store without its thread, reads nothing here, and that is logged
|
|
33
|
+
* once.
|
|
34
|
+
*/
|
|
35
|
+
export declare function durableRunSignalsStore({ mastra, runId, input, requestContext, }: {
|
|
36
|
+
mastra: Mastra | undefined;
|
|
37
|
+
runId: string;
|
|
38
|
+
input: DurableRunInput | undefined;
|
|
39
|
+
requestContext?: RequestContext;
|
|
40
|
+
}): Promise<ThreadSignalsStore | undefined> | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Close a storage-backed run that ended: the store deletes the taken rows it
|
|
43
|
+
* consumed and, while the run is still the thread's signal run, gives the
|
|
44
|
+
* other taken rows back to pending. Safe to repeat. Returns nothing to wait
|
|
45
|
+
* for when the run's signals are not stored, so other runs end without
|
|
46
|
+
* waiting on it.
|
|
47
|
+
*
|
|
48
|
+
* A failed close doesn't fail the run's ending: the thread keeps the run as
|
|
49
|
+
* its signal run until the thread's next run is prepared.
|
|
50
|
+
*/
|
|
51
|
+
export declare function closeStoredSignalRun({ mastra, runId, input, requestContext, state, deadline, }: {
|
|
52
|
+
mastra: Mastra | undefined;
|
|
53
|
+
runId: string;
|
|
54
|
+
input: DurableRunInput | undefined;
|
|
55
|
+
requestContext?: RequestContext;
|
|
56
|
+
/** The run's latest saved workflow state, or a read of it. */
|
|
57
|
+
state: unknown | (() => unknown);
|
|
58
|
+
/** Set by the close of the run's total deadline. */
|
|
59
|
+
deadline?: boolean;
|
|
60
|
+
}): Promise<void> | undefined;
|
|
61
|
+
export type StoredSignalDrain = {
|
|
62
|
+
signals: CreatedAgentSignal[];
|
|
63
|
+
/** Workflow state to save together with the transcript that holds `signals`. */
|
|
64
|
+
state: {
|
|
65
|
+
[CONSUMED_SIGNAL_IDS_KEY]: string[];
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* One drain of a storage-backed run: claim the thread's pending rows and get
|
|
70
|
+
* back every taken row of the thread that the run's saved state doesn't list
|
|
71
|
+
* as consumed. A step that fails before saving its result gets the same rows
|
|
72
|
+
* again from its retry, except a row saved into the thread inside that step,
|
|
73
|
+
* and a step that saved its result never gets them again.
|
|
74
|
+
*/
|
|
75
|
+
export declare function claimStoredSignals({ queue: { store, threadId }, runId, consumed, logger, }: {
|
|
76
|
+
queue: ThreadSignalsStore;
|
|
77
|
+
runId: string;
|
|
78
|
+
consumed: readonly string[];
|
|
79
|
+
logger?: IMastraLogger;
|
|
80
|
+
}): Promise<StoredSignalDrain>;
|
|
81
|
+
/**
|
|
82
|
+
* The drain of a storage-backed run at one site: `undefined` when the run's
|
|
83
|
+
* signals are not stored, `drain()` resolves `undefined` when the store could
|
|
84
|
+
* not be resolved or a read failed, so the saved consumed set stays as it is.
|
|
85
|
+
* A failed claim takes nothing, as the loop's other drain points do: the rows
|
|
86
|
+
* come back at the next drain. A claim that was written while its answer
|
|
87
|
+
* failed leaves the rows claimed by this run, so a cancel no longer finds
|
|
88
|
+
* them, and the run's next drain returns them because their ids are not in
|
|
89
|
+
* its consumed set. It does not check for an abort; callers check
|
|
90
|
+
* before calling it.
|
|
91
|
+
*/
|
|
92
|
+
export declare function storedSignalDrain({ mastra, runId, input, requestContext, getState, }: {
|
|
93
|
+
mastra: Mastra | undefined;
|
|
94
|
+
runId: string;
|
|
95
|
+
input: DurableRunInput | undefined;
|
|
96
|
+
requestContext?: RequestContext;
|
|
97
|
+
getState: (keys: readonly string[]) => Promise<unknown>;
|
|
98
|
+
}): (() => Promise<StoredSignalDrain | undefined>) | undefined;
|
|
99
|
+
export {};
|
|
100
|
+
//# sourceMappingURL=stored-signal-drain.d.ts.map
|
|
@@ -33,6 +33,7 @@ import type { AIV5ResponseMessage, MessageList } from '../message-list/index.js'
|
|
|
33
33
|
import type { SerializedMessageListState } from '../message-list/state/index.js';
|
|
34
34
|
import type { SaveQueueManager } from '../save-queue/index.js';
|
|
35
35
|
import type { PendingSignalListener, AgentSignalInput, CreatedAgentSignal } from '../signals.js';
|
|
36
|
+
import type { ThreadSignalsStore } from '../stored-signals.js';
|
|
36
37
|
import type { AgentStreamsConfig } from '../streams/types.js';
|
|
37
38
|
import type { TripwireData } from '../trip-wire.js';
|
|
38
39
|
import type { AgentMethodType, GoalConfig, StructuredOutputOptions, ToolsInput } from '../types.js';
|
|
@@ -322,6 +323,14 @@ export interface DurableAgenticWorkflowInput {
|
|
|
322
323
|
agentId: string;
|
|
323
324
|
/** Agent name for logging/tracing */
|
|
324
325
|
agentName?: string;
|
|
326
|
+
/**
|
|
327
|
+
* Whether signals sent to this run are kept in the messages table of its
|
|
328
|
+
* memory storage rather than in the starting process's memory. Decided once
|
|
329
|
+
* when the run is prepared, so every process that executes its steps reads
|
|
330
|
+
* the same place senders write to. Absent on runs that keep them in memory.
|
|
331
|
+
* @internal
|
|
332
|
+
*/
|
|
333
|
+
signalsStored?: boolean;
|
|
325
334
|
/**
|
|
326
335
|
* Exact stored version id the run resolved to at start time. A run that
|
|
327
336
|
* suspends while executing a stored version must resume on *that* version —
|
|
@@ -987,6 +996,28 @@ export interface RunRegistryEntry {
|
|
|
987
996
|
subscribePendingSignals?: (listener: PendingSignalListener) => () => void;
|
|
988
997
|
/** Releases the latest LLM step's pending-signal listener, whichever way that step exited. */
|
|
989
998
|
stopStepSignalListener?: () => void;
|
|
999
|
+
/**
|
|
1000
|
+
* Interrupts the latest LLM step's model request the way its pending-signal
|
|
1001
|
+
* listener does. Set for runs that keep their signals in storage: a signal a
|
|
1002
|
+
* processor stores for such a run reaches no queue listener. Cleared when
|
|
1003
|
+
* that step ends.
|
|
1004
|
+
* @internal
|
|
1005
|
+
*/
|
|
1006
|
+
interruptStepForSignals?: PendingSignalListener;
|
|
1007
|
+
/**
|
|
1008
|
+
* Hears `signal-available` hints for the latest LLM step of a run that keeps
|
|
1009
|
+
* its signals in storage, from whichever process stored them. Cleared when
|
|
1010
|
+
* that step ends.
|
|
1011
|
+
* @internal
|
|
1012
|
+
*/
|
|
1013
|
+
onSignalAvailable?: (signalId: string) => void;
|
|
1014
|
+
/**
|
|
1015
|
+
* Where this process reads and settles the signals of a run that keeps them
|
|
1016
|
+
* in memory storage, once resolved: set by preparation, or by the first
|
|
1017
|
+
* resolution that succeeded. See `durableRunSignalsStore`.
|
|
1018
|
+
* @internal
|
|
1019
|
+
*/
|
|
1020
|
+
pendingSignalsStore?: ThreadSignalsStore;
|
|
990
1021
|
/**
|
|
991
1022
|
* Thread title generation closure — mirrors the non-durable `#executeOnFinish`
|
|
992
1023
|
* title-generation branch, which was never ported to the durable finish step
|
|
@@ -1056,6 +1087,12 @@ export interface RunRegistryEntry {
|
|
|
1056
1087
|
timeoutTotalMs?: number;
|
|
1057
1088
|
/** A late subscriber re-publishes the winning deadline error at most once per segment. */
|
|
1058
1089
|
deadlineErrorRedelivered?: boolean;
|
|
1090
|
+
/**
|
|
1091
|
+
* Set once this process's total deadline is going to close the run's stored signals with the transcript it saves.
|
|
1092
|
+
* The run's other endings then leave the close to it.
|
|
1093
|
+
* @internal
|
|
1094
|
+
*/
|
|
1095
|
+
deadlineClosesStoredSignals?: boolean;
|
|
1059
1096
|
/**
|
|
1060
1097
|
* This process's subscription to cross-process abort requests for the run.
|
|
1061
1098
|
* Set by `ensureRemoteAbortListener`, which every durable step calls on
|
|
@@ -94,6 +94,17 @@ export declare class DurableProcessorRebuildError extends Error {
|
|
|
94
94
|
export declare class DurableAgentNotFoundError extends Error {
|
|
95
95
|
constructor(agentId: string, runId: string, cause?: unknown);
|
|
96
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* The memory of a run on this process: the registry entry's when this process
|
|
99
|
+
* prepared or rebuilt the run, else the agent's, resolved with the request
|
|
100
|
+
* context entries the run carries, as {@link resolveRuntimeDependencies} does.
|
|
101
|
+
*/
|
|
102
|
+
export declare function resolveRunMemory(options: {
|
|
103
|
+
mastra: Mastra;
|
|
104
|
+
runId: string;
|
|
105
|
+
input: Pick<DurableAgenticWorkflowInput, 'agentId' | 'agentVersionId' | 'requestContextEntries'>;
|
|
106
|
+
requestContext?: RequestContext;
|
|
107
|
+
}): Promise<MastraMemory | undefined>;
|
|
97
108
|
/**
|
|
98
109
|
* Resolve all runtime dependencies needed for durable step execution.
|
|
99
110
|
*
|
|
@@ -15,6 +15,7 @@ export declare function createDurableAgenticWorkflow(options?: DurableAgenticWor
|
|
|
15
15
|
runId: string;
|
|
16
16
|
agentId: string;
|
|
17
17
|
agentName?: string | undefined;
|
|
18
|
+
signalsStored?: boolean | undefined;
|
|
18
19
|
agentVersionId?: string | undefined;
|
|
19
20
|
messageListState: any;
|
|
20
21
|
toolsMetadata: any[];
|
|
@@ -128,6 +128,7 @@ export declare class DurableAgenticLoopBuilder extends BaseAgenticLoopBuilder {
|
|
|
128
128
|
agentId: string;
|
|
129
129
|
agentVersionId?: string | undefined;
|
|
130
130
|
agentName?: string | undefined;
|
|
131
|
+
signalsStored?: boolean | undefined;
|
|
131
132
|
messageListState: any;
|
|
132
133
|
initialUntaggedSystemMessages?: any[] | undefined;
|
|
133
134
|
toolsMetadata: any[];
|
|
@@ -402,6 +403,7 @@ export declare class DurableAgenticLoopBuilder extends BaseAgenticLoopBuilder {
|
|
|
402
403
|
runId: string;
|
|
403
404
|
agentId: string;
|
|
404
405
|
agentName?: string | undefined;
|
|
406
|
+
signalsStored?: boolean | undefined;
|
|
405
407
|
messageListState?: any;
|
|
406
408
|
initialUntaggedSystemMessages?: any[] | undefined;
|
|
407
409
|
toolsMetadata: any[];
|
|
@@ -462,6 +464,7 @@ export declare class DurableAgenticLoopBuilder extends BaseAgenticLoopBuilder {
|
|
|
462
464
|
runId: string;
|
|
463
465
|
agentId: string;
|
|
464
466
|
agentName?: string | undefined;
|
|
467
|
+
signalsStored?: boolean | undefined;
|
|
465
468
|
messageListState?: any;
|
|
466
469
|
initialUntaggedSystemMessages?: any[] | undefined;
|
|
467
470
|
toolsMetadata: any[];
|
|
@@ -522,6 +525,7 @@ export declare class DurableAgenticLoopBuilder extends BaseAgenticLoopBuilder {
|
|
|
522
525
|
runId: string;
|
|
523
526
|
agentId: string;
|
|
524
527
|
agentName?: string | undefined;
|
|
528
|
+
signalsStored?: boolean | undefined;
|
|
525
529
|
messageListState?: any;
|
|
526
530
|
initialUntaggedSystemMessages?: any[] | undefined;
|
|
527
531
|
toolsMetadata: any[];
|
|
@@ -596,6 +600,7 @@ export declare class DurableAgenticLoopBuilder extends BaseAgenticLoopBuilder {
|
|
|
596
600
|
runId: string;
|
|
597
601
|
agentId: string;
|
|
598
602
|
agentName?: string | undefined;
|
|
603
|
+
signalsStored?: boolean | undefined;
|
|
599
604
|
agentVersionId?: string | undefined;
|
|
600
605
|
messageListState: any;
|
|
601
606
|
toolsMetadata: any[];
|
|
@@ -82,6 +82,12 @@ export declare function deadlineMessageListState(entry: RunRegistryEntry, fallba
|
|
|
82
82
|
messageListState: SerializedMessageListState;
|
|
83
83
|
cutOffText?: string;
|
|
84
84
|
};
|
|
85
|
+
/**
|
|
86
|
+
* The ids of the signals a transcript holds: a signal's message id is its signal id. A total deadline closes a run
|
|
87
|
+
* that stores its signals with the ids of the transcript it saves, so exactly the signals that reach memory are
|
|
88
|
+
* deleted and the run's other rows are left to the thread's next run.
|
|
89
|
+
*/
|
|
90
|
+
export declare function transcriptSignalIds(messageListState: SerializedMessageListState): string[];
|
|
85
91
|
/**
|
|
86
92
|
* Give the output processors (and with them memory) their one pass when a total deadline ends a
|
|
87
93
|
* durable run. The run never reaches its finish step, so this runs over what the deadline saves
|
|
@@ -39,8 +39,11 @@ export declare function readMessageListState(params: TranscriptParams, stepPaylo
|
|
|
39
39
|
* Stores an updated transcript where this run keeps it. Returns the fields to
|
|
40
40
|
* spread into the step output: nothing when it went to workflow state,
|
|
41
41
|
* `{ messageListState }` when the run threads it through step payloads.
|
|
42
|
+
*
|
|
43
|
+
* `extraState` goes to workflow state in the same write, for values that must
|
|
44
|
+
* be saved together with the transcript they describe.
|
|
42
45
|
*/
|
|
43
|
-
export declare function storeMessageListState(params: WritableTranscriptParams, messageListState: SerializedMessageListState): Promise<MessageListStateCarrier>;
|
|
46
|
+
export declare function storeMessageListState(params: WritableTranscriptParams, messageListState: SerializedMessageListState, extraState?: Record<string, unknown>): Promise<MessageListStateCarrier>;
|
|
44
47
|
/**
|
|
45
48
|
* The transcript for code that reads and rewrites it in place across several
|
|
46
49
|
* phases (the continuation predicate): restored once up front, then `write`
|
|
@@ -48,7 +51,8 @@ export declare function storeMessageListState(params: WritableTranscriptParams,
|
|
|
48
51
|
*/
|
|
49
52
|
export declare function openMessageListState(params: TranscriptParams, stepPayload: MessageListStateCarrier): Promise<{
|
|
50
53
|
read(): SerializedMessageListState;
|
|
51
|
-
|
|
54
|
+
/** `extraState` lands in workflow state with the transcript, as in {@link storeMessageListState}. */
|
|
55
|
+
write(next: SerializedMessageListState, extraState?: Record<string, unknown>): void;
|
|
52
56
|
}>;
|
|
53
57
|
/** Test hook: replaces the waits between mid-run load retries. Returns a restore function. */
|
|
54
58
|
export declare function __setMidRunLoadRetryDelaysForTests(delays: readonly number[]): () => void;
|
|
@@ -96,6 +96,7 @@ export declare const baseDurableAgenticInputSchema: z.ZodObject<{
|
|
|
96
96
|
runId: z.ZodString;
|
|
97
97
|
agentId: z.ZodString;
|
|
98
98
|
agentName: z.ZodOptional<z.ZodString>;
|
|
99
|
+
signalsStored: z.ZodOptional<z.ZodBoolean>;
|
|
99
100
|
messageListState: z.ZodAny;
|
|
100
101
|
toolsMetadata: z.ZodArray<z.ZodAny>;
|
|
101
102
|
modelConfig: z.ZodObject<{
|
|
@@ -123,6 +124,7 @@ export declare const baseIterationStateSchema: z.ZodObject<{
|
|
|
123
124
|
runId: z.ZodString;
|
|
124
125
|
agentId: z.ZodString;
|
|
125
126
|
agentName: z.ZodOptional<z.ZodString>;
|
|
127
|
+
signalsStored: z.ZodOptional<z.ZodBoolean>;
|
|
126
128
|
messageListState: z.ZodOptional<z.ZodAny>;
|
|
127
129
|
initialUntaggedSystemMessages: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
128
130
|
toolsMetadata: z.ZodArray<z.ZodAny>;
|
|
@@ -24,6 +24,7 @@ export declare function createDurableLLMExecutionStep(_options?: DurableLLMExecu
|
|
|
24
24
|
agentId: string;
|
|
25
25
|
agentVersionId?: string | undefined;
|
|
26
26
|
agentName?: string | undefined;
|
|
27
|
+
signalsStored?: boolean | undefined;
|
|
27
28
|
messageListState: any;
|
|
28
29
|
initialUntaggedSystemMessages?: any[] | undefined;
|
|
29
30
|
toolsMetadata: any[];
|
package/dist/agent/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_run_registry = require("../run-registry-
|
|
3
|
-
const require_stream = require("../stream-
|
|
2
|
+
const require_run_registry = require("../run-registry-DOlZccsr.cjs");
|
|
3
|
+
const require_stream = require("../stream-aGuW9AL8.cjs");
|
|
4
4
|
const require_message_list = require("../message-list-C0F2sDNC.cjs");
|
|
5
5
|
const require_signals = require("../signals-CWxAMEmE.cjs");
|
|
6
6
|
const require_to_prompt = require("../to-prompt-CG-LyaBY.cjs");
|
package/dist/agent/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as agentInstructions, F as Agent, Lt as DEFAULT_TOOL_DECLINE_REASON, M as MAX_FS_SUBAGENT_DEPTH, N as mergeAgentPersona, P as AGENT_RESUME_CLAIM_STALE_MS, Rl as hasResumableStreams, Rt as resolveDeclineReason, Us as getGoalActivityDurationMs, au as isAgentCompatible, j as assembleAgentFromFsEntry, k as agentConfig, zl as isDurableAgentLike } from "../run-registry-
|
|
2
|
-
import { dn as resolveSuspendedToolRunId, fn as resolveThreadIdFromArgs, hn as tryStreamWithJsonFallback, l as TripWire, mn as tryGenerateWithJsonFallback, pn as supportedLanguageModelSpecifications, un as isSupportedLanguageModel } from "../stream-
|
|
1
|
+
import { A as agentInstructions, F as Agent, Lt as DEFAULT_TOOL_DECLINE_REASON, M as MAX_FS_SUBAGENT_DEPTH, N as mergeAgentPersona, P as AGENT_RESUME_CLAIM_STALE_MS, Rl as hasResumableStreams, Rt as resolveDeclineReason, Us as getGoalActivityDurationMs, au as isAgentCompatible, j as assembleAgentFromFsEntry, k as agentConfig, zl as isDurableAgentLike } from "../run-registry-sTm40Ecv.js";
|
|
2
|
+
import { dn as resolveSuspendedToolRunId, fn as resolveThreadIdFromArgs, hn as tryStreamWithJsonFallback, l as TripWire, mn as tryGenerateWithJsonFallback, pn as supportedLanguageModelSpecifications, un as isSupportedLanguageModel } from "../stream-k-Q1NLUs.js";
|
|
3
3
|
import { Q as TypeDetector, n as MessageList, t as convertMessages } from "../message-list-RgFlLrxG.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-CMlVGYxC.js";
|
package/dist/agent/signals.d.ts
CHANGED
|
@@ -68,9 +68,13 @@ export type AgentSignalInput = (AgentSignalInputBase & {
|
|
|
68
68
|
/**
|
|
69
69
|
* Whether this signal is transient. Defaults to `false`.
|
|
70
70
|
*
|
|
71
|
-
* A transient signal is delivered to the model for the current call
|
|
72
|
-
*
|
|
73
|
-
*
|
|
71
|
+
* A transient signal is delivered to the model for the current call, but it is never saved as a
|
|
72
|
+
* message of the conversation, so later turns don't find it in the history. When the run keeps
|
|
73
|
+
* its signals in memory storage, the signal waits there as a row that no read by thread or resource
|
|
74
|
+
* returns, and the row is deleted when the run that took it ends. One no run took waits for the
|
|
75
|
+
* thread's next turn. A run whose failure carries no saved progress, such as a step that runs out of
|
|
76
|
+
* deliveries with `storageVersion: 2`, gives back the signals it took, and the thread's next turn
|
|
77
|
+
* receives them again, so a transient signal can be seen twice. Re-send it each turn from a processor
|
|
74
78
|
* to keep a single fresh copy near the latest message instead of an accumulating history.
|
|
75
79
|
*
|
|
76
80
|
* Transient takes precedence over `persist` delivery behaviors: combining them means the
|