Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Hide JS SDK constructors that should not be called when spawning sandboxes

Tomas Valenta201aefeb8f07
diff --git a/packages/js-sdk/src/sandbox/index.ts b/packages/js-sdk/src/sandbox/index.ts
index 6bbc04b9f..7ef1bf7b3 100644
--- a/packages/js-sdk/src/sandbox/index.ts
+++ b/packages/js-sdk/src/sandbox/index.ts
@@ -33,7 +33,7 @@ export class Sandbox extends SandboxConnection {
private onScanPorts?: ScanOpenPortsHandler
- constructor(opts?: SandboxOpts) {
+ protected constructor(opts?: SandboxOpts) {
opts = opts || {}
super(opts)
this.onScanPorts = opts.onScanPorts
diff --git a/packages/js-sdk/src/sandbox/sandboxConnection.ts b/packages/js-sdk/src/sandbox/sandboxConnection.ts
index 93922d079..bbd3da155 100644
--- a/packages/js-sdk/src/sandbox/sandboxConnection.ts
+++ b/packages/js-sdk/src/sandbox/sandboxConnection.ts
@@ -68,7 +68,7 @@ export class SandboxConnection {
private subscribers: Subscriber[] = []
// let's keep opts readonly, but public - for convenience, mainly when debugging
- constructor(readonly opts: SandboxConnectionOpts) {
+ protected constructor(readonly opts: SandboxConnectionOpts) {
const apiKey = opts.apiKey || process?.env?.E2B_API_KEY
if (!apiKey) {
throw new AuthenticationError(