update vercel sandbox support
This commit is contained in:
@@ -1,10 +1,30 @@
|
||||
import { Sandbox } from '@e2b/code-interpreter';
|
||||
import { SandboxProvider, SandboxInfo, CommandResult, SandboxProviderConfig } from '../types';
|
||||
import { SandboxProvider, SandboxInfo, CommandResult } from '../types';
|
||||
// SandboxProviderConfig available through parent class
|
||||
import { appConfig } from '@/config/app.config';
|
||||
|
||||
export class E2BProvider extends SandboxProvider {
|
||||
private existingFiles: Set<string> = new Set();
|
||||
|
||||
/**
|
||||
* Attempt to reconnect to an existing E2B sandbox
|
||||
*/
|
||||
async reconnect(sandboxId: string): Promise<boolean> {
|
||||
try {
|
||||
console.log(`[E2BProvider] Attempting to reconnect to sandbox ${sandboxId}...`);
|
||||
|
||||
// Try to connect to existing sandbox
|
||||
// Note: E2B SDK doesn't directly support reconnection, but we can try to recreate
|
||||
// For now, return false to indicate reconnection isn't supported
|
||||
// In the future, E2B may add this capability
|
||||
|
||||
return false;
|
||||
} catch (error) {
|
||||
console.error(`[E2BProvider] Failed to reconnect to sandbox ${sandboxId}:`, error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async createSandbox(): Promise<SandboxInfo> {
|
||||
try {
|
||||
console.log('[E2BProvider] Creating sandbox...');
|
||||
@@ -274,7 +294,7 @@ export default defineConfig({
|
||||
port: 5173,
|
||||
strictPort: true,
|
||||
hmr: false,
|
||||
allowedHosts: ['.e2b.app', 'localhost', '127.0.0.1']
|
||||
allowedHosts: ['.e2b.app', '.e2b.dev', '.vercel.run', 'localhost', '127.0.0.1']
|
||||
}
|
||||
})"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user