@mastra/e2b 0.3.0-alpha.0 → 0.3.1-alpha.0
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 +29 -0
- package/dist/index.cjs +16 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/dist/sandbox/mounts/s3.d.ts.map +1 -1
- package/dist/sandbox/mounts/types.d.ts +1 -0
- package/dist/sandbox/mounts/types.d.ts.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @mastra/e2b
|
|
2
2
|
|
|
3
|
+
## 0.3.1-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fixed S3 mounts in E2B sandboxes by honoring the configured region and verifying that the FUSE mount attached successfully. ([#16222](https://github.com/mastra-ai/mastra/pull/16222))
|
|
8
|
+
|
|
9
|
+
Mount failures that previously appeared successful now surface a clear error, making region, credential, and endpoint compatibility problems easier to diagnose.
|
|
10
|
+
|
|
11
|
+
## 0.3.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- Added Azure Blob sandbox mount support via blobfuse2 in @mastra/e2b and @mastra/daytona. `sandbox.mount(azureBlobFilesystem, '/data')` now works for Azure containers, matching the existing s3fs (S3) and gcsfuse (GCS) integration. Supports authentication via accountKey, sasToken, connectionString, or managed identity/default credentials, and preserves AzureBlobFilesystem prefixes when mounting. ([#15874](https://github.com/mastra-ai/mastra/pull/15874))
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { E2BSandbox } from '@mastra/e2b';
|
|
19
|
+
import { AzureBlobFilesystem } from '@mastra/azure/blob';
|
|
20
|
+
|
|
21
|
+
const azureFs = new AzureBlobFilesystem({ container: 'my-data', connectionString: '...' });
|
|
22
|
+
const sandbox = new E2BSandbox();
|
|
23
|
+
await sandbox.mount(azureFs, '/data');
|
|
24
|
+
// Sandbox processes can now read/write /data/* directly against the Azure container.
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- Updated dependencies [[`6db978c`](https://github.com/mastra-ai/mastra/commit/6db978c42e94e75540a504f7230086f0b5cd35f9), [`512a013`](https://github.com/mastra-ai/mastra/commit/512a013f285aa9c0aa8f08a35b2ce09f9938b017), [`e9becde`](https://github.com/mastra-ai/mastra/commit/e9becdeed9176b9f8392e557bde12b933f99cf7a), [`703a443`](https://github.com/mastra-ai/mastra/commit/703a44390c587d9c0b8ae94ec4edd8afb2a74044), [`808df1b`](https://github.com/mastra-ai/mastra/commit/808df1b39358b5f10b7317107e42b1fda7c87185)]:
|
|
30
|
+
- @mastra/core@1.29.1
|
|
31
|
+
|
|
3
32
|
## 0.3.0-alpha.0
|
|
4
33
|
|
|
5
34
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -35,6 +35,14 @@ function validateEndpoint(endpoint) {
|
|
|
35
35
|
throw new Error(`Invalid endpoint URL: "${endpoint}"`);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
+
var SAFE_REGION = /^[a-z0-9-]{2,32}$/;
|
|
39
|
+
function validateRegion(region) {
|
|
40
|
+
if (typeof region !== "string" || !SAFE_REGION.test(region)) {
|
|
41
|
+
throw new Error(
|
|
42
|
+
`Invalid region: ${JSON.stringify(region)}. Region must be a string of lowercase alphanumeric or hyphens (e.g., "us-east-1", "ap-northeast-1", "auto").`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
38
46
|
function validatePrefix(prefix) {
|
|
39
47
|
let normalized = prefix;
|
|
40
48
|
while (normalized.startsWith("/")) normalized = normalized.slice(1);
|
|
@@ -61,6 +69,7 @@ function shellQuote(arg) {
|
|
|
61
69
|
async function mountS3(mountPath, config, ctx) {
|
|
62
70
|
const { sandbox, logger } = ctx;
|
|
63
71
|
validateBucketName(config.bucket);
|
|
72
|
+
validateRegion(config.region);
|
|
64
73
|
if (config.endpoint) {
|
|
65
74
|
validateEndpoint(config.endpoint);
|
|
66
75
|
}
|
|
@@ -120,6 +129,7 @@ Error details: ${installResult.stderr || installResult.stdout}`
|
|
|
120
129
|
const endpoint = config.endpoint.replace(/\/$/, "");
|
|
121
130
|
mountOptions.push(`url=${endpoint}`, "use_path_request_style", "sigv4", "nomultipart");
|
|
122
131
|
}
|
|
132
|
+
mountOptions.push(`endpoint=${config.region}`);
|
|
123
133
|
if (config.readOnly) {
|
|
124
134
|
mountOptions.push("ro");
|
|
125
135
|
logger.debug(`${LOG_PREFIX} Mounting as read-only`);
|
|
@@ -148,6 +158,12 @@ Error details: ${installResult.stderr || installResult.stdout}`
|
|
|
148
158
|
logger.error(`${LOG_PREFIX} s3fs error:`, { stderr, stdout, error: String(error) });
|
|
149
159
|
throw new Error(`Failed to mount S3 bucket: ${stderr || stdout || error}`);
|
|
150
160
|
}
|
|
161
|
+
const verify = await sandbox.commands.run(`mountpoint -q ${shellQuote(mountPath)}`);
|
|
162
|
+
if (verify.exitCode !== 0) {
|
|
163
|
+
throw new Error(
|
|
164
|
+
`s3fs returned exit 0 but ${mountPath} is not a mountpoint. The s3fs daemon likely failed during FUSE init (common causes: region mismatch, invalid credentials, or an S3-compatible endpoint that rejects the signature). Re-run inside the sandbox with '-f -o dbglevel=info' to see the underlying error.`
|
|
165
|
+
);
|
|
166
|
+
}
|
|
151
167
|
}
|
|
152
168
|
|
|
153
169
|
// src/sandbox/mounts/gcs.ts
|