Skip to content

An open-source, faster Devin alternative

TypeScript

Add sandbox.commands alias for backwards compatibility with exec

motatoes935ccaf9d371
diff --git a/sdks/python/opencomputer/sandbox.py b/sdks/python/opencomputer/sandbox.py
index 9c499435..02e6f971 100644
--- a/sdks/python/opencomputer/sandbox.py
+++ b/sdks/python/opencomputer/sandbox.py
@@ -179,6 +179,11 @@ class Sandbox:
"""Access session-based command execution."""
return Exec(self._ops_client, self.sandbox_id, self._connect_url, self._token)
+ @property
+ def commands(self) -> Exec:
+ """Backwards-compatible alias for ``exec``. Prefer ``sandbox.exec`` instead."""
+ return self.exec
+
@property
def pty(self) -> Pty:
"""Access PTY terminal sessions."""
diff --git a/sdks/typescript/src/sandbox.ts b/sdks/typescript/src/sandbox.ts
index 1b2ba45d..c29db23b 100644
--- a/sdks/typescript/src/sandbox.ts
+++ b/sdks/typescript/src/sandbox.ts
@@ -71,6 +71,8 @@ export class Sandbox {
readonly files: Filesystem;
readonly exec: Exec;
readonly pty: Pty;
+ /** @deprecated Use `sandbox.exec` instead. This alias exists for backwards compatibility. */
+ readonly commands: Exec;
private apiUrl: string;
private apiKey: string;
@@ -93,6 +95,7 @@ export class Sandbox {
this.files = new Filesystem(opsUrl, opsKey, this.sandboxId, opsToken);
this.exec = new Exec(opsUrl, opsKey, this.sandboxId, opsToken);
+ this.commands = this.exec; // backwards-compatible alias
this.pty = new Pty(opsUrl, opsKey, this.sandboxId, opsToken);
}