@mastra/core 1.86.0-alpha.8 → 1.86.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_types/@internal_core@0.1.4/dist/knowledge-compat/index.d.ts +363 -0
- package/dist/a2a/index.cjs +1 -1
- package/dist/a2a/index.js +1 -1
- package/dist/agent/agent.d.ts +12 -0
- package/dist/agent/durable/index.cjs +1 -13
- package/dist/agent/durable/index.js +1 -13
- package/dist/agent/durable/preparation.d.ts +2 -0
- package/dist/agent/durable/utils/resolve-runtime.d.ts +9 -0
- package/dist/agent/durable/workflows/durable-loop-builder.d.ts +4 -0
- package/dist/agent/durable/workflows/finalize-run.d.ts +3 -1
- package/dist/agent/durable/workflows/steps/llm-execution.d.ts +1 -0
- package/dist/agent/index.cjs +3 -3
- package/dist/agent/index.js +3 -3
- package/dist/agent/message-list/index.cjs +1 -1
- package/dist/agent/message-list/index.js +1 -1
- package/dist/agent/message-list/message-list.d.ts +11 -0
- package/dist/agent/message-list/utils/provider-compat.d.ts +1 -0
- package/dist/agent/request-context-snapshot.d.ts +1 -1
- package/dist/agent/streams/types.d.ts +10 -0
- package/dist/agent/thread-stream-runtime.d.ts +5 -0
- package/dist/agent-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-DEPayioq.cjs → agent-controller-CrQ9OF80.cjs} +7 -7
- package/dist/{agent-controller-B7POPub5.js → agent-controller-SSlKzE6A.js} +7 -7
- package/dist/background-tasks/index.cjs +1 -1
- package/dist/background-tasks/index.js +1 -1
- package/dist/{background-tasks-7iftnRK_.cjs → background-tasks-BDrYBis-.cjs} +5 -3
- package/dist/{background-tasks-Cv1ecD6S.js → background-tasks-BnJfNLFo.js} +5 -3
- package/dist/browser/index.cjs +2 -2
- package/dist/browser/index.js +2 -2
- package/dist/{builder-Gg-xnX_E.js → builder-Cl-0BWkh.js} +2 -2
- package/dist/{builder-DuJBbQDH.cjs → builder-Cw8u3pPl.cjs} +2 -2
- package/dist/capabilities/302ai.json +204 -204
- package/dist/capabilities/abliteratedllm.json +30 -30
- package/dist/capabilities/above.json +21 -21
- package/dist/capabilities/adaption.json +15 -15
- package/dist/capabilities/adzuki.json +24 -24
- package/dist/capabilities/agentrouter.json +9 -9
- package/dist/capabilities/agnes.json +3 -3
- package/dist/capabilities/ai-router.json +8 -8
- package/dist/capabilities/aiand.json +31 -23
- package/dist/capabilities/aigrow.json +14 -14
- package/dist/capabilities/aimlapi.json +144 -147
- package/dist/capabilities/aipg.json +2 -2
- package/dist/capabilities/aixy.json +21 -21
- package/dist/capabilities/aki-io.json +10 -10
- package/dist/capabilities/alibaba-cn.json +136 -117
- package/dist/capabilities/alibaba-coding-plan-cn.json +7 -19
- package/dist/capabilities/alibaba-coding-plan.json +7 -19
- package/dist/capabilities/alibaba-token-plan-cn.json +49 -67
- package/dist/capabilities/alibaba-token-plan.json +50 -68
- package/dist/capabilities/alibaba.json +72 -119
- package/dist/capabilities/ambient.json +8 -8
- package/dist/capabilities/amd.json +10 -10
- package/dist/capabilities/anthropic.json +47 -47
- package/dist/capabilities/anyapi.json +19 -19
- package/dist/capabilities/apiko.json +5 -5
- package/dist/capabilities/arcee.json +11 -11
- package/dist/capabilities/augure.json +2 -2
- package/dist/capabilities/auriko.json +23 -23
- package/dist/capabilities/bailing.json +4 -4
- package/dist/capabilities/baseten.json +55 -25
- package/dist/capabilities/bee.json +4 -4
- package/dist/capabilities/berget.json +5 -5
- package/dist/capabilities/bothub.json +17 -17
- package/dist/capabilities/boundless.json +37 -37
- package/dist/capabilities/bumo.json +41 -41
- package/dist/capabilities/byteplus.json +26 -26
- package/dist/capabilities/cerebras.json +4 -4
- package/dist/capabilities/cheapaimodel.json +3 -3
- package/dist/capabilities/cheapest-token.json +30 -30
- package/dist/capabilities/chutes.json +10 -10
- package/dist/capabilities/cline-pass.json +39 -39
- package/dist/capabilities/cloudcode.json +9 -9
- package/dist/capabilities/cloudferro-sherlock.json +4 -4
- package/dist/capabilities/cloudflare-workers-ai.json +33 -33
- package/dist/capabilities/commandcode.json +139 -139
- package/dist/capabilities/concentrate.json +274 -274
- package/dist/capabilities/cortecs.json +108 -108
- package/dist/capabilities/crossmodel.json +189 -189
- package/dist/capabilities/crusoe.json +10 -10
- package/dist/capabilities/daoxe.json +9 -9
- package/dist/capabilities/databricks.json +315 -59
- package/dist/capabilities/deepinfra.json +90 -155
- package/dist/capabilities/deepseek.json +2 -2
- package/dist/capabilities/digitalocean.json +114 -114
- package/dist/capabilities/dothoosh.json +34 -34
- package/dist/capabilities/doubleword.json +28 -28
- package/dist/capabilities/edenai.json +433 -433
- package/dist/capabilities/empiriolabs.json +176 -176
- package/dist/capabilities/engy.json +17 -17
- package/dist/capabilities/entrim.json +6 -6
- package/dist/capabilities/evroc.json +13 -13
- package/dist/capabilities/ezkielyna.json +12 -12
- package/dist/capabilities/fastrouter.json +88 -88
- package/dist/capabilities/fireworks-ai.json +104 -41
- package/dist/capabilities/freemodel.json +20 -20
- package/dist/capabilities/friendli.json +9 -9
- package/dist/capabilities/frogbot.json +93 -93
- package/dist/capabilities/gisoo.json +19 -19
- package/dist/capabilities/gmicloud.json +21 -21
- package/dist/capabilities/google.json +55 -55
- package/dist/capabilities/graphn.json +11 -11
- package/dist/capabilities/greenpt.json +36 -36
- package/dist/capabilities/groq.json +9 -9
- package/dist/capabilities/helicone.json +83 -83
- package/dist/capabilities/hostinger-router.json +13 -13
- package/dist/capabilities/hpc-ai.json +8 -8
- package/dist/capabilities/huawei-maas.json +17 -17
- package/dist/capabilities/hubris.json +28 -28
- package/dist/capabilities/huggingface.json +200 -53
- package/dist/capabilities/humain.json +2 -2
- package/dist/capabilities/hyper.json +26 -26
- package/dist/capabilities/impossibl.json +127 -127
- 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/inference-coop.json +15 -15
- package/dist/capabilities/inferenceapis.json +22 -22
- package/dist/capabilities/inferris.json +3 -3
- package/dist/capabilities/infersia.json +9 -9
- package/dist/capabilities/inferx.json +3 -3
- package/dist/capabilities/infomaniak.json +4 -4
- package/dist/capabilities/io-net.json +5 -5
- package/dist/capabilities/isoquant.json +4 -4
- package/dist/capabilities/iteracompute.json +51 -51
- package/dist/capabilities/jalapeno.json +12 -12
- 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 +21 -28
- package/dist/capabilities/kenari.json +124 -121
- package/dist/capabilities/kilo.json +635 -636
- 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 +4 -4
- package/dist/capabilities/klavo.json +13 -13
- package/dist/capabilities/korouter.json +31 -31
- package/dist/capabilities/kunavo.json +9 -9
- package/dist/capabilities/liquid.json +10 -10
- package/dist/capabilities/llmgateway-providers.json +909 -909
- package/dist/capabilities/llmgateway.json +333 -333
- package/dist/capabilities/llmtr.json +19 -19
- package/dist/capabilities/logits.json +2 -2
- package/dist/capabilities/longcat.json +1 -6
- package/dist/capabilities/lowrouter.json +52 -52
- package/dist/capabilities/lyceum.json +7 -7
- package/dist/capabilities/melious.json +16 -16
- package/dist/capabilities/merge-gateway.json +275 -275
- package/dist/capabilities/meta.json +9 -9
- package/dist/capabilities/minimax-cn-coding-plan.json +6 -6
- package/dist/capabilities/minimax-coding-plan.json +6 -6
- package/dist/capabilities/mistral.json +18 -18
- package/dist/capabilities/mixlayer.json +5 -5
- package/dist/capabilities/modal.json +13 -13
- package/dist/capabilities/model-oracle-ai.json +26 -26
- package/dist/capabilities/modelis.json +24 -24
- package/dist/capabilities/modelscope.json +2 -2
- package/dist/capabilities/modular.json +9 -9
- package/dist/capabilities/moneo.json +14 -14
- package/dist/capabilities/moonshotai-cn.json +6 -6
- package/dist/capabilities/moonshotai.json +6 -6
- package/dist/capabilities/morph.json +13 -13
- package/dist/capabilities/munito-eu.json +6 -6
- package/dist/capabilities/munito.json +10 -10
- package/dist/capabilities/nan.json +24 -24
- package/dist/capabilities/nano-gpt.json +577 -577
- package/dist/capabilities/nearai.json +82 -82
- package/dist/capabilities/nebius.json +29 -29
- package/dist/capabilities/neon.json +134 -134
- package/dist/capabilities/neuralwatt.json +43 -43
- package/dist/capabilities/nokeep.json +4 -4
- package/dist/capabilities/novita-ai.json +135 -135
- package/dist/capabilities/nvidia.json +38 -38
- package/dist/capabilities/oathbreaker.json +2 -2
- package/dist/capabilities/obscurify.json +26 -26
- package/dist/capabilities/oci.json +5 -5
- package/dist/capabilities/ofox.json +338 -338
- package/dist/capabilities/ollama-cloud.json +55 -55
- package/dist/capabilities/openai.json +48 -48
- package/dist/capabilities/opencode-go.json +81 -81
- package/dist/capabilities/openreason.json +5 -5
- package/dist/capabilities/openrouter.json +548 -563
- package/dist/capabilities/opper.json +23 -23
- package/dist/capabilities/orcarouter.json +212 -212
- package/dist/capabilities/outerlabs.json +30 -30
- package/dist/capabilities/ovhcloud.json +8 -8
- package/dist/capabilities/pareto.json +5 -5
- package/dist/capabilities/pendra.json +4 -4
- package/dist/capabilities/perplexity-agent.json +59 -59
- package/dist/capabilities/perplexity.json +2 -2
- package/dist/capabilities/phala.json +27 -27
- package/dist/capabilities/pioneer.json +24 -24
- package/dist/capabilities/poe.json +136 -136
- package/dist/capabilities/powerspring.json +14 -14
- package/dist/capabilities/primalabs.json +7 -7
- package/dist/capabilities/prime.json +108 -108
- package/dist/capabilities/privatemode-ai.json +12 -12
- package/dist/capabilities/proxystacks.json +6 -6
- package/dist/capabilities/qiniu-ai.json +15 -15
- package/dist/capabilities/refuseless.json +9 -9
- package/dist/capabilities/regolo-ai.json +6 -6
- package/dist/capabilities/requesty.json +171 -171
- package/dist/capabilities/ruapi.json +20 -20
- package/dist/capabilities/runcrate.json +16 -16
- package/dist/capabilities/runinfra.json +17 -17
- package/dist/capabilities/sakana.json +6 -6
- package/dist/capabilities/sambanova.json +6 -6
- package/dist/capabilities/sandbase.json +16 -16
- package/dist/capabilities/sarvam.json +12 -12
- package/dist/capabilities/scaleway.json +17 -17
- package/dist/capabilities/scnet-token-plan.json +8 -8
- package/dist/capabilities/scx-ai.json +29 -29
- package/dist/capabilities/sensenova.json +14 -14
- package/dist/capabilities/siliconflow-cn.json +61 -61
- package/dist/capabilities/siliconflow.json +57 -57
- package/dist/capabilities/snowflake-cortex.json +24 -24
- package/dist/capabilities/sokkan.json +10 -10
- package/dist/capabilities/sparrowcodes.json +24 -24
- package/dist/capabilities/standardcompute.json +89 -89
- package/dist/capabilities/steadyrouter.json +38 -38
- package/dist/capabilities/stepfun-ai-step-plan.json +7 -7
- package/dist/capabilities/stepfun-ai.json +16 -9
- package/dist/capabilities/stepfun-step-plan.json +16 -9
- package/dist/capabilities/stepfun.json +16 -9
- package/dist/capabilities/stepping-stone.json +18 -18
- package/dist/capabilities/subconscious.json +2 -2
- package/dist/capabilities/synthetic.json +12 -12
- package/dist/capabilities/synthorai.json +26 -26
- package/dist/capabilities/teamorouter.json +21 -21
- package/dist/capabilities/teapot-router.json +9 -9
- package/dist/capabilities/tencent-coding-plan.json +1 -23
- package/dist/capabilities/tencent-token-plan.json +57 -20
- package/dist/capabilities/tencent-tokenhub.json +182 -7
- package/dist/capabilities/tensorx.json +36 -36
- package/dist/capabilities/the-grid-ai.json +29 -29
- package/dist/capabilities/thinkingmachines.json +73 -56
- package/dist/capabilities/tinfoil.json +9 -9
- package/dist/capabilities/toapis.json +3 -3
- package/dist/capabilities/togetherai.json +61 -90
- package/dist/capabilities/tokengo.json +21 -21
- package/dist/capabilities/tokenify.json +9 -9
- package/dist/capabilities/trustedrouter.json +7 -7
- package/dist/capabilities/trustedtokens.json +14 -14
- package/dist/capabilities/umans-ai-coding-plan.json +13 -13
- package/dist/capabilities/umans-ai.json +10 -10
- package/dist/capabilities/uncensuredai.json +4 -4
- package/dist/capabilities/unrestricted.json +4 -4
- package/dist/capabilities/uplinkswitch.json +19 -19
- package/dist/capabilities/upstage.json +6 -6
- package/dist/capabilities/vancine.json +19 -19
- package/dist/capabilities/vercel.json +558 -537
- package/dist/capabilities/vivgrid.json +78 -78
- package/dist/capabilities/volcengine-coding-plan.json +26 -56
- package/dist/capabilities/volcengine.json +57 -62
- package/dist/capabilities/vultr.json +28 -28
- package/dist/capabilities/wafer.ai.json +18 -18
- package/dist/capabilities/wallaby.json +5 -5
- package/dist/capabilities/wally.json +14 -14
- package/dist/capabilities/wandb.json +20 -20
- package/dist/capabilities/watt.json +22 -22
- package/dist/capabilities/xai.json +4 -4
- package/dist/capabilities/xiaomi-token-plan-ams.json +2 -12
- package/dist/capabilities/xiaomi-token-plan-cn.json +2 -12
- package/dist/capabilities/xiaomi-token-plan-sgp.json +2 -12
- package/dist/capabilities/xiaomi.json +3 -25
- package/dist/capabilities/xpersona.json +11 -11
- package/dist/capabilities/xxapi.json +27 -27
- package/dist/capabilities/zai-coding-plan.json +14 -14
- package/dist/capabilities/zai.json +47 -24
- package/dist/capabilities/zenifra.json +24 -24
- package/dist/capabilities/zenmux.json +185 -185
- package/dist/capabilities/zerogpu.json +12 -12
- package/dist/capabilities/zhipuai-coding-plan.json +8 -8
- package/dist/capabilities/zhipuai.json +35 -20
- package/dist/capabilities/zro.json +7 -7
- package/dist/channels/index.cjs +2 -2
- package/dist/channels/index.js +2 -2
- package/dist/{channels-BRVCOutx.js → channels-Cz1y3W6u.js} +1 -1
- package/dist/{channels-MjTA9bFp.cjs → channels-DQg4v_gm.cjs} +1 -1
- package/dist/coding-agent/index.cjs +2 -2
- package/dist/coding-agent/index.js +2 -2
- package/dist/datasets/index.cjs +2 -2
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +3 -2
- package/dist/docs/assets/SOURCE_MAP.json +895 -870
- package/dist/docs/references/docs-harness-background-tasks.md +4 -1
- package/dist/docs/references/docs-knowledge-importers.md +195 -0
- package/dist/docs/references/docs-knowledge-load-your-content.md +1 -1
- package/dist/docs/references/docs-knowledge-overview.md +1 -1
- package/dist/docs/references/docs-sandbox-filesystem.md +1 -1
- package/dist/docs/references/docs-signals-thread-streams.md +1 -1
- package/dist/docs/references/docs-studio-auth.md +54 -7
- package/dist/docs/references/integrations-auth-clerk.md +48 -4
- package/dist/docs/references/reference-agents-agent.md +1 -1
- package/dist/docs/references/reference-agents-durable-agent.md +10 -4
- package/dist/docs/references/reference-auth-clerk.md +21 -1
- package/dist/docs/references/reference-knowledge-knowledge-class.md +11 -4
- package/dist/docs/references/reference-memory-observational-memory.md +2 -2
- package/dist/docs/references/reference-streaming-ChunkType.md +2 -2
- package/dist/docs/references/reference-workspace-local-sandbox.md +2 -0
- package/dist/error/index.cjs +1 -1
- package/dist/error/index.js +1 -1
- package/dist/{error-C9d_24w-.js → error-BLwEXqOK.js} +2 -2
- package/dist/{error-BRQf2ku0.cjs → error-BdEvO8za.cjs} +2 -2
- package/dist/evals/index.cjs +1 -1
- package/dist/evals/index.js +1 -1
- package/dist/evals/scoreTraces/index.cjs +1 -1
- package/dist/evals/scoreTraces/index.js +1 -1
- package/dist/features/index.cjs +1 -0
- package/dist/features/index.js +1 -0
- package/dist/{filesystem-B5X-5G0x.js → filesystem-B8ad6kAW.js} +1 -1
- package/dist/{filesystem-BDSpwBke.cjs → filesystem-BB5YWXH-.cjs} +1 -1
- package/dist/{filesystem-DzM9pcQ8.js → filesystem-BDHUxbHn.js} +1 -1
- package/dist/{filesystem-B0AZrbj8.cjs → filesystem-BP5yz5LG.cjs} +1 -1
- package/dist/{filesystem-BsdkC311.js → filesystem-B_afSgYk.js} +1 -1
- package/dist/{filesystem-C-cyJfi1.cjs → filesystem-BaOJOc-V.cjs} +1 -1
- package/dist/{filesystem-B3s0WRud.js → filesystem-BhYgU8qg.js} +1 -1
- package/dist/{filesystem-DzfqVTO_.js → filesystem-CLBVmR5j.js} +1 -1
- package/dist/{filesystem-CEbD_77-.cjs → filesystem-Cgxc2a_-.cjs} +1 -1
- package/dist/{filesystem-Cv79mHRk.js → filesystem-ClBOBoDc.js} +1 -1
- package/dist/{filesystem-DsCQiBl2.cjs → filesystem-DVVecqZt.cjs} +1 -1
- package/dist/{filesystem-CUAgLugE.cjs → filesystem-Fpsu7e24.cjs} +1 -1
- package/dist/{filesystem-versioned-Bijb_p9l.js → filesystem-versioned-BL1ojJLo.js} +1 -1
- package/dist/{filesystem-versioned-DZGyPbNC.cjs → filesystem-versioned-BavRtYWJ.cjs} +1 -1
- package/dist/harness/index.cjs +1 -1
- package/dist/harness/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/knowledge/config.d.ts +10 -0
- package/dist/knowledge/host-writes.d.ts +10 -0
- package/dist/knowledge/importers/conformance.d.ts +25 -0
- package/dist/knowledge/importers/define.d.ts +204 -0
- package/dist/knowledge/importers/host.d.ts +143 -0
- package/dist/knowledge/importers/index.d.ts +12 -0
- package/dist/knowledge/importers/local-host.d.ts +106 -0
- package/dist/knowledge/importers/manifest.d.ts +25 -0
- package/dist/knowledge/importers/runner.d.ts +61 -0
- package/dist/knowledge/importers/sink.d.ts +105 -0
- package/dist/knowledge/importers/types.d.ts +144 -0
- package/dist/knowledge/index.cjs +2715 -8
- package/dist/knowledge/index.d.ts +54 -4
- package/dist/knowledge/index.js +2692 -9
- package/dist/knowledge/instructions.d.ts +1 -1
- package/dist/knowledge/links.d.ts +8 -0
- package/dist/knowledge/pinned-state-processor.d.ts +5 -0
- package/dist/knowledge/pinned.d.ts +4 -1
- package/dist/knowledge/scope-runtime.d.ts +10 -0
- package/dist/llm/index.cjs +3 -3
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/provider-types.generated.d.ts +7705 -7727
- package/dist/{llm-DmUucguC.cjs → llm-8Av3mSjD.cjs} +2 -2
- package/dist/{llm-Djd8Qzi0.js → llm-B5A5cwJr.js} +2 -2
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +2 -2
- package/dist/{manager-CO_Xz2zR.js → manager-DfWQCJUK.js} +2 -2
- package/dist/{manager-D27PkIPo.cjs → manager-sv35JY-z.cjs} +2 -2
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/mastra/resolve-agent.d.ts +3 -1
- package/dist/{mastra-Ch00nEAJ.js → mastra-CigBrT7X.js} +17 -23
- package/dist/{mastra-qsVWpOTi.cjs → mastra-D4hvfuxX.cjs} +19 -25
- package/dist/memory/index.cjs +3 -3
- package/dist/memory/index.js +3 -3
- package/dist/{message-list-DPXPXvin.cjs → message-list-Cj0Sq_JP.cjs} +63 -8
- package/dist/{message-list-DEuRl82K.js → message-list-KRbg-TnI.js} +63 -8
- package/dist/{model-Do6DTJoj.cjs → model-BK93CMtl.cjs} +1 -1
- package/dist/{model-CW-mfGYA.js → model-CYtXw861.js} +1 -1
- package/dist/{netlify-DU32SDT6.cjs → netlify-BAnn3ouY.cjs} +1 -1
- package/dist/{netlify-DZSAbdve.js → netlify-CuI1ZrwR.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/abort-signal-scope.d.ts +6 -0
- package/dist/processors/index.cjs +2 -2
- package/dist/processors/index.js +2 -2
- package/dist/{provider-registry-zGezZVsL.cjs → provider-registry-BwuI_IpT.cjs} +21696 -21828
- package/dist/{provider-registry-deA0x-Gd.js → provider-registry-CmQLzLF_.js} +21696 -21828
- package/dist/provider-registry.json +22300 -22417
- package/dist/{registry-generator-VvBfOKAD.js → registry-generator-C17V4WfG.js} +1 -1
- package/dist/{registry-generator-BkQ1AxZn.cjs → registry-generator-C_0ae7Ce.cjs} +1 -1
- package/dist/{rehydrate-DDYFpQsV.cjs → rehydrate-CDQ4dOYj.cjs} +2 -2
- package/dist/{rehydrate-BjLV643n.js → rehydrate-PnaVawGX.js} +2 -2
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +2 -2
- package/dist/{run-registry-5Suldxz3.cjs → run-registry-BmckDVBk.cjs} +1156 -403
- package/dist/{run-registry-CGRPldLH.js → run-registry-BwEcwYlU.js} +1103 -404
- package/dist/{source-DDwx-87N.cjs → source-BVOi8Xhp.cjs} +1 -1
- package/dist/{source-Did_2XQc.js → source-fNa6u1kH.js} +1 -1
- package/dist/storage/domains/agents/index.cjs +1 -1
- package/dist/storage/domains/agents/index.js +1 -1
- package/dist/storage/domains/knowledge/base.d.ts +67 -0
- package/dist/storage/domains/knowledge/importers-inmemory.d.ts +146 -0
- package/dist/storage/domains/knowledge/importers.d.ts +287 -0
- package/dist/storage/domains/knowledge/index.d.ts +1 -0
- package/dist/storage/domains/knowledge/inmemory.d.ts +11 -0
- package/dist/storage/domains/knowledge/pages-inmemory.d.ts +12 -1
- package/dist/storage/domains/knowledge/pages.d.ts +1 -0
- package/dist/storage/domains/mcp-clients/index.cjs +1 -1
- package/dist/storage/domains/mcp-clients/index.js +1 -1
- package/dist/storage/domains/mcp-servers/index.cjs +1 -1
- package/dist/storage/domains/mcp-servers/index.js +1 -1
- package/dist/storage/domains/prompt-blocks/index.cjs +1 -1
- package/dist/storage/domains/prompt-blocks/index.js +1 -1
- package/dist/storage/domains/scorer-definitions/index.cjs +1 -1
- package/dist/storage/domains/scorer-definitions/index.js +1 -1
- package/dist/storage/domains/skills/index.cjs +1 -1
- package/dist/storage/domains/skills/index.js +1 -1
- package/dist/storage/domains/workspaces/index.cjs +1 -1
- package/dist/storage/domains/workspaces/index.js +1 -1
- package/dist/storage/index.cjs +15 -10
- package/dist/storage/index.js +11 -11
- package/dist/stream/base/output.d.ts +17 -0
- package/dist/stream/index.cjs +2 -2
- package/dist/stream/index.js +2 -2
- package/dist/stream/types.d.ts +5 -2
- package/dist/{stream-Dvy_0o14.cjs → stream-0kdqBOOn.cjs} +64 -9
- package/dist/{stream-Dpwx0whf.js → stream-D1y9GzoD.js} +29 -10
- package/dist/test-utils/llm-mock.cjs +1 -1
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/tool-loop-agent/index.cjs +1 -1
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/{tool-loop-agent-PbWrEj1k.js → tool-loop-agent-BdjWGVIb.js} +4 -4
- package/dist/{tool-loop-agent-UxOv3FoK.cjs → tool-loop-agent-kWaZAT6Q.cjs} +4 -4
- package/dist/{utils-BbMTlyBO.cjs → utils-BKUCaZ12.cjs} +1 -1
- package/dist/{utils-BnNi1BYM.js → utils-GHY3hmLx.js} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{validate-HSBcm96b.js → validate-CB-q-R2F.js} +1 -1
- package/dist/{validate-Skps-cM3.cjs → validate-De92squ7.cjs} +1 -1
- package/dist/vector/index.cjs +2 -2
- package/dist/vector/index.js +2 -2
- package/dist/worker/index.cjs +1 -1
- package/dist/worker/index.js +1 -1
- package/dist/{worker-BNS5A3qP.cjs → worker-BbWPQuPR.cjs} +2 -2
- package/dist/{worker-DehaD4qD.js → worker-C3u_xzY2.js} +2 -2
- package/dist/{worker-BE-0DyKL.cjs → worker-CAKvQj9_.cjs} +2 -2
- package/dist/{worker-BKrKHZzU.js → worker-Kwm8EKcj.js} +2 -2
- package/dist/{workflow-BjUTwaK9.cjs → workflow-CSjXeNcR.cjs} +3 -3
- package/dist/{workflow-Bvw6yDjc.js → workflow-CVmI1Sw-.js} +3 -3
- package/dist/workflows/builder/index.cjs +1 -1
- package/dist/workflows/builder/index.js +1 -1
- package/dist/workflows/evented/index.cjs +1 -1
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/index.cjs +4 -4
- package/dist/workflows/index.js +4 -4
- package/dist/workspace/filesystem/filesystem.d.ts +5 -0
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/sandbox/local-sandbox.d.ts +16 -7
- package/dist/workspace/sandbox/native-sandbox/types.d.ts +11 -1
- package/dist/{workspace-C05xDH60.js → workspace-DY2Nxiyi.js} +75 -27
- package/dist/{workspace-D1OzzlLw.cjs → workspace-X2RHJZU9.cjs} +75 -27
- package/package.json +3 -3
- package/src/llm/model/provider-types.generated.d.ts +7705 -7727
|
@@ -3834,6 +3834,7 @@ function generateSeatbeltProfile(workspacePath, config) {
|
|
|
3834
3834
|
]) if (config.readOnly) lines.push(`(allow file-write* (require-all (subpath ${escapePath(tempPath)}) (require-not (subpath ${escapePath(canonicalWorkspacePath)}))))`);
|
|
3835
3835
|
else lines.push(`(allow file-write* (subpath ${escapePath(tempPath)}))`);
|
|
3836
3836
|
for (const p of config.readWritePaths ?? []) lines.push(`(allow file-write* (subpath ${escapePath(canonicalizePath(p))}))`);
|
|
3837
|
+
for (const p of config.denyWritePaths ?? []) lines.push(`(deny file-write* (subpath ${escapePath(canonicalizePath(p))}))`);
|
|
3837
3838
|
lines.push("");
|
|
3838
3839
|
lines.push("; Network");
|
|
3839
3840
|
if (config.allowNetwork) lines.push("(allow network*)");
|
|
@@ -3928,6 +3929,7 @@ function buildBwrapCommand(command, workspacePath, config) {
|
|
|
3928
3929
|
if (config.readOnly) bwrapArgs.push("--ro-bind", workspacePath, workspacePath);
|
|
3929
3930
|
else bwrapArgs.push("--bind", workspacePath, workspacePath);
|
|
3930
3931
|
for (const path of config.readWritePaths ?? []) bwrapArgs.push("--bind", path, path);
|
|
3932
|
+
for (const path of config.denyWritePaths ?? []) bwrapArgs.push("--ro-bind", path, path);
|
|
3931
3933
|
bwrapArgs.push("--dev", "/dev");
|
|
3932
3934
|
bwrapArgs.push("--chdir", workspacePath);
|
|
3933
3935
|
bwrapArgs.push("--die-with-parent");
|
|
@@ -4052,9 +4054,11 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
|
|
|
4052
4054
|
_activeMountPaths = /* @__PURE__ */ new Set();
|
|
4053
4055
|
/** Snapshot of `readWritePaths` from ctor; entries here are never removed on unmount. */
|
|
4054
4056
|
_initialReadWritePaths;
|
|
4055
|
-
/**
|
|
4057
|
+
/** Snapshot of `denyWritePaths` from ctor; entries here are never removed on unmount. */
|
|
4058
|
+
_initialDenyWritePaths;
|
|
4059
|
+
/** Refcount for isolation paths added by mounts, keyed by `<list>:<path>`. */
|
|
4056
4060
|
_mountIsolationRefCount = /* @__PURE__ */ new Map();
|
|
4057
|
-
/** Normalized mount path → canonical isolation path
|
|
4061
|
+
/** Normalized mount path → canonical isolation path and the list it was added to. */
|
|
4058
4062
|
_mountPathToIsolationPath = /* @__PURE__ */ new Map();
|
|
4059
4063
|
/** Named checkpoint to seed from on start and persist to on snapshot. */
|
|
4060
4064
|
_checkpointName;
|
|
@@ -4094,9 +4098,11 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
|
|
|
4094
4098
|
this._nativeSandboxConfig = {
|
|
4095
4099
|
...options.nativeSandbox,
|
|
4096
4100
|
readWritePaths: [...options.nativeSandbox?.readWritePaths ?? []],
|
|
4097
|
-
readOnlyPaths: [...options.nativeSandbox?.readOnlyPaths ?? []]
|
|
4101
|
+
readOnlyPaths: [...options.nativeSandbox?.readOnlyPaths ?? []],
|
|
4102
|
+
denyWritePaths: [...options.nativeSandbox?.denyWritePaths ?? []]
|
|
4098
4103
|
};
|
|
4099
4104
|
this._initialReadWritePaths = new Set(this._nativeSandboxConfig.readWritePaths ?? []);
|
|
4105
|
+
this._initialDenyWritePaths = new Set(this._nativeSandboxConfig.denyWritePaths ?? []);
|
|
4100
4106
|
this.isolation = requestedIsolation;
|
|
4101
4107
|
this._instructionsOverride = options.instructions;
|
|
4102
4108
|
this._checkpointName = options.checkpointName;
|
|
@@ -4124,7 +4130,8 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
|
|
|
4124
4130
|
nativeSandbox: {
|
|
4125
4131
|
...this._nativeSandboxConfig,
|
|
4126
4132
|
readWritePaths: [...this._initialReadWritePaths],
|
|
4127
|
-
readOnlyPaths: [...this._nativeSandboxConfig.readOnlyPaths ?? []]
|
|
4133
|
+
readOnlyPaths: [...this._nativeSandboxConfig.readOnlyPaths ?? []],
|
|
4134
|
+
denyWritePaths: [...this._initialDenyWritePaths]
|
|
4128
4135
|
},
|
|
4129
4136
|
...this._instructionsOverride !== void 0 && { instructions: this._instructionsOverride },
|
|
4130
4137
|
...(options.checkpointName ?? this._checkpointName) !== void 0 && { checkpointName: options.checkpointName ?? this._checkpointName },
|
|
@@ -4362,7 +4369,8 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
|
|
|
4362
4369
|
isolationConfig: this.isolation !== "none" ? {
|
|
4363
4370
|
allowNetwork: this._nativeSandboxConfig.allowNetwork ?? false,
|
|
4364
4371
|
readOnlyPaths: this._nativeSandboxConfig.readOnlyPaths,
|
|
4365
|
-
readWritePaths: this._nativeSandboxConfig.readWritePaths
|
|
4372
|
+
readWritePaths: this._nativeSandboxConfig.readWritePaths,
|
|
4373
|
+
denyWritePaths: this._nativeSandboxConfig.denyWritePaths
|
|
4366
4374
|
} : void 0
|
|
4367
4375
|
}
|
|
4368
4376
|
};
|
|
@@ -4433,7 +4441,8 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
|
|
|
4433
4441
|
config
|
|
4434
4442
|
});
|
|
4435
4443
|
this._activeMountPaths.add(mountPath);
|
|
4436
|
-
this.addMountPathToIsolation(mountPath, hostPath);
|
|
4444
|
+
const isolationError = this.addMountPathToIsolation(mountPath, hostPath, filesystem.readOnly === true);
|
|
4445
|
+
if (isolationError) return this.failMountIsolation(filesystem, mountPath, config, isolationError);
|
|
4437
4446
|
return {
|
|
4438
4447
|
success: true,
|
|
4439
4448
|
mountPath
|
|
@@ -4544,7 +4553,8 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
|
|
|
4544
4553
|
});
|
|
4545
4554
|
this._activeMountPaths.add(mountPath);
|
|
4546
4555
|
await this.writeMarkerFile(mountPath, hostPath);
|
|
4547
|
-
this.addMountPathToIsolation(mountPath, hostPath);
|
|
4556
|
+
const isolationError = this.addMountPathToIsolation(mountPath, hostPath, filesystem.readOnly === true);
|
|
4557
|
+
if (isolationError) return this.failMountIsolation(filesystem, mountPath, config, isolationError);
|
|
4548
4558
|
this.logger.debug("Mounted", {
|
|
4549
4559
|
mountPath,
|
|
4550
4560
|
hostPath
|
|
@@ -4657,53 +4667,91 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
|
|
|
4657
4667
|
}
|
|
4658
4668
|
}
|
|
4659
4669
|
/**
|
|
4660
|
-
* Dynamically add a mount path to the sandbox isolation
|
|
4670
|
+
* Dynamically add a mount path to the sandbox isolation config.
|
|
4661
4671
|
*
|
|
4662
|
-
* -
|
|
4663
|
-
*
|
|
4672
|
+
* Read-write mounts go to `readWritePaths`; mounts whose filesystem is
|
|
4673
|
+
* `readOnly` go to `denyWritePaths` so subprocesses can read but never write
|
|
4674
|
+
* them, matching what file tools enforce. Both backends read the config on
|
|
4675
|
+
* every wrapCommand() call, so the change takes effect immediately.
|
|
4664
4676
|
*
|
|
4665
4677
|
* Local mounts are symlinks under `workingDirectory`. Bubblewrap cannot
|
|
4666
4678
|
* `--bind` a symlink (it fails with "Unable to mount source on destination"),
|
|
4667
4679
|
* so we store the canonical path (`realpath`) of the mount point — the same
|
|
4668
4680
|
* directory the symlink refers to.
|
|
4681
|
+
*
|
|
4682
|
+
* Returns an error when a read-only mount can't be resolved: a write denial on
|
|
4683
|
+
* the unresolved symlink wouldn't cover the directory writes actually land in.
|
|
4669
4684
|
*/
|
|
4670
|
-
addMountPathToIsolation(mountPath, hostPath) {
|
|
4685
|
+
addMountPathToIsolation(mountPath, hostPath, readOnly) {
|
|
4671
4686
|
if (this.isolation === "none") return;
|
|
4672
4687
|
const normMount = normalizeMountPath(mountPath);
|
|
4673
|
-
|
|
4688
|
+
const list = readOnly ? "denyWritePaths" : "readWritePaths";
|
|
4689
|
+
const existing = this._mountPathToIsolationPath.get(normMount);
|
|
4690
|
+
if (existing?.list === list) return;
|
|
4691
|
+
if (existing) this.removeMountIsolationForPath(normMount);
|
|
4674
4692
|
let isolationPath = hostPath;
|
|
4675
4693
|
try {
|
|
4676
4694
|
isolationPath = realpathSync(hostPath);
|
|
4677
|
-
} catch {
|
|
4678
|
-
|
|
4695
|
+
} catch {
|
|
4696
|
+
if (readOnly) return `Cannot mount read-only filesystem at ${hostPath}: its source could not be resolved, so writes to it can't be denied to sandboxed commands.`;
|
|
4697
|
+
this.logger.warn("Could not resolve mount path for isolation; using unresolved path", { hostPath });
|
|
4698
|
+
}
|
|
4699
|
+
if (!this._nativeSandboxConfig[list]) this._nativeSandboxConfig = {
|
|
4679
4700
|
...this._nativeSandboxConfig,
|
|
4680
|
-
|
|
4701
|
+
[list]: []
|
|
4681
4702
|
};
|
|
4682
|
-
const paths = this._nativeSandboxConfig
|
|
4703
|
+
const paths = this._nativeSandboxConfig[list];
|
|
4683
4704
|
if (!paths.includes(isolationPath)) paths.push(isolationPath);
|
|
4684
|
-
if (!
|
|
4685
|
-
|
|
4705
|
+
if (!(readOnly ? this._initialDenyWritePaths : this._initialReadWritePaths).has(isolationPath)) {
|
|
4706
|
+
const key = `${list}:${isolationPath}`;
|
|
4707
|
+
this._mountIsolationRefCount.set(key, (this._mountIsolationRefCount.get(key) ?? 0) + 1);
|
|
4708
|
+
}
|
|
4709
|
+
this._mountPathToIsolationPath.set(normMount, {
|
|
4710
|
+
path: isolationPath,
|
|
4711
|
+
list
|
|
4712
|
+
});
|
|
4713
|
+
}
|
|
4714
|
+
/** Undo a mount whose isolation couldn't be applied and record it as failed. */
|
|
4715
|
+
async failMountIsolation(filesystem, mountPath, config, error) {
|
|
4716
|
+
this.logger.error("Could not apply mount isolation", {
|
|
4717
|
+
mountPath,
|
|
4718
|
+
error
|
|
4719
|
+
});
|
|
4720
|
+
await this.unmount(mountPath);
|
|
4721
|
+
this.mounts.set(mountPath, {
|
|
4722
|
+
filesystem,
|
|
4723
|
+
state: "error",
|
|
4724
|
+
config,
|
|
4725
|
+
error
|
|
4726
|
+
});
|
|
4727
|
+
return {
|
|
4728
|
+
success: false,
|
|
4729
|
+
mountPath,
|
|
4730
|
+
error
|
|
4731
|
+
};
|
|
4686
4732
|
}
|
|
4687
4733
|
/**
|
|
4688
|
-
* Reverse {@link addMountPathToIsolation}: drop refcounted paths from the
|
|
4689
|
-
* while preserving user-provided
|
|
4734
|
+
* Reverse {@link addMountPathToIsolation}: drop refcounted paths from the isolation
|
|
4735
|
+
* config on unmount while preserving user-provided paths from construction.
|
|
4690
4736
|
*/
|
|
4691
4737
|
removeMountIsolationForPath(mountPath) {
|
|
4692
4738
|
if (this.isolation === "none") return;
|
|
4693
4739
|
const normMount = normalizeMountPath(mountPath);
|
|
4694
|
-
const
|
|
4695
|
-
if (
|
|
4740
|
+
const entry = this._mountPathToIsolationPath.get(normMount);
|
|
4741
|
+
if (entry === void 0) return;
|
|
4696
4742
|
this._mountPathToIsolationPath.delete(normMount);
|
|
4697
|
-
|
|
4698
|
-
|
|
4743
|
+
const { path: isolationPath, list } = entry;
|
|
4744
|
+
if ((list === "denyWritePaths" ? this._initialDenyWritePaths : this._initialReadWritePaths).has(isolationPath)) return;
|
|
4745
|
+
const key = `${list}:${isolationPath}`;
|
|
4746
|
+
const next = (this._mountIsolationRefCount.get(key) ?? 0) - 1;
|
|
4699
4747
|
if (next <= 0) {
|
|
4700
|
-
this._mountIsolationRefCount.delete(
|
|
4701
|
-
const paths = this._nativeSandboxConfig
|
|
4748
|
+
this._mountIsolationRefCount.delete(key);
|
|
4749
|
+
const paths = this._nativeSandboxConfig[list];
|
|
4702
4750
|
if (paths) {
|
|
4703
4751
|
const idx = paths.indexOf(isolationPath);
|
|
4704
4752
|
if (idx !== -1) paths.splice(idx, 1);
|
|
4705
4753
|
}
|
|
4706
|
-
} else this._mountIsolationRefCount.set(
|
|
4754
|
+
} else this._mountIsolationRefCount.set(key, next);
|
|
4707
4755
|
}
|
|
4708
4756
|
/**
|
|
4709
4757
|
* Resolve a virtual mount path to a host filesystem path.
|
|
@@ -3839,6 +3839,7 @@ function generateSeatbeltProfile(workspacePath, config) {
|
|
|
3839
3839
|
]) if (config.readOnly) lines.push(`(allow file-write* (require-all (subpath ${escapePath(tempPath)}) (require-not (subpath ${escapePath(canonicalWorkspacePath)}))))`);
|
|
3840
3840
|
else lines.push(`(allow file-write* (subpath ${escapePath(tempPath)}))`);
|
|
3841
3841
|
for (const p of config.readWritePaths ?? []) lines.push(`(allow file-write* (subpath ${escapePath(canonicalizePath(p))}))`);
|
|
3842
|
+
for (const p of config.denyWritePaths ?? []) lines.push(`(deny file-write* (subpath ${escapePath(canonicalizePath(p))}))`);
|
|
3842
3843
|
lines.push("");
|
|
3843
3844
|
lines.push("; Network");
|
|
3844
3845
|
if (config.allowNetwork) lines.push("(allow network*)");
|
|
@@ -3933,6 +3934,7 @@ function buildBwrapCommand(command, workspacePath, config) {
|
|
|
3933
3934
|
if (config.readOnly) bwrapArgs.push("--ro-bind", workspacePath, workspacePath);
|
|
3934
3935
|
else bwrapArgs.push("--bind", workspacePath, workspacePath);
|
|
3935
3936
|
for (const path of config.readWritePaths ?? []) bwrapArgs.push("--bind", path, path);
|
|
3937
|
+
for (const path of config.denyWritePaths ?? []) bwrapArgs.push("--ro-bind", path, path);
|
|
3936
3938
|
bwrapArgs.push("--dev", "/dev");
|
|
3937
3939
|
bwrapArgs.push("--chdir", workspacePath);
|
|
3938
3940
|
bwrapArgs.push("--die-with-parent");
|
|
@@ -4057,9 +4059,11 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
|
|
|
4057
4059
|
_activeMountPaths = /* @__PURE__ */ new Set();
|
|
4058
4060
|
/** Snapshot of `readWritePaths` from ctor; entries here are never removed on unmount. */
|
|
4059
4061
|
_initialReadWritePaths;
|
|
4060
|
-
/**
|
|
4062
|
+
/** Snapshot of `denyWritePaths` from ctor; entries here are never removed on unmount. */
|
|
4063
|
+
_initialDenyWritePaths;
|
|
4064
|
+
/** Refcount for isolation paths added by mounts, keyed by `<list>:<path>`. */
|
|
4061
4065
|
_mountIsolationRefCount = /* @__PURE__ */ new Map();
|
|
4062
|
-
/** Normalized mount path → canonical isolation path
|
|
4066
|
+
/** Normalized mount path → canonical isolation path and the list it was added to. */
|
|
4063
4067
|
_mountPathToIsolationPath = /* @__PURE__ */ new Map();
|
|
4064
4068
|
/** Named checkpoint to seed from on start and persist to on snapshot. */
|
|
4065
4069
|
_checkpointName;
|
|
@@ -4099,9 +4103,11 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
|
|
|
4099
4103
|
this._nativeSandboxConfig = {
|
|
4100
4104
|
...options.nativeSandbox,
|
|
4101
4105
|
readWritePaths: [...options.nativeSandbox?.readWritePaths ?? []],
|
|
4102
|
-
readOnlyPaths: [...options.nativeSandbox?.readOnlyPaths ?? []]
|
|
4106
|
+
readOnlyPaths: [...options.nativeSandbox?.readOnlyPaths ?? []],
|
|
4107
|
+
denyWritePaths: [...options.nativeSandbox?.denyWritePaths ?? []]
|
|
4103
4108
|
};
|
|
4104
4109
|
this._initialReadWritePaths = new Set(this._nativeSandboxConfig.readWritePaths ?? []);
|
|
4110
|
+
this._initialDenyWritePaths = new Set(this._nativeSandboxConfig.denyWritePaths ?? []);
|
|
4105
4111
|
this.isolation = requestedIsolation;
|
|
4106
4112
|
this._instructionsOverride = options.instructions;
|
|
4107
4113
|
this._checkpointName = options.checkpointName;
|
|
@@ -4129,7 +4135,8 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
|
|
|
4129
4135
|
nativeSandbox: {
|
|
4130
4136
|
...this._nativeSandboxConfig,
|
|
4131
4137
|
readWritePaths: [...this._initialReadWritePaths],
|
|
4132
|
-
readOnlyPaths: [...this._nativeSandboxConfig.readOnlyPaths ?? []]
|
|
4138
|
+
readOnlyPaths: [...this._nativeSandboxConfig.readOnlyPaths ?? []],
|
|
4139
|
+
denyWritePaths: [...this._initialDenyWritePaths]
|
|
4133
4140
|
},
|
|
4134
4141
|
...this._instructionsOverride !== void 0 && { instructions: this._instructionsOverride },
|
|
4135
4142
|
...(options.checkpointName ?? this._checkpointName) !== void 0 && { checkpointName: options.checkpointName ?? this._checkpointName },
|
|
@@ -4367,7 +4374,8 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
|
|
|
4367
4374
|
isolationConfig: this.isolation !== "none" ? {
|
|
4368
4375
|
allowNetwork: this._nativeSandboxConfig.allowNetwork ?? false,
|
|
4369
4376
|
readOnlyPaths: this._nativeSandboxConfig.readOnlyPaths,
|
|
4370
|
-
readWritePaths: this._nativeSandboxConfig.readWritePaths
|
|
4377
|
+
readWritePaths: this._nativeSandboxConfig.readWritePaths,
|
|
4378
|
+
denyWritePaths: this._nativeSandboxConfig.denyWritePaths
|
|
4371
4379
|
} : void 0
|
|
4372
4380
|
}
|
|
4373
4381
|
};
|
|
@@ -4438,7 +4446,8 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
|
|
|
4438
4446
|
config
|
|
4439
4447
|
});
|
|
4440
4448
|
this._activeMountPaths.add(mountPath);
|
|
4441
|
-
this.addMountPathToIsolation(mountPath, hostPath);
|
|
4449
|
+
const isolationError = this.addMountPathToIsolation(mountPath, hostPath, filesystem.readOnly === true);
|
|
4450
|
+
if (isolationError) return this.failMountIsolation(filesystem, mountPath, config, isolationError);
|
|
4442
4451
|
return {
|
|
4443
4452
|
success: true,
|
|
4444
4453
|
mountPath
|
|
@@ -4549,7 +4558,8 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
|
|
|
4549
4558
|
});
|
|
4550
4559
|
this._activeMountPaths.add(mountPath);
|
|
4551
4560
|
await this.writeMarkerFile(mountPath, hostPath);
|
|
4552
|
-
this.addMountPathToIsolation(mountPath, hostPath);
|
|
4561
|
+
const isolationError = this.addMountPathToIsolation(mountPath, hostPath, filesystem.readOnly === true);
|
|
4562
|
+
if (isolationError) return this.failMountIsolation(filesystem, mountPath, config, isolationError);
|
|
4553
4563
|
this.logger.debug("Mounted", {
|
|
4554
4564
|
mountPath,
|
|
4555
4565
|
hostPath
|
|
@@ -4662,53 +4672,91 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
|
|
|
4662
4672
|
}
|
|
4663
4673
|
}
|
|
4664
4674
|
/**
|
|
4665
|
-
* Dynamically add a mount path to the sandbox isolation
|
|
4675
|
+
* Dynamically add a mount path to the sandbox isolation config.
|
|
4666
4676
|
*
|
|
4667
|
-
* -
|
|
4668
|
-
*
|
|
4677
|
+
* Read-write mounts go to `readWritePaths`; mounts whose filesystem is
|
|
4678
|
+
* `readOnly` go to `denyWritePaths` so subprocesses can read but never write
|
|
4679
|
+
* them, matching what file tools enforce. Both backends read the config on
|
|
4680
|
+
* every wrapCommand() call, so the change takes effect immediately.
|
|
4669
4681
|
*
|
|
4670
4682
|
* Local mounts are symlinks under `workingDirectory`. Bubblewrap cannot
|
|
4671
4683
|
* `--bind` a symlink (it fails with "Unable to mount source on destination"),
|
|
4672
4684
|
* so we store the canonical path (`realpath`) of the mount point — the same
|
|
4673
4685
|
* directory the symlink refers to.
|
|
4686
|
+
*
|
|
4687
|
+
* Returns an error when a read-only mount can't be resolved: a write denial on
|
|
4688
|
+
* the unresolved symlink wouldn't cover the directory writes actually land in.
|
|
4674
4689
|
*/
|
|
4675
|
-
addMountPathToIsolation(mountPath, hostPath) {
|
|
4690
|
+
addMountPathToIsolation(mountPath, hostPath, readOnly) {
|
|
4676
4691
|
if (this.isolation === "none") return;
|
|
4677
4692
|
const normMount = normalizeMountPath(mountPath);
|
|
4678
|
-
|
|
4693
|
+
const list = readOnly ? "denyWritePaths" : "readWritePaths";
|
|
4694
|
+
const existing = this._mountPathToIsolationPath.get(normMount);
|
|
4695
|
+
if (existing?.list === list) return;
|
|
4696
|
+
if (existing) this.removeMountIsolationForPath(normMount);
|
|
4679
4697
|
let isolationPath = hostPath;
|
|
4680
4698
|
try {
|
|
4681
4699
|
isolationPath = (0, fs.realpathSync)(hostPath);
|
|
4682
|
-
} catch {
|
|
4683
|
-
|
|
4700
|
+
} catch {
|
|
4701
|
+
if (readOnly) return `Cannot mount read-only filesystem at ${hostPath}: its source could not be resolved, so writes to it can't be denied to sandboxed commands.`;
|
|
4702
|
+
this.logger.warn("Could not resolve mount path for isolation; using unresolved path", { hostPath });
|
|
4703
|
+
}
|
|
4704
|
+
if (!this._nativeSandboxConfig[list]) this._nativeSandboxConfig = {
|
|
4684
4705
|
...this._nativeSandboxConfig,
|
|
4685
|
-
|
|
4706
|
+
[list]: []
|
|
4686
4707
|
};
|
|
4687
|
-
const paths = this._nativeSandboxConfig
|
|
4708
|
+
const paths = this._nativeSandboxConfig[list];
|
|
4688
4709
|
if (!paths.includes(isolationPath)) paths.push(isolationPath);
|
|
4689
|
-
if (!
|
|
4690
|
-
|
|
4710
|
+
if (!(readOnly ? this._initialDenyWritePaths : this._initialReadWritePaths).has(isolationPath)) {
|
|
4711
|
+
const key = `${list}:${isolationPath}`;
|
|
4712
|
+
this._mountIsolationRefCount.set(key, (this._mountIsolationRefCount.get(key) ?? 0) + 1);
|
|
4713
|
+
}
|
|
4714
|
+
this._mountPathToIsolationPath.set(normMount, {
|
|
4715
|
+
path: isolationPath,
|
|
4716
|
+
list
|
|
4717
|
+
});
|
|
4718
|
+
}
|
|
4719
|
+
/** Undo a mount whose isolation couldn't be applied and record it as failed. */
|
|
4720
|
+
async failMountIsolation(filesystem, mountPath, config, error) {
|
|
4721
|
+
this.logger.error("Could not apply mount isolation", {
|
|
4722
|
+
mountPath,
|
|
4723
|
+
error
|
|
4724
|
+
});
|
|
4725
|
+
await this.unmount(mountPath);
|
|
4726
|
+
this.mounts.set(mountPath, {
|
|
4727
|
+
filesystem,
|
|
4728
|
+
state: "error",
|
|
4729
|
+
config,
|
|
4730
|
+
error
|
|
4731
|
+
});
|
|
4732
|
+
return {
|
|
4733
|
+
success: false,
|
|
4734
|
+
mountPath,
|
|
4735
|
+
error
|
|
4736
|
+
};
|
|
4691
4737
|
}
|
|
4692
4738
|
/**
|
|
4693
|
-
* Reverse {@link addMountPathToIsolation}: drop refcounted paths from the
|
|
4694
|
-
* while preserving user-provided
|
|
4739
|
+
* Reverse {@link addMountPathToIsolation}: drop refcounted paths from the isolation
|
|
4740
|
+
* config on unmount while preserving user-provided paths from construction.
|
|
4695
4741
|
*/
|
|
4696
4742
|
removeMountIsolationForPath(mountPath) {
|
|
4697
4743
|
if (this.isolation === "none") return;
|
|
4698
4744
|
const normMount = normalizeMountPath(mountPath);
|
|
4699
|
-
const
|
|
4700
|
-
if (
|
|
4745
|
+
const entry = this._mountPathToIsolationPath.get(normMount);
|
|
4746
|
+
if (entry === void 0) return;
|
|
4701
4747
|
this._mountPathToIsolationPath.delete(normMount);
|
|
4702
|
-
|
|
4703
|
-
|
|
4748
|
+
const { path: isolationPath, list } = entry;
|
|
4749
|
+
if ((list === "denyWritePaths" ? this._initialDenyWritePaths : this._initialReadWritePaths).has(isolationPath)) return;
|
|
4750
|
+
const key = `${list}:${isolationPath}`;
|
|
4751
|
+
const next = (this._mountIsolationRefCount.get(key) ?? 0) - 1;
|
|
4704
4752
|
if (next <= 0) {
|
|
4705
|
-
this._mountIsolationRefCount.delete(
|
|
4706
|
-
const paths = this._nativeSandboxConfig
|
|
4753
|
+
this._mountIsolationRefCount.delete(key);
|
|
4754
|
+
const paths = this._nativeSandboxConfig[list];
|
|
4707
4755
|
if (paths) {
|
|
4708
4756
|
const idx = paths.indexOf(isolationPath);
|
|
4709
4757
|
if (idx !== -1) paths.splice(idx, 1);
|
|
4710
4758
|
}
|
|
4711
|
-
} else this._mountIsolationRefCount.set(
|
|
4759
|
+
} else this._mountIsolationRefCount.set(key, next);
|
|
4712
4760
|
}
|
|
4713
4761
|
/**
|
|
4714
4762
|
* Resolve a virtual mount path to a host filesystem path.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/core",
|
|
3
|
-
"version": "1.86.0-alpha.
|
|
3
|
+
"version": "1.86.0-alpha.9",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -968,12 +968,12 @@
|
|
|
968
968
|
"zod-v3": "npm:zod@3.25.76",
|
|
969
969
|
"@internal/ai-sdk-v4": "0.0.98",
|
|
970
970
|
"@internal/ai-sdk-v5": "0.0.98",
|
|
971
|
-
"@internal/ai-v7": "0.0.98",
|
|
972
971
|
"@internal/ai-v6": "0.0.98",
|
|
972
|
+
"@internal/ai-v7": "0.0.98",
|
|
973
973
|
"@internal/auth": "0.0.39",
|
|
974
974
|
"@internal/core": "0.1.4",
|
|
975
|
-
"@internal/deployer": "0.0.4",
|
|
976
975
|
"@internal/external-types": "0.0.101",
|
|
976
|
+
"@internal/deployer": "0.0.4",
|
|
977
977
|
"@internal/lint": "0.0.151",
|
|
978
978
|
"@internal/llm-recorder": "0.0.87",
|
|
979
979
|
"@internal/test-utils": "0.0.87",
|