@mastra/e2b 0.4.0-alpha.0 → 0.4.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/dist/index.js CHANGED
@@ -100,7 +100,8 @@ Error details: ${installResult.stderr || installResult.stdout}`
100
100
  const idResult = await sandbox.commands.run("id -u && id -g");
101
101
  const [uid, gid] = idResult.stdout.trim().split("\n");
102
102
  const hasCredentials = config.accessKeyId && config.secretAccessKey;
103
- const credentialsPath = "/tmp/.passwd-s3fs";
103
+ const mountHash = createHash("md5").update(mountPath).digest("hex").slice(0, 8);
104
+ const credentialsPath = `/tmp/.passwd-s3fs-${mountHash}`;
104
105
  if (!hasCredentials && config.endpoint) {
105
106
  throw new Error(
106
107
  `S3-compatible storage requires credentials. Detected endpoint: ${config.endpoint}. The public_bucket option only works for AWS S3 public buckets, not R2, MinIO, etc.`
@@ -163,8 +164,6 @@ Error details: ${installResult.stderr || installResult.stdout}`
163
164
  );
164
165
  }
165
166
  }
166
-
167
- // src/sandbox/mounts/gcs.ts
168
167
  async function mountGCS(mountPath, config, ctx) {
169
168
  const { sandbox, logger } = ctx;
170
169
  validateBucketName(config.bucket);
@@ -184,7 +183,8 @@ async function mountGCS(mountPath, config, ctx) {
184
183
  const hasCredentials = !!config.serviceAccountKey;
185
184
  let mountCmd;
186
185
  if (hasCredentials) {
187
- const keyPath = "/tmp/gcs-key.json";
186
+ const mountHash = createHash("md5").update(mountPath).digest("hex").slice(0, 8);
187
+ const keyPath = `/tmp/gcs-key-${mountHash}.json`;
188
188
  await sandbox.commands.run(`sudo rm -f ${keyPath}`);
189
189
  await sandbox.files.write(keyPath, config.serviceAccountKey);
190
190
  await sandbox.commands.run(`sudo chown root:root ${keyPath} && sudo chmod 600 ${keyPath}`);