@mastra/e2b 0.3.2 → 0.3.3-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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @mastra/e2b
2
2
 
3
+ ## 0.3.3-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Add prefix-scoped GCS sandbox mounts (parity with S3 and Azure) ([#17613](https://github.com/mastra-ai/mastra/pull/17613))
8
+
9
+ `GCSFilesystem.getMountConfig()` now includes its `prefix` (trailing slash
10
+ stripped), and the E2B `mountGCS` adds the corresponding `gcsfuse --only-dir`
11
+ flag when a prefix is set. This scopes the FUSE mount to the prefixed
12
+ subdirectory so sandbox paths map directly to prefixed GCS keys — matching the
13
+ existing S3 (`bucket:/prefix`) and Azure (`--subdirectory`) mounts. Previously a
14
+ prefixed `GCSFilesystem` dropped the prefix at both layers and mounted the entire
15
+ bucket inside the sandbox.
16
+
17
+ The prefix is validated with the existing `validatePrefix` (path-traversal guard)
18
+ and shell-escaped with `shellQuote`.
19
+
20
+ - Updated dependencies [[`d468acb`](https://github.com/mastra-ai/mastra/commit/d468acb07aec1bb19a2cb0ada8042b05b46746b2), [`e9be4e7`](https://github.com/mastra-ai/mastra/commit/e9be4e747ec3d8b65548bff92f9377db06105376), [`d53cfc2`](https://github.com/mastra-ai/mastra/commit/d53cfc2c7f8d78343a4aa84ec4e129ba25f3325e), [`65799d4`](https://github.com/mastra-ai/mastra/commit/65799d4d549e5ebb9c848fbe3f51ac090f64becf), [`c268c89`](https://github.com/mastra-ai/mastra/commit/c268c89f4c63a93ee474d3cffdf3ea60bf00d4f2), [`d468acb`](https://github.com/mastra-ai/mastra/commit/d468acb07aec1bb19a2cb0ada8042b05b46746b2), [`0c72f03`](https://github.com/mastra-ai/mastra/commit/0c72f032abb13254df5a7856d64be2f207b8006d), [`3b45ea9`](https://github.com/mastra-ai/mastra/commit/3b45ea95015557a6cb9d70dc5252af54ab1b78ac), [`f084be1`](https://github.com/mastra-ai/mastra/commit/f084be1fcbe33ad7480913e44d6130c421c0976f)]:
21
+ - @mastra/core@1.42.0-alpha.0
22
+
3
23
  ## 0.3.2
4
24
 
5
25
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -182,6 +182,7 @@ async function mountGCS(mountPath, config, ctx) {
182
182
  const idResult = await sandbox.commands.run("id -u && id -g");
183
183
  const [uid, gid] = idResult.stdout.trim().split("\n");
184
184
  const uidGidFlags = uid && gid ? `--uid=${uid} --gid=${gid}` : "";
185
+ const onlyDirFlag = config.prefix ? ` --only-dir=${shellQuote(validatePrefix(config.prefix))}` : "";
185
186
  const hasCredentials = !!config.serviceAccountKey;
186
187
  let mountCmd;
187
188
  if (hasCredentials) {
@@ -189,10 +190,10 @@ async function mountGCS(mountPath, config, ctx) {
189
190
  await sandbox.commands.run(`sudo rm -f ${keyPath}`);
190
191
  await sandbox.files.write(keyPath, config.serviceAccountKey);
191
192
  await sandbox.commands.run(`sudo chown root:root ${keyPath} && sudo chmod 600 ${keyPath}`);
192
- mountCmd = `sudo gcsfuse --key-file=${keyPath} -o allow_other ${uidGidFlags} ${config.bucket} ${mountPath}`;
193
+ mountCmd = `sudo gcsfuse --key-file=${keyPath} -o allow_other ${uidGidFlags}${onlyDirFlag} ${config.bucket} ${mountPath}`;
193
194
  } else {
194
195
  logger.debug(`${LOG_PREFIX} No credentials provided, mounting GCS as public bucket (read-only)`);
195
- mountCmd = `sudo gcsfuse --anonymous-access -o allow_other ${uidGidFlags} ${config.bucket} ${mountPath}`;
196
+ mountCmd = `sudo gcsfuse --anonymous-access -o allow_other ${uidGidFlags}${onlyDirFlag} ${config.bucket} ${mountPath}`;
196
197
  }
197
198
  logger.debug(`${LOG_PREFIX} Mounting GCS:`, mountCmd);
198
199
  try {