@mastra/core 1.2.1-alpha.0 → 1.3.0-alpha.2
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/CHANGELOG.md +341 -0
- package/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +2093 -262
- package/dist/agent/agent-legacy.d.ts.map +1 -1
- package/dist/agent/agent.d.ts +12 -3
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/index.cjs +13 -13
- package/dist/agent/index.js +2 -2
- package/dist/agent/message-list/index.cjs +18 -18
- package/dist/agent/message-list/index.js +1 -1
- package/dist/agent/message-list/message-list.d.ts.map +1 -1
- package/dist/agent/types.d.ts +6 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/index.d.ts +3 -1
- package/dist/agent/workflows/prepare-stream/index.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/map-results-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/stream-step.d.ts +3 -1
- package/dist/agent/workflows/prepare-stream/stream-step.d.ts.map +1 -1
- package/dist/base.cjs +2 -2
- package/dist/base.d.ts +13 -1
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +1 -1
- package/dist/bundler/index.cjs +2 -2
- package/dist/bundler/index.js +1 -1
- package/dist/cache/index.cjs +3 -3
- package/dist/cache/index.js +1 -1
- package/dist/{chunk-ENCTSDWC.js → chunk-2GWTJFVM.js} +2410 -1402
- package/dist/chunk-2GWTJFVM.js.map +1 -0
- package/dist/{chunk-OB4V67IX.cjs → chunk-2K5PNW2U.cjs} +4 -4
- package/dist/{chunk-OB4V67IX.cjs.map → chunk-2K5PNW2U.cjs.map} +1 -1
- package/dist/{chunk-VZXYBFCX.cjs → chunk-2P6DD7M5.cjs} +10 -10
- package/dist/{chunk-VZXYBFCX.cjs.map → chunk-2P6DD7M5.cjs.map} +1 -1
- package/dist/{chunk-Q2D7LERO.cjs → chunk-2VD5OGOT.cjs} +4 -4
- package/dist/{chunk-Q2D7LERO.cjs.map → chunk-2VD5OGOT.cjs.map} +1 -1
- package/dist/{chunk-2DMSFLJY.cjs → chunk-6TZKQI4R.cjs} +8 -8
- package/dist/chunk-6TZKQI4R.cjs.map +1 -0
- package/dist/{chunk-4NG7CKEG.js → chunk-6VGCVSP4.js} +3 -3
- package/dist/{chunk-4NG7CKEG.js.map → chunk-6VGCVSP4.js.map} +1 -1
- package/dist/{chunk-IIZF4W7B.cjs → chunk-7UWHFWST.cjs} +52 -5
- package/dist/chunk-7UWHFWST.cjs.map +1 -0
- package/dist/{chunk-VW7YQWDW.cjs → chunk-BFIOQFGF.cjs} +28 -2
- package/dist/chunk-BFIOQFGF.cjs.map +1 -0
- package/dist/{chunk-E3VFKTIA.js → chunk-BXLLXTT4.js} +2245 -179
- package/dist/chunk-BXLLXTT4.js.map +1 -0
- package/dist/{chunk-HMCXNOF6.cjs → chunk-CGPH7CMG.cjs} +2431 -1417
- package/dist/chunk-CGPH7CMG.cjs.map +1 -0
- package/dist/{chunk-GVLPTDJA.cjs → chunk-D5JZT6EK.cjs} +236 -63
- package/dist/chunk-D5JZT6EK.cjs.map +1 -0
- package/dist/{chunk-5SOS47PH.cjs → chunk-FLHFB23E.cjs} +454 -222
- package/dist/chunk-FLHFB23E.cjs.map +1 -0
- package/dist/{chunk-XCPEEIHI.cjs → chunk-GCTAD6B7.cjs} +3012 -927
- package/dist/chunk-GCTAD6B7.cjs.map +1 -0
- package/dist/{chunk-W3AQUG66.js → chunk-GIY5BINT.js} +4 -4
- package/dist/{chunk-W3AQUG66.js.map → chunk-GIY5BINT.js.map} +1 -1
- package/dist/{chunk-M6VFJX5A.js → chunk-GMSAGYTB.js} +3 -3
- package/dist/{chunk-M6VFJX5A.js.map → chunk-GMSAGYTB.js.map} +1 -1
- package/dist/{chunk-JRJJ5VQE.cjs → chunk-GZD6443M.cjs} +99 -55
- package/dist/chunk-GZD6443M.cjs.map +1 -0
- package/dist/{chunk-Z6NRYYOH.js → chunk-ILQXPZCD.js} +9 -4
- package/dist/chunk-ILQXPZCD.js.map +1 -0
- package/dist/{chunk-5YVR7B4R.js → chunk-JQNREL64.js} +29 -9
- package/dist/chunk-JQNREL64.js.map +1 -0
- package/dist/{chunk-QOFI2WBM.cjs → chunk-JU6K7UDX.cjs} +991 -229
- package/dist/chunk-JU6K7UDX.cjs.map +1 -0
- package/dist/{chunk-HN2MSTR6.cjs → chunk-KAJNBNWP.cjs} +283 -38
- package/dist/chunk-KAJNBNWP.cjs.map +1 -0
- package/dist/{chunk-MSWXEOZC.js → chunk-KL2JPSRX.js} +5 -5
- package/dist/chunk-KL2JPSRX.js.map +1 -0
- package/dist/{chunk-MQB7XFXP.js → chunk-LHRHOPUC.js} +3 -3
- package/dist/{chunk-MQB7XFXP.js.map → chunk-LHRHOPUC.js.map} +1 -1
- package/dist/{chunk-VX7UA3SO.js → chunk-MOOJ3H3C.js} +974 -217
- package/dist/chunk-MOOJ3H3C.js.map +1 -0
- package/dist/{chunk-HU2ONA2W.cjs → chunk-ON2KVIUJ.cjs} +17 -17
- package/dist/{chunk-HU2ONA2W.cjs.map → chunk-ON2KVIUJ.cjs.map} +1 -1
- package/dist/{chunk-I66TMZJ3.cjs → chunk-OOCEAC6U.cjs} +21 -18
- package/dist/chunk-OOCEAC6U.cjs.map +1 -0
- package/dist/{chunk-MNWW2R3U.js → chunk-OV7OOUUR.js} +90 -54
- package/dist/chunk-OV7OOUUR.js.map +1 -0
- package/dist/{chunk-C4WWWQHT.cjs → chunk-RO47SMI7.cjs} +23 -3
- package/dist/chunk-RO47SMI7.cjs.map +1 -0
- package/dist/{chunk-6FG6FU5Y.cjs → chunk-RQ56ZSIR.cjs} +4 -4
- package/dist/{chunk-6FG6FU5Y.cjs.map → chunk-RQ56ZSIR.cjs.map} +1 -1
- package/dist/{chunk-IW3BNL7A.js → chunk-RS6CZXGA.js} +50 -3
- package/dist/chunk-RS6CZXGA.js.map +1 -0
- package/dist/{chunk-AIJLACR2.js → chunk-S53FKKVL.js} +27 -3
- package/dist/chunk-S53FKKVL.js.map +1 -0
- package/dist/{chunk-G6E3QNJC.js → chunk-SBPPGJL6.js} +4078 -4333
- package/dist/chunk-SBPPGJL6.js.map +1 -0
- package/dist/{chunk-UZL4H5P2.cjs → chunk-SH4PCZ3X.cjs} +5375 -5648
- package/dist/chunk-SH4PCZ3X.cjs.map +1 -0
- package/dist/{chunk-ZWM2CAIM.js → chunk-STKNQDVA.js} +4 -4
- package/dist/{chunk-ZWM2CAIM.js.map → chunk-STKNQDVA.js.map} +1 -1
- package/dist/{chunk-A5QFWX67.cjs → chunk-U2CABSMC.cjs} +79 -59
- package/dist/chunk-U2CABSMC.cjs.map +1 -0
- package/dist/{chunk-7MDVYPWX.cjs → chunk-UE2G2LRP.cjs} +9 -4
- package/dist/chunk-UE2G2LRP.cjs.map +1 -0
- package/dist/{chunk-AUF6U2BL.js → chunk-VM25PDSW.js} +5 -5
- package/dist/{chunk-AUF6U2BL.js.map → chunk-VM25PDSW.js.map} +1 -1
- package/dist/{chunk-RXD5EGQF.js → chunk-VVD56FI4.js} +228 -55
- package/dist/chunk-VVD56FI4.js.map +1 -0
- package/dist/{chunk-JIT2OY3X.js → chunk-WCAFTXGK.js} +23 -3
- package/dist/chunk-WCAFTXGK.js.map +1 -0
- package/dist/{chunk-P62OJXQ4.js → chunk-WL3AW3YA.js} +282 -37
- package/dist/chunk-WL3AW3YA.js.map +1 -0
- package/dist/{chunk-YLODOPYM.cjs → chunk-XDD5V446.cjs} +4163 -5352
- package/dist/chunk-XDD5V446.cjs.map +1 -0
- package/dist/{chunk-B4M33FCS.cjs → chunk-XQVYEOI7.cjs} +7 -7
- package/dist/{chunk-B4M33FCS.cjs.map → chunk-XQVYEOI7.cjs.map} +1 -1
- package/dist/{chunk-BP2TSCBW.js → chunk-ZATLLPIH.js} +4391 -5561
- package/dist/chunk-ZATLLPIH.js.map +1 -0
- package/dist/{chunk-T6PRRKMW.js → chunk-ZHFM7HCQ.js} +9 -6
- package/dist/chunk-ZHFM7HCQ.js.map +1 -0
- package/dist/{chunk-WFUNLRQX.js → chunk-ZRUTE56J.js} +366 -134
- package/dist/chunk-ZRUTE56J.js.map +1 -0
- package/dist/deployer/index.cjs +2 -2
- package/dist/deployer/index.js +1 -1
- package/dist/docs/SKILL.md +2 -9
- package/dist/docs/assets/SOURCE_MAP.json +399 -342
- package/dist/docs/references/docs-agents-agent-memory.md +45 -1
- package/dist/docs/references/docs-agents-network-approval.md +1 -1
- package/dist/docs/references/docs-agents-networks.md +3 -3
- package/dist/docs/references/docs-agents-overview.md +8 -0
- package/dist/docs/references/docs-agents-using-tools.md +82 -72
- package/dist/docs/references/docs-memory-observational-memory.md +11 -8
- package/dist/docs/references/docs-observability-overview.md +1 -1
- package/dist/docs/references/docs-observability-tracing-exporters-langsmith.md +70 -0
- package/dist/docs/references/docs-observability-tracing-overview.md +1 -1
- package/dist/docs/references/docs-server-middleware.md +0 -2
- package/dist/docs/references/docs-server-request-context.md +17 -0
- package/dist/docs/references/docs-workflows-agents-and-tools.md +2 -2
- package/dist/docs/references/docs-workflows-overview.md +1 -1
- package/dist/docs/references/docs-workspace-filesystem.md +2 -0
- package/dist/docs/references/docs-workspace-overview.md +3 -1
- package/dist/docs/references/docs-workspace-sandbox.md +2 -0
- package/dist/docs/references/docs-workspace-search.md +2 -0
- package/dist/docs/references/docs-workspace-skills.md +3 -1
- package/dist/docs/references/reference-agents-getTools.md +1 -6
- package/dist/docs/references/reference-agents-listAgents.md +1 -1
- package/dist/docs/references/reference-agents-network.md +0 -2
- package/dist/docs/references/reference-cli-mastra.md +29 -4
- package/dist/docs/references/reference-client-js-agents.md +1 -1
- package/dist/docs/references/reference-configuration.md +1 -1
- package/dist/docs/references/reference-core-getStoredAgentById.md +2 -2
- package/dist/docs/references/reference-core-listStoredAgents.md +1 -1
- package/dist/docs/references/reference-memory-observational-memory.md +2 -0
- package/dist/docs/references/reference-tools-mcp-client.md +0 -2
- package/dist/docs/references/reference-workflows-step.md +2 -0
- package/dist/docs/references/reference-workflows-workflow-methods-map.md +2 -2
- package/dist/docs/references/reference-workspace-filesystem.md +2 -0
- package/dist/docs/references/reference-workspace-local-filesystem.md +2 -0
- package/dist/docs/references/reference-workspace-local-sandbox.md +2 -0
- package/dist/docs/references/reference-workspace-sandbox.md +2 -0
- package/dist/docs/references/reference-workspace-workspace-class.md +2 -0
- package/dist/docs/references/reference.md +7 -2
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/index.d.ts.map +1 -1
- package/dist/editor/types.d.ts +53 -48
- package/dist/editor/types.d.ts.map +1 -1
- package/dist/evals/base.d.ts +15 -0
- package/dist/evals/base.d.ts.map +1 -1
- package/dist/evals/index.cjs +20 -20
- package/dist/evals/index.js +3 -3
- package/dist/evals/run/index.d.ts +3 -3
- package/dist/evals/run/index.d.ts.map +1 -1
- package/dist/evals/scoreTraces/index.cjs +5 -5
- package/dist/evals/scoreTraces/index.js +2 -2
- package/dist/features/index.cjs +1 -1
- package/dist/features/index.cjs.map +1 -1
- package/dist/features/index.d.ts.map +1 -1
- package/dist/features/index.js +1 -1
- package/dist/features/index.js.map +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/integration/index.cjs +2 -2
- package/dist/integration/index.js +1 -1
- package/dist/llm/index.cjs +16 -16
- package/dist/llm/index.js +5 -5
- package/dist/llm/model/gateways/constants.d.ts.map +1 -1
- package/dist/llm/model/gateways/models-dev.d.ts.map +1 -1
- package/dist/llm/model/model.loop.d.ts +1 -1
- package/dist/llm/model/model.loop.d.ts.map +1 -1
- package/dist/llm/model/provider-types.generated.d.ts +128 -10
- package/dist/llm/model/resolve-model.d.ts.map +1 -1
- package/dist/loop/index.cjs +12 -12
- package/dist/loop/index.js +1 -1
- package/dist/loop/network/index.d.ts +3 -3
- package/dist/loop/network/index.d.ts.map +1 -1
- package/dist/loop/network/run-command-tool.d.ts +1 -1
- package/dist/loop/types.d.ts +13 -0
- package/dist/loop/types.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/index.d.ts +9 -9
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +7 -7
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts +3 -3
- package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-loop/index.d.ts +9 -9
- package/dist/loop/workflows/schema.d.ts +12 -12
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.d.ts +91 -5
- package/dist/mastra/index.d.ts.map +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/mcp/index.cjs +2 -2
- package/dist/mcp/index.js +1 -1
- package/dist/memory/index.cjs +14 -14
- package/dist/memory/index.js +1 -1
- package/dist/memory/mock.d.ts.map +1 -1
- package/dist/memory/types.d.ts +128 -0
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/models-dev-FQVUTQ7L.js +3 -0
- package/dist/{models-dev-Z45JSLWD.js.map → models-dev-FQVUTQ7L.js.map} +1 -1
- package/dist/models-dev-PPIXUUCU.cjs +12 -0
- package/dist/{models-dev-OQKVMEIT.cjs.map → models-dev-PPIXUUCU.cjs.map} +1 -1
- package/dist/netlify-4RIKF7Y3.js +3 -0
- package/dist/{netlify-SSWMYSAX.js.map → netlify-4RIKF7Y3.js.map} +1 -1
- package/dist/netlify-V5F7JEJH.cjs +12 -0
- package/dist/{netlify-TXZZCT6N.cjs.map → netlify-V5F7JEJH.cjs.map} +1 -1
- package/dist/processors/index.cjs +41 -41
- package/dist/processors/index.js +1 -1
- package/dist/processors/step-schema.d.ts +44 -44
- package/dist/provider-registry-C6XCYX44.cjs +40 -0
- package/dist/{provider-registry-NR7FXV2Q.cjs.map → provider-registry-C6XCYX44.cjs.map} +1 -1
- package/dist/provider-registry-NWU4YFQW.js +3 -0
- package/dist/{provider-registry-RPOTQNHI.js.map → provider-registry-NWU4YFQW.js.map} +1 -1
- package/dist/provider-registry.json +278 -33
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/server/index.cjs +3 -3
- package/dist/server/index.js +1 -1
- package/dist/storage/base.d.ts +3 -1
- package/dist/storage/base.d.ts.map +1 -1
- package/dist/storage/constants.cjs +51 -19
- package/dist/storage/constants.d.ts +10 -2
- package/dist/storage/constants.d.ts.map +1 -1
- package/dist/storage/constants.js +1 -1
- package/dist/storage/domains/agents/base.d.ts +13 -164
- package/dist/storage/domains/agents/base.d.ts.map +1 -1
- package/dist/storage/domains/agents/index.d.ts +0 -1
- package/dist/storage/domains/agents/index.d.ts.map +1 -1
- package/dist/storage/domains/agents/inmemory.d.ts +6 -10
- package/dist/storage/domains/agents/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/index.d.ts +3 -0
- package/dist/storage/domains/index.d.ts.map +1 -1
- package/dist/storage/domains/inmemory-db.d.ts +7 -1
- package/dist/storage/domains/inmemory-db.d.ts.map +1 -1
- package/dist/storage/domains/memory/base.d.ts +45 -5
- package/dist/storage/domains/memory/base.d.ts.map +1 -1
- package/dist/storage/domains/memory/inmemory.d.ts +7 -7
- package/dist/storage/domains/memory/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/observability/types.d.ts +62 -62
- package/dist/storage/domains/operations/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/prompt-blocks/base.d.ts +47 -0
- package/dist/storage/domains/prompt-blocks/base.d.ts.map +1 -0
- package/dist/storage/domains/prompt-blocks/index.d.ts +3 -0
- package/dist/storage/domains/prompt-blocks/index.d.ts.map +1 -0
- package/dist/storage/domains/prompt-blocks/inmemory.d.ts +31 -0
- package/dist/storage/domains/prompt-blocks/inmemory.d.ts.map +1 -0
- package/dist/storage/domains/scorer-definitions/base.d.ts +47 -0
- package/dist/storage/domains/scorer-definitions/base.d.ts.map +1 -0
- package/dist/storage/domains/scorer-definitions/index.d.ts +3 -0
- package/dist/storage/domains/scorer-definitions/index.d.ts.map +1 -0
- package/dist/storage/domains/scorer-definitions/inmemory.d.ts +31 -0
- package/dist/storage/domains/scorer-definitions/inmemory.d.ts.map +1 -0
- package/dist/storage/domains/versioned.d.ts +136 -0
- package/dist/storage/domains/versioned.d.ts.map +1 -0
- package/dist/storage/index.cjs +156 -104
- package/dist/storage/index.js +2 -2
- package/dist/storage/mock.d.ts.map +1 -1
- package/dist/storage/types.d.ts +481 -27
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/stream/MastraAgentNetworkStream.d.ts +1 -1
- package/dist/stream/MastraWorkflowStream.d.ts +1 -1
- package/dist/stream/RunOutput.d.ts +1 -1
- package/dist/stream/RunOutput.d.ts.map +1 -1
- package/dist/stream/base/output.d.ts +4 -0
- package/dist/stream/base/output.d.ts.map +1 -1
- package/dist/stream/index.cjs +11 -11
- package/dist/stream/index.js +2 -2
- package/dist/test-utils/llm-mock.cjs +4 -4
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/tool-loop-agent/index.cjs +4 -4
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/tools/index.cjs +4 -4
- package/dist/tools/index.js +1 -1
- package/dist/tools/is-vercel-tool.cjs +2 -2
- package/dist/tools/is-vercel-tool.js +1 -1
- package/dist/tools/tool-builder/builder.d.ts.map +1 -1
- package/dist/tools/types.d.ts +15 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/validation.d.ts.map +1 -1
- package/dist/tts/index.cjs +2 -2
- package/dist/tts/index.js +1 -1
- package/dist/types/zod-compat.d.ts +2 -2
- package/dist/types/zod-compat.d.ts.map +1 -1
- package/dist/utils/zod-utils.d.ts +19 -0
- package/dist/utils/zod-utils.d.ts.map +1 -1
- package/dist/utils.cjs +28 -28
- package/dist/utils.d.ts +7 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +2 -2
- package/dist/vector/index.cjs +9 -9
- package/dist/vector/index.js +2 -2
- package/dist/voice/index.cjs +6 -6
- package/dist/voice/index.js +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/evented/step-executor.d.ts.map +1 -1
- package/dist/workflows/evented/workflow.d.ts +3 -1
- package/dist/workflows/evented/workflow.d.ts.map +1 -1
- package/dist/workflows/execution-engine.d.ts.map +1 -1
- package/dist/workflows/index.cjs +25 -25
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/step.d.ts +4 -3
- package/dist/workflows/step.d.ts.map +1 -1
- package/dist/workflows/types.d.ts +2 -1
- package/dist/workflows/types.d.ts.map +1 -1
- package/dist/workflows/workflow.d.ts +12 -4
- package/dist/workflows/workflow.d.ts.map +1 -1
- package/dist/workspace/errors.d.ts +6 -0
- package/dist/workspace/errors.d.ts.map +1 -1
- package/dist/workspace/filesystem/composite-filesystem.d.ts +93 -0
- package/dist/workspace/filesystem/composite-filesystem.d.ts.map +1 -0
- package/dist/workspace/filesystem/filesystem.d.ts +35 -0
- package/dist/workspace/filesystem/filesystem.d.ts.map +1 -1
- package/dist/workspace/filesystem/index.d.ts +2 -0
- package/dist/workspace/filesystem/index.d.ts.map +1 -1
- package/dist/workspace/filesystem/local-filesystem.d.ts +9 -1
- package/dist/workspace/filesystem/local-filesystem.d.ts.map +1 -1
- package/dist/workspace/filesystem/mastra-filesystem.d.ts +92 -3
- package/dist/workspace/filesystem/mastra-filesystem.d.ts.map +1 -1
- package/dist/workspace/filesystem/mount.d.ts +34 -0
- package/dist/workspace/filesystem/mount.d.ts.map +1 -0
- package/dist/workspace/index.cjs +62 -34
- package/dist/workspace/index.d.ts +6 -2
- package/dist/workspace/index.d.ts.map +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/lifecycle.d.ts +29 -0
- package/dist/workspace/lifecycle.d.ts.map +1 -1
- package/dist/workspace/sandbox/errors.d.ts +50 -0
- package/dist/workspace/sandbox/errors.d.ts.map +1 -0
- package/dist/workspace/sandbox/index.d.ts +3 -0
- package/dist/workspace/sandbox/index.d.ts.map +1 -1
- package/dist/workspace/sandbox/local-sandbox.d.ts +17 -2
- package/dist/workspace/sandbox/local-sandbox.d.ts.map +1 -1
- package/dist/workspace/sandbox/mastra-sandbox.d.ts +153 -6
- package/dist/workspace/sandbox/mastra-sandbox.d.ts.map +1 -1
- package/dist/workspace/sandbox/mount-manager.d.ts +195 -0
- package/dist/workspace/sandbox/mount-manager.d.ts.map +1 -0
- package/dist/workspace/sandbox/sandbox.d.ts +37 -84
- package/dist/workspace/sandbox/sandbox.d.ts.map +1 -1
- package/dist/workspace/sandbox/types.d.ts +92 -0
- package/dist/workspace/sandbox/types.d.ts.map +1 -0
- package/dist/workspace/tools/tools.d.ts.map +1 -1
- package/dist/workspace/tools/tree-formatter.d.ts.map +1 -1
- package/dist/workspace/workspace.d.ts +73 -3
- package/dist/workspace/workspace.d.ts.map +1 -1
- package/package.json +16 -16
- package/src/llm/model/provider-types.generated.d.ts +128 -10
- package/dist/chunk-2DMSFLJY.cjs.map +0 -1
- package/dist/chunk-5SOS47PH.cjs.map +0 -1
- package/dist/chunk-5YVR7B4R.js.map +0 -1
- package/dist/chunk-7MDVYPWX.cjs.map +0 -1
- package/dist/chunk-A5QFWX67.cjs.map +0 -1
- package/dist/chunk-AIJLACR2.js.map +0 -1
- package/dist/chunk-BP2TSCBW.js.map +0 -1
- package/dist/chunk-C4WWWQHT.cjs.map +0 -1
- package/dist/chunk-E3VFKTIA.js.map +0 -1
- package/dist/chunk-ENCTSDWC.js.map +0 -1
- package/dist/chunk-G6E3QNJC.js.map +0 -1
- package/dist/chunk-GVLPTDJA.cjs.map +0 -1
- package/dist/chunk-HMCXNOF6.cjs.map +0 -1
- package/dist/chunk-HN2MSTR6.cjs.map +0 -1
- package/dist/chunk-I66TMZJ3.cjs.map +0 -1
- package/dist/chunk-IIZF4W7B.cjs.map +0 -1
- package/dist/chunk-IW3BNL7A.js.map +0 -1
- package/dist/chunk-JIT2OY3X.js.map +0 -1
- package/dist/chunk-JRJJ5VQE.cjs.map +0 -1
- package/dist/chunk-MNWW2R3U.js.map +0 -1
- package/dist/chunk-MSWXEOZC.js.map +0 -1
- package/dist/chunk-P62OJXQ4.js.map +0 -1
- package/dist/chunk-QOFI2WBM.cjs.map +0 -1
- package/dist/chunk-RXD5EGQF.js.map +0 -1
- package/dist/chunk-T6PRRKMW.js.map +0 -1
- package/dist/chunk-UZL4H5P2.cjs.map +0 -1
- package/dist/chunk-VW7YQWDW.cjs.map +0 -1
- package/dist/chunk-VX7UA3SO.js.map +0 -1
- package/dist/chunk-WFUNLRQX.js.map +0 -1
- package/dist/chunk-XCPEEIHI.cjs.map +0 -1
- package/dist/chunk-YLODOPYM.cjs.map +0 -1
- package/dist/chunk-Z6NRYYOH.js.map +0 -1
- package/dist/docs/references/docs-tools-mcp-advanced-usage.md +0 -143
- package/dist/docs/references/docs-tools-mcp-mcp-overview.md +0 -383
- package/dist/docs/references/docs-tools-mcp-overview.md +0 -78
- package/dist/docs/references/docs-workflows-input-data-mapping.md +0 -102
- package/dist/docs/references/reference-deployer-netlify.md +0 -14
- package/dist/docs/references/reference-deployer-vercel.md +0 -39
- package/dist/docs/references/reference-tools-client.md +0 -228
- package/dist/models-dev-OQKVMEIT.cjs +0 -12
- package/dist/models-dev-Z45JSLWD.js +0 -3
- package/dist/netlify-SSWMYSAX.js +0 -3
- package/dist/netlify-TXZZCT6N.cjs +0 -12
- package/dist/provider-registry-NR7FXV2Q.cjs +0 -40
- package/dist/provider-registry-RPOTQNHI.js +0 -3
|
@@ -4,35 +4,81 @@
|
|
|
4
4
|
* Abstract base class for sandbox providers that want automatic logger integration.
|
|
5
5
|
* Extends MastraBase to receive the Mastra logger when registered with a Mastra instance.
|
|
6
6
|
*
|
|
7
|
+
* MountManager is automatically created if the subclass implements `mount()`.
|
|
8
|
+
* Use `declare readonly mounts: MountManager` to get non-optional typing.
|
|
9
|
+
*
|
|
10
|
+
* ## Lifecycle Management
|
|
11
|
+
*
|
|
12
|
+
* The base class provides race-condition-safe lifecycle wrappers:
|
|
13
|
+
* - `_start()` - Handles concurrent calls, status management, and mount processing
|
|
14
|
+
* - `_stop()` - Handles concurrent calls and status management
|
|
15
|
+
* - `_destroy()` - Handles concurrent calls and status management
|
|
16
|
+
*
|
|
17
|
+
* Subclasses override the plain `start()`, `stop()`, and `destroy()` methods
|
|
18
|
+
* to provide their implementation. Callers use the `_`-prefixed wrappers
|
|
19
|
+
* (or `callLifecycle()`) which add status tracking and race-condition safety.
|
|
20
|
+
*
|
|
7
21
|
* External providers can extend this class to get logger support, or implement
|
|
8
22
|
* the WorkspaceSandbox interface directly if they don't need logging.
|
|
9
23
|
*/
|
|
10
24
|
import { MastraBase } from '../../base.js';
|
|
25
|
+
import type { IMastraLogger } from '../../logger/index.js';
|
|
26
|
+
import type { WorkspaceFilesystem } from '../filesystem/filesystem.js';
|
|
27
|
+
import type { MountResult } from '../filesystem/mount.js';
|
|
11
28
|
import type { ProviderStatus } from '../lifecycle.js';
|
|
29
|
+
import { MountManager } from './mount-manager.js';
|
|
12
30
|
import type { WorkspaceSandbox } from './sandbox.js';
|
|
31
|
+
/**
|
|
32
|
+
* Lifecycle hook that fires during sandbox state transitions.
|
|
33
|
+
* Receives the sandbox instance so users can call `executeCommand`, read files, etc.
|
|
34
|
+
*/
|
|
35
|
+
export type SandboxLifecycleHook = (args: {
|
|
36
|
+
sandbox: WorkspaceSandbox;
|
|
37
|
+
}) => void | Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Options for the MastraSandbox base class constructor.
|
|
40
|
+
* Providers extend this to add their own options while inheriting lifecycle hooks.
|
|
41
|
+
*/
|
|
42
|
+
export interface MastraSandboxOptions {
|
|
43
|
+
name: string;
|
|
44
|
+
/** Called after the sandbox reaches 'running' status */
|
|
45
|
+
onStart?: SandboxLifecycleHook;
|
|
46
|
+
/** Called before the sandbox stops */
|
|
47
|
+
onStop?: SandboxLifecycleHook;
|
|
48
|
+
/** Called before the sandbox is destroyed */
|
|
49
|
+
onDestroy?: SandboxLifecycleHook;
|
|
50
|
+
}
|
|
13
51
|
/**
|
|
14
52
|
* Abstract base class for sandbox providers with logger support.
|
|
15
53
|
*
|
|
16
54
|
* Providers that extend this class automatically receive the Mastra logger
|
|
17
|
-
* when the sandbox is used with a Mastra instance.
|
|
55
|
+
* when the sandbox is used with a Mastra instance. MountManager is also
|
|
56
|
+
* automatically created if the subclass implements `mount()`.
|
|
18
57
|
*
|
|
19
58
|
* @example
|
|
20
59
|
* ```typescript
|
|
21
60
|
* class MyCustomSandbox extends MastraSandbox {
|
|
61
|
+
* declare readonly mounts: MountManager; // Non-optional type
|
|
22
62
|
* readonly id = 'my-sandbox';
|
|
23
63
|
* readonly name = 'MyCustomSandbox';
|
|
24
64
|
* readonly provider = 'custom';
|
|
25
|
-
* status: ProviderStatus = '
|
|
65
|
+
* status: ProviderStatus = 'pending';
|
|
26
66
|
*
|
|
27
67
|
* constructor() {
|
|
28
68
|
* super({ name: 'MyCustomSandbox' });
|
|
29
69
|
* }
|
|
30
70
|
*
|
|
71
|
+
* // Override start() to provide startup logic
|
|
72
|
+
* async start(): Promise<void> {
|
|
73
|
+
* // Your startup logic here
|
|
74
|
+
* }
|
|
75
|
+
*
|
|
76
|
+
* async mount(filesystem, mountPath) { ... }
|
|
77
|
+
* async unmount(mountPath) { ... }
|
|
31
78
|
* async executeCommand(command: string, args?: string[]): Promise<CommandResult> {
|
|
32
79
|
* this.logger.debug('Executing command', { command, args });
|
|
33
80
|
* // Implementation...
|
|
34
81
|
* }
|
|
35
|
-
* // ... implement other WorkspaceSandbox methods
|
|
36
82
|
* }
|
|
37
83
|
* ```
|
|
38
84
|
*/
|
|
@@ -45,8 +91,109 @@ export declare abstract class MastraSandbox extends MastraBase implements Worksp
|
|
|
45
91
|
abstract readonly provider: string;
|
|
46
92
|
/** Current status of the sandbox */
|
|
47
93
|
abstract status: ProviderStatus;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
94
|
+
/** Mount manager - automatically created if subclass implements mount() */
|
|
95
|
+
readonly mounts?: MountManager;
|
|
96
|
+
/** Optional mount method - implement to enable mounting support */
|
|
97
|
+
mount?(filesystem: WorkspaceFilesystem, mountPath: string): Promise<MountResult>;
|
|
98
|
+
/** Promise for _start() to prevent race conditions from concurrent calls */
|
|
99
|
+
protected _startPromise?: Promise<void>;
|
|
100
|
+
/** Promise for _stop() to prevent race conditions from concurrent calls */
|
|
101
|
+
protected _stopPromise?: Promise<void>;
|
|
102
|
+
/** Promise for _destroy() to prevent race conditions from concurrent calls */
|
|
103
|
+
protected _destroyPromise?: Promise<void>;
|
|
104
|
+
/** Lifecycle callbacks */
|
|
105
|
+
private readonly _onStart?;
|
|
106
|
+
private readonly _onStop?;
|
|
107
|
+
private readonly _onDestroy?;
|
|
108
|
+
constructor(options: MastraSandboxOptions);
|
|
109
|
+
/**
|
|
110
|
+
* Start the sandbox (wrapper with status management and race-condition safety).
|
|
111
|
+
*
|
|
112
|
+
* This method is race-condition-safe - concurrent calls will return the same promise.
|
|
113
|
+
* Handles status management and automatically processes pending mounts after startup.
|
|
114
|
+
*
|
|
115
|
+
* Subclasses override `start()` to provide their startup logic.
|
|
116
|
+
*/
|
|
117
|
+
_start(): Promise<void>;
|
|
118
|
+
/**
|
|
119
|
+
* Internal start execution - handles status and mount processing.
|
|
120
|
+
*/
|
|
121
|
+
private _executeStart;
|
|
122
|
+
/**
|
|
123
|
+
* Override this method to implement sandbox startup logic.
|
|
124
|
+
*
|
|
125
|
+
* Called by `_start()` after status is set to 'starting'.
|
|
126
|
+
* Status will be set to 'running' on success, 'error' on failure.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* async start(): Promise<void> {
|
|
131
|
+
* this._sandbox = await Sandbox.create({ ... });
|
|
132
|
+
* }
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
start(): Promise<void>;
|
|
136
|
+
/**
|
|
137
|
+
* Ensure the sandbox is running.
|
|
138
|
+
*
|
|
139
|
+
* Calls `_start()` if status is not 'running'. Useful for lazy initialization
|
|
140
|
+
* where operations should automatically start the sandbox if needed.
|
|
141
|
+
*
|
|
142
|
+
* @throws {SandboxNotReadyError} if the sandbox fails to reach 'running' status
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* async executeCommand(command: string): Promise<CommandResult> {
|
|
147
|
+
* await this.ensureRunning();
|
|
148
|
+
* // Now safe to use the sandbox
|
|
149
|
+
* }
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
protected ensureRunning(): Promise<void>;
|
|
153
|
+
/**
|
|
154
|
+
* Stop the sandbox (wrapper with status management and race-condition safety).
|
|
155
|
+
*
|
|
156
|
+
* This method is race-condition-safe - concurrent calls will return the same promise.
|
|
157
|
+
* Handles status management.
|
|
158
|
+
*
|
|
159
|
+
* Subclasses override `stop()` to provide their stop logic.
|
|
160
|
+
*/
|
|
161
|
+
_stop(): Promise<void>;
|
|
162
|
+
/**
|
|
163
|
+
* Internal stop execution - handles status.
|
|
164
|
+
*/
|
|
165
|
+
private _executeStop;
|
|
166
|
+
/**
|
|
167
|
+
* Override this method to implement sandbox stop logic.
|
|
168
|
+
*
|
|
169
|
+
* Called by `_stop()` after status is set to 'stopping'.
|
|
170
|
+
* Status will be set to 'stopped' on success, 'error' on failure.
|
|
171
|
+
*/
|
|
172
|
+
stop(): Promise<void>;
|
|
173
|
+
/**
|
|
174
|
+
* Destroy the sandbox and clean up all resources (wrapper with status management).
|
|
175
|
+
*
|
|
176
|
+
* This method is race-condition-safe - concurrent calls will return the same promise.
|
|
177
|
+
* Handles status management.
|
|
178
|
+
*
|
|
179
|
+
* Subclasses override `destroy()` to provide their destroy logic.
|
|
180
|
+
*/
|
|
181
|
+
_destroy(): Promise<void>;
|
|
182
|
+
/**
|
|
183
|
+
* Internal destroy execution - handles status.
|
|
184
|
+
*/
|
|
185
|
+
private _executeDestroy;
|
|
186
|
+
/**
|
|
187
|
+
* Override this method to implement sandbox destroy logic.
|
|
188
|
+
*
|
|
189
|
+
* Called by `_destroy()` after status is set to 'destroying'.
|
|
190
|
+
* Status will be set to 'destroyed' on success, 'error' on failure.
|
|
191
|
+
*/
|
|
192
|
+
destroy(): Promise<void>;
|
|
193
|
+
/**
|
|
194
|
+
* Override to propagate logger to MountManager.
|
|
195
|
+
* @internal
|
|
196
|
+
*/
|
|
197
|
+
__setLogger(logger: IMastraLogger): void;
|
|
51
198
|
}
|
|
52
199
|
//# sourceMappingURL=mastra-sandbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mastra-sandbox.d.ts","sourceRoot":"","sources":["../../../src/workspace/sandbox/mastra-sandbox.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mastra-sandbox.d.ts","sourceRoot":"","sources":["../../../src/workspace/sandbox/mastra-sandbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,gBAAgB,CAAA;CAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEjG;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD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W,aAAa;IA8B3B;;;;;;;;;;;;OAYG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B;;;;;;;;;;;;;;;OAeG;cACa,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAS9C;;;;;;;OAOG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAwB5B;;OAEG;YACW,YAAY;IAe1B;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B;;;;;;;OAOG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAyB/B;;OAEG;YACW,eAAe;IAe7B;;;;;OAKG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ9B;;;OAGG;IACM,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;CAKlD"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mount Manager
|
|
3
|
+
*
|
|
4
|
+
* Encapsulates all mount-related state and operations for sandboxes.
|
|
5
|
+
* Used by BaseSandbox to manage filesystem mounts.
|
|
6
|
+
*/
|
|
7
|
+
import type { IMastraLogger } from '../../logger/index.js';
|
|
8
|
+
import type { WorkspaceFilesystem } from '../filesystem/filesystem.js';
|
|
9
|
+
import type { FilesystemMountConfig, MountResult } from '../filesystem/mount.js';
|
|
10
|
+
import type { Workspace } from '../workspace.js';
|
|
11
|
+
import type { WorkspaceSandbox } from './sandbox.js';
|
|
12
|
+
import type { MountEntry, MountState } from './types.js';
|
|
13
|
+
/**
|
|
14
|
+
* Mount function signature.
|
|
15
|
+
*/
|
|
16
|
+
export type MountFn = (filesystem: WorkspaceFilesystem, mountPath: string) => Promise<MountResult>;
|
|
17
|
+
/**
|
|
18
|
+
* onMount hook result.
|
|
19
|
+
* - false: skip mount
|
|
20
|
+
* - { success, error? }: hook handled it
|
|
21
|
+
* - void: use default mount
|
|
22
|
+
*/
|
|
23
|
+
export type OnMountResult = false | {
|
|
24
|
+
success: boolean;
|
|
25
|
+
error?: string;
|
|
26
|
+
} | void;
|
|
27
|
+
/**
|
|
28
|
+
* Arguments passed to the onMount hook.
|
|
29
|
+
*/
|
|
30
|
+
export interface OnMountArgs {
|
|
31
|
+
/** The filesystem being mounted */
|
|
32
|
+
filesystem: WorkspaceFilesystem;
|
|
33
|
+
/** The mount path in the sandbox */
|
|
34
|
+
mountPath: string;
|
|
35
|
+
/** The mount configuration from filesystem.getMountConfig() (undefined if not supported) */
|
|
36
|
+
config: FilesystemMountConfig | undefined;
|
|
37
|
+
/** The sandbox instance for custom mount implementations */
|
|
38
|
+
sandbox: WorkspaceSandbox;
|
|
39
|
+
/** The workspace instance */
|
|
40
|
+
workspace: Workspace;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* onMount hook function.
|
|
44
|
+
*
|
|
45
|
+
* Called for each filesystem before mounting into sandbox.
|
|
46
|
+
* Return value controls mounting behavior (see {@link OnMountResult}).
|
|
47
|
+
*
|
|
48
|
+
* @example Skip local filesystems
|
|
49
|
+
* ```typescript
|
|
50
|
+
* onMount: ({ filesystem }) => {
|
|
51
|
+
* if (filesystem.provider === 'local') return false;
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @example Custom mount implementation
|
|
56
|
+
* ```typescript
|
|
57
|
+
* onMount: async ({ filesystem, mountPath, sandbox }) => {
|
|
58
|
+
* if (mountPath === '/custom') {
|
|
59
|
+
* await sandbox.executeCommand?.('my-mount-script', [mountPath]);
|
|
60
|
+
* return { success: true };
|
|
61
|
+
* }
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export type OnMountHook = (args: OnMountArgs) => Promise<OnMountResult> | OnMountResult;
|
|
66
|
+
/**
|
|
67
|
+
* MountManager configuration.
|
|
68
|
+
*/
|
|
69
|
+
export interface MountManagerConfig {
|
|
70
|
+
/** The mount implementation from the sandbox */
|
|
71
|
+
mount: MountFn;
|
|
72
|
+
/** Logger instance */
|
|
73
|
+
logger: IMastraLogger;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Manages filesystem mounts for a sandbox.
|
|
77
|
+
*
|
|
78
|
+
* Provides methods for tracking mount state, updating entries,
|
|
79
|
+
* and processing pending mounts.
|
|
80
|
+
*/
|
|
81
|
+
export declare class MountManager {
|
|
82
|
+
private _entries;
|
|
83
|
+
private _mountFn;
|
|
84
|
+
private _onMount?;
|
|
85
|
+
private _sandbox?;
|
|
86
|
+
private _workspace?;
|
|
87
|
+
private logger;
|
|
88
|
+
constructor(config: MountManagerConfig);
|
|
89
|
+
/**
|
|
90
|
+
* Set the sandbox and workspace references for onMount hook args.
|
|
91
|
+
* Called by Workspace during construction.
|
|
92
|
+
*/
|
|
93
|
+
setContext(context: {
|
|
94
|
+
sandbox: WorkspaceSandbox;
|
|
95
|
+
workspace: Workspace;
|
|
96
|
+
}): void;
|
|
97
|
+
/**
|
|
98
|
+
* Set the onMount hook for custom mount handling.
|
|
99
|
+
* Called before each mount - can skip, handle, or defer to default.
|
|
100
|
+
*/
|
|
101
|
+
setOnMount(hook: OnMountHook | undefined): void;
|
|
102
|
+
/**
|
|
103
|
+
* Update the logger instance.
|
|
104
|
+
* Called when the sandbox receives a logger from Mastra.
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
__setLogger(logger: IMastraLogger): void;
|
|
108
|
+
/**
|
|
109
|
+
* Get all mount entries.
|
|
110
|
+
*/
|
|
111
|
+
get entries(): ReadonlyMap<string, MountEntry>;
|
|
112
|
+
/**
|
|
113
|
+
* Get a mount entry by path.
|
|
114
|
+
*/
|
|
115
|
+
get(path: string): MountEntry | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* Check if a mount exists at the given path.
|
|
118
|
+
*/
|
|
119
|
+
has(path: string): boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Add pending mounts from workspace config.
|
|
122
|
+
* These will be processed when `processPending()` is called.
|
|
123
|
+
*/
|
|
124
|
+
add(mounts: Record<string, WorkspaceFilesystem>): void;
|
|
125
|
+
/**
|
|
126
|
+
* Update a mount entry's state.
|
|
127
|
+
* Creates the entry if it doesn't exist.
|
|
128
|
+
*/
|
|
129
|
+
set(path: string, updates: {
|
|
130
|
+
filesystem?: WorkspaceFilesystem;
|
|
131
|
+
state: MountState;
|
|
132
|
+
config?: FilesystemMountConfig;
|
|
133
|
+
error?: string;
|
|
134
|
+
}): void;
|
|
135
|
+
/**
|
|
136
|
+
* Delete a mount entry.
|
|
137
|
+
*/
|
|
138
|
+
delete(path: string): boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Clear all mount entries.
|
|
141
|
+
*/
|
|
142
|
+
clear(): void;
|
|
143
|
+
/**
|
|
144
|
+
* Process all pending mounts.
|
|
145
|
+
* Call this after sandbox is ready (in start()).
|
|
146
|
+
*/
|
|
147
|
+
processPending(): Promise<void>;
|
|
148
|
+
/**
|
|
149
|
+
* Generate a marker filename for a mount path.
|
|
150
|
+
* Used by sandboxes to store mount metadata for reconnection detection.
|
|
151
|
+
*
|
|
152
|
+
* @param mountPath - The mount path to generate a filename for
|
|
153
|
+
* @returns A safe filename like "mount-abc123"
|
|
154
|
+
*/
|
|
155
|
+
markerFilename(mountPath: string): string;
|
|
156
|
+
/**
|
|
157
|
+
* Generate marker file content for a mount path.
|
|
158
|
+
* Format: "path|configHash" - used for detecting config changes on reconnect.
|
|
159
|
+
*
|
|
160
|
+
* @param mountPath - The mount path
|
|
161
|
+
* @returns Marker content string, or null if no config hash available
|
|
162
|
+
*/
|
|
163
|
+
getMarkerContent(mountPath: string): string | null;
|
|
164
|
+
/**
|
|
165
|
+
* Parse marker file content.
|
|
166
|
+
*
|
|
167
|
+
* @param content - The marker file content (format: "path|configHash")
|
|
168
|
+
* @returns Parsed path and configHash, or null if invalid format
|
|
169
|
+
*/
|
|
170
|
+
parseMarkerContent(content: string): {
|
|
171
|
+
path: string;
|
|
172
|
+
configHash: string;
|
|
173
|
+
} | null;
|
|
174
|
+
/**
|
|
175
|
+
* Check if a config hash matches the expected hash for a mount path.
|
|
176
|
+
*
|
|
177
|
+
* @param mountPath - The mount path to check
|
|
178
|
+
* @param storedHash - The hash from the marker file
|
|
179
|
+
* @returns true if the hashes match
|
|
180
|
+
*/
|
|
181
|
+
isConfigMatching(mountPath: string, storedHash: string): boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Compute a hash for a mount config. Used for comparing configs across mounts.
|
|
184
|
+
*
|
|
185
|
+
* @param config - The config to hash
|
|
186
|
+
* @returns A hash string suitable for comparison
|
|
187
|
+
*/
|
|
188
|
+
computeConfigHash(config: FilesystemMountConfig): string;
|
|
189
|
+
/**
|
|
190
|
+
* Hash a mount config for comparison.
|
|
191
|
+
*/
|
|
192
|
+
private hashConfig;
|
|
193
|
+
private sortKeysDeep;
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=mount-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mount-manager.d.ts","sourceRoot":"","sources":["../../../src/workspace/sandbox/mount-manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAItD;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;AAEnG;;;;;GAKG;AACH,MAAM,MAAM,aAAa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|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
import type {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
exitCode: number;
|
|
32
|
-
/** Standard output */
|
|
33
|
-
stdout: string;
|
|
34
|
-
/** Standard error */
|
|
35
|
-
stderr: string;
|
|
36
|
-
/** Execution time in milliseconds */
|
|
37
|
-
executionTimeMs: number;
|
|
38
|
-
/** Whether execution timed out */
|
|
39
|
-
timedOut?: boolean;
|
|
40
|
-
/** Whether execution was killed */
|
|
41
|
-
killed?: boolean;
|
|
42
|
-
}
|
|
43
|
-
export interface CommandResult extends ExecutionResult {
|
|
44
|
-
/** The command that was executed */
|
|
45
|
-
command?: string;
|
|
46
|
-
/** Arguments passed to the command */
|
|
47
|
-
args?: string[];
|
|
48
|
-
}
|
|
49
|
-
export interface ExecuteCommandOptions {
|
|
50
|
-
/** Timeout in milliseconds */
|
|
51
|
-
timeout?: number;
|
|
52
|
-
/** Environment variables */
|
|
53
|
-
env?: NodeJS.ProcessEnv;
|
|
54
|
-
/** Working directory */
|
|
55
|
-
cwd?: string;
|
|
56
|
-
/** Callback for stdout chunks (enables streaming) */
|
|
57
|
-
onStdout?: (data: string) => void;
|
|
58
|
-
/** Callback for stderr chunks (enables streaming) */
|
|
59
|
-
onStderr?: (data: string) => void;
|
|
60
|
-
}
|
|
26
|
+
import type { WorkspaceFilesystem } from '../filesystem/filesystem.js';
|
|
27
|
+
import type { MountResult } from '../filesystem/mount.js';
|
|
28
|
+
import type { Lifecycle } from '../lifecycle.js';
|
|
29
|
+
import type { MountManager } from './mount-manager.js';
|
|
30
|
+
import type { CommandResult, ExecuteCommandOptions, SandboxInfo } from './types.js';
|
|
61
31
|
/**
|
|
62
32
|
* Abstract sandbox interface for code and command execution.
|
|
63
33
|
*
|
|
@@ -101,54 +71,37 @@ export interface WorkspaceSandbox extends Lifecycle<SandboxInfo> {
|
|
|
101
71
|
* @throws {SandboxTimeoutError} if command times out
|
|
102
72
|
*/
|
|
103
73
|
executeCommand?(command: string, args?: string[], options?: ExecuteCommandOptions): Promise<CommandResult>;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
readonly stderr: string;
|
|
137
|
-
constructor(message: string, exitCode: number, stdout: string, stderr: string);
|
|
138
|
-
}
|
|
139
|
-
/** Sandbox operation types for timeout errors */
|
|
140
|
-
export type SandboxOperation = 'command' | 'sync' | 'install';
|
|
141
|
-
export declare class SandboxTimeoutError extends SandboxError {
|
|
142
|
-
readonly timeoutMs: number;
|
|
143
|
-
readonly operation: SandboxOperation;
|
|
144
|
-
constructor(timeoutMs: number, operation: SandboxOperation);
|
|
145
|
-
}
|
|
146
|
-
export declare class SandboxNotReadyError extends SandboxError {
|
|
147
|
-
constructor(idOrStatus: string);
|
|
148
|
-
}
|
|
149
|
-
export declare class IsolationUnavailableError extends SandboxError {
|
|
150
|
-
readonly backend: string;
|
|
151
|
-
readonly reason: string;
|
|
152
|
-
constructor(backend: string, reason: string);
|
|
74
|
+
/**
|
|
75
|
+
* Mount manager for tracking and processing filesystem mounts.
|
|
76
|
+
* Only available if the sandbox implements mount().
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```typescript
|
|
80
|
+
* // Add pending mounts
|
|
81
|
+
* sandbox.mounts?.add({ '/data': s3fs });
|
|
82
|
+
*
|
|
83
|
+
* // Check mount entries
|
|
84
|
+
* const entries = sandbox.mounts?.entries;
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
readonly mounts?: MountManager;
|
|
88
|
+
/**
|
|
89
|
+
* Mount a filesystem at a path in the sandbox.
|
|
90
|
+
* Uses FUSE tools (s3fs, gcsfuse) to mount cloud storage.
|
|
91
|
+
*
|
|
92
|
+
* @param filesystem - The filesystem to mount
|
|
93
|
+
* @param mountPath - Path in the sandbox where filesystem should be mounted
|
|
94
|
+
* @returns Mount result with success status and mount path
|
|
95
|
+
* @throws {MountError} if mount fails
|
|
96
|
+
* @throws {MountNotSupportedError} if sandbox doesn't support mounting
|
|
97
|
+
* @throws {FilesystemNotMountableError} if filesystem cannot be mounted
|
|
98
|
+
*/
|
|
99
|
+
mount?(filesystem: WorkspaceFilesystem, mountPath: string): Promise<MountResult>;
|
|
100
|
+
/**
|
|
101
|
+
* Unmount a filesystem from a path in the sandbox.
|
|
102
|
+
*
|
|
103
|
+
* @param mountPath - Path to unmount
|
|
104
|
+
*/
|
|
105
|
+
unmount?(mountPath: string): Promise<void>;
|
|
153
106
|
}
|
|
154
107
|
//# sourceMappingURL=sandbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../../src/workspace/sandbox/sandbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../../src/workspace/sandbox/sandbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAMjF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,gBAAiB,SAAQ,SAAS,CAAC,WAAW,CAAC;IAC9D,kDAAkD;IAClD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,+BAA+B;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAEnC;;;;;OAKG;IACH,eAAe,CAAC,IAAI,MAAM,CAAC;IAM3B;;;;;OAKG;IACH,cAAc,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAM3G;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;IAE/B;;;;;;;;;;OAUG;IACH,KAAK,CAAC,CAAC,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEjF;;;;OAIG;IACH,OAAO,CAAC,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for sandbox state, execution results, and configuration.
|
|
5
|
+
*/
|
|
6
|
+
import type { WorkspaceFilesystem } from '../filesystem/filesystem.js';
|
|
7
|
+
import type { FilesystemMountConfig } from '../filesystem/mount.js';
|
|
8
|
+
import type { ProviderStatus } from '../lifecycle.js';
|
|
9
|
+
/**
|
|
10
|
+
* State of a mount in the sandbox.
|
|
11
|
+
*/
|
|
12
|
+
export type MountState = 'pending' | 'mounting' | 'mounted' | 'error' | 'unsupported';
|
|
13
|
+
/**
|
|
14
|
+
* Entry representing a mount in the sandbox.
|
|
15
|
+
*/
|
|
16
|
+
export interface MountEntry {
|
|
17
|
+
/** The filesystem to mount */
|
|
18
|
+
filesystem: WorkspaceFilesystem;
|
|
19
|
+
/** Current state of the mount */
|
|
20
|
+
state: MountState;
|
|
21
|
+
/** Error message if state is 'error' */
|
|
22
|
+
error?: string;
|
|
23
|
+
/** Resolved mount config from filesystem.getMountConfig() */
|
|
24
|
+
config?: FilesystemMountConfig;
|
|
25
|
+
/** Hash of config for quick comparison */
|
|
26
|
+
configHash?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ExecutionResult {
|
|
29
|
+
/** Whether execution completed successfully (exitCode === 0) */
|
|
30
|
+
success: boolean;
|
|
31
|
+
/** Exit code (0 = success) */
|
|
32
|
+
exitCode: number;
|
|
33
|
+
/** Standard output */
|
|
34
|
+
stdout: string;
|
|
35
|
+
/** Standard error */
|
|
36
|
+
stderr: string;
|
|
37
|
+
/** Execution time in milliseconds */
|
|
38
|
+
executionTimeMs: number;
|
|
39
|
+
/** Whether execution timed out */
|
|
40
|
+
timedOut?: boolean;
|
|
41
|
+
/** Whether execution was killed */
|
|
42
|
+
killed?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface CommandResult extends ExecutionResult {
|
|
45
|
+
/** The command that was executed */
|
|
46
|
+
command?: string;
|
|
47
|
+
/** Arguments passed to the command */
|
|
48
|
+
args?: string[];
|
|
49
|
+
}
|
|
50
|
+
export interface ExecuteCommandOptions {
|
|
51
|
+
/** Timeout in milliseconds */
|
|
52
|
+
timeout?: number;
|
|
53
|
+
/** Environment variables */
|
|
54
|
+
env?: NodeJS.ProcessEnv;
|
|
55
|
+
/** Working directory */
|
|
56
|
+
cwd?: string;
|
|
57
|
+
/** Callback for stdout chunks (enables streaming) */
|
|
58
|
+
onStdout?: (data: string) => void;
|
|
59
|
+
/** Callback for stderr chunks (enables streaming) */
|
|
60
|
+
onStderr?: (data: string) => void;
|
|
61
|
+
}
|
|
62
|
+
export interface SandboxInfo {
|
|
63
|
+
id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
provider: string;
|
|
66
|
+
status: ProviderStatus;
|
|
67
|
+
/** When the sandbox was created */
|
|
68
|
+
createdAt: Date;
|
|
69
|
+
/** When the sandbox was last used */
|
|
70
|
+
lastUsedAt?: Date;
|
|
71
|
+
/** Time until auto-shutdown (if applicable) */
|
|
72
|
+
timeoutAt?: Date;
|
|
73
|
+
/** Current mounts in the sandbox */
|
|
74
|
+
mounts?: Array<{
|
|
75
|
+
path: string;
|
|
76
|
+
filesystem: string;
|
|
77
|
+
}>;
|
|
78
|
+
/** Resource info (if available) */
|
|
79
|
+
resources?: {
|
|
80
|
+
memoryMB?: number;
|
|
81
|
+
memoryUsedMB?: number;
|
|
82
|
+
cpuCores?: number;
|
|
83
|
+
cpuPercent?: number;
|
|
84
|
+
diskMB?: number;
|
|
85
|
+
diskUsedMB?: number;
|
|
86
|
+
};
|
|
87
|
+
/** Provider-specific metadata */
|
|
88
|
+
metadata?: Record<string, unknown>;
|
|
89
|
+
}
|
|
90
|
+
/** Sandbox operation types for timeout errors */
|
|
91
|
+
export type SandboxOperation = 'command' | 'sync' | 'install';
|
|
92
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/workspace/sandbox/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAMnD;;GAEG;AACH,MAAM,MAAM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G,SAAS,EAC7C,QAAQ,EAAE,iBAAiB,GAC1B;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,eAAe,EAAE,OAAO,CAAC;IAAC,sBAAsB,CAAC,EAAE,OAAO,CAAA;CAAE,CA+BlF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/workspace/tools/tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAYtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,oBAAoB,GAAG,SAAS,EAC7C,QAAQ,EAAE,iBAAiB,GAC1B;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,eAAe,EAAE,OAAO,CAAC;IAAC,sBAAsB,CAAC,EAAE,OAAO,CAAA;CAAE,CA+BlF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,uBAooBxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-formatter.d.ts","sourceRoot":"","sources":["../../../src/workspace/tools/tree-formatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAa,MAAM,eAAe,CAAC;AAMpE,MAAM,WAAW,WAAW;IAC1B,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mGAAmG;IACnG,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yFAAyF;IACzF,OAAO,CAAC,EAAE,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