@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 +20 -0
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/sandbox/mounts/gcs.d.ts +10 -0
- package/dist/sandbox/mounts/gcs.d.ts.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -180,6 +180,7 @@ async function mountGCS(mountPath, config, ctx) {
|
|
|
180
180
|
const idResult = await sandbox.commands.run("id -u && id -g");
|
|
181
181
|
const [uid, gid] = idResult.stdout.trim().split("\n");
|
|
182
182
|
const uidGidFlags = uid && gid ? `--uid=${uid} --gid=${gid}` : "";
|
|
183
|
+
const onlyDirFlag = config.prefix ? ` --only-dir=${shellQuote(validatePrefix(config.prefix))}` : "";
|
|
183
184
|
const hasCredentials = !!config.serviceAccountKey;
|
|
184
185
|
let mountCmd;
|
|
185
186
|
if (hasCredentials) {
|
|
@@ -187,10 +188,10 @@ async function mountGCS(mountPath, config, ctx) {
|
|
|
187
188
|
await sandbox.commands.run(`sudo rm -f ${keyPath}`);
|
|
188
189
|
await sandbox.files.write(keyPath, config.serviceAccountKey);
|
|
189
190
|
await sandbox.commands.run(`sudo chown root:root ${keyPath} && sudo chmod 600 ${keyPath}`);
|
|
190
|
-
mountCmd = `sudo gcsfuse --key-file=${keyPath} -o allow_other ${uidGidFlags} ${config.bucket} ${mountPath}`;
|
|
191
|
+
mountCmd = `sudo gcsfuse --key-file=${keyPath} -o allow_other ${uidGidFlags}${onlyDirFlag} ${config.bucket} ${mountPath}`;
|
|
191
192
|
} else {
|
|
192
193
|
logger.debug(`${LOG_PREFIX} No credentials provided, mounting GCS as public bucket (read-only)`);
|
|
193
|
-
mountCmd = `sudo gcsfuse --anonymous-access -o allow_other ${uidGidFlags} ${config.bucket} ${mountPath}`;
|
|
194
|
+
mountCmd = `sudo gcsfuse --anonymous-access -o allow_other ${uidGidFlags}${onlyDirFlag} ${config.bucket} ${mountPath}`;
|
|
194
195
|
}
|
|
195
196
|
logger.debug(`${LOG_PREFIX} Mounting GCS:`, mountCmd);
|
|
196
197
|
try {
|