@mastra/daytona 0.11.3 → 0.11.4-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.cjs +9 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -18
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
package/dist/index.cjs
CHANGED
|
@@ -2,15 +2,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
let _daytonaio_sdk = require("@daytonaio/sdk");
|
|
3
3
|
let _mastra_core_workspace = require("@mastra/core/workspace");
|
|
4
4
|
let crypto = require("crypto");
|
|
5
|
-
|
|
5
|
+
// src/utils/compact.ts
|
|
6
6
|
/**
|
|
7
7
|
* Returns a shallow copy of the object with all undefined values removed.
|
|
8
8
|
*/
|
|
9
9
|
function compact(obj) {
|
|
10
10
|
return Object.fromEntries(Object.entries(obj).filter(([, v]) => v !== void 0));
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
//#region src/utils/shell-quote.ts
|
|
12
|
+
// src/utils/shell-quote.ts
|
|
14
13
|
/**
|
|
15
14
|
* Shell-quote a single argument for safe use in a command string.
|
|
16
15
|
*
|
|
@@ -21,8 +20,7 @@ function shellQuote(arg) {
|
|
|
21
20
|
if (/^[a-zA-Z0-9._\-/@:=]+$/.test(arg)) return arg;
|
|
22
21
|
return "'" + arg.replace(/'/g, "'\\''") + "'";
|
|
23
22
|
}
|
|
24
|
-
|
|
25
|
-
//#region src/sandbox/mounts/types.ts
|
|
23
|
+
// src/sandbox/mounts/types.ts
|
|
26
24
|
const LOG_PREFIX = "[@mastra/daytona]";
|
|
27
25
|
const SAFE_S3_BUCKET_NAME = /^[a-z0-9][a-z0-9.\-]{1,61}[a-z0-9]$/;
|
|
28
26
|
const SAFE_GCS_BUCKET_NAME = /^[a-z0-9][a-z0-9._-]{1,61}[a-z0-9]$/;
|
|
@@ -76,8 +74,7 @@ async function runCommand(sandbox, command, options) {
|
|
|
76
74
|
output: result.result ?? ""
|
|
77
75
|
};
|
|
78
76
|
}
|
|
79
|
-
|
|
80
|
-
//#region src/sandbox/mounts/s3-credentials.ts
|
|
77
|
+
// src/sandbox/mounts/s3-credentials.ts
|
|
81
78
|
function s3CredentialsPrefix(mountPath) {
|
|
82
79
|
return `/tmp/.mastra-s3-${(0, crypto.createHash)("sha256").update(mountPath.replace(/\/$/, "")).digest("hex")}-`;
|
|
83
80
|
}
|
|
@@ -121,8 +118,7 @@ exit "$result"`;
|
|
|
121
118
|
ctx.logger.warn(`${LOG_PREFIX} Could not clean up S3 credentials`);
|
|
122
119
|
}
|
|
123
120
|
}
|
|
124
|
-
|
|
125
|
-
//#region src/sandbox/mounts/s3.ts
|
|
121
|
+
// src/sandbox/mounts/s3.ts
|
|
126
122
|
/**
|
|
127
123
|
* Mount an S3 bucket using s3fs-fuse.
|
|
128
124
|
*/
|
|
@@ -214,8 +210,7 @@ async function mountS3(mountPath, config, ctx) {
|
|
|
214
210
|
}
|
|
215
211
|
}
|
|
216
212
|
}
|
|
217
|
-
|
|
218
|
-
//#region src/sandbox/mounts/gcs.ts
|
|
213
|
+
// src/sandbox/mounts/gcs.ts
|
|
219
214
|
/**
|
|
220
215
|
* Mount a GCS bucket using gcsfuse.
|
|
221
216
|
*/
|
|
@@ -280,8 +275,7 @@ async function mountGCS(mountPath, config, ctx) {
|
|
|
280
275
|
});
|
|
281
276
|
if (result.exitCode !== 0) throw new Error(`Failed to mount GCS bucket: ${result.stderr || result.stdout}`);
|
|
282
277
|
}
|
|
283
|
-
|
|
284
|
-
//#region src/sandbox/mounts/azure.ts
|
|
278
|
+
// src/sandbox/mounts/azure.ts
|
|
285
279
|
const SAFE_CONTAINER_NAME = /^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/;
|
|
286
280
|
const BLOBFUSE2_GITHUB_DEB = "https://github.com/Azure/azure-storage-fuse/releases/download/blobfuse2-2.5.1/blobfuse2-2.5.1-Ubuntu-22.04.x86_64.deb";
|
|
287
281
|
function validateContainerName(name) {
|
|
@@ -475,8 +469,7 @@ async function mountAzure(mountPath, config, ctx) {
|
|
|
475
469
|
});
|
|
476
470
|
if (result.exitCode !== 0) throw new Error(`Failed to mount Azure Blob container: ${result.stderr || result.stdout}`);
|
|
477
471
|
}
|
|
478
|
-
|
|
479
|
-
//#region src/sandbox/process-manager.ts
|
|
472
|
+
// src/sandbox/process-manager.ts
|
|
480
473
|
/**
|
|
481
474
|
* Wraps a Daytona session + command pair to conform to Mastra's ProcessHandle.
|
|
482
475
|
* Not exported — internal to this module.
|
|
@@ -649,8 +642,7 @@ function buildSpawnCommand(command, cwd, envs) {
|
|
|
649
642
|
parts.push(`(${command})`);
|
|
650
643
|
return parts.join(" && ");
|
|
651
644
|
}
|
|
652
|
-
|
|
653
|
-
//#region src/sandbox/index.ts
|
|
645
|
+
// src/sandbox/index.ts
|
|
654
646
|
/**
|
|
655
647
|
* Daytona Sandbox Provider
|
|
656
648
|
*
|
|
@@ -1617,7 +1609,6 @@ var DaytonaSandbox = class DaytonaSandbox extends _mastra_core_workspace.MastraS
|
|
|
1617
1609
|
}
|
|
1618
1610
|
}
|
|
1619
1611
|
};
|
|
1620
|
-
//#endregion
|
|
1621
1612
|
exports.DaytonaProcessManager = DaytonaProcessManager;
|
|
1622
1613
|
exports.DaytonaSandbox = DaytonaSandbox;
|
|
1623
1614
|
|