Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
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.tsindex 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.onScanPortsdiff --git a/packages/js-sdk/src/sandbox/sandboxConnection.ts b/packages/js-sdk/src/sandbox/sandboxConnection.tsindex 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_KEYif (!apiKey) {throw new AuthenticationError(