@mastra/daytona 0.9.1 → 0.10.0-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 +13 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/sandbox/index.d.ts +8 -1
- package/dist/sandbox/index.d.ts.map +1 -1
- package/dist/sandbox/process-manager.d.ts.map +1 -1
- package/package.json +9 -10
- package/CHANGELOG.md +0 -773
package/dist/index.cjs
CHANGED
|
@@ -532,7 +532,7 @@ var DaytonaProcessManager = class extends _mastra_core_workspace.SandboxProcessM
|
|
|
532
532
|
const effectiveOptions = {
|
|
533
533
|
...options,
|
|
534
534
|
timeout: options.timeout ?? this._defaultTimeout,
|
|
535
|
-
cwd: options.cwd ?? this.sandbox.mounts?.entries?.keys().next().value
|
|
535
|
+
cwd: options.cwd ?? this.sandbox.explicitWorkingDirectory ?? this.sandbox.mounts?.entries?.keys().next().value
|
|
536
536
|
};
|
|
537
537
|
const envs = Object.fromEntries(Object.entries(effectiveOptions.env ?? {}).filter((entry) => entry[1] !== void 0));
|
|
538
538
|
const sessionCommand = buildSpawnCommand(command, effectiveOptions.cwd, envs);
|
|
@@ -690,7 +690,6 @@ var DaytonaSandbox = class DaytonaSandbox extends _mastra_core_workspace.MastraS
|
|
|
690
690
|
_daytona = null;
|
|
691
691
|
_sandbox = null;
|
|
692
692
|
_createdAt = null;
|
|
693
|
-
_workingDir = null;
|
|
694
693
|
_isRetrying = false;
|
|
695
694
|
_computerUseStarted = null;
|
|
696
695
|
computerUseAutoStart;
|
|
@@ -716,6 +715,14 @@ var DaytonaSandbox = class DaytonaSandbox extends _mastra_core_workspace.MastraS
|
|
|
716
715
|
secrets;
|
|
717
716
|
connectionOpts;
|
|
718
717
|
_constructorOptions;
|
|
718
|
+
/**
|
|
719
|
+
* The `workingDirectory` option as explicitly configured, as distinct from
|
|
720
|
+
* the probe-filled base field. The process manager's cwd fallback uses only
|
|
721
|
+
* this value so the runtime probe (which just reports the session home)
|
|
722
|
+
* never displaces the FUSE-mount default for relative paths.
|
|
723
|
+
* @internal
|
|
724
|
+
*/
|
|
725
|
+
explicitWorkingDirectory;
|
|
719
726
|
constructor(options = {}) {
|
|
720
727
|
super({
|
|
721
728
|
...options,
|
|
@@ -723,6 +730,7 @@ var DaytonaSandbox = class DaytonaSandbox extends _mastra_core_workspace.MastraS
|
|
|
723
730
|
processes: new DaytonaProcessManager({ defaultTimeout: options.timeout ?? 3e5 })
|
|
724
731
|
});
|
|
725
732
|
this.id = options.id ?? this.generateId();
|
|
733
|
+
this.explicitWorkingDirectory = options.workingDirectory;
|
|
726
734
|
this.timeout = options.timeout ?? 3e5;
|
|
727
735
|
this.language = options.language ?? "typescript";
|
|
728
736
|
this.resources = options.resources;
|
|
@@ -948,7 +956,7 @@ var DaytonaSandbox = class DaytonaSandbox extends _mastra_core_workspace.MastraS
|
|
|
948
956
|
const mountCount = this.mounts.entries.size;
|
|
949
957
|
const mountInfo = mountCount > 0 ? ` ${mountCount} filesystem(s) mounted via FUSE.` : "";
|
|
950
958
|
parts.push(`Cloud sandbox with isolated execution (${this.language} runtime).${mountInfo}`);
|
|
951
|
-
if (this.
|
|
959
|
+
if (this.workingDirectory) parts.push(`Default working directory: ${this.workingDirectory}.`);
|
|
952
960
|
parts.push(`Command timeout: ${Math.ceil(this.timeout / 1e3)}s.`);
|
|
953
961
|
parts.push(`Running as user: ${this.sandboxUser ?? "daytona"}.`);
|
|
954
962
|
if (this.volumeConfigs.length > 0) parts.push(`${this.volumeConfigs.length} volume(s) attached.`);
|
|
@@ -1363,10 +1371,11 @@ var DaytonaSandbox = class DaytonaSandbox extends _mastra_core_workspace.MastraS
|
|
|
1363
1371
|
*/
|
|
1364
1372
|
async detectWorkingDir() {
|
|
1365
1373
|
if (!this._sandbox) return;
|
|
1374
|
+
if (this.explicitWorkingDirectory !== void 0) return;
|
|
1366
1375
|
try {
|
|
1367
1376
|
const dir = (await runCommand(this._sandbox, "pwd", { timeout: MOUNT_COMMAND_TIMEOUT_MS })).output?.trim();
|
|
1368
1377
|
if (dir) {
|
|
1369
|
-
this.
|
|
1378
|
+
this.setWorkingDirectory(dir);
|
|
1370
1379
|
this.logger.debug(`${LOG_PREFIX} Detected working directory: ${dir}`);
|
|
1371
1380
|
}
|
|
1372
1381
|
} catch {
|