diff --git a/backend/server/package-lock.json b/backend/server/package-lock.json index dab4e32..31b4af6 100644 --- a/backend/server/package-lock.json +++ b/backend/server/package-lock.json @@ -12,7 +12,7 @@ "concurrently": "^8.2.2", "cors": "^2.8.5", "dotenv": "^16.4.5", - "e2b": "^0.16.2-beta.47", + "e2b": "^1.0.5", "express": "^4.19.2", "jzip": "^1.0.0", "rate-limiter-flexible": "^5.0.3", @@ -44,25 +44,25 @@ } }, "node_modules/@bufbuild/protobuf": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.10.0.tgz", - "integrity": "sha512-QDdVFLoN93Zjg36NoQPZfsVH9tZew7wKDKyV5qRdj8ntT4wQCOradQjRaTdwMhWUYsgKsvCINKKm87FdEk96Ag==" + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-2.2.2.tgz", + "integrity": "sha512-UNtPCbrwrenpmrXuRwn9jYpPoweNXj8X5sMvYgsqYyaH8jQ6LfUJSk3dJLnBK+6sfYPrF4iAIo5sd5HQ+tg75A==" }, "node_modules/@connectrpc/connect": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@connectrpc/connect/-/connect-1.4.0.tgz", - "integrity": "sha512-vZeOkKaAjyV4+RH3+rJZIfDFJAfr+7fyYr6sLDKbYX3uuTVszhFe9/YKf5DNqrDb5cKdKVlYkGn6DTDqMitAnA==", + "version": "2.0.0-rc.3", + "resolved": "https://registry.npmjs.org/@connectrpc/connect/-/connect-2.0.0-rc.3.tgz", + "integrity": "sha512-ARBt64yEyKbanyRETTjcjJuHr2YXorzQo0etyS5+P6oSeW8xEuzajA9g+zDnMcj1hlX2dQE93foIWQGfpru7gQ==", "peerDependencies": { - "@bufbuild/protobuf": "^1.4.2" + "@bufbuild/protobuf": "^2.2.0" } }, "node_modules/@connectrpc/connect-web": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@connectrpc/connect-web/-/connect-web-1.4.0.tgz", - "integrity": "sha512-13aO4psFbbm7rdOFGV0De2Za64DY/acMspgloDlcOKzLPPs0yZkhp1OOzAQeiAIr7BM/VOHIA3p8mF0inxCYTA==", + "version": "2.0.0-rc.3", + "resolved": "https://registry.npmjs.org/@connectrpc/connect-web/-/connect-web-2.0.0-rc.3.tgz", + "integrity": "sha512-w88P8Lsn5CCsA7MFRl2e6oLY4J/5toiNtJns/YJrlyQaWOy3RO8pDgkz+iIkG98RPMhj2thuBvsd3Cn4DKKCkw==", "peerDependencies": { - "@bufbuild/protobuf": "^1.4.2", - "@connectrpc/connect": "1.4.0" + "@bufbuild/protobuf": "^2.2.0", + "@connectrpc/connect": "2.0.0-rc.3" } }, "node_modules/@cspotcode/source-map-support": { @@ -783,13 +783,13 @@ } }, "node_modules/e2b": { - "version": "0.16.2-beta.47", - "resolved": "https://registry.npmjs.org/e2b/-/e2b-0.16.2-beta.47.tgz", - "integrity": "sha512-tMPDYLMD+8+JyLPrsWft3NHBhK5YKOFOXzKMwpOKR5KvXOkd1silkArDwplmBUzN/eG/uRzWdtHZs9mHUQ5b9g==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/e2b/-/e2b-1.0.5.tgz", + "integrity": "sha512-0c2xqNQfVcVBmETsd1bXWCYaN3iVl7m81dJVcjB7O2/c15A7t0s/FkydcZGzVvfZchj40/1f09AdjGX6nk1eNQ==", "dependencies": { - "@bufbuild/protobuf": "^1.10.0", - "@connectrpc/connect": "^1.4.0", - "@connectrpc/connect-web": "^1.4.0", + "@bufbuild/protobuf": "^2.2.2", + "@connectrpc/connect": "2.0.0-rc.3", + "@connectrpc/connect-web": "2.0.0-rc.3", "compare-versions": "^6.1.0", "openapi-fetch": "^0.9.7", "platform": "^1.3.6" diff --git a/backend/server/package.json b/backend/server/package.json index ff093dc..2d09280 100644 --- a/backend/server/package.json +++ b/backend/server/package.json @@ -14,7 +14,7 @@ "concurrently": "^8.2.2", "cors": "^2.8.5", "dotenv": "^16.4.5", - "e2b": "^0.16.2-beta.47", + "e2b": "^1.0.5", "express": "^4.19.2", "jzip": "^1.0.0", "rate-limiter-flexible": "^5.0.3", diff --git a/backend/server/src/FileManager.ts b/backend/server/src/FileManager.ts index 0022c1f..775313e 100644 --- a/backend/server/src/FileManager.ts +++ b/backend/server/src/FileManager.ts @@ -188,7 +188,7 @@ export class FileManager { // Watch a directory for changes async watchDirectory(directory: string): Promise { try { - const handle = await this.sandbox.files.watch( + const handle = await this.sandbox.files.watchDir( directory, async (event: FilesystemEvent) => { try { @@ -341,7 +341,7 @@ export class FileManager { ) } }, - { timeout: 0 } + { timeoutMs: 0 } ) this.fileWatchers.push(handle) return handle @@ -595,7 +595,7 @@ export class FileManager { async closeWatchers() { await Promise.all( this.fileWatchers.map(async (handle: WatchHandle) => { - await handle.close() + await handle.stop() }) ) } diff --git a/backend/server/src/Terminal.ts b/backend/server/src/Terminal.ts index 482b8a4..588112d 100644 --- a/backend/server/src/Terminal.ts +++ b/backend/server/src/Terminal.ts @@ -1,8 +1,8 @@ -import { ProcessHandle, Sandbox } from "e2b" +import { CommandHandle, Sandbox } from "e2b" // Terminal class to manage a pseudo-terminal (PTY) in a sandbox environment export class Terminal { - private pty: ProcessHandle | undefined // Holds the PTY process handle + private pty: CommandHandle | undefined // Holds the PTY process handle private sandbox: Sandbox // Reference to the sandbox environment // Constructor initializes the Terminal with a sandbox @@ -24,7 +24,7 @@ export class Terminal { this.pty = await this.sandbox.pty.create({ rows, cols, - timeout: 0, + timeoutMs: 0, onData: (data: Uint8Array) => { onData(new TextDecoder().decode(data)) // Convert received data to string and pass to handler },