@mastra/core 1.87.0-alpha.11 → 1.87.0-alpha.13
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/a2a/index.cjs +1 -1
- package/dist/a2a/index.js +1 -1
- 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/run-registry.d.ts +2 -0
- package/dist/agent/durable/stored-signal-drain.d.ts +100 -0
- package/dist/agent/durable/types.d.ts +43 -0
- package/dist/agent/durable/utils/resolve-runtime.d.ts +16 -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 +3 -3
- package/dist/agent/index.js +3 -3
- package/dist/agent/message-list/index.cjs +1 -1
- package/dist/agent/message-list/index.js +1 -1
- package/dist/agent/message-list/state/MessageStateManager.d.ts +5 -0
- 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-DKI-d-np.cjs → agent-controller-DDxEG9Nd.cjs} +29 -200
- package/dist/{agent-controller-BrRzZy4-.js → agent-controller-DYwtbG2-.js} +29 -200
- 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-CDP3Pgeu.js → background-tasks-B8Lk1bt5.js} +239 -28
- package/dist/{background-tasks-CDgdfRmB.cjs → background-tasks-LfQsDG6J.cjs} +262 -27
- package/dist/browser/index.cjs +15 -6
- package/dist/browser/index.js +15 -6
- package/dist/browser/processor.d.ts +1 -0
- package/dist/{builder-Bs4CtyqT.cjs → builder-CPgUrTDP.cjs} +2 -2
- package/dist/{builder-DuT0Iqb5.js → builder-DLaSPG2u.js} +2 -2
- package/dist/capabilities/302ai.json +203 -203
- package/dist/capabilities/abliteratedllm.json +38 -38
- package/dist/capabilities/abliteration-ai.json +9 -9
- package/dist/capabilities/above.json +25 -25
- package/dist/capabilities/adaption.json +11 -11
- package/dist/capabilities/adzuki.json +30 -30
- package/dist/capabilities/agentrouter.json +13 -13
- package/dist/capabilities/agnes.json +2 -2
- package/dist/capabilities/ai-router.json +9 -9
- package/dist/capabilities/aiand.json +25 -25
- package/dist/capabilities/aigrow.json +10 -10
- package/dist/capabilities/aimlapi.json +142 -142
- package/dist/capabilities/aixy.json +12 -12
- package/dist/capabilities/aki-io.json +15 -15
- package/dist/capabilities/alibaba-cn.json +132 -96
- package/dist/capabilities/alibaba-coding-plan-cn.json +4 -9
- package/dist/capabilities/alibaba-coding-plan.json +4 -9
- package/dist/capabilities/alibaba-token-plan-cn.json +46 -46
- package/dist/capabilities/alibaba-token-plan.json +47 -47
- package/dist/capabilities/alibaba.json +92 -66
- package/dist/capabilities/ambient.json +16 -16
- package/dist/capabilities/amd.json +6 -6
- package/dist/capabilities/anthropic.json +51 -51
- package/dist/capabilities/anyapi.json +19 -19
- package/dist/capabilities/apiko.json +4 -4
- package/dist/capabilities/arcee.json +10 -10
- package/dist/capabilities/augure.json +2 -2
- package/dist/capabilities/auriko.json +17 -17
- package/dist/capabilities/bailing.json +5 -5
- package/dist/capabilities/baseten.json +33 -33
- package/dist/capabilities/bee.json +3 -3
- package/dist/capabilities/berget.json +8 -8
- package/dist/capabilities/bothub.json +11 -11
- package/dist/capabilities/boundless.json +30 -30
- package/dist/capabilities/bumo.json +44 -44
- package/dist/capabilities/byteplus.json +28 -28
- package/dist/capabilities/cheapaimodel.json +6 -6
- package/dist/capabilities/cheapest-token.json +27 -27
- package/dist/capabilities/chutes.json +56 -8
- package/dist/capabilities/clarifai.json +2 -2
- package/dist/capabilities/cline-pass.json +40 -40
- package/dist/capabilities/cloudcode.json +8 -8
- package/dist/capabilities/cloudferro-sherlock.json +4 -4
- package/dist/capabilities/cloudflare-workers-ai.json +18 -18
- package/dist/capabilities/commandcode.json +155 -155
- package/dist/capabilities/concentrate.json +283 -283
- package/dist/capabilities/cortecs.json +105 -105
- package/dist/capabilities/crossmodel.json +168 -168
- package/dist/capabilities/crusoe.json +14 -14
- package/dist/capabilities/daoxe.json +7 -7
- package/dist/capabilities/databricks.json +125 -125
- package/dist/capabilities/deepinfra.json +96 -96
- package/dist/capabilities/deepseek.json +2 -2
- package/dist/capabilities/digitalocean.json +114 -114
- package/dist/capabilities/dothoosh.json +31 -31
- package/dist/capabilities/doubleword.json +27 -27
- package/dist/capabilities/edenai.json +276 -276
- package/dist/capabilities/empiriolabs.json +169 -169
- package/dist/capabilities/engy.json +26 -26
- package/dist/capabilities/entrim.json +8 -8
- package/dist/capabilities/evroc.json +18 -18
- package/dist/capabilities/ezkielyna.json +2 -2
- package/dist/capabilities/fastrouter.json +88 -88
- package/dist/capabilities/fireworks-ai.json +90 -90
- package/dist/capabilities/freemodel.json +25 -25
- package/dist/capabilities/friendli.json +8 -8
- package/dist/capabilities/frogbot.json +97 -97
- package/dist/capabilities/gisoo.json +18 -18
- package/dist/capabilities/gmicloud.json +16 -16
- package/dist/capabilities/google.json +56 -56
- package/dist/capabilities/graphn.json +15 -15
- package/dist/capabilities/greenpt.json +32 -32
- package/dist/capabilities/groq.json +8 -8
- package/dist/capabilities/helicone.json +84 -84
- package/dist/capabilities/hetzner.json +4 -4
- package/dist/capabilities/hostinger-router.json +11 -18
- package/dist/capabilities/hpc-ai.json +15 -15
- package/dist/capabilities/huawei-maas.json +17 -17
- package/dist/capabilities/hubris.json +28 -28
- package/dist/capabilities/huggingface.json +86 -79
- package/dist/capabilities/hyper.json +22 -22
- package/dist/capabilities/impossibl.json +135 -135
- 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 +12 -12
- package/dist/capabilities/inferall.json +12 -12
- package/dist/capabilities/inference-coop.json +9 -9
- package/dist/capabilities/inferenceapis.json +22 -22
- package/dist/capabilities/inferris.json +4 -4
- package/dist/capabilities/infersia.json +6 -6
- package/dist/capabilities/infomaniak.json +4 -4
- package/dist/capabilities/io-net.json +4 -4
- package/dist/capabilities/iteracompute.json +53 -53
- package/dist/capabilities/jad-ai.json +3 -3
- package/dist/capabilities/jalapeno.json +9 -9
- package/dist/capabilities/jiekou.json +65 -65
- package/dist/capabilities/joingonka.json +4 -4
- package/dist/capabilities/jzstoken.json +54 -54
- package/dist/capabilities/keln.json +25 -25
- package/dist/capabilities/kenari.json +152 -119
- package/dist/capabilities/kilo.json +609 -625
- 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 +24 -24
- package/dist/capabilities/korouter.json +34 -34
- package/dist/capabilities/kunavo.json +4 -4
- package/dist/capabilities/liquid.json +13 -13
- package/dist/capabilities/lithosai.json +2 -2
- package/dist/capabilities/llmgateway-providers.json +920 -928
- package/dist/capabilities/llmgateway.json +343 -335
- package/dist/capabilities/llmtr.json +25 -25
- package/dist/capabilities/logits.json +2 -2
- package/dist/capabilities/lowrouter.json +55 -55
- package/dist/capabilities/lyceum.json +15 -15
- package/dist/capabilities/melious.json +15 -15
- package/dist/capabilities/merge-gateway.json +298 -298
- package/dist/capabilities/meta.json +11 -11
- 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 +20 -20
- package/dist/capabilities/mixlayer.json +5 -5
- package/dist/capabilities/modal.json +10 -10
- package/dist/capabilities/model-oracle-ai.json +27 -27
- package/dist/capabilities/modelis.json +11 -11
- package/dist/capabilities/modelscope.json +2 -2
- package/dist/capabilities/modular.json +13 -13
- package/dist/capabilities/moneo.json +15 -15
- package/dist/capabilities/moonshotai-cn.json +6 -6
- package/dist/capabilities/moonshotai.json +6 -6
- package/dist/capabilities/morph.json +14 -14
- package/dist/capabilities/munito-eu.json +8 -8
- package/dist/capabilities/munito.json +10 -10
- package/dist/capabilities/nan.json +30 -30
- package/dist/capabilities/nano-gpt.json +573 -573
- package/dist/capabilities/nearai.json +81 -81
- package/dist/capabilities/nebius.json +34 -34
- package/dist/capabilities/neon.json +131 -131
- package/dist/capabilities/neuralwatt.json +40 -40
- package/dist/capabilities/novita-ai.json +154 -154
- package/dist/capabilities/nvidia.json +42 -42
- package/dist/capabilities/oathbreaker.json +3 -3
- package/dist/capabilities/obscurify.json +26 -26
- package/dist/capabilities/oci.json +9 -9
- package/dist/capabilities/ofox.json +186 -550
- package/dist/capabilities/ollama-cloud.json +53 -53
- package/dist/capabilities/openai.json +57 -57
- package/dist/capabilities/opencode-go.json +84 -82
- package/dist/capabilities/openreason.json +5 -5
- package/dist/capabilities/openrouter.json +542 -556
- package/dist/capabilities/opper.json +27 -27
- package/dist/capabilities/orcarouter.json +491 -233
- package/dist/capabilities/outerlabs.json +31 -31
- package/dist/capabilities/ovhcloud.json +20 -21
- package/dist/capabilities/pareto.json +6 -6
- package/dist/capabilities/perplexity-agent.json +61 -61
- package/dist/capabilities/phala.json +33 -33
- package/dist/capabilities/pioneer.json +33 -33
- package/dist/capabilities/poe.json +138 -138
- package/dist/capabilities/powerspring.json +12 -12
- package/dist/capabilities/primalabs.json +10 -10
- package/dist/capabilities/prime.json +120 -120
- package/dist/capabilities/privatemode-ai.json +13 -13
- package/dist/capabilities/proxystacks.json +3 -3
- package/dist/capabilities/qiniu-ai.json +13 -13
- package/dist/capabilities/refuseless.json +7 -7
- package/dist/capabilities/regolo-ai.json +9 -9
- package/dist/capabilities/requesty.json +203 -203
- package/dist/capabilities/ruapi.json +22 -22
- package/dist/capabilities/runcrate.json +13 -13
- package/dist/capabilities/runinfra.json +13 -13
- package/dist/capabilities/sakana.json +6 -6
- package/dist/capabilities/sambanova.json +5 -5
- package/dist/capabilities/sandbase.json +17 -17
- package/dist/capabilities/sarvam.json +11 -11
- package/dist/capabilities/scaleway.json +18 -18
- package/dist/capabilities/scnet-token-plan.json +9 -9
- package/dist/capabilities/scx-ai.json +28 -28
- package/dist/capabilities/sensenova.json +8 -8
- package/dist/capabilities/siliconflow-cn.json +61 -61
- package/dist/capabilities/siliconflow.json +62 -62
- package/dist/capabilities/snowflake-cortex.json +25 -25
- package/dist/capabilities/sokkan.json +9 -9
- package/dist/capabilities/sparrowcodes.json +24 -24
- package/dist/capabilities/standardcompute.json +89 -89
- package/dist/capabilities/steadyrouter.json +40 -40
- package/dist/capabilities/stepfun-ai-step-plan.json +14 -8
- package/dist/capabilities/stepfun-ai.json +21 -7
- package/dist/capabilities/stepfun-step-plan.json +14 -7
- package/dist/capabilities/stepfun.json +21 -7
- package/dist/capabilities/stepping-stone.json +14 -14
- package/dist/capabilities/subconscious.json +2 -2
- package/dist/capabilities/synthetic.json +12 -12
- package/dist/capabilities/synthorai.json +27 -27
- package/dist/capabilities/teamorouter.json +20 -20
- package/dist/capabilities/teapot-router.json +16 -16
- package/dist/capabilities/tencent-token-plan-intl.json +22 -22
- package/dist/capabilities/tencent-token-plan.json +44 -44
- package/dist/capabilities/tencent-tokenhub.json +46 -46
- package/dist/capabilities/tensorx.json +38 -38
- package/dist/capabilities/tenstorrent.json +8 -8
- package/dist/capabilities/the-grid-ai.json +33 -33
- package/dist/capabilities/thinkingmachines.json +43 -43
- package/dist/capabilities/tinfoil.json +13 -13
- package/dist/capabilities/toapis.json +3 -3
- package/dist/capabilities/togetherai.json +49 -57
- package/dist/capabilities/tokengo.json +26 -26
- package/dist/capabilities/tokenify.json +10 -10
- package/dist/capabilities/trustedrouter.json +6 -6
- package/dist/capabilities/trustedtokens.json +18 -18
- package/dist/capabilities/umans-ai-coding-plan.json +17 -17
- package/dist/capabilities/umans-ai.json +14 -14
- package/dist/capabilities/unrestricted.json +6 -6
- package/dist/capabilities/uplinkswitch.json +20 -20
- package/dist/capabilities/upstage.json +4 -4
- package/dist/capabilities/vancine.json +23 -23
- package/dist/capabilities/vercel.json +537 -530
- package/dist/capabilities/verda.json +8 -1
- package/dist/capabilities/vivgrid.json +86 -86
- package/dist/capabilities/volcengine-coding-plan.json +23 -23
- package/dist/capabilities/volcengine.json +28 -28
- package/dist/capabilities/vultr.json +31 -31
- package/dist/capabilities/wafer.ai.json +14 -14
- package/dist/capabilities/wallaby.json +4 -4
- package/dist/capabilities/wally.json +12 -12
- package/dist/capabilities/wandb.json +21 -21
- package/dist/capabilities/watt.json +24 -24
- package/dist/capabilities/xai.json +7 -7
- package/dist/capabilities/xiaomi.json +2 -2
- package/dist/capabilities/xpersona.json +13 -13
- package/dist/capabilities/xxapi.json +30 -30
- package/dist/capabilities/zai-coding-plan.json +13 -13
- package/dist/capabilities/zai.json +30 -30
- package/dist/capabilities/zenifra.json +26 -26
- package/dist/capabilities/zenmux.json +170 -170
- package/dist/capabilities/zerogpu.json +13 -13
- package/dist/capabilities/zhipuai-coding-plan.json +8 -8
- package/dist/capabilities/zhipuai.json +28 -28
- package/dist/capabilities/zro.json +7 -7
- package/dist/channels/index.cjs +2 -2
- package/dist/channels/index.js +2 -2
- package/dist/{channels-CkRMEIQ6.js → channels-BPxJYR70.js} +1 -1
- package/dist/{channels-Bkd_v8M1.cjs → channels-DH9fKqmy.cjs} +1 -1
- package/dist/coding-agent/index.cjs +3 -3
- package/dist/coding-agent/index.js +3 -3
- 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 +844 -819
- 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 +1 -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 +7 -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-local-filesystem.md +1 -1
- package/dist/docs/references/reference-workspace-local-sandbox.md +1 -1
- package/dist/docs/references/reference.md +2 -0
- package/dist/evals/index.cjs +1 -1
- package/dist/evals/index.js +1 -1
- package/dist/evals/scoreTraces/index.cjs +1 -1
- package/dist/evals/scoreTraces/index.js +1 -1
- package/dist/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 +8246 -8257
- package/dist/llm/reasoning/anthropic-thinking.d.ts +5 -0
- package/dist/llm/reasoning/gemini-thinking.d.ts +24 -0
- package/dist/llm/reasoning/index.cjs +389 -0
- package/dist/llm/reasoning/index.d.ts +8 -0
- package/dist/llm/reasoning/index.js +362 -0
- package/dist/llm/reasoning/model-fallback.d.ts +75 -0
- package/dist/llm/reasoning/model-ids.d.ts +5 -0
- package/dist/llm/reasoning/thinking-provider-options.d.ts +10 -0
- package/dist/llm/reasoning/thinking-request.d.ts +14 -0
- package/dist/llm/reasoning/thinking.d.ts +37 -0
- package/dist/{llm-DFT5EKp4.js → llm-DGa7alUy.js} +2 -2
- package/dist/{llm-DAw2eouV.cjs → llm-DeOr7BXy.cjs} +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-hxzEe4U5.cjs → manager-B-pQMauy.cjs} +2 -2
- package/dist/{manager-DiDnvKLM.js → manager-BErWwr50.js} +2 -2
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.d.ts +2 -0
- package/dist/mastra/index.js +1 -1
- package/dist/{mastra-BPaPxG5t.js → mastra-B1BKkzX0.js} +23 -17
- package/dist/{mastra-1diaq68N.cjs → mastra-CoWxmLQl.cjs} +23 -17
- package/dist/memory/index.cjs +3 -3
- package/dist/memory/index.js +3 -3
- package/dist/memory/om-events/index.cjs +189 -0
- package/dist/memory/om-events/index.d.ts +17 -0
- package/dist/memory/om-events/index.js +188 -0
- package/dist/{message-list-vR3uLAHL.cjs → message-list-C0F2sDNC.cjs} +3 -2
- package/dist/{message-list-BGm1DCiG.js → message-list-RgFlLrxG.js} +3 -2
- package/dist/{model-CUBZjm0T.js → model-Bz3zffBv.js} +1 -1
- package/dist/{model-DSMHJM3c.cjs → model-CGH6nAvh.cjs} +1 -1
- package/dist/{netlify-D1BKjns0.js → netlify-CzbukKO2.js} +1 -1
- package/dist/{netlify-C21T9ozJ.cjs → netlify-D7oirBdu.cjs} +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-BAlFFX5o.js → provider-registry-CdCkSE3h.js} +22629 -22689
- package/dist/{provider-registry-ChojUVJa.cjs → provider-registry-DTaqnIYP.cjs} +22629 -22689
- package/dist/provider-registry.json +22764 -22828
- package/dist/{registry-generator-CAUL9Hek.cjs → registry-generator-CcgFsigf.cjs} +1 -1
- package/dist/{registry-generator-BbWSH6W4.js → registry-generator-Dbxm-MYh.js} +1 -1
- package/dist/{rehydrate-CzUnNFU6.js → rehydrate-BhmzzvtV.js} +2 -2
- package/dist/{rehydrate-0xSq47n9.cjs → rehydrate-D7eaaJxI.cjs} +2 -2
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +2 -2
- package/dist/{run-registry-CrTsH9iL.cjs → run-registry-59R9kE8Z.cjs} +4417 -1964
- package/dist/{run-registry-DJT02z_9.js → run-registry-Du22tS_D.js} +4418 -1965
- 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/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/workflows/base.d.ts +14 -0
- package/dist/storage/domains/workflows/inmemory.d.ts +4 -1
- package/dist/storage/index.cjs +8 -3
- package/dist/storage/index.js +4 -4
- package/dist/stream/base/output.d.ts +7 -0
- package/dist/stream/index.cjs +2 -2
- package/dist/stream/index.js +2 -2
- package/dist/{stream-CG9OooRx.js → stream-C_oNulbg.js} +88 -6
- package/dist/{stream-CMKRczs4.cjs → stream-mYc-fHPF.cjs} +123 -5
- 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-14o3Z1qo.cjs → tool-loop-agent-Bi09dOW5.cjs} +4 -4
- package/dist/{tool-loop-agent-Bi6z_q7o.js → tool-loop-agent-Du1BJO8a.js} +4 -4
- package/dist/{utils-DkvbP8EA.cjs → utils-BGq3p2MX.cjs} +1 -1
- package/dist/{utils-Fag7YDBU.js → utils-nyjsIsHZ.js} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{validate-Bhrlve2E.cjs → validate-CcE7gP2j.cjs} +1 -1
- package/dist/{validate-DLER0nlQ.js → validate-q0hhKzA4.js} +1 -1
- package/dist/vector/index.cjs +2 -2
- package/dist/vector/index.js +2 -2
- package/dist/worker/index.cjs +1 -1
- package/dist/worker/index.js +1 -1
- package/dist/{worker-D-em3hyS.js → worker-Dboi5I9k.js} +2 -2
- package/dist/{worker-0gczpztM.cjs → worker-DmJLbaGI.cjs} +2 -2
- package/dist/{worker-BwJyrFQN.cjs → worker-Dzfx-9D0.cjs} +2 -2
- package/dist/{worker-leYV1Y91.js → worker-Wv2nS-Df.js} +2 -2
- package/dist/{workflow-DWdcEcxw.cjs → workflow-BPf1-mkb.cjs} +25 -33
- package/dist/{workflow-FikHVwog.js → workflow-CFfCkulP.js} +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 +4 -4
- package/dist/workflows/index.js +4 -4
- package/dist/workflows/run-storage.d.ts +11 -2
- 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/sandbox/local-sandbox.d.ts +11 -0
- package/dist/workspace/sandbox/sandbox.d.ts +2 -0
- package/dist/{workspace-DOAil8mG.js → workspace-Ct2kAiDv.js} +224 -23
- package/dist/{workspace-C8Zo5_qK.cjs → workspace-CzzrnE6Q.cjs} +224 -23
- package/llm/reasoning.d.ts +1 -0
- package/memory/om-events.d.ts +1 -0
- package/package.json +25 -5
- package/src/llm/model/provider-types.generated.d.ts +8246 -8257
- package/dist/signals-B1JSj-Ew.cjs +0 -58
- package/dist/signals-De9VnwL2.js +0 -53
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
const require_run_registry = require("./run-registry-
|
|
2
|
-
const require_message_list = require("./message-list-
|
|
1
|
+
const require_run_registry = require("./run-registry-59R9kE8Z.cjs");
|
|
2
|
+
const require_message_list = require("./message-list-C0F2sDNC.cjs");
|
|
3
3
|
const require_signals = require("./signals-CWxAMEmE.cjs");
|
|
4
4
|
const require_ee_iTj2bRDt = require("./ee-iTj2bRDt-D3-QLGDF.cjs");
|
|
5
|
-
const require_channels = require("./channels-
|
|
6
|
-
const require_llm = require("./llm-
|
|
7
|
-
const require_mastra = require("./mastra-
|
|
8
|
-
const require_stream = require("./stream-
|
|
5
|
+
const require_channels = require("./channels-DH9fKqmy.cjs");
|
|
6
|
+
const require_llm = require("./llm-DeOr7BXy.cjs");
|
|
7
|
+
const require_mastra = require("./mastra-CoWxmLQl.cjs");
|
|
8
|
+
const require_stream = require("./stream-mYc-fHPF.cjs");
|
|
9
9
|
const require_request_context = require("./request-context-D9RXYCy8.cjs");
|
|
10
10
|
const require_dynamic_argument = require("./dynamic-argument-CUc1BBOS.cjs");
|
|
11
11
|
const require_error = require("./error-D90lJ6M7.cjs");
|
|
12
12
|
const require_utils_safe_stringify = require("./utils/safe-stringify.cjs");
|
|
13
|
-
const require_workspace = require("./workspace-
|
|
13
|
+
const require_workspace = require("./workspace-CzzrnE6Q.cjs");
|
|
14
14
|
const require_output_helpers = require("./output-helpers-DgsH4aTb.cjs");
|
|
15
|
-
const
|
|
15
|
+
const require_memory_om_events_index = require("./memory/om-events/index.cjs");
|
|
16
16
|
const require_tools = require("./tools-BEYxowf0.cjs");
|
|
17
|
+
const require_payload_transform = require("./payload-transform-CWgnsO9w.cjs");
|
|
17
18
|
const require_tool = require("./tool-CYlT2UA-.cjs");
|
|
18
19
|
const require_state_processor = require("./state-processor-kRNZ38Nf.cjs");
|
|
19
20
|
let zod_v4 = require("zod/v4");
|
|
@@ -357,9 +358,6 @@ function isProviderMetadata(value) {
|
|
|
357
358
|
function getString(value) {
|
|
358
359
|
return typeof value === "string" ? value : void 0;
|
|
359
360
|
}
|
|
360
|
-
function getNumber(value, fallback) {
|
|
361
|
-
return typeof value === "number" && Number.isFinite(value) ? value : fallback;
|
|
362
|
-
}
|
|
363
361
|
function getOptionalNumber(value) {
|
|
364
362
|
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
365
363
|
}
|
|
@@ -375,9 +373,6 @@ function getPayload(chunk) {
|
|
|
375
373
|
function getDataRecord(chunk) {
|
|
376
374
|
return "data" in chunk ? getRecord(chunk.data) : void 0;
|
|
377
375
|
}
|
|
378
|
-
function getNestedRecord(record, key) {
|
|
379
|
-
return record ? getRecord(record[key]) : void 0;
|
|
380
|
-
}
|
|
381
376
|
function isTaskCompletePayload(value) {
|
|
382
377
|
const record = getRecord(value);
|
|
383
378
|
return Boolean(record && typeof record.passed === "boolean" && Array.isArray(record.results));
|
|
@@ -389,13 +384,6 @@ function isGoalEvaluationPayload(value) {
|
|
|
389
384
|
function getOperationType(value) {
|
|
390
385
|
return value === "reflection" ? "reflection" : "observation";
|
|
391
386
|
}
|
|
392
|
-
function getActivationTrigger(value) {
|
|
393
|
-
if (value === "ttl" || value === "threshold" || value === "provider_change") return value;
|
|
394
|
-
}
|
|
395
|
-
function getOmStatus(value) {
|
|
396
|
-
if (value === "running" || value === "complete") return value;
|
|
397
|
-
return "idle";
|
|
398
|
-
}
|
|
399
387
|
function formatToolProgressOutput(progress) {
|
|
400
388
|
if (typeof progress === "string") return progress.endsWith("\n") ? progress : `${progress}\n`;
|
|
401
389
|
if (typeof progress !== "object" || progress === null) return `${String(progress)}\n`;
|
|
@@ -1258,161 +1246,31 @@ var SessionRunEngine = class {
|
|
|
1258
1246
|
});
|
|
1259
1247
|
break;
|
|
1260
1248
|
}
|
|
1261
|
-
case "data-om-status":
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
windows: {
|
|
1274
|
-
active: {
|
|
1275
|
-
messages: {
|
|
1276
|
-
tokens: getNumber(msgs?.tokens, 0),
|
|
1277
|
-
threshold: getNumber(msgs?.threshold, 0)
|
|
1278
|
-
},
|
|
1279
|
-
observations: {
|
|
1280
|
-
tokens: getNumber(obs?.tokens, 0),
|
|
1281
|
-
threshold: getNumber(obs?.threshold, 0)
|
|
1282
|
-
}
|
|
1283
|
-
},
|
|
1284
|
-
buffered: {
|
|
1285
|
-
observations: {
|
|
1286
|
-
status: getOmStatus(buffObs?.status),
|
|
1287
|
-
chunks: getNumber(buffObs?.chunks, 0),
|
|
1288
|
-
messageTokens: getNumber(buffObs?.messageTokens, 0),
|
|
1289
|
-
projectedMessageRemoval: getNumber(buffObs?.projectedMessageRemoval, 0),
|
|
1290
|
-
observationTokens: getNumber(buffObs?.observationTokens, 0)
|
|
1291
|
-
},
|
|
1292
|
-
reflection: {
|
|
1293
|
-
status: getOmStatus(buffRef?.status),
|
|
1294
|
-
inputObservationTokens: getNumber(buffRef?.inputObservationTokens, 0),
|
|
1295
|
-
observationTokens: getNumber(buffRef?.observationTokens, 0)
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
|
-
},
|
|
1299
|
-
recordId: getString(d.recordId) ?? "",
|
|
1300
|
-
threadId: getString(d.threadId) ?? "",
|
|
1301
|
-
stepNumber: getNumber(d.stepNumber, 0),
|
|
1302
|
-
generationCount: getNumber(d.generationCount, 0)
|
|
1303
|
-
});
|
|
1304
|
-
}
|
|
1305
|
-
break;
|
|
1306
|
-
}
|
|
1307
|
-
case "data-om-observation-start": {
|
|
1308
|
-
const payload = getDataRecord(chunk);
|
|
1309
|
-
const cycleId = getString(payload?.cycleId);
|
|
1310
|
-
if (payload && cycleId) {
|
|
1311
|
-
const operationType = getOperationType(payload.operationType);
|
|
1312
|
-
if (operationType === "observation") this.#session.emit({
|
|
1313
|
-
type: "om_observation_start",
|
|
1314
|
-
cycleId,
|
|
1315
|
-
operationType,
|
|
1316
|
-
tokensToObserve: getNumber(payload.tokensToObserve, 0)
|
|
1317
|
-
});
|
|
1318
|
-
else this.#session.emit({
|
|
1319
|
-
type: "om_reflection_start",
|
|
1320
|
-
cycleId,
|
|
1321
|
-
tokensToReflect: getNumber(payload.tokensToObserve, 0)
|
|
1322
|
-
});
|
|
1323
|
-
}
|
|
1324
|
-
break;
|
|
1325
|
-
}
|
|
1326
|
-
case "data-om-observation-end": {
|
|
1327
|
-
const payload = getDataRecord(chunk);
|
|
1328
|
-
const cycleId = getString(payload?.cycleId);
|
|
1329
|
-
if (payload && cycleId) {
|
|
1330
|
-
if (payload.operationType === "reflection") this.#session.emit({
|
|
1331
|
-
type: "om_reflection_end",
|
|
1332
|
-
cycleId,
|
|
1333
|
-
durationMs: getNumber(payload.durationMs, 0),
|
|
1334
|
-
compressedTokens: getNumber(payload.observationTokens, 0),
|
|
1335
|
-
observations: getString(payload.observations)
|
|
1336
|
-
});
|
|
1337
|
-
else this.#session.emit({
|
|
1338
|
-
type: "om_observation_end",
|
|
1339
|
-
cycleId,
|
|
1340
|
-
durationMs: getNumber(payload.durationMs, 0),
|
|
1341
|
-
tokensObserved: getNumber(payload.tokensObserved, 0),
|
|
1342
|
-
observationTokens: getNumber(payload.observationTokens, 0),
|
|
1343
|
-
observations: getString(payload.observations),
|
|
1344
|
-
currentTask: getString(payload.currentTask),
|
|
1345
|
-
suggestedResponse: getString(payload.suggestedResponse)
|
|
1346
|
-
});
|
|
1347
|
-
}
|
|
1348
|
-
break;
|
|
1349
|
-
}
|
|
1350
|
-
case "data-om-observation-failed": {
|
|
1351
|
-
const payload = getDataRecord(chunk);
|
|
1249
|
+
case "data-om-status":
|
|
1250
|
+
case "data-om-observation-start":
|
|
1251
|
+
case "data-om-observation-end":
|
|
1252
|
+
case "data-om-observation-failed":
|
|
1253
|
+
case "data-om-buffering-start":
|
|
1254
|
+
case "data-om-buffering-end":
|
|
1255
|
+
case "data-om-buffering-failed":
|
|
1256
|
+
case "data-om-activation":
|
|
1257
|
+
case "data-om-thread-update": {
|
|
1258
|
+
const event = require_memory_om_events_index.omEventFromChunk(chunk, this.#session.thread.getId() ?? void 0);
|
|
1259
|
+
if (event) this.#session.emit(event);
|
|
1260
|
+
const payload = chunk.type === "data-om-observation-failed" ? getDataRecord(chunk) : void 0;
|
|
1352
1261
|
if (payload) {
|
|
1353
1262
|
const operationType = getOperationType(payload.operationType);
|
|
1354
|
-
const error = getString(payload.error) ?? "Unknown error";
|
|
1355
|
-
if (operationType === "reflection") this.#session.emit({
|
|
1356
|
-
type: "om_reflection_failed",
|
|
1357
|
-
cycleId: getString(payload.cycleId) ?? "unknown",
|
|
1358
|
-
error,
|
|
1359
|
-
durationMs: getNumber(payload.durationMs, 0)
|
|
1360
|
-
});
|
|
1361
|
-
else this.#session.emit({
|
|
1362
|
-
type: "om_observation_failed",
|
|
1363
|
-
cycleId: getString(payload.cycleId) ?? "unknown",
|
|
1364
|
-
error,
|
|
1365
|
-
durationMs: getNumber(payload.durationMs, 0)
|
|
1366
|
-
});
|
|
1367
1263
|
if (!(Object.hasOwn(payload, "retrying") && payload.retrying === true) && (!Object.hasOwn(payload, "failurePolicy") || !Object.hasOwn(payload, "failureKind") || payload.failurePolicy !== "continue" || payload.failureKind !== (operationType === "reflection" ? "reflector-model" : "observer-model"))) {
|
|
1368
1264
|
this.abortForOmFailure({
|
|
1369
1265
|
operationType,
|
|
1370
1266
|
stage: "run",
|
|
1371
|
-
error
|
|
1267
|
+
error: getString(payload.error) ?? "Unknown error"
|
|
1372
1268
|
});
|
|
1373
1269
|
return { message: state.currentMessage };
|
|
1374
1270
|
}
|
|
1375
1271
|
}
|
|
1376
1272
|
break;
|
|
1377
1273
|
}
|
|
1378
|
-
case "data-om-buffering-start": {
|
|
1379
|
-
const payload = getDataRecord(chunk);
|
|
1380
|
-
const cycleId = getString(payload?.cycleId);
|
|
1381
|
-
if (payload && cycleId) this.#session.emit({
|
|
1382
|
-
type: "om_buffering_start",
|
|
1383
|
-
cycleId,
|
|
1384
|
-
operationType: getOperationType(payload.operationType),
|
|
1385
|
-
tokensToBuffer: getNumber(payload.tokensToBuffer, 0)
|
|
1386
|
-
});
|
|
1387
|
-
break;
|
|
1388
|
-
}
|
|
1389
|
-
case "data-om-buffering-end": {
|
|
1390
|
-
const payload = getDataRecord(chunk);
|
|
1391
|
-
const cycleId = getString(payload?.cycleId);
|
|
1392
|
-
if (payload && cycleId) this.#session.emit({
|
|
1393
|
-
type: "om_buffering_end",
|
|
1394
|
-
cycleId,
|
|
1395
|
-
operationType: getOperationType(payload.operationType),
|
|
1396
|
-
tokensBuffered: getNumber(payload.tokensBuffered, 0),
|
|
1397
|
-
bufferedTokens: getNumber(payload.bufferedTokens, 0),
|
|
1398
|
-
observations: getString(payload.observations)
|
|
1399
|
-
});
|
|
1400
|
-
break;
|
|
1401
|
-
}
|
|
1402
|
-
case "data-om-buffering-failed": {
|
|
1403
|
-
const payload = getDataRecord(chunk);
|
|
1404
|
-
if (payload) {
|
|
1405
|
-
const operationType = getOperationType(payload.operationType);
|
|
1406
|
-
const error = getString(payload.error) ?? "Unknown error";
|
|
1407
|
-
this.#session.emit({
|
|
1408
|
-
type: "om_buffering_failed",
|
|
1409
|
-
cycleId: getString(payload.cycleId) ?? "unknown",
|
|
1410
|
-
operationType,
|
|
1411
|
-
error
|
|
1412
|
-
});
|
|
1413
|
-
}
|
|
1414
|
-
break;
|
|
1415
|
-
}
|
|
1416
1274
|
case "data-signal": {
|
|
1417
1275
|
const payload = getDataRecord(chunk);
|
|
1418
1276
|
if (payload) {
|
|
@@ -1459,39 +1317,6 @@ var SessionRunEngine = class {
|
|
|
1459
1317
|
}
|
|
1460
1318
|
break;
|
|
1461
1319
|
}
|
|
1462
|
-
case "data-om-activation": {
|
|
1463
|
-
const payload = getDataRecord(chunk);
|
|
1464
|
-
const cycleId = getString(payload?.cycleId);
|
|
1465
|
-
if (payload && cycleId) this.#session.emit({
|
|
1466
|
-
type: "om_activation",
|
|
1467
|
-
cycleId,
|
|
1468
|
-
operationType: getOperationType(payload.operationType),
|
|
1469
|
-
chunksActivated: getNumber(payload.chunksActivated, 0),
|
|
1470
|
-
tokensActivated: getNumber(payload.tokensActivated, 0),
|
|
1471
|
-
observationTokens: getNumber(payload.observationTokens, 0),
|
|
1472
|
-
messagesActivated: getNumber(payload.messagesActivated, 0),
|
|
1473
|
-
generationCount: getNumber(payload.generationCount, 0),
|
|
1474
|
-
triggeredBy: getActivationTrigger(payload.triggeredBy),
|
|
1475
|
-
lastActivityAt: getOptionalNumber(payload.lastActivityAt),
|
|
1476
|
-
ttlExpiredMs: getOptionalNumber(payload.ttlExpiredMs),
|
|
1477
|
-
activateAfterIdle: getOptionalNumber(getRecord(payload.config)?.activateAfterIdle),
|
|
1478
|
-
previousModel: getString(payload.previousModel),
|
|
1479
|
-
currentModel: getString(payload.currentModel)
|
|
1480
|
-
});
|
|
1481
|
-
break;
|
|
1482
|
-
}
|
|
1483
|
-
case "data-om-thread-update": {
|
|
1484
|
-
const payload = getDataRecord(chunk);
|
|
1485
|
-
const newTitle = getString(payload?.newTitle);
|
|
1486
|
-
if (payload && newTitle) this.#session.emit({
|
|
1487
|
-
type: "om_thread_title_updated",
|
|
1488
|
-
cycleId: getString(payload.cycleId) ?? "unknown",
|
|
1489
|
-
threadId: getString(payload.threadId) ?? this.#session.thread.getId() ?? "unknown",
|
|
1490
|
-
oldTitle: getString(payload.oldTitle),
|
|
1491
|
-
newTitle
|
|
1492
|
-
});
|
|
1493
|
-
break;
|
|
1494
|
-
}
|
|
1495
1320
|
case "data-mastracode-tool-progress": {
|
|
1496
1321
|
const d = chunk.data;
|
|
1497
1322
|
if (d?.toolCallId && d?.progress !== void 0) {
|
|
@@ -1812,7 +1637,7 @@ var SessionRunEngine = class {
|
|
|
1812
1637
|
const abortedRunId = this.#session.stream.abortedRunId({ subscription });
|
|
1813
1638
|
if (runId && runId === abortedRunId) continue;
|
|
1814
1639
|
if (runId && abortedRunId) this.#session.stream.clearAbortedRun();
|
|
1815
|
-
if (!currentRun) {
|
|
1640
|
+
if (!currentRun || !requestContext) {
|
|
1816
1641
|
currentRun = this.createStreamState(threadId, resourceId);
|
|
1817
1642
|
this.#session.run.nextOperation();
|
|
1818
1643
|
this.#session.run.ensureAbortController();
|
|
@@ -1855,6 +1680,7 @@ var SessionRunEngine = class {
|
|
|
1855
1680
|
abortReason: aborted ? getString(getRecord(chunk.payload)?.reason) : void 0
|
|
1856
1681
|
});
|
|
1857
1682
|
currentRun = void 0;
|
|
1683
|
+
requestContext = void 0;
|
|
1858
1684
|
if (aborted) this.#session.stream.markAbortedRun({
|
|
1859
1685
|
subscription,
|
|
1860
1686
|
runId: runId ?? null
|
|
@@ -1863,6 +1689,7 @@ var SessionRunEngine = class {
|
|
|
1863
1689
|
} catch (error) {
|
|
1864
1690
|
await this.handleSubscribedStreamError(error, resourceId, threadId);
|
|
1865
1691
|
currentRun = void 0;
|
|
1692
|
+
requestContext = void 0;
|
|
1866
1693
|
}
|
|
1867
1694
|
}
|
|
1868
1695
|
};
|
|
@@ -7549,7 +7376,7 @@ const FABLE_FALLBACK_MODEL = "claude-opus-4-8";
|
|
|
7549
7376
|
* capped and ends with `reason:"complete"` after a few steps — the agent stops
|
|
7550
7377
|
* mid-task even though it promised to continue. See {@link buildSharedRunOptions}.
|
|
7551
7378
|
*/
|
|
7552
|
-
const
|
|
7379
|
+
const DEFAULT_CONTROLLER_MAX_STEPS = 1e3;
|
|
7553
7380
|
/**
|
|
7554
7381
|
* Returns Anthropic `providerOptions` that enable a server-side fallback to
|
|
7555
7382
|
* {@link FABLE_FALLBACK_MODEL} when the active model is `claude-fable-5`, and
|
|
@@ -8332,6 +8159,7 @@ var AgentController = class {
|
|
|
8332
8159
|
...this.config.observability ? { observability: this.config.observability } : {},
|
|
8333
8160
|
...gateways ? { gateways } : {}
|
|
8334
8161
|
});
|
|
8162
|
+
this.#internalMastra.__setStandaloneAgentController(this);
|
|
8335
8163
|
await this.#internalMastra.getStorage().init();
|
|
8336
8164
|
} else if (this.#externalMastra) await this.#externalMastra.getStorage()?.init();
|
|
8337
8165
|
}
|
|
@@ -9162,7 +8990,7 @@ var AgentController = class {
|
|
|
9162
8990
|
const isYolo = session.state.get().yolo === true;
|
|
9163
8991
|
const channelAutoApprove = this.#channels?.__isAutoApproveResource(context?.resourceId ?? session.identity.getResourceId()) === true;
|
|
9164
8992
|
const shared = {
|
|
9165
|
-
maxSteps:
|
|
8993
|
+
maxSteps: this.config.maxSteps ?? DEFAULT_CONTROLLER_MAX_STEPS,
|
|
9166
8994
|
savePerStep: false,
|
|
9167
8995
|
requireToolApproval: isYolo || channelAutoApprove ? false : ({ toolName }) => session.resolveToolApproval(toolName, requestContext) !== "allow",
|
|
9168
8996
|
toolCallConcurrency: { strategy: "called" },
|
|
@@ -9557,6 +9385,7 @@ var AgentController = class {
|
|
|
9557
9385
|
}
|
|
9558
9386
|
}
|
|
9559
9387
|
async destroy() {
|
|
9388
|
+
this.#internalMastra?.__unregisterHooks();
|
|
9560
9389
|
await this.stopIntervals();
|
|
9561
9390
|
}
|
|
9562
9391
|
generateId() {
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { $ as isSpanChunk, Cc as CONTROLLER_RUN_BINDING_KEY, F as Agent, Q as MessagePartSpans, Va as validateStorageMetadataFilter, _ as describeNonSuccessFinishReason, g as AGENTIC_LOOP_WORKFLOW_ID, h as AGENTIC_EXECUTION_WORKFLOW_ID, m as agentThreadStreamRuntime, mi as InMemoryMemory, p as AgentThreadLeaseLostError, qn as CHAT_CHANNEL_RENDER_CONTEXT_KEY, vc as DurableStepIds, wc as restoredWorkerControllerContexts, zt as getServerSideFallbackInfo } from "./run-registry-
|
|
2
|
-
import { n as MessageList } from "./message-list-
|
|
1
|
+
import { $ as isSpanChunk, Cc as CONTROLLER_RUN_BINDING_KEY, F as Agent, Q as MessagePartSpans, Va as validateStorageMetadataFilter, _ as describeNonSuccessFinishReason, g as AGENTIC_LOOP_WORKFLOW_ID, h as AGENTIC_EXECUTION_WORKFLOW_ID, m as agentThreadStreamRuntime, mi as InMemoryMemory, p as AgentThreadLeaseLostError, qn as CHAT_CHANNEL_RENDER_CONTEXT_KEY, vc as DurableStepIds, wc as restoredWorkerControllerContexts, zt as getServerSideFallbackInfo } from "./run-registry-Du22tS_D.js";
|
|
2
|
+
import { n as MessageList } from "./message-list-RgFlLrxG.js";
|
|
3
3
|
import { c as isUserAuthoredMessage, n as createSignal, u as resolveDeliveryAttributes } from "./signals-CqR_iWkg.js";
|
|
4
4
|
import { i as MastraFGAPermissions } from "./ee-iTj2bRDt-By_B9ngH.js";
|
|
5
|
-
import { a as AgentControllerChannels } from "./channels-
|
|
6
|
-
import { a as ModelRouterLanguageModel, l as defaultGateways, s as GatewayManager } from "./llm-
|
|
7
|
-
import { t as Mastra } from "./mastra-
|
|
8
|
-
import {
|
|
5
|
+
import { a as AgentControllerChannels } from "./channels-BPxJYR70.js";
|
|
6
|
+
import { a as ModelRouterLanguageModel, l as defaultGateways, s as GatewayManager } from "./llm-DGa7alUy.js";
|
|
7
|
+
import { t as Mastra } from "./mastra-B1BKkzX0.js";
|
|
8
|
+
import { Rn as createRunScopeKey, qt as TITLE_PINNED_THREAD_METADATA_KEY } from "./stream-C_oNulbg.js";
|
|
9
9
|
import { c as MASTRA_THREAD_ID_KEY, i as MASTRA_MESSAGE_AUTHOR_KEY, o as MASTRA_RESOURCE_ID_KEY, u as RequestContext } from "./request-context-COnZHt2-.js";
|
|
10
10
|
import { n as resolveDynamicArgument } from "./dynamic-argument-BzPK3qPN.js";
|
|
11
11
|
import { i as MastraError, o as getErrorFromUnknown } from "./error-oh2DLsP2.js";
|
|
12
12
|
import { toStandardSchema } from "./schema/index.js";
|
|
13
13
|
import { safeStringify } from "./utils/safe-stringify.js";
|
|
14
|
-
import { c as Workspace, h as createWorkspaceTools } from "./workspace-
|
|
14
|
+
import { c as Workspace, h as createWorkspaceTools } from "./workspace-Ct2kAiDv.js";
|
|
15
15
|
import { x as isLeaseProvider } from "./output-helpers-CVzhy1Y0.js";
|
|
16
|
-
import {
|
|
16
|
+
import { omEventFromChunk } from "./memory/om-events/index.js";
|
|
17
17
|
import { s as askUserTool, t as submitPlanTool } from "./tools-tPy2FwMI.js";
|
|
18
|
+
import { n as hasTransformedToolPayload, t as getTransformedToolPayload } from "./payload-transform-Dj3HUeD4.js";
|
|
18
19
|
import { r as createTool, s as isValidationError } from "./tool-Z3bykc1m.js";
|
|
19
20
|
import { d as summarizeTaskCheck, f as taskCheckTool, h as taskWriteTool, m as taskUpdateTool, p as taskCompleteTool } from "./state-processor-B9kxpM53.js";
|
|
20
21
|
import { z } from "zod/v4";
|
|
@@ -357,9 +358,6 @@ function isProviderMetadata(value) {
|
|
|
357
358
|
function getString(value) {
|
|
358
359
|
return typeof value === "string" ? value : void 0;
|
|
359
360
|
}
|
|
360
|
-
function getNumber(value, fallback) {
|
|
361
|
-
return typeof value === "number" && Number.isFinite(value) ? value : fallback;
|
|
362
|
-
}
|
|
363
361
|
function getOptionalNumber(value) {
|
|
364
362
|
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
365
363
|
}
|
|
@@ -375,9 +373,6 @@ function getPayload(chunk) {
|
|
|
375
373
|
function getDataRecord(chunk) {
|
|
376
374
|
return "data" in chunk ? getRecord(chunk.data) : void 0;
|
|
377
375
|
}
|
|
378
|
-
function getNestedRecord(record, key) {
|
|
379
|
-
return record ? getRecord(record[key]) : void 0;
|
|
380
|
-
}
|
|
381
376
|
function isTaskCompletePayload(value) {
|
|
382
377
|
const record = getRecord(value);
|
|
383
378
|
return Boolean(record && typeof record.passed === "boolean" && Array.isArray(record.results));
|
|
@@ -389,13 +384,6 @@ function isGoalEvaluationPayload(value) {
|
|
|
389
384
|
function getOperationType(value) {
|
|
390
385
|
return value === "reflection" ? "reflection" : "observation";
|
|
391
386
|
}
|
|
392
|
-
function getActivationTrigger(value) {
|
|
393
|
-
if (value === "ttl" || value === "threshold" || value === "provider_change") return value;
|
|
394
|
-
}
|
|
395
|
-
function getOmStatus(value) {
|
|
396
|
-
if (value === "running" || value === "complete") return value;
|
|
397
|
-
return "idle";
|
|
398
|
-
}
|
|
399
387
|
function formatToolProgressOutput(progress) {
|
|
400
388
|
if (typeof progress === "string") return progress.endsWith("\n") ? progress : `${progress}\n`;
|
|
401
389
|
if (typeof progress !== "object" || progress === null) return `${String(progress)}\n`;
|
|
@@ -1258,161 +1246,31 @@ var SessionRunEngine = class {
|
|
|
1258
1246
|
});
|
|
1259
1247
|
break;
|
|
1260
1248
|
}
|
|
1261
|
-
case "data-om-status":
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
windows: {
|
|
1274
|
-
active: {
|
|
1275
|
-
messages: {
|
|
1276
|
-
tokens: getNumber(msgs?.tokens, 0),
|
|
1277
|
-
threshold: getNumber(msgs?.threshold, 0)
|
|
1278
|
-
},
|
|
1279
|
-
observations: {
|
|
1280
|
-
tokens: getNumber(obs?.tokens, 0),
|
|
1281
|
-
threshold: getNumber(obs?.threshold, 0)
|
|
1282
|
-
}
|
|
1283
|
-
},
|
|
1284
|
-
buffered: {
|
|
1285
|
-
observations: {
|
|
1286
|
-
status: getOmStatus(buffObs?.status),
|
|
1287
|
-
chunks: getNumber(buffObs?.chunks, 0),
|
|
1288
|
-
messageTokens: getNumber(buffObs?.messageTokens, 0),
|
|
1289
|
-
projectedMessageRemoval: getNumber(buffObs?.projectedMessageRemoval, 0),
|
|
1290
|
-
observationTokens: getNumber(buffObs?.observationTokens, 0)
|
|
1291
|
-
},
|
|
1292
|
-
reflection: {
|
|
1293
|
-
status: getOmStatus(buffRef?.status),
|
|
1294
|
-
inputObservationTokens: getNumber(buffRef?.inputObservationTokens, 0),
|
|
1295
|
-
observationTokens: getNumber(buffRef?.observationTokens, 0)
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
|
-
},
|
|
1299
|
-
recordId: getString(d.recordId) ?? "",
|
|
1300
|
-
threadId: getString(d.threadId) ?? "",
|
|
1301
|
-
stepNumber: getNumber(d.stepNumber, 0),
|
|
1302
|
-
generationCount: getNumber(d.generationCount, 0)
|
|
1303
|
-
});
|
|
1304
|
-
}
|
|
1305
|
-
break;
|
|
1306
|
-
}
|
|
1307
|
-
case "data-om-observation-start": {
|
|
1308
|
-
const payload = getDataRecord(chunk);
|
|
1309
|
-
const cycleId = getString(payload?.cycleId);
|
|
1310
|
-
if (payload && cycleId) {
|
|
1311
|
-
const operationType = getOperationType(payload.operationType);
|
|
1312
|
-
if (operationType === "observation") this.#session.emit({
|
|
1313
|
-
type: "om_observation_start",
|
|
1314
|
-
cycleId,
|
|
1315
|
-
operationType,
|
|
1316
|
-
tokensToObserve: getNumber(payload.tokensToObserve, 0)
|
|
1317
|
-
});
|
|
1318
|
-
else this.#session.emit({
|
|
1319
|
-
type: "om_reflection_start",
|
|
1320
|
-
cycleId,
|
|
1321
|
-
tokensToReflect: getNumber(payload.tokensToObserve, 0)
|
|
1322
|
-
});
|
|
1323
|
-
}
|
|
1324
|
-
break;
|
|
1325
|
-
}
|
|
1326
|
-
case "data-om-observation-end": {
|
|
1327
|
-
const payload = getDataRecord(chunk);
|
|
1328
|
-
const cycleId = getString(payload?.cycleId);
|
|
1329
|
-
if (payload && cycleId) {
|
|
1330
|
-
if (payload.operationType === "reflection") this.#session.emit({
|
|
1331
|
-
type: "om_reflection_end",
|
|
1332
|
-
cycleId,
|
|
1333
|
-
durationMs: getNumber(payload.durationMs, 0),
|
|
1334
|
-
compressedTokens: getNumber(payload.observationTokens, 0),
|
|
1335
|
-
observations: getString(payload.observations)
|
|
1336
|
-
});
|
|
1337
|
-
else this.#session.emit({
|
|
1338
|
-
type: "om_observation_end",
|
|
1339
|
-
cycleId,
|
|
1340
|
-
durationMs: getNumber(payload.durationMs, 0),
|
|
1341
|
-
tokensObserved: getNumber(payload.tokensObserved, 0),
|
|
1342
|
-
observationTokens: getNumber(payload.observationTokens, 0),
|
|
1343
|
-
observations: getString(payload.observations),
|
|
1344
|
-
currentTask: getString(payload.currentTask),
|
|
1345
|
-
suggestedResponse: getString(payload.suggestedResponse)
|
|
1346
|
-
});
|
|
1347
|
-
}
|
|
1348
|
-
break;
|
|
1349
|
-
}
|
|
1350
|
-
case "data-om-observation-failed": {
|
|
1351
|
-
const payload = getDataRecord(chunk);
|
|
1249
|
+
case "data-om-status":
|
|
1250
|
+
case "data-om-observation-start":
|
|
1251
|
+
case "data-om-observation-end":
|
|
1252
|
+
case "data-om-observation-failed":
|
|
1253
|
+
case "data-om-buffering-start":
|
|
1254
|
+
case "data-om-buffering-end":
|
|
1255
|
+
case "data-om-buffering-failed":
|
|
1256
|
+
case "data-om-activation":
|
|
1257
|
+
case "data-om-thread-update": {
|
|
1258
|
+
const event = omEventFromChunk(chunk, this.#session.thread.getId() ?? void 0);
|
|
1259
|
+
if (event) this.#session.emit(event);
|
|
1260
|
+
const payload = chunk.type === "data-om-observation-failed" ? getDataRecord(chunk) : void 0;
|
|
1352
1261
|
if (payload) {
|
|
1353
1262
|
const operationType = getOperationType(payload.operationType);
|
|
1354
|
-
const error = getString(payload.error) ?? "Unknown error";
|
|
1355
|
-
if (operationType === "reflection") this.#session.emit({
|
|
1356
|
-
type: "om_reflection_failed",
|
|
1357
|
-
cycleId: getString(payload.cycleId) ?? "unknown",
|
|
1358
|
-
error,
|
|
1359
|
-
durationMs: getNumber(payload.durationMs, 0)
|
|
1360
|
-
});
|
|
1361
|
-
else this.#session.emit({
|
|
1362
|
-
type: "om_observation_failed",
|
|
1363
|
-
cycleId: getString(payload.cycleId) ?? "unknown",
|
|
1364
|
-
error,
|
|
1365
|
-
durationMs: getNumber(payload.durationMs, 0)
|
|
1366
|
-
});
|
|
1367
1263
|
if (!(Object.hasOwn(payload, "retrying") && payload.retrying === true) && (!Object.hasOwn(payload, "failurePolicy") || !Object.hasOwn(payload, "failureKind") || payload.failurePolicy !== "continue" || payload.failureKind !== (operationType === "reflection" ? "reflector-model" : "observer-model"))) {
|
|
1368
1264
|
this.abortForOmFailure({
|
|
1369
1265
|
operationType,
|
|
1370
1266
|
stage: "run",
|
|
1371
|
-
error
|
|
1267
|
+
error: getString(payload.error) ?? "Unknown error"
|
|
1372
1268
|
});
|
|
1373
1269
|
return { message: state.currentMessage };
|
|
1374
1270
|
}
|
|
1375
1271
|
}
|
|
1376
1272
|
break;
|
|
1377
1273
|
}
|
|
1378
|
-
case "data-om-buffering-start": {
|
|
1379
|
-
const payload = getDataRecord(chunk);
|
|
1380
|
-
const cycleId = getString(payload?.cycleId);
|
|
1381
|
-
if (payload && cycleId) this.#session.emit({
|
|
1382
|
-
type: "om_buffering_start",
|
|
1383
|
-
cycleId,
|
|
1384
|
-
operationType: getOperationType(payload.operationType),
|
|
1385
|
-
tokensToBuffer: getNumber(payload.tokensToBuffer, 0)
|
|
1386
|
-
});
|
|
1387
|
-
break;
|
|
1388
|
-
}
|
|
1389
|
-
case "data-om-buffering-end": {
|
|
1390
|
-
const payload = getDataRecord(chunk);
|
|
1391
|
-
const cycleId = getString(payload?.cycleId);
|
|
1392
|
-
if (payload && cycleId) this.#session.emit({
|
|
1393
|
-
type: "om_buffering_end",
|
|
1394
|
-
cycleId,
|
|
1395
|
-
operationType: getOperationType(payload.operationType),
|
|
1396
|
-
tokensBuffered: getNumber(payload.tokensBuffered, 0),
|
|
1397
|
-
bufferedTokens: getNumber(payload.bufferedTokens, 0),
|
|
1398
|
-
observations: getString(payload.observations)
|
|
1399
|
-
});
|
|
1400
|
-
break;
|
|
1401
|
-
}
|
|
1402
|
-
case "data-om-buffering-failed": {
|
|
1403
|
-
const payload = getDataRecord(chunk);
|
|
1404
|
-
if (payload) {
|
|
1405
|
-
const operationType = getOperationType(payload.operationType);
|
|
1406
|
-
const error = getString(payload.error) ?? "Unknown error";
|
|
1407
|
-
this.#session.emit({
|
|
1408
|
-
type: "om_buffering_failed",
|
|
1409
|
-
cycleId: getString(payload.cycleId) ?? "unknown",
|
|
1410
|
-
operationType,
|
|
1411
|
-
error
|
|
1412
|
-
});
|
|
1413
|
-
}
|
|
1414
|
-
break;
|
|
1415
|
-
}
|
|
1416
1274
|
case "data-signal": {
|
|
1417
1275
|
const payload = getDataRecord(chunk);
|
|
1418
1276
|
if (payload) {
|
|
@@ -1459,39 +1317,6 @@ var SessionRunEngine = class {
|
|
|
1459
1317
|
}
|
|
1460
1318
|
break;
|
|
1461
1319
|
}
|
|
1462
|
-
case "data-om-activation": {
|
|
1463
|
-
const payload = getDataRecord(chunk);
|
|
1464
|
-
const cycleId = getString(payload?.cycleId);
|
|
1465
|
-
if (payload && cycleId) this.#session.emit({
|
|
1466
|
-
type: "om_activation",
|
|
1467
|
-
cycleId,
|
|
1468
|
-
operationType: getOperationType(payload.operationType),
|
|
1469
|
-
chunksActivated: getNumber(payload.chunksActivated, 0),
|
|
1470
|
-
tokensActivated: getNumber(payload.tokensActivated, 0),
|
|
1471
|
-
observationTokens: getNumber(payload.observationTokens, 0),
|
|
1472
|
-
messagesActivated: getNumber(payload.messagesActivated, 0),
|
|
1473
|
-
generationCount: getNumber(payload.generationCount, 0),
|
|
1474
|
-
triggeredBy: getActivationTrigger(payload.triggeredBy),
|
|
1475
|
-
lastActivityAt: getOptionalNumber(payload.lastActivityAt),
|
|
1476
|
-
ttlExpiredMs: getOptionalNumber(payload.ttlExpiredMs),
|
|
1477
|
-
activateAfterIdle: getOptionalNumber(getRecord(payload.config)?.activateAfterIdle),
|
|
1478
|
-
previousModel: getString(payload.previousModel),
|
|
1479
|
-
currentModel: getString(payload.currentModel)
|
|
1480
|
-
});
|
|
1481
|
-
break;
|
|
1482
|
-
}
|
|
1483
|
-
case "data-om-thread-update": {
|
|
1484
|
-
const payload = getDataRecord(chunk);
|
|
1485
|
-
const newTitle = getString(payload?.newTitle);
|
|
1486
|
-
if (payload && newTitle) this.#session.emit({
|
|
1487
|
-
type: "om_thread_title_updated",
|
|
1488
|
-
cycleId: getString(payload.cycleId) ?? "unknown",
|
|
1489
|
-
threadId: getString(payload.threadId) ?? this.#session.thread.getId() ?? "unknown",
|
|
1490
|
-
oldTitle: getString(payload.oldTitle),
|
|
1491
|
-
newTitle
|
|
1492
|
-
});
|
|
1493
|
-
break;
|
|
1494
|
-
}
|
|
1495
1320
|
case "data-mastracode-tool-progress": {
|
|
1496
1321
|
const d = chunk.data;
|
|
1497
1322
|
if (d?.toolCallId && d?.progress !== void 0) {
|
|
@@ -1812,7 +1637,7 @@ var SessionRunEngine = class {
|
|
|
1812
1637
|
const abortedRunId = this.#session.stream.abortedRunId({ subscription });
|
|
1813
1638
|
if (runId && runId === abortedRunId) continue;
|
|
1814
1639
|
if (runId && abortedRunId) this.#session.stream.clearAbortedRun();
|
|
1815
|
-
if (!currentRun) {
|
|
1640
|
+
if (!currentRun || !requestContext) {
|
|
1816
1641
|
currentRun = this.createStreamState(threadId, resourceId);
|
|
1817
1642
|
this.#session.run.nextOperation();
|
|
1818
1643
|
this.#session.run.ensureAbortController();
|
|
@@ -1855,6 +1680,7 @@ var SessionRunEngine = class {
|
|
|
1855
1680
|
abortReason: aborted ? getString(getRecord(chunk.payload)?.reason) : void 0
|
|
1856
1681
|
});
|
|
1857
1682
|
currentRun = void 0;
|
|
1683
|
+
requestContext = void 0;
|
|
1858
1684
|
if (aborted) this.#session.stream.markAbortedRun({
|
|
1859
1685
|
subscription,
|
|
1860
1686
|
runId: runId ?? null
|
|
@@ -1863,6 +1689,7 @@ var SessionRunEngine = class {
|
|
|
1863
1689
|
} catch (error) {
|
|
1864
1690
|
await this.handleSubscribedStreamError(error, resourceId, threadId);
|
|
1865
1691
|
currentRun = void 0;
|
|
1692
|
+
requestContext = void 0;
|
|
1866
1693
|
}
|
|
1867
1694
|
}
|
|
1868
1695
|
};
|
|
@@ -7549,7 +7376,7 @@ const FABLE_FALLBACK_MODEL = "claude-opus-4-8";
|
|
|
7549
7376
|
* capped and ends with `reason:"complete"` after a few steps — the agent stops
|
|
7550
7377
|
* mid-task even though it promised to continue. See {@link buildSharedRunOptions}.
|
|
7551
7378
|
*/
|
|
7552
|
-
const
|
|
7379
|
+
const DEFAULT_CONTROLLER_MAX_STEPS = 1e3;
|
|
7553
7380
|
/**
|
|
7554
7381
|
* Returns Anthropic `providerOptions` that enable a server-side fallback to
|
|
7555
7382
|
* {@link FABLE_FALLBACK_MODEL} when the active model is `claude-fable-5`, and
|
|
@@ -8332,6 +8159,7 @@ var AgentController = class {
|
|
|
8332
8159
|
...this.config.observability ? { observability: this.config.observability } : {},
|
|
8333
8160
|
...gateways ? { gateways } : {}
|
|
8334
8161
|
});
|
|
8162
|
+
this.#internalMastra.__setStandaloneAgentController(this);
|
|
8335
8163
|
await this.#internalMastra.getStorage().init();
|
|
8336
8164
|
} else if (this.#externalMastra) await this.#externalMastra.getStorage()?.init();
|
|
8337
8165
|
}
|
|
@@ -9162,7 +8990,7 @@ var AgentController = class {
|
|
|
9162
8990
|
const isYolo = session.state.get().yolo === true;
|
|
9163
8991
|
const channelAutoApprove = this.#channels?.__isAutoApproveResource(context?.resourceId ?? session.identity.getResourceId()) === true;
|
|
9164
8992
|
const shared = {
|
|
9165
|
-
maxSteps:
|
|
8993
|
+
maxSteps: this.config.maxSteps ?? DEFAULT_CONTROLLER_MAX_STEPS,
|
|
9166
8994
|
savePerStep: false,
|
|
9167
8995
|
requireToolApproval: isYolo || channelAutoApprove ? false : ({ toolName }) => session.resolveToolApproval(toolName, requestContext) !== "allow",
|
|
9168
8996
|
toolCallConcurrency: { strategy: "called" },
|
|
@@ -9557,6 +9385,7 @@ var AgentController = class {
|
|
|
9557
9385
|
}
|
|
9558
9386
|
}
|
|
9559
9387
|
async destroy() {
|
|
9388
|
+
this.#internalMastra?.__unregisterHooks();
|
|
9560
9389
|
await this.stopIntervals();
|
|
9561
9390
|
}
|
|
9562
9391
|
generateId() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_background_tasks = require("../background-tasks-
|
|
2
|
+
const require_background_tasks = require("../background-tasks-LfQsDG6J.cjs");
|
|
3
3
|
exports.BACKGROUND_TASK_WORKFLOW_ID = require_background_tasks.BACKGROUND_TASK_WORKFLOW_ID;
|
|
4
4
|
exports.BackgroundTaskManager = require_background_tasks.BackgroundTaskManager;
|
|
5
5
|
exports.backgroundOverrideJsonSchema = require_background_tasks.backgroundOverrideJsonSchema;
|