@mastra/blaxel 0.0.0-studio-deploy-20260404182525 → 0.0.0-studio-cli-20260504022012

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,11 +1,83 @@
1
1
  # @mastra/blaxel
2
2
 
3
- ## 0.0.0-studio-deploy-20260404182525
3
+ ## 0.0.0-studio-cli-20260504022012
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [[`c55b527`](https://github.com/mastra-ai/mastra/commit/c55b52758a31368b2077b0dbbc3badfe4063f560), [`7eb2596`](https://github.com/mastra-ai/mastra/commit/7eb25960d607e07468c9a10c5437abd2deaf1e9a)]:
8
- - @mastra/core@0.0.0-studio-deploy-20260404182525
7
+ - Updated dependencies [[`6dcd65f`](https://github.com/mastra-ai/mastra/commit/6dcd65f2a34069e6dc43ba35f1d11119b9b40bef), [`c05c9a1`](https://github.com/mastra-ai/mastra/commit/c05c9a13230988cef6d438a62f37760f31927bc7), [`e24aacb`](https://github.com/mastra-ai/mastra/commit/e24aacba07bd66f5d95b636dc24016fca26b52cf), [`1c2dda8`](https://github.com/mastra-ai/mastra/commit/1c2dda805fbfccc0abf55d4cb20cc34402dc3f0c), [`c721164`](https://github.com/mastra-ai/mastra/commit/c7211643f7ac861f83b19a3757cc921487fc9d75), [`1b55954`](https://github.com/mastra-ai/mastra/commit/1b559541c1e08a10e49d01ffc51a634dfc37a286), [`5adc55e`](https://github.com/mastra-ai/mastra/commit/5adc55e63407be8ee977914957d68bcc2a075ceb), [`70017d7`](https://github.com/mastra-ai/mastra/commit/70017d72ab741b5d7040e2a15c251a317782e39e), [`e4942bc`](https://github.com/mastra-ai/mastra/commit/e4942bc7fdc903572f7d84f26d5e15f9d39c763d)]:
8
+ - @mastra/core@0.0.0-studio-cli-20260504022012
9
+
10
+ ## 0.3.0
11
+
12
+ ### Minor Changes
13
+
14
+ - Added S3 prefix (subdirectory) mount support. You can now mount a specific folder within an S3 bucket instead of the entire bucket by setting the `prefix` option on your S3 filesystem. ([#15171](https://github.com/mastra-ai/mastra/pull/15171))
15
+
16
+ **Example:**
17
+
18
+ ```typescript
19
+ const fs = new S3Filesystem({
20
+ bucket: 'my-bucket',
21
+ region: 'us-east-1',
22
+ prefix: 'workspace/data',
23
+ accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
24
+ secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
25
+ });
26
+ ```
27
+
28
+ When mounted in a sandbox, only the contents under `workspace/data/` in the bucket will be visible at the mount path. This uses the s3fs `bucket:/path` syntax under the hood.
29
+
30
+ Closes #15147.
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies [[`f112db1`](https://github.com/mastra-ai/mastra/commit/f112db179557ae9b5a0f1d25dc47f928d7d61cd9), [`21d9706`](https://github.com/mastra-ai/mastra/commit/21d970604d89eee970cbf8013d26d7551aff6ea5), [`0a0aa94`](https://github.com/mastra-ai/mastra/commit/0a0aa94729592e99885af2efb90c56aaada62247), [`ed07df3`](https://github.com/mastra-ai/mastra/commit/ed07df32a9d539c8261e892fc1bade783f5b41a6), [`01a7d51`](https://github.com/mastra-ai/mastra/commit/01a7d513493d21562f677f98550f7ceb165ba78c)]:
35
+ - @mastra/core@1.27.0
36
+
37
+ ## 0.3.0-alpha.0
38
+
39
+ ### Minor Changes
40
+
41
+ - Added S3 prefix (subdirectory) mount support. You can now mount a specific folder within an S3 bucket instead of the entire bucket by setting the `prefix` option on your S3 filesystem. ([#15171](https://github.com/mastra-ai/mastra/pull/15171))
42
+
43
+ **Example:**
44
+
45
+ ```typescript
46
+ const fs = new S3Filesystem({
47
+ bucket: 'my-bucket',
48
+ region: 'us-east-1',
49
+ prefix: 'workspace/data',
50
+ accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
51
+ secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
52
+ });
53
+ ```
54
+
55
+ When mounted in a sandbox, only the contents under `workspace/data/` in the bucket will be visible at the mount path. This uses the s3fs `bucket:/path` syntax under the hood.
56
+
57
+ Closes #15147.
58
+
59
+ ### Patch Changes
60
+
61
+ - Updated dependencies [[`f112db1`](https://github.com/mastra-ai/mastra/commit/f112db179557ae9b5a0f1d25dc47f928d7d61cd9), [`21d9706`](https://github.com/mastra-ai/mastra/commit/21d970604d89eee970cbf8013d26d7551aff6ea5)]:
62
+ - @mastra/core@1.26.1-alpha.0
63
+
64
+ ## 0.2.1
65
+
66
+ ### Patch Changes
67
+
68
+ - dependencies updates: ([#15086](https://github.com/mastra-ai/mastra/pull/15086))
69
+ - Updated dependency [`@blaxel/core@^0.2.78` ↗︎](https://www.npmjs.com/package/@blaxel/core/v/0.2.78) (from `^0.2.74`, in `dependencies`)
70
+ - Updated dependencies [[`f32b9e1`](https://github.com/mastra-ai/mastra/commit/f32b9e115a3c754d1c8cfa3f4256fba87b09cfb7), [`7d6f521`](https://github.com/mastra-ai/mastra/commit/7d6f52164d0cca099f0b07cb2bba334360f1c8ab), [`a50d220`](https://github.com/mastra-ai/mastra/commit/a50d220b01ecbc5644d489a3d446c3bd4ab30245), [`665477b`](https://github.com/mastra-ai/mastra/commit/665477bc104fd52cfef8e7610d7664781a70c220), [`4cc2755`](https://github.com/mastra-ai/mastra/commit/4cc2755a7194cb08720ff2ab4dffb4b4a5103dfd), [`ac7baf6`](https://github.com/mastra-ai/mastra/commit/ac7baf66ef1db15e03975ef4ebb02724f015a391), [`ed425d7`](https://github.com/mastra-ai/mastra/commit/ed425d78e7c66cbda8209fee910856f98c6c6b82), [`1371703`](https://github.com/mastra-ai/mastra/commit/1371703835080450ef3f9aea58059a95d0da2e5a), [`0df8321`](https://github.com/mastra-ai/mastra/commit/0df832196eeb2450ab77ce887e8553abdd44c5a6), [`98f8a8b`](https://github.com/mastra-ai/mastra/commit/98f8a8bdf5761b9982f3ad3acbe7f1cc3efa71f3), [`ba6f7e9`](https://github.com/mastra-ai/mastra/commit/ba6f7e9086d8281393f2acae60fda61de3bff1f9), [`7eb2596`](https://github.com/mastra-ai/mastra/commit/7eb25960d607e07468c9a10c5437abd2deaf1e9a), [`1805ddc`](https://github.com/mastra-ai/mastra/commit/1805ddc9c9b3b14b63749735a13c05a45af43a80), [`fff91cf`](https://github.com/mastra-ai/mastra/commit/fff91cf914de0e731578aacebffdeebef82f0440), [`61109b3`](https://github.com/mastra-ai/mastra/commit/61109b34feb0e38d54bee4b8ca83eb7345b1d557), [`33f1ead`](https://github.com/mastra-ai/mastra/commit/33f1eadfa19c86953f593478e5fa371093b33779)]:
71
+ - @mastra/core@1.23.0
72
+
73
+ ## 0.2.1-alpha.0
74
+
75
+ ### Patch Changes
76
+
77
+ - dependencies updates: ([#15086](https://github.com/mastra-ai/mastra/pull/15086))
78
+ - Updated dependency [`@blaxel/core@^0.2.78` ↗︎](https://www.npmjs.com/package/@blaxel/core/v/0.2.78) (from `^0.2.74`, in `dependencies`)
79
+ - Updated dependencies [[`665477b`](https://github.com/mastra-ai/mastra/commit/665477bc104fd52cfef8e7610d7664781a70c220), [`4cc2755`](https://github.com/mastra-ai/mastra/commit/4cc2755a7194cb08720ff2ab4dffb4b4a5103dfd)]:
80
+ - @mastra/core@1.23.0-alpha.7
9
81
 
10
82
  ## 0.2.0
11
83
 
package/dist/index.cjs CHANGED
@@ -37,6 +37,21 @@ function validateEndpoint(endpoint) {
37
37
  throw new Error(`Invalid endpoint URL scheme: "${parsed.protocol}". Only http: and https: are allowed.`);
38
38
  }
39
39
  }
40
+ function validatePrefix(prefix) {
41
+ let normalized = prefix;
42
+ while (normalized.startsWith("/")) normalized = normalized.slice(1);
43
+ while (normalized.endsWith("/")) normalized = normalized.slice(0, -1);
44
+ if (!normalized) {
45
+ throw new Error("Mount prefix cannot be empty after normalization.");
46
+ }
47
+ if (normalized.includes("//") || normalized.split("/").some((s) => s === "." || s === "..")) {
48
+ throw new Error(`Invalid mount prefix: "${prefix}". Path traversal is not allowed.`);
49
+ }
50
+ if (/[\x00-\x1f\x7f]/.test(normalized)) {
51
+ throw new Error(`Invalid mount prefix: "${prefix}". Control characters are not allowed.`);
52
+ }
53
+ return normalized;
54
+ }
40
55
  async function detectPackageManager(sandbox) {
41
56
  const result = await runCommand(
42
57
  sandbox,
@@ -149,8 +164,13 @@ Use a Debian-based image (e.g. blaxel/ts-app:latest) or Alpine-based image (e.g.
149
164
  mountOptions.push("ro");
150
165
  logger.debug(`${LOG_PREFIX} Mounting as read-only`);
151
166
  }
167
+ let bucketArg = config.bucket;
168
+ if (config.prefix) {
169
+ const normalizedPrefix = validatePrefix(config.prefix);
170
+ bucketArg = `${config.bucket}:/${normalizedPrefix}`;
171
+ }
152
172
  const quotedMountPath = shellQuote(mountPath);
153
- const mountCmd = `s3fs ${config.bucket} ${quotedMountPath} -o ${mountOptions.join(" -o ")}`;
173
+ const mountCmd = `s3fs ${shellQuote(bucketArg)} ${quotedMountPath} -o ${mountOptions.join(" -o ")}`;
154
174
  logger.debug(`${LOG_PREFIX} Mounting S3:`, hasCredentials ? mountCmd.replace(credentialsPath, "***") : mountCmd);
155
175
  const result = await runCommand(sandbox, mountCmd, { timeout: 6e4 });
156
176
  logger.debug(`${LOG_PREFIX} s3fs result:`, {