@mastra/daytona 0.5.1 → 0.5.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 CHANGED
@@ -1,5 +1,45 @@
1
1
  # @mastra/daytona
2
2
 
3
+ ## 0.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Pass `--implicit-dirs` to gcsfuse in Daytona GCS mounts. Without it, objects written directly to the bucket via the GCS API (no placeholder "directory" object) are unreachable in the mount — not listed and not readable by full path. This is common when the mount reads bucket contents produced by another process (SDK uploads, other services, gsutil). ([#19003](https://github.com/mastra-ai/mastra/pull/19003))
8
+
9
+ - Fixed Daytona GCS mounts ignoring the `prefix` option. Mounting a bucket with a prefix now scopes the mount to that subdirectory via gcsfuse `--only-dir`, so writes land under the prefix and sandboxes mounting the same bucket with different prefixes are isolated from each other. ([#18963](https://github.com/mastra-ai/mastra/pull/18963))
10
+
11
+ Before, every GCS mount used the bucket root regardless of prefix:
12
+
13
+ ```ts
14
+ await sandbox.mount(new GCSFilesystem({ bucket: 'my-bucket', prefix: 'a/b/threadA', credentials }), '/gcs-data');
15
+ await sandbox.executeCommand('bash', ['-lc', 'echo hi > /gcs-data/probe.txt']);
16
+ // Before: object lands at gs://my-bucket/probe.txt
17
+ // After: object lands at gs://my-bucket/a/b/threadA/probe.txt
18
+ ```
19
+
20
+ - Updated dependencies [[`e900f25`](https://github.com/mastra-ai/mastra/commit/e900f25dfe2c9237f15b26cb109ac55aa9de3000), [`e8eaf3a`](https://github.com/mastra-ai/mastra/commit/e8eaf3aea09d51c131b5d369aee459442f416efc), [`d1c930f`](https://github.com/mastra-ai/mastra/commit/d1c930f713d1de09d5f3cd665cb79a8b7ebd7ec7), [`02634f7`](https://github.com/mastra-ai/mastra/commit/02634f700051e014a125d0d10165e3c9b8414e95), [`a940148`](https://github.com/mastra-ai/mastra/commit/a9401483e1bfe85c18a6e73d33c5949239d65a92)]:
21
+ - @mastra/core@1.50.1
22
+
23
+ ## 0.5.2-alpha.0
24
+
25
+ ### Patch Changes
26
+
27
+ - Pass `--implicit-dirs` to gcsfuse in Daytona GCS mounts. Without it, objects written directly to the bucket via the GCS API (no placeholder "directory" object) are unreachable in the mount — not listed and not readable by full path. This is common when the mount reads bucket contents produced by another process (SDK uploads, other services, gsutil). ([#19003](https://github.com/mastra-ai/mastra/pull/19003))
28
+
29
+ - Fixed Daytona GCS mounts ignoring the `prefix` option. Mounting a bucket with a prefix now scopes the mount to that subdirectory via gcsfuse `--only-dir`, so writes land under the prefix and sandboxes mounting the same bucket with different prefixes are isolated from each other. ([#18963](https://github.com/mastra-ai/mastra/pull/18963))
30
+
31
+ Before, every GCS mount used the bucket root regardless of prefix:
32
+
33
+ ```ts
34
+ await sandbox.mount(new GCSFilesystem({ bucket: 'my-bucket', prefix: 'a/b/threadA', credentials }), '/gcs-data');
35
+ await sandbox.executeCommand('bash', ['-lc', 'echo hi > /gcs-data/probe.txt']);
36
+ // Before: object lands at gs://my-bucket/probe.txt
37
+ // After: object lands at gs://my-bucket/a/b/threadA/probe.txt
38
+ ```
39
+
40
+ - Updated dependencies [[`a940148`](https://github.com/mastra-ai/mastra/commit/a9401483e1bfe85c18a6e73d33c5949239d65a92)]:
41
+ - @mastra/core@1.50.1-alpha.2
42
+
3
43
  ## 0.5.1
4
44
 
5
45
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -244,7 +244,13 @@ Sandbox network response: ${checkOutput}` : "")
244
244
  await run(
245
245
  `sudo chmod a+rw /dev/fuse 2>/dev/null || true; sudo bash -c 'grep -q "^user_allow_other" /etc/fuse.conf 2>/dev/null || echo "user_allow_other" >> /etc/fuse.conf' 2>/dev/null || true`
246
246
  );
247
+ let onlyDirFlag = "";
248
+ if (config.prefix) {
249
+ const normalizedPrefix = validatePrefix(config.prefix);
250
+ onlyDirFlag = `--only-dir=${shellQuote(normalizedPrefix)} `;
251
+ }
247
252
  const hasCredentials = !!config.serviceAccountKey;
253
+ const implicitDirsFlag = "--implicit-dirs";
248
254
  let mountCmd;
249
255
  if (hasCredentials) {
250
256
  const mountHash = crypto.createHash("md5").update(mountPath).digest("hex").slice(0, 8);
@@ -252,10 +258,10 @@ Sandbox network response: ${checkOutput}` : "")
252
258
  await run(`sudo rm -f ${shellQuote(keyPath)}`, 3e4);
253
259
  await writeFile(keyPath, config.serviceAccountKey);
254
260
  await run(`chmod 600 ${shellQuote(keyPath)}`, 3e4);
255
- mountCmd = `gcsfuse --key-file=${shellQuote(keyPath)} -o allow_other ${uidGidFlags} ${shellQuote(config.bucket)} ${quotedMountPath}`;
261
+ mountCmd = `gcsfuse --key-file=${shellQuote(keyPath)} ${implicitDirsFlag} ${onlyDirFlag}-o allow_other ${uidGidFlags} ${shellQuote(config.bucket)} ${quotedMountPath}`;
256
262
  } else {
257
263
  logger.debug(`${LOG_PREFIX} No credentials provided, mounting GCS as public bucket (read-only)`);
258
- mountCmd = `gcsfuse --anonymous-access -o allow_other ${uidGidFlags} ${shellQuote(config.bucket)} ${quotedMountPath}`;
264
+ mountCmd = `gcsfuse --anonymous-access ${implicitDirsFlag} ${onlyDirFlag}-o allow_other ${uidGidFlags} ${shellQuote(config.bucket)} ${quotedMountPath}`;
259
265
  }
260
266
  logger.debug(`${LOG_PREFIX} Mounting GCS:`, mountCmd);
261
267
  const result = await run(mountCmd, 6e4);