@mastra/daytona 0.11.1 → 0.11.2-alpha.1
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.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/sandbox/mounts/s3.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Daytona, DaytonaGoneError, DaytonaNotFoundError, SandboxState } from "@daytonaio/sdk";
|
|
2
2
|
import { MastraSandbox, ProcessHandle, SandboxNotReadyError, SandboxProcessManager, UnsupportedStdinCloseError, assertModesUnsupported } from "@mastra/core/workspace";
|
|
3
|
-
import { createHash
|
|
3
|
+
import { createHash } from "crypto";
|
|
4
4
|
//#region src/utils/compact.ts
|
|
5
5
|
/**
|
|
6
6
|
* Returns a shallow copy of the object with all undefined values removed.
|
|
@@ -154,7 +154,7 @@ async function mountS3(mountPath, config, ctx) {
|
|
|
154
154
|
const [uid, gid] = idResult.stdout.trim().split("\n");
|
|
155
155
|
const validUidGid = uid && gid && /^\d+$/.test(uid) && /^\d+$/.test(gid);
|
|
156
156
|
if (!validUidGid) logger.warn(`${LOG_PREFIX} Unexpected uid/gid format: "${idResult.stdout.trim()}" — mounted files will be owned by root`);
|
|
157
|
-
const credentialsDirectory = `${s3CredentialsPrefix(mountPath)}${randomUUID()}`;
|
|
157
|
+
const credentialsDirectory = `${s3CredentialsPrefix(mountPath)}${globalThis.crypto.randomUUID()}`;
|
|
158
158
|
const credentialsPath = `${credentialsDirectory}/credentials`;
|
|
159
159
|
await run("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");
|
|
160
160
|
let credentialsCreated = false;
|
|
@@ -182,6 +182,7 @@ async function mountS3(mountPath, config, ctx) {
|
|
|
182
182
|
const endpoint = config.endpoint.replace(/\/$/, "");
|
|
183
183
|
mountOptions.push(`url=${shellQuote(endpoint)}`, "use_path_request_style", "sigv4", "nomultipart");
|
|
184
184
|
}
|
|
185
|
+
mountOptions.push(`endpoint=${shellQuote(config.region)}`);
|
|
185
186
|
if (config.readOnly) {
|
|
186
187
|
mountOptions.push("ro");
|
|
187
188
|
logger.debug(`${LOG_PREFIX} Mounting as read-only`);
|
|
@@ -190,6 +191,7 @@ async function mountS3(mountPath, config, ctx) {
|
|
|
190
191
|
if (config.prefix) {
|
|
191
192
|
const normalizedPrefix = validatePrefix(config.prefix);
|
|
192
193
|
bucketArg = `${config.bucket}:/${normalizedPrefix}`;
|
|
194
|
+
mountOptions.push("compat_dir");
|
|
193
195
|
}
|
|
194
196
|
const mountCmd = `${config.sessionToken ? `. ${shellQuote(credentialsPath)} && ` : ""}s3fs ${shellQuote(bucketArg)} ${quotedMountPath} -o ${mountOptions.join(" -o ")}`;
|
|
195
197
|
logger.debug(`${LOG_PREFIX} Mounting S3:`, hasCredentials ? mountCmd.replace(credentialsPath, "***") : mountCmd);
|