@cloudflare/sandbox
Advanced tools
| //#region ../shared/dist/errors/codes.js | ||
| /** | ||
| * Centralized error code registry | ||
| * Each code maps to a specific error type with consistent semantics | ||
| */ | ||
| const ErrorCode = { | ||
| FILE_NOT_FOUND: "FILE_NOT_FOUND", | ||
| PERMISSION_DENIED: "PERMISSION_DENIED", | ||
| FILE_EXISTS: "FILE_EXISTS", | ||
| IS_DIRECTORY: "IS_DIRECTORY", | ||
| NOT_DIRECTORY: "NOT_DIRECTORY", | ||
| FILE_TOO_LARGE: "FILE_TOO_LARGE", | ||
| NO_SPACE: "NO_SPACE", | ||
| TOO_MANY_FILES: "TOO_MANY_FILES", | ||
| RESOURCE_BUSY: "RESOURCE_BUSY", | ||
| READ_ONLY: "READ_ONLY", | ||
| NAME_TOO_LONG: "NAME_TOO_LONG", | ||
| TOO_MANY_LINKS: "TOO_MANY_LINKS", | ||
| FILESYSTEM_ERROR: "FILESYSTEM_ERROR", | ||
| COMMAND_NOT_FOUND: "COMMAND_NOT_FOUND", | ||
| COMMAND_PERMISSION_DENIED: "COMMAND_PERMISSION_DENIED", | ||
| INVALID_COMMAND: "INVALID_COMMAND", | ||
| COMMAND_EXECUTION_ERROR: "COMMAND_EXECUTION_ERROR", | ||
| STREAM_START_ERROR: "STREAM_START_ERROR", | ||
| PROCESS_NOT_FOUND: "PROCESS_NOT_FOUND", | ||
| PROCESS_PERMISSION_DENIED: "PROCESS_PERMISSION_DENIED", | ||
| PROCESS_ERROR: "PROCESS_ERROR", | ||
| SESSION_ALREADY_EXISTS: "SESSION_ALREADY_EXISTS", | ||
| SESSION_DESTROYED: "SESSION_DESTROYED", | ||
| SESSION_TERMINATED: "SESSION_TERMINATED", | ||
| PORT_ALREADY_EXPOSED: "PORT_ALREADY_EXPOSED", | ||
| PORT_IN_USE: "PORT_IN_USE", | ||
| PORT_NOT_EXPOSED: "PORT_NOT_EXPOSED", | ||
| INVALID_PORT_NUMBER: "INVALID_PORT_NUMBER", | ||
| INVALID_PORT: "INVALID_PORT", | ||
| SERVICE_NOT_RESPONDING: "SERVICE_NOT_RESPONDING", | ||
| PORT_OPERATION_ERROR: "PORT_OPERATION_ERROR", | ||
| CUSTOM_DOMAIN_REQUIRED: "CUSTOM_DOMAIN_REQUIRED", | ||
| GIT_REPOSITORY_NOT_FOUND: "GIT_REPOSITORY_NOT_FOUND", | ||
| GIT_BRANCH_NOT_FOUND: "GIT_BRANCH_NOT_FOUND", | ||
| GIT_AUTH_FAILED: "GIT_AUTH_FAILED", | ||
| GIT_NETWORK_ERROR: "GIT_NETWORK_ERROR", | ||
| INVALID_GIT_URL: "INVALID_GIT_URL", | ||
| GIT_CLONE_FAILED: "GIT_CLONE_FAILED", | ||
| GIT_CHECKOUT_FAILED: "GIT_CHECKOUT_FAILED", | ||
| GIT_OPERATION_FAILED: "GIT_OPERATION_FAILED", | ||
| BUCKET_MOUNT_ERROR: "BUCKET_MOUNT_ERROR", | ||
| BUCKET_UNMOUNT_ERROR: "BUCKET_UNMOUNT_ERROR", | ||
| S3FS_MOUNT_ERROR: "S3FS_MOUNT_ERROR", | ||
| MISSING_CREDENTIALS: "MISSING_CREDENTIALS", | ||
| INVALID_MOUNT_CONFIG: "INVALID_MOUNT_CONFIG", | ||
| BACKUP_CREATE_FAILED: "BACKUP_CREATE_FAILED", | ||
| BACKUP_RESTORE_FAILED: "BACKUP_RESTORE_FAILED", | ||
| BACKUP_NOT_FOUND: "BACKUP_NOT_FOUND", | ||
| BACKUP_EXPIRED: "BACKUP_EXPIRED", | ||
| INVALID_BACKUP_CONFIG: "INVALID_BACKUP_CONFIG", | ||
| INTERPRETER_NOT_READY: "INTERPRETER_NOT_READY", | ||
| CONTEXT_NOT_FOUND: "CONTEXT_NOT_FOUND", | ||
| CODE_EXECUTION_ERROR: "CODE_EXECUTION_ERROR", | ||
| PYTHON_NOT_AVAILABLE: "PYTHON_NOT_AVAILABLE", | ||
| JAVASCRIPT_NOT_AVAILABLE: "JAVASCRIPT_NOT_AVAILABLE", | ||
| OPENCODE_STARTUP_FAILED: "OPENCODE_STARTUP_FAILED", | ||
| PROCESS_READY_TIMEOUT: "PROCESS_READY_TIMEOUT", | ||
| PROCESS_EXITED_BEFORE_READY: "PROCESS_EXITED_BEFORE_READY", | ||
| DESKTOP_NOT_STARTED: "DESKTOP_NOT_STARTED", | ||
| DESKTOP_START_FAILED: "DESKTOP_START_FAILED", | ||
| DESKTOP_UNAVAILABLE: "DESKTOP_UNAVAILABLE", | ||
| DESKTOP_PROCESS_CRASHED: "DESKTOP_PROCESS_CRASHED", | ||
| DESKTOP_INVALID_OPTIONS: "DESKTOP_INVALID_OPTIONS", | ||
| DESKTOP_INVALID_COORDINATES: "DESKTOP_INVALID_COORDINATES", | ||
| WATCH_NOT_FOUND: "WATCH_NOT_FOUND", | ||
| WATCH_START_ERROR: "WATCH_START_ERROR", | ||
| WATCH_STOP_ERROR: "WATCH_STOP_ERROR", | ||
| VALIDATION_FAILED: "VALIDATION_FAILED", | ||
| INVALID_JSON_RESPONSE: "INVALID_JSON_RESPONSE", | ||
| UNKNOWN_ERROR: "UNKNOWN_ERROR", | ||
| INTERNAL_ERROR: "INTERNAL_ERROR", | ||
| RPC_TRANSPORT_ERROR: "RPC_TRANSPORT_ERROR" | ||
| }; | ||
| //#endregion | ||
| //#region ../shared/dist/errors/status-map.js | ||
| /** | ||
| * Maps error codes to HTTP status codes | ||
| * Centralized mapping ensures consistency across SDK | ||
| */ | ||
| const ERROR_STATUS_MAP = { | ||
| [ErrorCode.FILE_NOT_FOUND]: 404, | ||
| [ErrorCode.COMMAND_NOT_FOUND]: 404, | ||
| [ErrorCode.PROCESS_NOT_FOUND]: 404, | ||
| [ErrorCode.PORT_NOT_EXPOSED]: 404, | ||
| [ErrorCode.GIT_REPOSITORY_NOT_FOUND]: 404, | ||
| [ErrorCode.GIT_BRANCH_NOT_FOUND]: 404, | ||
| [ErrorCode.CONTEXT_NOT_FOUND]: 404, | ||
| [ErrorCode.WATCH_NOT_FOUND]: 404, | ||
| [ErrorCode.IS_DIRECTORY]: 400, | ||
| [ErrorCode.NOT_DIRECTORY]: 400, | ||
| [ErrorCode.INVALID_COMMAND]: 400, | ||
| [ErrorCode.INVALID_PORT_NUMBER]: 400, | ||
| [ErrorCode.INVALID_PORT]: 400, | ||
| [ErrorCode.INVALID_GIT_URL]: 400, | ||
| [ErrorCode.CUSTOM_DOMAIN_REQUIRED]: 400, | ||
| [ErrorCode.INVALID_JSON_RESPONSE]: 400, | ||
| [ErrorCode.NAME_TOO_LONG]: 400, | ||
| [ErrorCode.VALIDATION_FAILED]: 400, | ||
| [ErrorCode.MISSING_CREDENTIALS]: 400, | ||
| [ErrorCode.INVALID_MOUNT_CONFIG]: 400, | ||
| [ErrorCode.GIT_AUTH_FAILED]: 401, | ||
| [ErrorCode.PERMISSION_DENIED]: 403, | ||
| [ErrorCode.COMMAND_PERMISSION_DENIED]: 403, | ||
| [ErrorCode.PROCESS_PERMISSION_DENIED]: 403, | ||
| [ErrorCode.READ_ONLY]: 403, | ||
| [ErrorCode.FILE_EXISTS]: 409, | ||
| [ErrorCode.PORT_ALREADY_EXPOSED]: 409, | ||
| [ErrorCode.PORT_IN_USE]: 409, | ||
| [ErrorCode.RESOURCE_BUSY]: 409, | ||
| [ErrorCode.SESSION_ALREADY_EXISTS]: 409, | ||
| [ErrorCode.SESSION_DESTROYED]: 410, | ||
| [ErrorCode.SESSION_TERMINATED]: 410, | ||
| [ErrorCode.FILE_TOO_LARGE]: 413, | ||
| [ErrorCode.SERVICE_NOT_RESPONDING]: 502, | ||
| [ErrorCode.GIT_NETWORK_ERROR]: 502, | ||
| [ErrorCode.BACKUP_NOT_FOUND]: 404, | ||
| [ErrorCode.BACKUP_EXPIRED]: 400, | ||
| [ErrorCode.INVALID_BACKUP_CONFIG]: 400, | ||
| [ErrorCode.BACKUP_CREATE_FAILED]: 500, | ||
| [ErrorCode.BACKUP_RESTORE_FAILED]: 500, | ||
| [ErrorCode.PYTHON_NOT_AVAILABLE]: 501, | ||
| [ErrorCode.JAVASCRIPT_NOT_AVAILABLE]: 501, | ||
| [ErrorCode.DESKTOP_NOT_STARTED]: 409, | ||
| [ErrorCode.DESKTOP_START_FAILED]: 500, | ||
| [ErrorCode.DESKTOP_UNAVAILABLE]: 503, | ||
| [ErrorCode.DESKTOP_PROCESS_CRASHED]: 500, | ||
| [ErrorCode.DESKTOP_INVALID_OPTIONS]: 400, | ||
| [ErrorCode.DESKTOP_INVALID_COORDINATES]: 400, | ||
| [ErrorCode.INTERPRETER_NOT_READY]: 503, | ||
| [ErrorCode.OPENCODE_STARTUP_FAILED]: 503, | ||
| [ErrorCode.RPC_TRANSPORT_ERROR]: 503, | ||
| [ErrorCode.PROCESS_READY_TIMEOUT]: 408, | ||
| [ErrorCode.PROCESS_EXITED_BEFORE_READY]: 500, | ||
| [ErrorCode.NO_SPACE]: 500, | ||
| [ErrorCode.TOO_MANY_FILES]: 500, | ||
| [ErrorCode.TOO_MANY_LINKS]: 500, | ||
| [ErrorCode.FILESYSTEM_ERROR]: 500, | ||
| [ErrorCode.COMMAND_EXECUTION_ERROR]: 500, | ||
| [ErrorCode.STREAM_START_ERROR]: 500, | ||
| [ErrorCode.PROCESS_ERROR]: 500, | ||
| [ErrorCode.PORT_OPERATION_ERROR]: 500, | ||
| [ErrorCode.GIT_CLONE_FAILED]: 500, | ||
| [ErrorCode.GIT_CHECKOUT_FAILED]: 500, | ||
| [ErrorCode.GIT_OPERATION_FAILED]: 500, | ||
| [ErrorCode.CODE_EXECUTION_ERROR]: 500, | ||
| [ErrorCode.BUCKET_MOUNT_ERROR]: 500, | ||
| [ErrorCode.BUCKET_UNMOUNT_ERROR]: 500, | ||
| [ErrorCode.S3FS_MOUNT_ERROR]: 500, | ||
| [ErrorCode.WATCH_START_ERROR]: 500, | ||
| [ErrorCode.WATCH_STOP_ERROR]: 500, | ||
| [ErrorCode.UNKNOWN_ERROR]: 500, | ||
| [ErrorCode.INTERNAL_ERROR]: 500 | ||
| }; | ||
| /** | ||
| * Get HTTP status code for an error code | ||
| * Falls back to 500 for unknown errors | ||
| */ | ||
| function getHttpStatus(code) { | ||
| return ERROR_STATUS_MAP[code] || 500; | ||
| } | ||
| //#endregion | ||
| //#region ../shared/dist/errors/suggestions.js | ||
| /** | ||
| * Get actionable suggestion for an error code | ||
| * Used by handlers when enriching ServiceError → ErrorResponse | ||
| */ | ||
| function getSuggestion(code, context) { | ||
| switch (code) { | ||
| case ErrorCode.FILE_NOT_FOUND: return `Ensure the file exists at ${context.path} before attempting to access it`; | ||
| case ErrorCode.FILE_EXISTS: return `File already exists at ${context.path}. Use a different path or delete the existing file first`; | ||
| case ErrorCode.COMMAND_NOT_FOUND: return `Check that "${context.command}" is installed and available in the system PATH`; | ||
| case ErrorCode.PROCESS_NOT_FOUND: return "Verify the process ID is correct and the process has not already exited"; | ||
| case ErrorCode.PORT_NOT_EXPOSED: return `Port ${context.port} is not currently exposed. Use listExposedPorts() to see active ports`; | ||
| case ErrorCode.PORT_ALREADY_EXPOSED: return `Port ${context.port} is already exposed. Unexpose it first or use a different port`; | ||
| case ErrorCode.PORT_IN_USE: return `Port ${context.port} is already in use by another service. Choose a different port`; | ||
| case ErrorCode.SESSION_ALREADY_EXISTS: return `Session "${context.sessionId}" already exists. Use a different session ID or reuse the existing session`; | ||
| case ErrorCode.SESSION_DESTROYED: return `Session "${context.sessionId}" was destroyed. Create a new session to continue executing commands`; | ||
| case ErrorCode.SESSION_TERMINATED: return `Session "${context.sessionId}" ended because its shell exited (exit code: ${context.exitCode ?? "unknown"}). Session-local state (env vars, cwd, shell functions) has been lost. Retry the call to start a fresh session, or call createSession() with the same id to recreate it explicitly`; | ||
| case ErrorCode.INVALID_PORT: return `Port must be between 1 and 65535. Port ${context.port} is ${context.reason}`; | ||
| case ErrorCode.GIT_REPOSITORY_NOT_FOUND: return "Verify the repository URL is correct and accessible"; | ||
| case ErrorCode.GIT_AUTH_FAILED: return "Check authentication credentials or use a public repository"; | ||
| case ErrorCode.GIT_BRANCH_NOT_FOUND: return `Branch "${context.branch}" does not exist in the repository. Check the branch name or use the default branch`; | ||
| case ErrorCode.INTERPRETER_NOT_READY: return context.retryAfter ? `Code interpreter is starting up. Retry after ${context.retryAfter} seconds` : "Code interpreter is not ready. Please wait a moment and try again"; | ||
| case ErrorCode.CONTEXT_NOT_FOUND: return `Context "${context.contextId}" does not exist. Create a context first using createContext()`; | ||
| case ErrorCode.VALIDATION_FAILED: return "Check the request parameters and ensure they match the required format"; | ||
| case ErrorCode.NO_SPACE: return "Not enough disk space available. Consider cleaning up temporary files or increasing storage"; | ||
| case ErrorCode.PERMISSION_DENIED: return "Operation not permitted. Check file/directory permissions"; | ||
| case ErrorCode.IS_DIRECTORY: return `Cannot perform this operation on a directory. Path ${context.path} is a directory`; | ||
| case ErrorCode.NOT_DIRECTORY: return `Expected a directory but found a file at ${context.path}`; | ||
| case ErrorCode.RESOURCE_BUSY: return "Resource is currently in use. Wait for the current operation to complete"; | ||
| case ErrorCode.READ_ONLY: return "Cannot modify a read-only resource"; | ||
| case ErrorCode.SERVICE_NOT_RESPONDING: return "Service is not responding. Check if the service is running and accessible"; | ||
| case ErrorCode.BACKUP_NOT_FOUND: return `Backup "${context.backupId}" does not exist. Verify the backup ID is correct`; | ||
| case ErrorCode.BACKUP_EXPIRED: return `Backup "${context.backupId}" has expired. Create a new backup`; | ||
| case ErrorCode.INVALID_BACKUP_CONFIG: return `Invalid backup configuration: ${context.reason}`; | ||
| case ErrorCode.BACKUP_CREATE_FAILED: return "Backup creation failed. Check that the directory exists and you have sufficient disk space"; | ||
| case ErrorCode.BACKUP_RESTORE_FAILED: return "Backup restoration failed. The archive may be corrupted or the target directory may be in use"; | ||
| case ErrorCode.DESKTOP_NOT_STARTED: return "Desktop environment is not running. Call sandbox.desktop.start() first"; | ||
| case ErrorCode.DESKTOP_START_FAILED: return `Desktop failed to start: ${context.reason || "unknown error"}. Check container logs`; | ||
| case ErrorCode.DESKTOP_UNAVAILABLE: return "Desktop processes are not healthy. Try sandbox.desktop.stop() then sandbox.desktop.start()"; | ||
| case ErrorCode.DESKTOP_PROCESS_CRASHED: return `Desktop process "${context.crashedProcess}" crashed. Restart with sandbox.desktop.start()`; | ||
| case ErrorCode.DESKTOP_INVALID_OPTIONS: return `Invalid desktop options: ${context.reason}. Check resolution and DPI values`; | ||
| case ErrorCode.DESKTOP_INVALID_COORDINATES: return `Coordinates (${context.x}, ${context.y}) are outside the display area (${context.displayWidth}x${context.displayHeight})`; | ||
| case ErrorCode.RPC_TRANSPORT_ERROR: switch (context.kind) { | ||
| case "peer_closed": return "The container closed the WebSocket mid-call (likely a container restart, eviction, or crash). Retry the call — the SDK will open a fresh connection."; | ||
| case "connection_failed": return "The WebSocket connection failed. Retry the call; if the failure persists, check container health and network connectivity."; | ||
| case "upgrade_failed": return "The WebSocket upgrade was rejected by the container. Verify the container is running and reachable on the configured port."; | ||
| case "invalid_frame": return "The container sent a frame the RPC transport cannot handle. This usually indicates a version mismatch between the SDK and the container image."; | ||
| case "protocol_error": return "The peer sent a malformed RPC message (could not parse the wire format). This usually indicates a version mismatch between the SDK and the container image."; | ||
| case "session_disposed": return "The RPC session was disposed while a call was in flight. Avoid reusing stubs after disconnect(); the next method call will reconnect automatically."; | ||
| default: return "The RPC transport raised an error. Retry the call — the SDK will open a fresh connection."; | ||
| } | ||
| default: return; | ||
| } | ||
| } | ||
| //#endregion | ||
| export { getHttpStatus as n, ErrorCode as r, getSuggestion as t }; | ||
| //# sourceMappingURL=errors-8Hvune8K.js.map |
| {"version":3,"file":"errors-8Hvune8K.js","names":[],"sources":["../../shared/dist/errors/codes.js","../../shared/dist/errors/status-map.js","../../shared/dist/errors/suggestions.js"],"sourcesContent":["/**\n * Centralized error code registry\n * Each code maps to a specific error type with consistent semantics\n */\nexport const ErrorCode = {\n // File System Errors (404)\n FILE_NOT_FOUND: 'FILE_NOT_FOUND',\n // Permission Errors (403)\n PERMISSION_DENIED: 'PERMISSION_DENIED',\n // File System Errors (409)\n FILE_EXISTS: 'FILE_EXISTS',\n // File System Errors (400)\n IS_DIRECTORY: 'IS_DIRECTORY',\n NOT_DIRECTORY: 'NOT_DIRECTORY',\n // File Too Large Errors (413)\n FILE_TOO_LARGE: 'FILE_TOO_LARGE',\n // File System Errors (500)\n NO_SPACE: 'NO_SPACE',\n TOO_MANY_FILES: 'TOO_MANY_FILES',\n RESOURCE_BUSY: 'RESOURCE_BUSY',\n READ_ONLY: 'READ_ONLY',\n NAME_TOO_LONG: 'NAME_TOO_LONG',\n TOO_MANY_LINKS: 'TOO_MANY_LINKS',\n FILESYSTEM_ERROR: 'FILESYSTEM_ERROR',\n // Command Errors (404)\n COMMAND_NOT_FOUND: 'COMMAND_NOT_FOUND',\n // Command Errors (403/400)\n COMMAND_PERMISSION_DENIED: 'COMMAND_PERMISSION_DENIED',\n INVALID_COMMAND: 'INVALID_COMMAND',\n // Command Errors (500)\n COMMAND_EXECUTION_ERROR: 'COMMAND_EXECUTION_ERROR',\n STREAM_START_ERROR: 'STREAM_START_ERROR',\n // Process Errors (404)\n PROCESS_NOT_FOUND: 'PROCESS_NOT_FOUND',\n // Process Errors (403/500)\n PROCESS_PERMISSION_DENIED: 'PROCESS_PERMISSION_DENIED',\n PROCESS_ERROR: 'PROCESS_ERROR',\n // Session Errors (409)\n SESSION_ALREADY_EXISTS: 'SESSION_ALREADY_EXISTS',\n // Session Errors (410)\n SESSION_DESTROYED: 'SESSION_DESTROYED',\n SESSION_TERMINATED: 'SESSION_TERMINATED',\n // Port Errors (409)\n PORT_ALREADY_EXPOSED: 'PORT_ALREADY_EXPOSED',\n PORT_IN_USE: 'PORT_IN_USE',\n // Port Errors (404)\n PORT_NOT_EXPOSED: 'PORT_NOT_EXPOSED',\n // Port Errors (400)\n INVALID_PORT_NUMBER: 'INVALID_PORT_NUMBER',\n INVALID_PORT: 'INVALID_PORT',\n // Port Errors (502/500)\n SERVICE_NOT_RESPONDING: 'SERVICE_NOT_RESPONDING',\n PORT_OPERATION_ERROR: 'PORT_OPERATION_ERROR',\n // Port Errors (400)\n CUSTOM_DOMAIN_REQUIRED: 'CUSTOM_DOMAIN_REQUIRED',\n // Git Errors (404)\n GIT_REPOSITORY_NOT_FOUND: 'GIT_REPOSITORY_NOT_FOUND',\n GIT_BRANCH_NOT_FOUND: 'GIT_BRANCH_NOT_FOUND',\n // Git Errors (401)\n GIT_AUTH_FAILED: 'GIT_AUTH_FAILED',\n // Git Errors (502)\n GIT_NETWORK_ERROR: 'GIT_NETWORK_ERROR',\n // Git Errors (400)\n INVALID_GIT_URL: 'INVALID_GIT_URL',\n // Git Errors (500)\n GIT_CLONE_FAILED: 'GIT_CLONE_FAILED',\n GIT_CHECKOUT_FAILED: 'GIT_CHECKOUT_FAILED',\n GIT_OPERATION_FAILED: 'GIT_OPERATION_FAILED',\n // Bucket mounting errors\n BUCKET_MOUNT_ERROR: 'BUCKET_MOUNT_ERROR',\n BUCKET_UNMOUNT_ERROR: 'BUCKET_UNMOUNT_ERROR',\n S3FS_MOUNT_ERROR: 'S3FS_MOUNT_ERROR',\n MISSING_CREDENTIALS: 'MISSING_CREDENTIALS',\n INVALID_MOUNT_CONFIG: 'INVALID_MOUNT_CONFIG',\n // Backup Errors (500)\n BACKUP_CREATE_FAILED: 'BACKUP_CREATE_FAILED',\n BACKUP_RESTORE_FAILED: 'BACKUP_RESTORE_FAILED',\n // Backup Errors (404)\n BACKUP_NOT_FOUND: 'BACKUP_NOT_FOUND',\n // Backup Errors (400)\n BACKUP_EXPIRED: 'BACKUP_EXPIRED',\n INVALID_BACKUP_CONFIG: 'INVALID_BACKUP_CONFIG',\n // Code Interpreter Errors (503)\n INTERPRETER_NOT_READY: 'INTERPRETER_NOT_READY',\n // Code Interpreter Errors (404)\n CONTEXT_NOT_FOUND: 'CONTEXT_NOT_FOUND',\n // Code Interpreter Errors (500)\n CODE_EXECUTION_ERROR: 'CODE_EXECUTION_ERROR',\n // Code Interpreter Errors (501) - Feature not available in image variant\n PYTHON_NOT_AVAILABLE: 'PYTHON_NOT_AVAILABLE',\n JAVASCRIPT_NOT_AVAILABLE: 'JAVASCRIPT_NOT_AVAILABLE',\n // OpenCode Errors (503)\n OPENCODE_STARTUP_FAILED: 'OPENCODE_STARTUP_FAILED',\n // Process Readiness Errors (408/500)\n PROCESS_READY_TIMEOUT: 'PROCESS_READY_TIMEOUT',\n PROCESS_EXITED_BEFORE_READY: 'PROCESS_EXITED_BEFORE_READY',\n // Desktop Errors (409)\n DESKTOP_NOT_STARTED: 'DESKTOP_NOT_STARTED',\n // Desktop Errors (500)\n DESKTOP_START_FAILED: 'DESKTOP_START_FAILED',\n // Desktop Errors (503)\n DESKTOP_UNAVAILABLE: 'DESKTOP_UNAVAILABLE',\n // Desktop Errors (500)\n DESKTOP_PROCESS_CRASHED: 'DESKTOP_PROCESS_CRASHED',\n // Desktop Errors (400)\n DESKTOP_INVALID_OPTIONS: 'DESKTOP_INVALID_OPTIONS',\n DESKTOP_INVALID_COORDINATES: 'DESKTOP_INVALID_COORDINATES',\n // File Watch Errors (404)\n WATCH_NOT_FOUND: 'WATCH_NOT_FOUND',\n // File Watch Errors (500)\n WATCH_START_ERROR: 'WATCH_START_ERROR',\n WATCH_STOP_ERROR: 'WATCH_STOP_ERROR',\n // Validation Errors (400)\n VALIDATION_FAILED: 'VALIDATION_FAILED',\n // Generic Errors (400/500)\n INVALID_JSON_RESPONSE: 'INVALID_JSON_RESPONSE',\n UNKNOWN_ERROR: 'UNKNOWN_ERROR',\n INTERNAL_ERROR: 'INTERNAL_ERROR',\n // RPC Transport Errors (503) — capnweb WebSocket session-level failures\n // raised on the SDK side, not by the container. The container went away\n // mid-call (peer close), the WebSocket failed before/after upgrade, the\n // peer sent a frame the transport cannot handle, or the session was\n // disposed while a call was in flight.\n RPC_TRANSPORT_ERROR: 'RPC_TRANSPORT_ERROR'\n};\n","import { ErrorCode } from './codes';\n/**\n * Maps error codes to HTTP status codes\n * Centralized mapping ensures consistency across SDK\n */\nexport const ERROR_STATUS_MAP = {\n // 404 Not Found\n [ErrorCode.FILE_NOT_FOUND]: 404,\n [ErrorCode.COMMAND_NOT_FOUND]: 404,\n [ErrorCode.PROCESS_NOT_FOUND]: 404,\n [ErrorCode.PORT_NOT_EXPOSED]: 404,\n [ErrorCode.GIT_REPOSITORY_NOT_FOUND]: 404,\n [ErrorCode.GIT_BRANCH_NOT_FOUND]: 404,\n [ErrorCode.CONTEXT_NOT_FOUND]: 404,\n [ErrorCode.WATCH_NOT_FOUND]: 404,\n // 400 Bad Request\n [ErrorCode.IS_DIRECTORY]: 400,\n [ErrorCode.NOT_DIRECTORY]: 400,\n [ErrorCode.INVALID_COMMAND]: 400,\n [ErrorCode.INVALID_PORT_NUMBER]: 400,\n [ErrorCode.INVALID_PORT]: 400,\n [ErrorCode.INVALID_GIT_URL]: 400,\n [ErrorCode.CUSTOM_DOMAIN_REQUIRED]: 400,\n [ErrorCode.INVALID_JSON_RESPONSE]: 400,\n [ErrorCode.NAME_TOO_LONG]: 400,\n [ErrorCode.VALIDATION_FAILED]: 400,\n [ErrorCode.MISSING_CREDENTIALS]: 400,\n [ErrorCode.INVALID_MOUNT_CONFIG]: 400,\n // 401 Unauthorized\n [ErrorCode.GIT_AUTH_FAILED]: 401,\n // 403 Forbidden\n [ErrorCode.PERMISSION_DENIED]: 403,\n [ErrorCode.COMMAND_PERMISSION_DENIED]: 403,\n [ErrorCode.PROCESS_PERMISSION_DENIED]: 403,\n [ErrorCode.READ_ONLY]: 403,\n // 409 Conflict\n [ErrorCode.FILE_EXISTS]: 409,\n [ErrorCode.PORT_ALREADY_EXPOSED]: 409,\n [ErrorCode.PORT_IN_USE]: 409,\n [ErrorCode.RESOURCE_BUSY]: 409,\n [ErrorCode.SESSION_ALREADY_EXISTS]: 409,\n // 410 Gone\n [ErrorCode.SESSION_DESTROYED]: 410,\n [ErrorCode.SESSION_TERMINATED]: 410,\n // 413 Content Too Large\n [ErrorCode.FILE_TOO_LARGE]: 413,\n // 502 Bad Gateway\n [ErrorCode.SERVICE_NOT_RESPONDING]: 502,\n [ErrorCode.GIT_NETWORK_ERROR]: 502,\n // Backup errors\n [ErrorCode.BACKUP_NOT_FOUND]: 404,\n [ErrorCode.BACKUP_EXPIRED]: 400,\n [ErrorCode.INVALID_BACKUP_CONFIG]: 400,\n [ErrorCode.BACKUP_CREATE_FAILED]: 500,\n [ErrorCode.BACKUP_RESTORE_FAILED]: 500,\n // 501 Not Implemented (feature not available in image variant)\n [ErrorCode.PYTHON_NOT_AVAILABLE]: 501,\n [ErrorCode.JAVASCRIPT_NOT_AVAILABLE]: 501,\n // Desktop errors\n [ErrorCode.DESKTOP_NOT_STARTED]: 409,\n [ErrorCode.DESKTOP_START_FAILED]: 500,\n [ErrorCode.DESKTOP_UNAVAILABLE]: 503,\n [ErrorCode.DESKTOP_PROCESS_CRASHED]: 500,\n [ErrorCode.DESKTOP_INVALID_OPTIONS]: 400,\n [ErrorCode.DESKTOP_INVALID_COORDINATES]: 400,\n // 503 Service Unavailable\n [ErrorCode.INTERPRETER_NOT_READY]: 503,\n [ErrorCode.OPENCODE_STARTUP_FAILED]: 503,\n [ErrorCode.RPC_TRANSPORT_ERROR]: 503,\n // 408 Request Timeout\n [ErrorCode.PROCESS_READY_TIMEOUT]: 408,\n // 500 Internal Server Error\n [ErrorCode.PROCESS_EXITED_BEFORE_READY]: 500,\n [ErrorCode.NO_SPACE]: 500,\n [ErrorCode.TOO_MANY_FILES]: 500,\n [ErrorCode.TOO_MANY_LINKS]: 500,\n [ErrorCode.FILESYSTEM_ERROR]: 500,\n [ErrorCode.COMMAND_EXECUTION_ERROR]: 500,\n [ErrorCode.STREAM_START_ERROR]: 500,\n [ErrorCode.PROCESS_ERROR]: 500,\n [ErrorCode.PORT_OPERATION_ERROR]: 500,\n [ErrorCode.GIT_CLONE_FAILED]: 500,\n [ErrorCode.GIT_CHECKOUT_FAILED]: 500,\n [ErrorCode.GIT_OPERATION_FAILED]: 500,\n [ErrorCode.CODE_EXECUTION_ERROR]: 500,\n [ErrorCode.BUCKET_MOUNT_ERROR]: 500,\n [ErrorCode.BUCKET_UNMOUNT_ERROR]: 500,\n [ErrorCode.S3FS_MOUNT_ERROR]: 500,\n [ErrorCode.WATCH_START_ERROR]: 500,\n [ErrorCode.WATCH_STOP_ERROR]: 500,\n [ErrorCode.UNKNOWN_ERROR]: 500,\n [ErrorCode.INTERNAL_ERROR]: 500\n};\n/**\n * Get HTTP status code for an error code\n * Falls back to 500 for unknown errors\n */\nexport function getHttpStatus(code) {\n return ERROR_STATUS_MAP[code] || 500;\n}\n","import { ErrorCode } from './codes';\n/**\n * Get actionable suggestion for an error code\n * Used by handlers when enriching ServiceError → ErrorResponse\n */\nexport function getSuggestion(code, context) {\n switch (code) {\n case ErrorCode.FILE_NOT_FOUND:\n return `Ensure the file exists at ${context.path} before attempting to access it`;\n case ErrorCode.FILE_EXISTS:\n return `File already exists at ${context.path}. Use a different path or delete the existing file first`;\n case ErrorCode.COMMAND_NOT_FOUND:\n return `Check that \"${context.command}\" is installed and available in the system PATH`;\n case ErrorCode.PROCESS_NOT_FOUND:\n return 'Verify the process ID is correct and the process has not already exited';\n case ErrorCode.PORT_NOT_EXPOSED:\n return `Port ${context.port} is not currently exposed. Use listExposedPorts() to see active ports`;\n case ErrorCode.PORT_ALREADY_EXPOSED:\n return `Port ${context.port} is already exposed. Unexpose it first or use a different port`;\n case ErrorCode.PORT_IN_USE:\n return `Port ${context.port} is already in use by another service. Choose a different port`;\n case ErrorCode.SESSION_ALREADY_EXISTS:\n return `Session \"${context.sessionId}\" already exists. Use a different session ID or reuse the existing session`;\n case ErrorCode.SESSION_DESTROYED:\n return `Session \"${context.sessionId}\" was destroyed. Create a new session to continue executing commands`;\n case ErrorCode.SESSION_TERMINATED:\n return `Session \"${context.sessionId}\" ended because its shell exited (exit code: ${context.exitCode ?? 'unknown'}). Session-local state (env vars, cwd, shell functions) has been lost. Retry the call to start a fresh session, or call createSession() with the same id to recreate it explicitly`;\n case ErrorCode.INVALID_PORT:\n return `Port must be between 1 and 65535. Port ${context.port} is ${context.reason}`;\n case ErrorCode.GIT_REPOSITORY_NOT_FOUND:\n return 'Verify the repository URL is correct and accessible';\n case ErrorCode.GIT_AUTH_FAILED:\n return 'Check authentication credentials or use a public repository';\n case ErrorCode.GIT_BRANCH_NOT_FOUND:\n return `Branch \"${context.branch}\" does not exist in the repository. Check the branch name or use the default branch`;\n case ErrorCode.INTERPRETER_NOT_READY:\n return context.retryAfter\n ? `Code interpreter is starting up. Retry after ${context.retryAfter} seconds`\n : 'Code interpreter is not ready. Please wait a moment and try again';\n case ErrorCode.CONTEXT_NOT_FOUND:\n return `Context \"${context.contextId}\" does not exist. Create a context first using createContext()`;\n case ErrorCode.VALIDATION_FAILED:\n return 'Check the request parameters and ensure they match the required format';\n case ErrorCode.NO_SPACE:\n return 'Not enough disk space available. Consider cleaning up temporary files or increasing storage';\n case ErrorCode.PERMISSION_DENIED:\n return 'Operation not permitted. Check file/directory permissions';\n case ErrorCode.IS_DIRECTORY:\n return `Cannot perform this operation on a directory. Path ${context.path} is a directory`;\n case ErrorCode.NOT_DIRECTORY:\n return `Expected a directory but found a file at ${context.path}`;\n case ErrorCode.RESOURCE_BUSY:\n return 'Resource is currently in use. Wait for the current operation to complete';\n case ErrorCode.READ_ONLY:\n return 'Cannot modify a read-only resource';\n case ErrorCode.SERVICE_NOT_RESPONDING:\n return 'Service is not responding. Check if the service is running and accessible';\n case ErrorCode.BACKUP_NOT_FOUND:\n return `Backup \"${context.backupId}\" does not exist. Verify the backup ID is correct`;\n case ErrorCode.BACKUP_EXPIRED:\n return `Backup \"${context.backupId}\" has expired. Create a new backup`;\n case ErrorCode.INVALID_BACKUP_CONFIG:\n return `Invalid backup configuration: ${context.reason}`;\n case ErrorCode.BACKUP_CREATE_FAILED:\n return 'Backup creation failed. Check that the directory exists and you have sufficient disk space';\n case ErrorCode.BACKUP_RESTORE_FAILED:\n return 'Backup restoration failed. The archive may be corrupted or the target directory may be in use';\n case ErrorCode.DESKTOP_NOT_STARTED:\n return 'Desktop environment is not running. Call sandbox.desktop.start() first';\n case ErrorCode.DESKTOP_START_FAILED:\n return `Desktop failed to start: ${context.reason || 'unknown error'}. Check container logs`;\n case ErrorCode.DESKTOP_UNAVAILABLE:\n return 'Desktop processes are not healthy. Try sandbox.desktop.stop() then sandbox.desktop.start()';\n case ErrorCode.DESKTOP_PROCESS_CRASHED:\n return `Desktop process \"${context.crashedProcess}\" crashed. Restart with sandbox.desktop.start()`;\n case ErrorCode.DESKTOP_INVALID_OPTIONS:\n return `Invalid desktop options: ${context.reason}. Check resolution and DPI values`;\n case ErrorCode.DESKTOP_INVALID_COORDINATES:\n return `Coordinates (${context.x}, ${context.y}) are outside the display area (${context.displayWidth}x${context.displayHeight})`;\n case ErrorCode.RPC_TRANSPORT_ERROR: {\n const kind = context.kind;\n switch (kind) {\n case 'peer_closed':\n return 'The container closed the WebSocket mid-call (likely a container restart, eviction, or crash). Retry the call — the SDK will open a fresh connection.';\n case 'connection_failed':\n return 'The WebSocket connection failed. Retry the call; if the failure persists, check container health and network connectivity.';\n case 'upgrade_failed':\n return 'The WebSocket upgrade was rejected by the container. Verify the container is running and reachable on the configured port.';\n case 'invalid_frame':\n return 'The container sent a frame the RPC transport cannot handle. This usually indicates a version mismatch between the SDK and the container image.';\n case 'protocol_error':\n return 'The peer sent a malformed RPC message (could not parse the wire format). This usually indicates a version mismatch between the SDK and the container image.';\n case 'session_disposed':\n return 'The RPC session was disposed while a call was in flight. Avoid reusing stubs after disconnect(); the next method call will reconnect automatically.';\n default:\n return 'The RPC transport raised an error. Retry the call — the SDK will open a fresh connection.';\n }\n }\n // Generic fallback for other errors\n default:\n return undefined;\n }\n}\n"],"mappings":";;;;;AAIA,MAAa,YAAY;CAErB,gBAAgB;CAEhB,mBAAmB;CAEnB,aAAa;CAEb,cAAc;CACd,eAAe;CAEf,gBAAgB;CAEhB,UAAU;CACV,gBAAgB;CAChB,eAAe;CACf,WAAW;CACX,eAAe;CACf,gBAAgB;CAChB,kBAAkB;CAElB,mBA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KAAK,UAAU,sBACX,QAAO,iCAAiC,QAAQ;EACpD,KAAK,UAAU,qBACX,QAAO;EACX,KAAK,UAAU,sBACX,QAAO;EACX,KAAK,UAAU,oBACX,QAAO;EACX,KAAK,UAAU,qBACX,QAAO,4BAA4B,QAAQ,UAAU,gBAAgB;EACzE,KAAK,UAAU,oBACX,QAAO;EACX,KAAK,UAAU,wBACX,QAAO,oBAAoB,QAAQ,eAAe;EACtD,KAAK,UAAU,wBACX,QAAO,4BAA4B,QAAQ,OAAO;EACtD,KAAK,UAAU,4BACX,QAAO,gBAAgB,QAAQ,EAAE,IAAI,QAAQ,EAAE,kCAAkC,QAAQ,aAAa,GAAG,QAAQ,cAAc;EACnI,KAAK,UAAU,oBAEX,SADa,QAAQ,MACrB;GACI,KAAK,cACD,QAAO;GACX,KAAK,oBACD,QAAO;GACX,KAAK,iBACD,QAAO;GACX,KAAK,gBACD,QAAO;GACX,KAAK,iBACD,QAAO;GACX,KAAK,mBACD,QAAO;GACX,QACI,QAAO;;EAInB,QACI"} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
@@ -6,8 +6,2 @@ import { DurableObject } from "cloudflare:workers"; | ||
| /** | ||
| * Wire types and configuration types for the Cloudflare Sandbox Bridge. | ||
| * | ||
| * These types define the JSON payloads exchanged between HTTP clients | ||
| * (e.g. the Python `CloudflareSandboxClient`) and the bridge worker. | ||
| */ | ||
| /** | ||
| * Configuration options for the bridge() factory. | ||
@@ -14,0 +8,0 @@ */ |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/bridge/types.ts","../../src/bridge/helpers.ts","../../src/bridge/warm-pool.ts","../../src/bridge/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AAgBA;AAgCA;;;;;AAKgB,UArCC,YAAA,CAqCD;EAEA;;;;AAehB;;;;ICEgB;IAyBA,QAAA,CAAA,EAAA,MAAA;;;;AC7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yIc,CCzIE,SDyIF,CAAA"} | ||
| {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/bridge/types.ts","../../src/bridge/helpers.ts","../../src/bridge/warm-pool.ts","../../src/bridge/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AA6DgB,UAvCC,YAAA,CAuCD;EAEP;;;AAaT;;;;ICJgB,OAAA,CAAA,EAAU,MAAA;IAyBV;;;;AC7EhB;AAOA;AAWC;AA6CD;EAA4C,cAAA,CAAA,EAAA,MAAA;EA2BH;;;;;EAiFf,WAAA,CAAA,EAAA,MAAA;;;;;;;;UFzIT,cAAA;EGgCD,KAAA,EAAA,OAAM,EH9BT,OG8BS,EAAA,GAAA,EAAA,GAAA,EAAA,GAAA,EH5Bb,gBG4Ba,CAAA,EH3BjB,QG2BiB,GH3BN,OG2BM,CH3BE,QG2BF,CAAA;EACZ,SAAA,EAAA,UAAA,EH1BM,mBG0BN,EAAA,GAAA,EAAA,GAAA,EAAA,GAAA,EHxBD,gBGwBC,CAAA,EAAA,IAAA,GHvBE,OGuBF,CAAA,IAAA,CAAA;EACC,CAAA,GAAA,EAAA,MAAA,CAAA,EAAA,OAAA;;;;;;UHZM,SAAA;;;;;;;;;;;AAAjB;;;;ACJA;AAyBgB,iBAzBA,UAAA,CAyBoB,GAAA,EAAA,MAAA,CAAA,EAAA,MAAA;;;;AC7EpC;AAOA;AAmDU,iBDmBM,oBAAA,CClBL,QAAsB,EAAA,MAAA,CAAA,EAAA,MAAA,GAAA,IAAA;;;AFHhB,UExDA,cAAA,CFwDS;;;;ECJV,eAAU,CAAA,EAAA,MAAA;AAyB1B;UCtEiB,SAAA;;;EAPA;EAOA,QAAA,EAAA,MAAS;EAmDhB;EAKG,KAAA,EAAA,MAAS;EAAsB;EA2BH,MAAA,EA3E/B,QA2E+B,CA3EtB,cA2EsB,CAAA;EA6CG;EAYE,YAAA,EAAA,MAAA,GAAA,IAAA;;;;;;;UAzFpC,WAAA,CAKoB;EAAa,OAAA,EAJhC,sBAIgC;;;cAA9B,QAAA,SAAiB,cAAc;ECG5B,QAAA,MAAM;EACZ;EACC,QAAA,cAAA;EACQ;EAAhB,QAAA,WAAA;EAAe;;;;;;;;;;;mCDqBuB;;;;;;sCA6CG;;;;wCAYE;;;;cAS1B,QAAQ;;;;;oBAeF,iBAAiB;;;;;uBAUd;WAyBZ;;;;;;;;;;;;;;;;;;;;;;;;AAvMjB;AAWC;AA6CD;;;;;;;;;;AA+IiB,iBC5ID,MAAA,CD4IC,MAAA,EC3IP,cD2IO,EAAA,MAAA,CAAA,EC1IN,YD0IM,CAAA,ECzId,eDyIc,CCzIE,SDyIF,CAAA"} |
+2
-2
@@ -1,2 +0,2 @@ | ||
| import { $ as BackupOptions, A as DesktopStopResponse, At as ProcessStartResult, B as ExecuteResponse, Bt as WatchOptions, C as ClickOptions, Ct as Process, D as DesktopStartOptions, Dt as ProcessListResult, E as DesktopClient, Et as ProcessKillResult, F as ScreenshotRegion, Ft as SandboxTransport, G as HttpClientOptions, Gt as CodeContext, H as BaseApiResponse, Ht as isProcess, I as ScreenshotResponse, It as SessionOptions, J as SessionRequest, Jt as ExecutionResult, K as RequestConfig, Kt as CreateContextOptions, L as ScrollDirection, Lt as StreamOptions, M as ScreenSizeResponse, Mt as RemoteMountBucketOptions, N as ScreenshotBytesResponse, Nt as RestoreBackupResult, O as DesktopStartResponse, Ot as ProcessLogsResult, P as ScreenshotOptions, Pt as SandboxOptions, Q as StartProcessRequest, R as TypeOptions, Rt as WaitForLogResult, S as WriteFileRequest, St as PortListResult, T as Desktop, Tt as ProcessInfoResult, U as ContainerStub, Ut as isProcessStatus, V as BackupClient, Vt as isExecResult, W as ErrorResponse, Wt as PtyOptions, X as ExecuteRequest, Y as SandboxInterpreterAPI, Yt as RunCodeOptions, Z as ExposePortRequest, _ as GitClient, _t as LocalMountBucketOptions, a as CreateSessionRequest, at as DirectoryBackup, b as MkdirRequest, bt as PortCloseResult, c as DeleteSessionResponse, ct as ExecResult, d as ProcessClient, dt as FileMetadata, et as BaseExecOptions, f as PortClient, ft as FileStreamEvent, g as GitCheckoutRequest, gt as ListFilesOptions, h as InterpreterClient, ht as ISandbox, i as CommandsResponse, it as CheckChangesResult, j as KeyInput, jt as ProcessStatus, k as DesktopStatusResponse, kt as ProcessOptions, l as PingResponse, lt as ExecutionSession, m as ExecutionCallbacks, mt as GitCheckoutResult, n as getSandbox, nt as BucketProvider, o as CreateSessionResponse, ot as ExecEvent, p as UnexposePortRequest, pt as FileWatchSSEEvent, q as ResponseHandler, qt as Execution, r as SandboxClient, rt as CheckChangesOptions, s as DeleteSessionRequest, st as ExecOptions, t as Sandbox, tt as BucketCredentials, u as UtilityClient, ut as FileChunk, v as FileClient, vt as LogEvent, w as CursorPositionResponse, wt as ProcessCleanupResult, x as ReadFileRequest, xt as PortExposeResult, y as FileOperationRequest, yt as MountBucketOptions, z as CommandClient, zt as WaitForPortOptions } from "./sandbox-BVgScWy9.js"; | ||
| import { $ as StartProcessRequest, A as DesktopStopResponse, At as ProcessOptions, B as ExecuteResponse, Bt as WaitForPortOptions, C as ClickOptions, Ct as PortListResult, D as DesktopStartOptions, Dt as ProcessKillResult, E as DesktopClient, Et as ProcessInfoResult, F as ScreenshotRegion, Ft as SandboxOptions, G as HttpClientOptions, Gt as PtyOptions, H as BaseApiResponse, Ht as isExecResult, I as ScreenshotResponse, It as SandboxTransport, J as SessionRequest, Jt as Execution, K as RequestConfig, Kt as CodeContext, L as ScrollDirection, Lt as SessionOptions, M as ScreenSizeResponse, Mt as ProcessStatus, N as ScreenshotBytesResponse, Nt as RemoteMountBucketOptions, O as DesktopStartResponse, Ot as ProcessListResult, P as ScreenshotOptions, Pt as RestoreBackupResult, Q as ExposePortRequest, R as TypeOptions, Rt as StreamOptions, S as WriteFileRequest, St as PortExposeResult, T as Desktop, Tt as ProcessCleanupResult, U as ContainerStub, Ut as isProcess, V as BackupClient, Vt as WatchOptions, W as ErrorResponse, Wt as isProcessStatus, X as TunnelInfo, Xt as RunCodeOptions, Y as SandboxInterpreterAPI, Yt as ExecutionResult, Z as ExecuteRequest, _ as GitClient, _t as ListFilesOptions, a as CreateSessionRequest, at as CheckChangesResult, b as MkdirRequest, bt as MountBucketOptions, c as DeleteSessionResponse, ct as ExecOptions, d as ProcessClient, dt as FileChunk, et as BackupOptions, f as PortClient, ft as FileMetadata, g as GitCheckoutRequest, gt as ISandbox, h as InterpreterClient, ht as GitCheckoutResult, i as CommandsResponse, it as CheckChangesOptions, j as KeyInput, jt as ProcessStartResult, k as DesktopStatusResponse, kt as ProcessLogsResult, l as PingResponse, lt as ExecResult, m as ExecutionCallbacks, mt as FileWatchSSEEvent, n as getSandbox, nt as BucketCredentials, o as CreateSessionResponse, ot as DirectoryBackup, p as UnexposePortRequest, pt as FileStreamEvent, q as ResponseHandler, qt as CreateContextOptions, r as SandboxClient, rt as BucketProvider, s as DeleteSessionRequest, st as ExecEvent, t as Sandbox, tt as BaseExecOptions, u as UtilityClient, ut as ExecutionSession, v as FileClient, vt as LocalMountBucketOptions, w as CursorPositionResponse, wt as Process, x as ReadFileRequest, xt as PortCloseResult, y as FileOperationRequest, yt as LogEvent, z as CommandClient, zt as WaitForLogResult } from "./sandbox-KdzTTnWq.js"; | ||
| import { a as DesktopCoordinateErrorContext, d as RPCTransportContext, f as RPCTransportErrorKind, g as ErrorCode, h as OperationType, i as BackupRestoreContext, l as ProcessExitedBeforeReadyContext, m as ErrorResponse$1, n as BackupExpiredContext, o as DesktopErrorContext, p as SessionTerminatedContext, r as BackupNotFoundContext, s as InvalidBackupConfigContext, t as BackupCreateContext, u as ProcessReadyTimeoutContext } from "./contexts-D_shbnJs.js"; | ||
@@ -290,3 +290,3 @@ import { ContainerProxy } from "@cloudflare/containers"; | ||
| //#endregion | ||
| export { BackupClient, BackupCreateError, BackupExpiredError, BackupNotFoundError, type BackupOptions, BackupRestoreError, type BaseApiResponse, type BaseExecOptions, type BucketCredentials, BucketMountError, type BucketProvider, BucketUnmountError, type CheckChangesOptions, type CheckChangesResult, type ClickOptions, type CodeContext, CodeInterpreter, CommandClient, type ExecuteResponse as CommandExecuteResponse, type CommandsResponse, ContainerProxy, type ContainerStub, type CreateContextOptions, type CreateSessionRequest, type CreateSessionResponse, type CursorPositionResponse, type DeleteSessionRequest, type DeleteSessionResponse, type Desktop, DesktopClient, DesktopInvalidCoordinatesError, DesktopInvalidOptionsError, DesktopNotStartedError, DesktopProcessCrashedError, DesktopStartFailedError, type DesktopStartOptions, type DesktopStartResponse, type DesktopStatusResponse, type DesktopStopResponse, DesktopUnavailableError, type DirectoryBackup, type ErrorResponse, type ExecEvent, type ExecOptions, type ExecResult, type ExecuteRequest, type ExecutionCallbacks, type ExecutionResult, type ExecutionSession, type ExposePortRequest, type FileChunk, FileClient, type FileMetadata, type FileOperationRequest, type FileStreamEvent, type FileWatchSSEEvent, type GitCheckoutRequest, type GitCheckoutResult, GitClient, type ISandbox, type InterpreterClient, InvalidBackupConfigError, InvalidMountConfigError, type KeyInput, type ListFilesOptions, type LocalMountBucketOptions, type LogEvent, MissingCredentialsError, type MkdirRequest, type MountBucketOptions, type PingResponse, PortClient, type PortCloseResult, type PortExposeResult, type PortListResult, type Process, type ProcessCleanupResult, ProcessClient, ProcessExitedBeforeReadyError, type ProcessInfoResult, type ProcessKillResult, type ProcessListResult, type ProcessLogsResult, type ProcessOptions, ProcessReadyTimeoutError, type ProcessStartResult, type ProcessStatus, type PtyOptions, type RPCTransportContext, RPCTransportError, type RPCTransportErrorKind, type ReadFileRequest, type RemoteMountBucketOptions, type RequestConfig, type ResponseHandler, type RestoreBackupResult, type RouteInfo, type RunCodeOptions, S3FSMountError, Sandbox, SandboxClient, type HttpClientOptions as SandboxClientOptions, type SandboxEnv, type SandboxOptions, type SandboxTransport, type ScreenSizeResponse, type ScreenshotBytesResponse, type ScreenshotOptions, type ScreenshotRegion, type ScreenshotResponse, type ScrollDirection, type SessionOptions, type SessionRequest, SessionTerminatedError, type StartProcessRequest, type StreamOptions, type TypeOptions, type UnexposePortRequest, UtilityClient, type WaitForLogResult, type WaitForPortOptions, type WatchOptions, type WriteFileRequest, asyncIterableToSSEStream, collectFile, getSandbox, isExecResult, isProcess, isProcessStatus, parseSSEStream, proxyTerminal, proxyToSandbox, responseToAsyncIterable, streamFile }; | ||
| export { BackupClient, BackupCreateError, BackupExpiredError, BackupNotFoundError, type BackupOptions, BackupRestoreError, type BaseApiResponse, type BaseExecOptions, type BucketCredentials, BucketMountError, type BucketProvider, BucketUnmountError, type CheckChangesOptions, type CheckChangesResult, type ClickOptions, type CodeContext, CodeInterpreter, CommandClient, type ExecuteResponse as CommandExecuteResponse, type CommandsResponse, ContainerProxy, type ContainerStub, type CreateContextOptions, type CreateSessionRequest, type CreateSessionResponse, type CursorPositionResponse, type DeleteSessionRequest, type DeleteSessionResponse, type Desktop, DesktopClient, DesktopInvalidCoordinatesError, DesktopInvalidOptionsError, DesktopNotStartedError, DesktopProcessCrashedError, DesktopStartFailedError, type DesktopStartOptions, type DesktopStartResponse, type DesktopStatusResponse, type DesktopStopResponse, DesktopUnavailableError, type DirectoryBackup, type ErrorResponse, type ExecEvent, type ExecOptions, type ExecResult, type ExecuteRequest, type ExecutionCallbacks, type ExecutionResult, type ExecutionSession, type ExposePortRequest, type FileChunk, FileClient, type FileMetadata, type FileOperationRequest, type FileStreamEvent, type FileWatchSSEEvent, type GitCheckoutRequest, type GitCheckoutResult, GitClient, type ISandbox, type InterpreterClient, InvalidBackupConfigError, InvalidMountConfigError, type KeyInput, type ListFilesOptions, type LocalMountBucketOptions, type LogEvent, MissingCredentialsError, type MkdirRequest, type MountBucketOptions, type PingResponse, PortClient, type PortCloseResult, type PortExposeResult, type PortListResult, type Process, type ProcessCleanupResult, ProcessClient, ProcessExitedBeforeReadyError, type ProcessInfoResult, type ProcessKillResult, type ProcessListResult, type ProcessLogsResult, type ProcessOptions, ProcessReadyTimeoutError, type ProcessStartResult, type ProcessStatus, type PtyOptions, type RPCTransportContext, RPCTransportError, type RPCTransportErrorKind, type ReadFileRequest, type RemoteMountBucketOptions, type RequestConfig, type ResponseHandler, type RestoreBackupResult, type RouteInfo, type RunCodeOptions, S3FSMountError, Sandbox, SandboxClient, type HttpClientOptions as SandboxClientOptions, type SandboxEnv, type SandboxOptions, type SandboxTransport, type ScreenSizeResponse, type ScreenshotBytesResponse, type ScreenshotOptions, type ScreenshotRegion, type ScreenshotResponse, type ScrollDirection, type SessionOptions, type SessionRequest, SessionTerminatedError, type StartProcessRequest, type StreamOptions, type TunnelInfo, type TypeOptions, type UnexposePortRequest, UtilityClient, type WaitForLogResult, type WaitForPortOptions, type WatchOptions, type WriteFileRequest, asyncIterableToSSEStream, collectFile, getSandbox, isExecResult, isProcess, isProcessStatus, parseSSEStream, proxyTerminal, proxyToSandbox, responseToAsyncIterable, streamFile }; | ||
| //# sourceMappingURL=index.d.ts.map |
+2
-2
| import { a as isExecResult, o as isProcess, s as isProcessStatus } from "./dist-B_eXrP83.js"; | ||
| import "./errors-CBi-O-pF.js"; | ||
| import { A as DesktopInvalidOptionsError, C as CommandClient, D as BackupNotFoundError, E as BackupExpiredError, F as InvalidBackupConfigError, I as ProcessExitedBeforeReadyError, L as ProcessReadyTimeoutError, M as DesktopProcessCrashedError, N as DesktopStartFailedError, O as BackupRestoreError, P as DesktopUnavailableError, R as RPCTransportError, S as DesktopClient, T as BackupCreateError, _ as UtilityClient, a as BucketMountError, b as GitClient, c as MissingCredentialsError, d as parseSSEStream, f as responseToAsyncIterable, g as SandboxClient, h as streamFile, i as proxyTerminal, j as DesktopNotStartedError, k as DesktopInvalidCoordinatesError, l as S3FSMountError, m as collectFile, n as getSandbox, o as BucketUnmountError, p as CodeInterpreter, r as proxyToSandbox, s as InvalidMountConfigError, t as Sandbox, u as asyncIterableToSSEStream, v as ProcessClient, w as BackupClient, x as FileClient, y as PortClient, z as SessionTerminatedError } from "./sandbox-uC1vzWtG.js"; | ||
| import "./errors-8Hvune8K.js"; | ||
| import { A as DesktopInvalidOptionsError, C as CommandClient, D as BackupNotFoundError, E as BackupExpiredError, F as InvalidBackupConfigError, I as ProcessExitedBeforeReadyError, L as ProcessReadyTimeoutError, M as DesktopProcessCrashedError, N as DesktopStartFailedError, O as BackupRestoreError, P as DesktopUnavailableError, R as RPCTransportError, S as DesktopClient, T as BackupCreateError, _ as UtilityClient, a as BucketMountError, b as GitClient, c as MissingCredentialsError, d as parseSSEStream, f as responseToAsyncIterable, g as SandboxClient, h as streamFile, i as proxyTerminal, j as DesktopNotStartedError, k as DesktopInvalidCoordinatesError, l as S3FSMountError, m as collectFile, n as getSandbox, o as BucketUnmountError, p as CodeInterpreter, r as proxyToSandbox, s as InvalidMountConfigError, t as Sandbox, u as asyncIterableToSSEStream, v as ProcessClient, w as BackupClient, x as FileClient, y as PortClient, z as SessionTerminatedError } from "./sandbox-BcEq4aUF.js"; | ||
| import { ContainerProxy } from "@cloudflare/containers"; | ||
| export { BackupClient, BackupCreateError, BackupExpiredError, BackupNotFoundError, BackupRestoreError, BucketMountError, BucketUnmountError, CodeInterpreter, CommandClient, ContainerProxy, DesktopClient, DesktopInvalidCoordinatesError, DesktopInvalidOptionsError, DesktopNotStartedError, DesktopProcessCrashedError, DesktopStartFailedError, DesktopUnavailableError, FileClient, GitClient, InvalidBackupConfigError, InvalidMountConfigError, MissingCredentialsError, PortClient, ProcessClient, ProcessExitedBeforeReadyError, ProcessReadyTimeoutError, RPCTransportError, S3FSMountError, Sandbox, SandboxClient, SessionTerminatedError, UtilityClient, asyncIterableToSSEStream, collectFile, getSandbox, isExecResult, isProcess, isProcessStatus, parseSSEStream, proxyTerminal, proxyToSandbox, responseToAsyncIterable, streamFile }; |
@@ -1,2 +0,2 @@ | ||
| import { t as Sandbox } from "../sandbox-BVgScWy9.js"; | ||
| import { t as Sandbox } from "../sandbox-KdzTTnWq.js"; | ||
| import { ApplyPatchOperation, ApplyPatchResult, Editor as Editor$1, Shell as Shell$1, ShellAction, ShellResult } from "@openai/agents"; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
| import { t as Sandbox } from "../sandbox-BVgScWy9.js"; | ||
| import { t as Sandbox } from "../sandbox-KdzTTnWq.js"; | ||
| import { c as OpencodeStartupContext } from "../contexts-D_shbnJs.js"; | ||
@@ -3,0 +3,0 @@ import { OpencodeClient } from "@opencode-ai/sdk/v2/client"; |
| import { u as createLogger } from "../dist-B_eXrP83.js"; | ||
| import { r as ErrorCode } from "../errors-CBi-O-pF.js"; | ||
| import { r as ErrorCode } from "../errors-8Hvune8K.js"; | ||
@@ -4,0 +4,0 @@ //#region src/opencode/types.ts |
+32
-0
@@ -155,2 +155,34 @@ # Bun version — override via --build-arg BUN_VERSION=$(cat .bun-version) | ||
| # ============================================================================ | ||
| # cloudflared (Cloudflare Tunnel daemon) — enables sandbox.tunnels.* | ||
| # Pinned version with sha256 verification per architecture. | ||
| # Skipped in the musl/Alpine stage (no musl prebuilt). | ||
| # ============================================================================ | ||
| ARG CLOUDFLARED_VERSION=2026.3.0 | ||
| ARG CLOUDFLARED_SHA256_AMD64=4a9e50e6d6d798e90fcd01933151a90bf7edd99a0a55c28ad18f2e16263a5c30 | ||
| ARG CLOUDFLARED_SHA256_ARM64=0755ba4cbab59980e6148367fcf53a8f3ec85a97deefd63c2420cf7850769bee | ||
| RUN set -eux; \ | ||
| arch="$(dpkg --print-architecture)"; \ | ||
| case "$arch" in \ | ||
| amd64) suffix=amd64; sha="${CLOUDFLARED_SHA256_AMD64}" ;; \ | ||
| arm64) suffix=arm64; sha="${CLOUDFLARED_SHA256_ARM64}" ;; \ | ||
| *) echo "Unsupported arch for cloudflared: $arch" >&2; exit 1 ;; \ | ||
| esac; \ | ||
| url="https://github.com/cloudflare/cloudflared/releases/download/${CLOUDFLARED_VERSION}/cloudflared-linux-${suffix}"; \ | ||
| curl -fsSL -o /usr/local/bin/cloudflared "$url"; \ | ||
| echo "$sha /usr/local/bin/cloudflared" | sha256sum -c -; \ | ||
| chmod +x /usr/local/bin/cloudflared; \ | ||
| cloudflared --version | ||
| # Inject the host's extra CA bundle when running locally behind a TLS- | ||
| # intercepting proxy (e.g. Cloudflare WARP / Zero Trust). See | ||
| # DOCKER_README.md for the local-dev setup. No-op when the secret | ||
| # isn't passed. | ||
| RUN --mount=type=secret,id=wrangler_ca \ | ||
| if [ -f /run/secrets/wrangler_ca ] && [ -s /run/secrets/wrangler_ca ]; then \ | ||
| cp /run/secrets/wrangler_ca /usr/local/share/ca-certificates/wrangler-dev-ca.crt && \ | ||
| cat /run/secrets/wrangler_ca >> /etc/ssl/certs/ca-certificates.crt && \ | ||
| update-ca-certificates; \ | ||
| fi | ||
| RUN mkdir -p /workspace | ||
@@ -157,0 +189,0 @@ |
+1
-1
| { | ||
| "name": "@cloudflare/sandbox", | ||
| "version": "0.10.1", | ||
| "version": "0.10.2", | ||
| "repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
+46
-0
@@ -101,2 +101,47 @@ <img width="1362" height="450" alt="Image" src="https://github.com/user-attachments/assets/6f770ae3-0a14-4d2b-9aed-a304ee5446c5" /> | ||
| ## Quick tunnels | ||
| `sandbox.tunnels.get(port)` exposes a service running inside the | ||
| sandbox on a `*.trycloudflare.com` URL. No Cloudflare account or DNS | ||
| setup required — cloudflared opens a persistent QUIC connection to | ||
| Cloudflare's edge and Cloudflare hands back a hostname. | ||
| ```ts | ||
| // Inside a Worker with an RPC-transport sandbox: | ||
| const tunnel = await sandbox.tunnels.get(8080); | ||
| console.log(tunnel.url); | ||
| // → https://random-words-here.trycloudflare.com | ||
| // Repeated calls for the same port return the same record: | ||
| const same = await sandbox.tunnels.get(8080); | ||
| console.log(same.url === tunnel.url); // true | ||
| // Tear down by port number or by the record: | ||
| await sandbox.tunnels.destroy(8080); | ||
| // or: await sandbox.tunnels.destroy(tunnel); | ||
| ``` | ||
| `get()` is idempotent: it consults a per-sandbox cache in Durable | ||
| Object storage, returns the cached record on a hit, and only spawns a | ||
| fresh cloudflared process on a miss. `list()` returns every cached | ||
| tunnel. | ||
| Notes: | ||
| - Requires the RPC transport. The route-based transport's `tunnels` | ||
| stub throws "RPC transport required". | ||
| - URLs do **not** survive a container restart. Cloudflare assigns the | ||
| hostname during cloudflared's startup handshake, so every restart | ||
| yields a new URL. The SDK clears its cache on container start, so | ||
| the next `get(port)` after a restart returns a fresh record. | ||
| - The first fetch through a brand-new URL can take a couple of | ||
| seconds while DNS propagates, even after `get()` resolves. | ||
| - `*.trycloudflare.com` buffers `text/event-stream` responses. | ||
| WebSockets work fine. | ||
| - The musl/Alpine image variant does not ship cloudflared (no upstream | ||
| musl prebuilt); `sandbox.tunnels` is unavailable on that variant. | ||
| - Local builds behind a TLS-intercepting proxy (e.g. Cloudflare WARP) | ||
| need the host CA bundle injected at build time — see | ||
| [DOCKER_README.md](../../DOCKER_README.md). | ||
| ## Documentation | ||
@@ -119,2 +164,3 @@ | ||
| - **Preview URLs** - Expose services with public URLs | ||
| - **Quick tunnels** - Zero-config `*.trycloudflare.com` URLs via `sandbox.tunnels.get(port)` | ||
| - **Git Integration** - Clone repositories directly | ||
@@ -121,0 +167,0 @@ |
| //#region ../shared/dist/errors/codes.js | ||
| /** | ||
| * Centralized error code registry | ||
| * Each code maps to a specific error type with consistent semantics | ||
| */ | ||
| const ErrorCode = { | ||
| FILE_NOT_FOUND: "FILE_NOT_FOUND", | ||
| PERMISSION_DENIED: "PERMISSION_DENIED", | ||
| FILE_EXISTS: "FILE_EXISTS", | ||
| IS_DIRECTORY: "IS_DIRECTORY", | ||
| NOT_DIRECTORY: "NOT_DIRECTORY", | ||
| FILE_TOO_LARGE: "FILE_TOO_LARGE", | ||
| NO_SPACE: "NO_SPACE", | ||
| TOO_MANY_FILES: "TOO_MANY_FILES", | ||
| RESOURCE_BUSY: "RESOURCE_BUSY", | ||
| READ_ONLY: "READ_ONLY", | ||
| NAME_TOO_LONG: "NAME_TOO_LONG", | ||
| TOO_MANY_LINKS: "TOO_MANY_LINKS", | ||
| FILESYSTEM_ERROR: "FILESYSTEM_ERROR", | ||
| COMMAND_NOT_FOUND: "COMMAND_NOT_FOUND", | ||
| COMMAND_PERMISSION_DENIED: "COMMAND_PERMISSION_DENIED", | ||
| INVALID_COMMAND: "INVALID_COMMAND", | ||
| COMMAND_EXECUTION_ERROR: "COMMAND_EXECUTION_ERROR", | ||
| STREAM_START_ERROR: "STREAM_START_ERROR", | ||
| PROCESS_NOT_FOUND: "PROCESS_NOT_FOUND", | ||
| PROCESS_PERMISSION_DENIED: "PROCESS_PERMISSION_DENIED", | ||
| PROCESS_ERROR: "PROCESS_ERROR", | ||
| SESSION_ALREADY_EXISTS: "SESSION_ALREADY_EXISTS", | ||
| SESSION_DESTROYED: "SESSION_DESTROYED", | ||
| SESSION_TERMINATED: "SESSION_TERMINATED", | ||
| PORT_ALREADY_EXPOSED: "PORT_ALREADY_EXPOSED", | ||
| PORT_IN_USE: "PORT_IN_USE", | ||
| PORT_NOT_EXPOSED: "PORT_NOT_EXPOSED", | ||
| INVALID_PORT_NUMBER: "INVALID_PORT_NUMBER", | ||
| INVALID_PORT: "INVALID_PORT", | ||
| SERVICE_NOT_RESPONDING: "SERVICE_NOT_RESPONDING", | ||
| PORT_OPERATION_ERROR: "PORT_OPERATION_ERROR", | ||
| CUSTOM_DOMAIN_REQUIRED: "CUSTOM_DOMAIN_REQUIRED", | ||
| GIT_REPOSITORY_NOT_FOUND: "GIT_REPOSITORY_NOT_FOUND", | ||
| GIT_BRANCH_NOT_FOUND: "GIT_BRANCH_NOT_FOUND", | ||
| GIT_AUTH_FAILED: "GIT_AUTH_FAILED", | ||
| GIT_NETWORK_ERROR: "GIT_NETWORK_ERROR", | ||
| INVALID_GIT_URL: "INVALID_GIT_URL", | ||
| GIT_CLONE_FAILED: "GIT_CLONE_FAILED", | ||
| GIT_CHECKOUT_FAILED: "GIT_CHECKOUT_FAILED", | ||
| GIT_OPERATION_FAILED: "GIT_OPERATION_FAILED", | ||
| BUCKET_MOUNT_ERROR: "BUCKET_MOUNT_ERROR", | ||
| BUCKET_UNMOUNT_ERROR: "BUCKET_UNMOUNT_ERROR", | ||
| S3FS_MOUNT_ERROR: "S3FS_MOUNT_ERROR", | ||
| MISSING_CREDENTIALS: "MISSING_CREDENTIALS", | ||
| INVALID_MOUNT_CONFIG: "INVALID_MOUNT_CONFIG", | ||
| BACKUP_CREATE_FAILED: "BACKUP_CREATE_FAILED", | ||
| BACKUP_RESTORE_FAILED: "BACKUP_RESTORE_FAILED", | ||
| BACKUP_NOT_FOUND: "BACKUP_NOT_FOUND", | ||
| BACKUP_EXPIRED: "BACKUP_EXPIRED", | ||
| INVALID_BACKUP_CONFIG: "INVALID_BACKUP_CONFIG", | ||
| INTERPRETER_NOT_READY: "INTERPRETER_NOT_READY", | ||
| CONTEXT_NOT_FOUND: "CONTEXT_NOT_FOUND", | ||
| CODE_EXECUTION_ERROR: "CODE_EXECUTION_ERROR", | ||
| PYTHON_NOT_AVAILABLE: "PYTHON_NOT_AVAILABLE", | ||
| JAVASCRIPT_NOT_AVAILABLE: "JAVASCRIPT_NOT_AVAILABLE", | ||
| OPENCODE_STARTUP_FAILED: "OPENCODE_STARTUP_FAILED", | ||
| PROCESS_READY_TIMEOUT: "PROCESS_READY_TIMEOUT", | ||
| PROCESS_EXITED_BEFORE_READY: "PROCESS_EXITED_BEFORE_READY", | ||
| DESKTOP_NOT_STARTED: "DESKTOP_NOT_STARTED", | ||
| DESKTOP_START_FAILED: "DESKTOP_START_FAILED", | ||
| DESKTOP_UNAVAILABLE: "DESKTOP_UNAVAILABLE", | ||
| DESKTOP_PROCESS_CRASHED: "DESKTOP_PROCESS_CRASHED", | ||
| DESKTOP_INVALID_OPTIONS: "DESKTOP_INVALID_OPTIONS", | ||
| DESKTOP_INVALID_COORDINATES: "DESKTOP_INVALID_COORDINATES", | ||
| WATCH_NOT_FOUND: "WATCH_NOT_FOUND", | ||
| WATCH_START_ERROR: "WATCH_START_ERROR", | ||
| WATCH_STOP_ERROR: "WATCH_STOP_ERROR", | ||
| VALIDATION_FAILED: "VALIDATION_FAILED", | ||
| INVALID_JSON_RESPONSE: "INVALID_JSON_RESPONSE", | ||
| UNKNOWN_ERROR: "UNKNOWN_ERROR", | ||
| INTERNAL_ERROR: "INTERNAL_ERROR", | ||
| RPC_TRANSPORT_ERROR: "RPC_TRANSPORT_ERROR" | ||
| }; | ||
| //#endregion | ||
| //#region ../shared/dist/errors/status-map.js | ||
| /** | ||
| * Maps error codes to HTTP status codes | ||
| * Centralized mapping ensures consistency across SDK | ||
| */ | ||
| const ERROR_STATUS_MAP = { | ||
| [ErrorCode.FILE_NOT_FOUND]: 404, | ||
| [ErrorCode.COMMAND_NOT_FOUND]: 404, | ||
| [ErrorCode.PROCESS_NOT_FOUND]: 404, | ||
| [ErrorCode.PORT_NOT_EXPOSED]: 404, | ||
| [ErrorCode.GIT_REPOSITORY_NOT_FOUND]: 404, | ||
| [ErrorCode.GIT_BRANCH_NOT_FOUND]: 404, | ||
| [ErrorCode.CONTEXT_NOT_FOUND]: 404, | ||
| [ErrorCode.WATCH_NOT_FOUND]: 404, | ||
| [ErrorCode.IS_DIRECTORY]: 400, | ||
| [ErrorCode.NOT_DIRECTORY]: 400, | ||
| [ErrorCode.INVALID_COMMAND]: 400, | ||
| [ErrorCode.INVALID_PORT_NUMBER]: 400, | ||
| [ErrorCode.INVALID_PORT]: 400, | ||
| [ErrorCode.INVALID_GIT_URL]: 400, | ||
| [ErrorCode.CUSTOM_DOMAIN_REQUIRED]: 400, | ||
| [ErrorCode.INVALID_JSON_RESPONSE]: 400, | ||
| [ErrorCode.NAME_TOO_LONG]: 400, | ||
| [ErrorCode.VALIDATION_FAILED]: 400, | ||
| [ErrorCode.MISSING_CREDENTIALS]: 400, | ||
| [ErrorCode.INVALID_MOUNT_CONFIG]: 400, | ||
| [ErrorCode.GIT_AUTH_FAILED]: 401, | ||
| [ErrorCode.PERMISSION_DENIED]: 403, | ||
| [ErrorCode.COMMAND_PERMISSION_DENIED]: 403, | ||
| [ErrorCode.PROCESS_PERMISSION_DENIED]: 403, | ||
| [ErrorCode.READ_ONLY]: 403, | ||
| [ErrorCode.FILE_EXISTS]: 409, | ||
| [ErrorCode.PORT_ALREADY_EXPOSED]: 409, | ||
| [ErrorCode.PORT_IN_USE]: 409, | ||
| [ErrorCode.RESOURCE_BUSY]: 409, | ||
| [ErrorCode.SESSION_ALREADY_EXISTS]: 409, | ||
| [ErrorCode.SESSION_DESTROYED]: 410, | ||
| [ErrorCode.SESSION_TERMINATED]: 410, | ||
| [ErrorCode.FILE_TOO_LARGE]: 413, | ||
| [ErrorCode.SERVICE_NOT_RESPONDING]: 502, | ||
| [ErrorCode.GIT_NETWORK_ERROR]: 502, | ||
| [ErrorCode.BACKUP_NOT_FOUND]: 404, | ||
| [ErrorCode.BACKUP_EXPIRED]: 400, | ||
| [ErrorCode.INVALID_BACKUP_CONFIG]: 400, | ||
| [ErrorCode.BACKUP_CREATE_FAILED]: 500, | ||
| [ErrorCode.BACKUP_RESTORE_FAILED]: 500, | ||
| [ErrorCode.PYTHON_NOT_AVAILABLE]: 501, | ||
| [ErrorCode.JAVASCRIPT_NOT_AVAILABLE]: 501, | ||
| [ErrorCode.DESKTOP_NOT_STARTED]: 409, | ||
| [ErrorCode.DESKTOP_START_FAILED]: 500, | ||
| [ErrorCode.DESKTOP_UNAVAILABLE]: 503, | ||
| [ErrorCode.DESKTOP_PROCESS_CRASHED]: 500, | ||
| [ErrorCode.DESKTOP_INVALID_OPTIONS]: 400, | ||
| [ErrorCode.DESKTOP_INVALID_COORDINATES]: 400, | ||
| [ErrorCode.INTERPRETER_NOT_READY]: 503, | ||
| [ErrorCode.OPENCODE_STARTUP_FAILED]: 503, | ||
| [ErrorCode.RPC_TRANSPORT_ERROR]: 503, | ||
| [ErrorCode.PROCESS_READY_TIMEOUT]: 408, | ||
| [ErrorCode.PROCESS_EXITED_BEFORE_READY]: 500, | ||
| [ErrorCode.NO_SPACE]: 500, | ||
| [ErrorCode.TOO_MANY_FILES]: 500, | ||
| [ErrorCode.TOO_MANY_LINKS]: 500, | ||
| [ErrorCode.FILESYSTEM_ERROR]: 500, | ||
| [ErrorCode.COMMAND_EXECUTION_ERROR]: 500, | ||
| [ErrorCode.STREAM_START_ERROR]: 500, | ||
| [ErrorCode.PROCESS_ERROR]: 500, | ||
| [ErrorCode.PORT_OPERATION_ERROR]: 500, | ||
| [ErrorCode.GIT_CLONE_FAILED]: 500, | ||
| [ErrorCode.GIT_CHECKOUT_FAILED]: 500, | ||
| [ErrorCode.GIT_OPERATION_FAILED]: 500, | ||
| [ErrorCode.CODE_EXECUTION_ERROR]: 500, | ||
| [ErrorCode.BUCKET_MOUNT_ERROR]: 500, | ||
| [ErrorCode.BUCKET_UNMOUNT_ERROR]: 500, | ||
| [ErrorCode.S3FS_MOUNT_ERROR]: 500, | ||
| [ErrorCode.WATCH_START_ERROR]: 500, | ||
| [ErrorCode.WATCH_STOP_ERROR]: 500, | ||
| [ErrorCode.UNKNOWN_ERROR]: 500, | ||
| [ErrorCode.INTERNAL_ERROR]: 500 | ||
| }; | ||
| /** | ||
| * Get HTTP status code for an error code | ||
| * Falls back to 500 for unknown errors | ||
| */ | ||
| function getHttpStatus(code) { | ||
| return ERROR_STATUS_MAP[code] || 500; | ||
| } | ||
| //#endregion | ||
| //#region ../shared/dist/errors/suggestions.js | ||
| /** | ||
| * Get actionable suggestion for an error code | ||
| * Used by handlers when enriching ServiceError → ErrorResponse | ||
| */ | ||
| function getSuggestion(code, context) { | ||
| switch (code) { | ||
| case ErrorCode.FILE_NOT_FOUND: return `Ensure the file exists at ${context.path} before attempting to access it`; | ||
| case ErrorCode.FILE_EXISTS: return `File already exists at ${context.path}. Use a different path or delete the existing file first`; | ||
| case ErrorCode.COMMAND_NOT_FOUND: return `Check that "${context.command}" is installed and available in the system PATH`; | ||
| case ErrorCode.PROCESS_NOT_FOUND: return "Verify the process ID is correct and the process has not already exited"; | ||
| case ErrorCode.PORT_NOT_EXPOSED: return `Port ${context.port} is not currently exposed. Use listExposedPorts() to see active ports`; | ||
| case ErrorCode.PORT_ALREADY_EXPOSED: return `Port ${context.port} is already exposed. Unexpose it first or use a different port`; | ||
| case ErrorCode.PORT_IN_USE: return `Port ${context.port} is already in use by another service. Choose a different port`; | ||
| case ErrorCode.SESSION_ALREADY_EXISTS: return `Session "${context.sessionId}" already exists. Use a different session ID or reuse the existing session`; | ||
| case ErrorCode.SESSION_DESTROYED: return `Session "${context.sessionId}" was destroyed. Create a new session to continue executing commands`; | ||
| case ErrorCode.SESSION_TERMINATED: return `Session "${context.sessionId}" ended because its shell exited (exit code: ${context.exitCode ?? "unknown"}). Session-local state (env vars, cwd, shell functions) has been lost. Retry the call to start a fresh session, or call createSession() with the same id to recreate it explicitly`; | ||
| case ErrorCode.INVALID_PORT: return `Port must be between 1 and 65535. Port ${context.port} is ${context.reason}`; | ||
| case ErrorCode.GIT_REPOSITORY_NOT_FOUND: return "Verify the repository URL is correct and accessible"; | ||
| case ErrorCode.GIT_AUTH_FAILED: return "Check authentication credentials or use a public repository"; | ||
| case ErrorCode.GIT_BRANCH_NOT_FOUND: return `Branch "${context.branch}" does not exist in the repository. Check the branch name or use the default branch`; | ||
| case ErrorCode.INTERPRETER_NOT_READY: return context.retryAfter ? `Code interpreter is starting up. Retry after ${context.retryAfter} seconds` : "Code interpreter is not ready. Please wait a moment and try again"; | ||
| case ErrorCode.CONTEXT_NOT_FOUND: return `Context "${context.contextId}" does not exist. Create a context first using createContext()`; | ||
| case ErrorCode.VALIDATION_FAILED: return "Check the request parameters and ensure they match the required format"; | ||
| case ErrorCode.NO_SPACE: return "Not enough disk space available. Consider cleaning up temporary files or increasing storage"; | ||
| case ErrorCode.PERMISSION_DENIED: return "Operation not permitted. Check file/directory permissions"; | ||
| case ErrorCode.IS_DIRECTORY: return `Cannot perform this operation on a directory. Path ${context.path} is a directory`; | ||
| case ErrorCode.NOT_DIRECTORY: return `Expected a directory but found a file at ${context.path}`; | ||
| case ErrorCode.RESOURCE_BUSY: return "Resource is currently in use. Wait for the current operation to complete"; | ||
| case ErrorCode.READ_ONLY: return "Cannot modify a read-only resource"; | ||
| case ErrorCode.SERVICE_NOT_RESPONDING: return "Service is not responding. Check if the service is running and accessible"; | ||
| case ErrorCode.BACKUP_NOT_FOUND: return `Backup "${context.backupId}" does not exist. Verify the backup ID is correct`; | ||
| case ErrorCode.BACKUP_EXPIRED: return `Backup "${context.backupId}" has expired. Create a new backup`; | ||
| case ErrorCode.INVALID_BACKUP_CONFIG: return `Invalid backup configuration: ${context.reason}`; | ||
| case ErrorCode.BACKUP_CREATE_FAILED: return "Backup creation failed. Check that the directory exists and you have sufficient disk space"; | ||
| case ErrorCode.BACKUP_RESTORE_FAILED: return "Backup restoration failed. The archive may be corrupted or the target directory may be in use"; | ||
| case ErrorCode.DESKTOP_NOT_STARTED: return "Desktop environment is not running. Call sandbox.desktop.start() first"; | ||
| case ErrorCode.DESKTOP_START_FAILED: return `Desktop failed to start: ${context.reason || "unknown error"}. Check container logs`; | ||
| case ErrorCode.DESKTOP_UNAVAILABLE: return "Desktop processes are not healthy. Try sandbox.desktop.stop() then sandbox.desktop.start()"; | ||
| case ErrorCode.DESKTOP_PROCESS_CRASHED: return `Desktop process "${context.crashedProcess}" crashed. Restart with sandbox.desktop.start()`; | ||
| case ErrorCode.DESKTOP_INVALID_OPTIONS: return `Invalid desktop options: ${context.reason}. Check resolution and DPI values`; | ||
| case ErrorCode.DESKTOP_INVALID_COORDINATES: return `Coordinates (${context.x}, ${context.y}) are outside the display area (${context.displayWidth}x${context.displayHeight})`; | ||
| case ErrorCode.RPC_TRANSPORT_ERROR: switch (context.kind) { | ||
| case "peer_closed": return "The container closed the WebSocket mid-call (likely a container restart, eviction, or crash). Retry the call — the SDK will open a fresh connection."; | ||
| case "connection_failed": return "The WebSocket connection failed. Retry the call; if the failure persists, check container health and network connectivity."; | ||
| case "upgrade_failed": return "The WebSocket upgrade was rejected by the container. Verify the container is running and reachable on the configured port."; | ||
| case "invalid_frame": return "The container sent a frame the RPC transport cannot handle. This usually indicates a version mismatch between the SDK and the container image."; | ||
| case "protocol_error": return "The peer sent a malformed RPC message (capnweb could not parse the wire format). This usually indicates a version mismatch between the SDK and the container image."; | ||
| case "session_disposed": return "The RPC session was disposed while a call was in flight. Avoid reusing stubs after disconnect(); the next method call will reconnect automatically."; | ||
| default: return "The RPC transport raised an error. Retry the call — the SDK will open a fresh connection."; | ||
| } | ||
| default: return; | ||
| } | ||
| } | ||
| //#endregion | ||
| export { getHttpStatus as n, ErrorCode as r, getSuggestion as t }; | ||
| //# sourceMappingURL=errors-CBi-O-pF.js.map |
| {"version":3,"file":"errors-CBi-O-pF.js","names":[],"sources":["../../shared/dist/errors/codes.js","../../shared/dist/errors/status-map.js","../../shared/dist/errors/suggestions.js"],"sourcesContent":["/**\n * Centralized error code registry\n * Each code maps to a specific error type with consistent semantics\n */\nexport const ErrorCode = {\n // File System Errors (404)\n FILE_NOT_FOUND: 'FILE_NOT_FOUND',\n // Permission Errors (403)\n PERMISSION_DENIED: 'PERMISSION_DENIED',\n // File System Errors (409)\n FILE_EXISTS: 'FILE_EXISTS',\n // File System Errors (400)\n IS_DIRECTORY: 'IS_DIRECTORY',\n NOT_DIRECTORY: 'NOT_DIRECTORY',\n // File Too Large Errors (413)\n FILE_TOO_LARGE: 'FILE_TOO_LARGE',\n // File System Errors (500)\n NO_SPACE: 'NO_SPACE',\n TOO_MANY_FILES: 'TOO_MANY_FILES',\n RESOURCE_BUSY: 'RESOURCE_BUSY',\n READ_ONLY: 'READ_ONLY',\n NAME_TOO_LONG: 'NAME_TOO_LONG',\n TOO_MANY_LINKS: 'TOO_MANY_LINKS',\n FILESYSTEM_ERROR: 'FILESYSTEM_ERROR',\n // Command Errors (404)\n COMMAND_NOT_FOUND: 'COMMAND_NOT_FOUND',\n // Command Errors (403/400)\n COMMAND_PERMISSION_DENIED: 'COMMAND_PERMISSION_DENIED',\n INVALID_COMMAND: 'INVALID_COMMAND',\n // Command Errors (500)\n COMMAND_EXECUTION_ERROR: 'COMMAND_EXECUTION_ERROR',\n STREAM_START_ERROR: 'STREAM_START_ERROR',\n // Process Errors (404)\n PROCESS_NOT_FOUND: 'PROCESS_NOT_FOUND',\n // Process Errors (403/500)\n PROCESS_PERMISSION_DENIED: 'PROCESS_PERMISSION_DENIED',\n PROCESS_ERROR: 'PROCESS_ERROR',\n // Session Errors (409)\n SESSION_ALREADY_EXISTS: 'SESSION_ALREADY_EXISTS',\n // Session Errors (410)\n SESSION_DESTROYED: 'SESSION_DESTROYED',\n SESSION_TERMINATED: 'SESSION_TERMINATED',\n // Port Errors (409)\n PORT_ALREADY_EXPOSED: 'PORT_ALREADY_EXPOSED',\n PORT_IN_USE: 'PORT_IN_USE',\n // Port Errors (404)\n PORT_NOT_EXPOSED: 'PORT_NOT_EXPOSED',\n // Port Errors (400)\n INVALID_PORT_NUMBER: 'INVALID_PORT_NUMBER',\n INVALID_PORT: 'INVALID_PORT',\n // Port Errors (502/500)\n SERVICE_NOT_RESPONDING: 'SERVICE_NOT_RESPONDING',\n PORT_OPERATION_ERROR: 'PORT_OPERATION_ERROR',\n // Port Errors (400)\n CUSTOM_DOMAIN_REQUIRED: 'CUSTOM_DOMAIN_REQUIRED',\n // Git Errors (404)\n GIT_REPOSITORY_NOT_FOUND: 'GIT_REPOSITORY_NOT_FOUND',\n GIT_BRANCH_NOT_FOUND: 'GIT_BRANCH_NOT_FOUND',\n // Git Errors (401)\n GIT_AUTH_FAILED: 'GIT_AUTH_FAILED',\n // Git Errors (502)\n GIT_NETWORK_ERROR: 'GIT_NETWORK_ERROR',\n // Git Errors (400)\n INVALID_GIT_URL: 'INVALID_GIT_URL',\n // Git Errors (500)\n GIT_CLONE_FAILED: 'GIT_CLONE_FAILED',\n GIT_CHECKOUT_FAILED: 'GIT_CHECKOUT_FAILED',\n GIT_OPERATION_FAILED: 'GIT_OPERATION_FAILED',\n // Bucket mounting errors\n BUCKET_MOUNT_ERROR: 'BUCKET_MOUNT_ERROR',\n BUCKET_UNMOUNT_ERROR: 'BUCKET_UNMOUNT_ERROR',\n S3FS_MOUNT_ERROR: 'S3FS_MOUNT_ERROR',\n MISSING_CREDENTIALS: 'MISSING_CREDENTIALS',\n INVALID_MOUNT_CONFIG: 'INVALID_MOUNT_CONFIG',\n // Backup Errors (500)\n BACKUP_CREATE_FAILED: 'BACKUP_CREATE_FAILED',\n BACKUP_RESTORE_FAILED: 'BACKUP_RESTORE_FAILED',\n // Backup Errors (404)\n BACKUP_NOT_FOUND: 'BACKUP_NOT_FOUND',\n // Backup Errors (400)\n BACKUP_EXPIRED: 'BACKUP_EXPIRED',\n INVALID_BACKUP_CONFIG: 'INVALID_BACKUP_CONFIG',\n // Code Interpreter Errors (503)\n INTERPRETER_NOT_READY: 'INTERPRETER_NOT_READY',\n // Code Interpreter Errors (404)\n CONTEXT_NOT_FOUND: 'CONTEXT_NOT_FOUND',\n // Code Interpreter Errors (500)\n CODE_EXECUTION_ERROR: 'CODE_EXECUTION_ERROR',\n // Code Interpreter Errors (501) - Feature not available in image variant\n PYTHON_NOT_AVAILABLE: 'PYTHON_NOT_AVAILABLE',\n JAVASCRIPT_NOT_AVAILABLE: 'JAVASCRIPT_NOT_AVAILABLE',\n // OpenCode Errors (503)\n OPENCODE_STARTUP_FAILED: 'OPENCODE_STARTUP_FAILED',\n // Process Readiness Errors (408/500)\n PROCESS_READY_TIMEOUT: 'PROCESS_READY_TIMEOUT',\n PROCESS_EXITED_BEFORE_READY: 'PROCESS_EXITED_BEFORE_READY',\n // Desktop Errors (409)\n DESKTOP_NOT_STARTED: 'DESKTOP_NOT_STARTED',\n // Desktop Errors (500)\n DESKTOP_START_FAILED: 'DESKTOP_START_FAILED',\n // Desktop Errors (503)\n DESKTOP_UNAVAILABLE: 'DESKTOP_UNAVAILABLE',\n // Desktop Errors (500)\n DESKTOP_PROCESS_CRASHED: 'DESKTOP_PROCESS_CRASHED',\n // Desktop Errors (400)\n DESKTOP_INVALID_OPTIONS: 'DESKTOP_INVALID_OPTIONS',\n DESKTOP_INVALID_COORDINATES: 'DESKTOP_INVALID_COORDINATES',\n // File Watch Errors (404)\n WATCH_NOT_FOUND: 'WATCH_NOT_FOUND',\n // File Watch Errors (500)\n WATCH_START_ERROR: 'WATCH_START_ERROR',\n WATCH_STOP_ERROR: 'WATCH_STOP_ERROR',\n // Validation Errors (400)\n VALIDATION_FAILED: 'VALIDATION_FAILED',\n // Generic Errors (400/500)\n INVALID_JSON_RESPONSE: 'INVALID_JSON_RESPONSE',\n UNKNOWN_ERROR: 'UNKNOWN_ERROR',\n INTERNAL_ERROR: 'INTERNAL_ERROR',\n // RPC Transport Errors (503) — capnweb WebSocket session-level failures\n // raised on the SDK side, not by the container. The container went away\n // mid-call (peer close), the WebSocket failed before/after upgrade, the\n // peer sent a frame the transport cannot handle, or the session was\n // disposed while a call was in flight.\n RPC_TRANSPORT_ERROR: 'RPC_TRANSPORT_ERROR'\n};\n","import { ErrorCode } from './codes';\n/**\n * Maps error codes to HTTP status codes\n * Centralized mapping ensures consistency across SDK\n */\nexport const ERROR_STATUS_MAP = {\n // 404 Not Found\n [ErrorCode.FILE_NOT_FOUND]: 404,\n [ErrorCode.COMMAND_NOT_FOUND]: 404,\n [ErrorCode.PROCESS_NOT_FOUND]: 404,\n [ErrorCode.PORT_NOT_EXPOSED]: 404,\n [ErrorCode.GIT_REPOSITORY_NOT_FOUND]: 404,\n [ErrorCode.GIT_BRANCH_NOT_FOUND]: 404,\n [ErrorCode.CONTEXT_NOT_FOUND]: 404,\n [ErrorCode.WATCH_NOT_FOUND]: 404,\n // 400 Bad Request\n [ErrorCode.IS_DIRECTORY]: 400,\n [ErrorCode.NOT_DIRECTORY]: 400,\n [ErrorCode.INVALID_COMMAND]: 400,\n [ErrorCode.INVALID_PORT_NUMBER]: 400,\n [ErrorCode.INVALID_PORT]: 400,\n [ErrorCode.INVALID_GIT_URL]: 400,\n [ErrorCode.CUSTOM_DOMAIN_REQUIRED]: 400,\n [ErrorCode.INVALID_JSON_RESPONSE]: 400,\n [ErrorCode.NAME_TOO_LONG]: 400,\n [ErrorCode.VALIDATION_FAILED]: 400,\n [ErrorCode.MISSING_CREDENTIALS]: 400,\n [ErrorCode.INVALID_MOUNT_CONFIG]: 400,\n // 401 Unauthorized\n [ErrorCode.GIT_AUTH_FAILED]: 401,\n // 403 Forbidden\n [ErrorCode.PERMISSION_DENIED]: 403,\n [ErrorCode.COMMAND_PERMISSION_DENIED]: 403,\n [ErrorCode.PROCESS_PERMISSION_DENIED]: 403,\n [ErrorCode.READ_ONLY]: 403,\n // 409 Conflict\n [ErrorCode.FILE_EXISTS]: 409,\n [ErrorCode.PORT_ALREADY_EXPOSED]: 409,\n [ErrorCode.PORT_IN_USE]: 409,\n [ErrorCode.RESOURCE_BUSY]: 409,\n [ErrorCode.SESSION_ALREADY_EXISTS]: 409,\n // 410 Gone\n [ErrorCode.SESSION_DESTROYED]: 410,\n [ErrorCode.SESSION_TERMINATED]: 410,\n // 413 Content Too Large\n [ErrorCode.FILE_TOO_LARGE]: 413,\n // 502 Bad Gateway\n [ErrorCode.SERVICE_NOT_RESPONDING]: 502,\n [ErrorCode.GIT_NETWORK_ERROR]: 502,\n // Backup errors\n [ErrorCode.BACKUP_NOT_FOUND]: 404,\n [ErrorCode.BACKUP_EXPIRED]: 400,\n [ErrorCode.INVALID_BACKUP_CONFIG]: 400,\n [ErrorCode.BACKUP_CREATE_FAILED]: 500,\n [ErrorCode.BACKUP_RESTORE_FAILED]: 500,\n // 501 Not Implemented (feature not available in image variant)\n [ErrorCode.PYTHON_NOT_AVAILABLE]: 501,\n [ErrorCode.JAVASCRIPT_NOT_AVAILABLE]: 501,\n // Desktop errors\n [ErrorCode.DESKTOP_NOT_STARTED]: 409,\n [ErrorCode.DESKTOP_START_FAILED]: 500,\n [ErrorCode.DESKTOP_UNAVAILABLE]: 503,\n [ErrorCode.DESKTOP_PROCESS_CRASHED]: 500,\n [ErrorCode.DESKTOP_INVALID_OPTIONS]: 400,\n [ErrorCode.DESKTOP_INVALID_COORDINATES]: 400,\n // 503 Service Unavailable\n [ErrorCode.INTERPRETER_NOT_READY]: 503,\n [ErrorCode.OPENCODE_STARTUP_FAILED]: 503,\n [ErrorCode.RPC_TRANSPORT_ERROR]: 503,\n // 408 Request Timeout\n [ErrorCode.PROCESS_READY_TIMEOUT]: 408,\n // 500 Internal Server Error\n [ErrorCode.PROCESS_EXITED_BEFORE_READY]: 500,\n [ErrorCode.NO_SPACE]: 500,\n [ErrorCode.TOO_MANY_FILES]: 500,\n [ErrorCode.TOO_MANY_LINKS]: 500,\n [ErrorCode.FILESYSTEM_ERROR]: 500,\n [ErrorCode.COMMAND_EXECUTION_ERROR]: 500,\n [ErrorCode.STREAM_START_ERROR]: 500,\n [ErrorCode.PROCESS_ERROR]: 500,\n [ErrorCode.PORT_OPERATION_ERROR]: 500,\n [ErrorCode.GIT_CLONE_FAILED]: 500,\n [ErrorCode.GIT_CHECKOUT_FAILED]: 500,\n [ErrorCode.GIT_OPERATION_FAILED]: 500,\n [ErrorCode.CODE_EXECUTION_ERROR]: 500,\n [ErrorCode.BUCKET_MOUNT_ERROR]: 500,\n [ErrorCode.BUCKET_UNMOUNT_ERROR]: 500,\n [ErrorCode.S3FS_MOUNT_ERROR]: 500,\n [ErrorCode.WATCH_START_ERROR]: 500,\n [ErrorCode.WATCH_STOP_ERROR]: 500,\n [ErrorCode.UNKNOWN_ERROR]: 500,\n [ErrorCode.INTERNAL_ERROR]: 500\n};\n/**\n * Get HTTP status code for an error code\n * Falls back to 500 for unknown errors\n */\nexport function getHttpStatus(code) {\n return ERROR_STATUS_MAP[code] || 500;\n}\n","import { ErrorCode } from './codes';\n/**\n * Get actionable suggestion for an error code\n * Used by handlers when enriching ServiceError → ErrorResponse\n */\nexport function getSuggestion(code, context) {\n switch (code) {\n case ErrorCode.FILE_NOT_FOUND:\n return `Ensure the file exists at ${context.path} before attempting to access it`;\n case ErrorCode.FILE_EXISTS:\n return `File already exists at ${context.path}. Use a different path or delete the existing file first`;\n case ErrorCode.COMMAND_NOT_FOUND:\n return `Check that \"${context.command}\" is installed and available in the system PATH`;\n case ErrorCode.PROCESS_NOT_FOUND:\n return 'Verify the process ID is correct and the process has not already exited';\n case ErrorCode.PORT_NOT_EXPOSED:\n return `Port ${context.port} is not currently exposed. Use listExposedPorts() to see active ports`;\n case ErrorCode.PORT_ALREADY_EXPOSED:\n return `Port ${context.port} is already exposed. Unexpose it first or use a different port`;\n case ErrorCode.PORT_IN_USE:\n return `Port ${context.port} is already in use by another service. Choose a different port`;\n case ErrorCode.SESSION_ALREADY_EXISTS:\n return `Session \"${context.sessionId}\" already exists. Use a different session ID or reuse the existing session`;\n case ErrorCode.SESSION_DESTROYED:\n return `Session \"${context.sessionId}\" was destroyed. Create a new session to continue executing commands`;\n case ErrorCode.SESSION_TERMINATED:\n return `Session \"${context.sessionId}\" ended because its shell exited (exit code: ${context.exitCode ?? 'unknown'}). Session-local state (env vars, cwd, shell functions) has been lost. Retry the call to start a fresh session, or call createSession() with the same id to recreate it explicitly`;\n case ErrorCode.INVALID_PORT:\n return `Port must be between 1 and 65535. Port ${context.port} is ${context.reason}`;\n case ErrorCode.GIT_REPOSITORY_NOT_FOUND:\n return 'Verify the repository URL is correct and accessible';\n case ErrorCode.GIT_AUTH_FAILED:\n return 'Check authentication credentials or use a public repository';\n case ErrorCode.GIT_BRANCH_NOT_FOUND:\n return `Branch \"${context.branch}\" does not exist in the repository. Check the branch name or use the default branch`;\n case ErrorCode.INTERPRETER_NOT_READY:\n return context.retryAfter\n ? `Code interpreter is starting up. Retry after ${context.retryAfter} seconds`\n : 'Code interpreter is not ready. Please wait a moment and try again';\n case ErrorCode.CONTEXT_NOT_FOUND:\n return `Context \"${context.contextId}\" does not exist. Create a context first using createContext()`;\n case ErrorCode.VALIDATION_FAILED:\n return 'Check the request parameters and ensure they match the required format';\n case ErrorCode.NO_SPACE:\n return 'Not enough disk space available. Consider cleaning up temporary files or increasing storage';\n case ErrorCode.PERMISSION_DENIED:\n return 'Operation not permitted. Check file/directory permissions';\n case ErrorCode.IS_DIRECTORY:\n return `Cannot perform this operation on a directory. Path ${context.path} is a directory`;\n case ErrorCode.NOT_DIRECTORY:\n return `Expected a directory but found a file at ${context.path}`;\n case ErrorCode.RESOURCE_BUSY:\n return 'Resource is currently in use. Wait for the current operation to complete';\n case ErrorCode.READ_ONLY:\n return 'Cannot modify a read-only resource';\n case ErrorCode.SERVICE_NOT_RESPONDING:\n return 'Service is not responding. Check if the service is running and accessible';\n case ErrorCode.BACKUP_NOT_FOUND:\n return `Backup \"${context.backupId}\" does not exist. Verify the backup ID is correct`;\n case ErrorCode.BACKUP_EXPIRED:\n return `Backup \"${context.backupId}\" has expired. Create a new backup`;\n case ErrorCode.INVALID_BACKUP_CONFIG:\n return `Invalid backup configuration: ${context.reason}`;\n case ErrorCode.BACKUP_CREATE_FAILED:\n return 'Backup creation failed. Check that the directory exists and you have sufficient disk space';\n case ErrorCode.BACKUP_RESTORE_FAILED:\n return 'Backup restoration failed. The archive may be corrupted or the target directory may be in use';\n case ErrorCode.DESKTOP_NOT_STARTED:\n return 'Desktop environment is not running. Call sandbox.desktop.start() first';\n case ErrorCode.DESKTOP_START_FAILED:\n return `Desktop failed to start: ${context.reason || 'unknown error'}. Check container logs`;\n case ErrorCode.DESKTOP_UNAVAILABLE:\n return 'Desktop processes are not healthy. Try sandbox.desktop.stop() then sandbox.desktop.start()';\n case ErrorCode.DESKTOP_PROCESS_CRASHED:\n return `Desktop process \"${context.crashedProcess}\" crashed. Restart with sandbox.desktop.start()`;\n case ErrorCode.DESKTOP_INVALID_OPTIONS:\n return `Invalid desktop options: ${context.reason}. Check resolution and DPI values`;\n case ErrorCode.DESKTOP_INVALID_COORDINATES:\n return `Coordinates (${context.x}, ${context.y}) are outside the display area (${context.displayWidth}x${context.displayHeight})`;\n case ErrorCode.RPC_TRANSPORT_ERROR: {\n const kind = context.kind;\n switch (kind) {\n case 'peer_closed':\n return 'The container closed the WebSocket mid-call (likely a container restart, eviction, or crash). Retry the call — the SDK will open a fresh connection.';\n case 'connection_failed':\n return 'The WebSocket connection failed. Retry the call; if the failure persists, check container health and network connectivity.';\n case 'upgrade_failed':\n return 'The WebSocket upgrade was rejected by the container. Verify the container is running and reachable on the configured port.';\n case 'invalid_frame':\n return 'The container sent a frame the RPC transport cannot handle. This usually indicates a version mismatch between the SDK and the container image.';\n case 'protocol_error':\n return 'The peer sent a malformed RPC message (capnweb could not parse the wire format). This usually indicates a version mismatch between the SDK and the container image.';\n case 'session_disposed':\n return 'The RPC session was disposed while a call was in flight. Avoid reusing stubs after disconnect(); the next method call will reconnect automatically.';\n default:\n return 'The RPC transport raised an error. Retry the call — the SDK will open a fresh connection.';\n }\n }\n // Generic fallback for other errors\n default:\n return undefined;\n }\n}\n"],"mappings":";;;;;AAIA,MAAa,YAAY;CAErB,gBAAgB;CAEhB,mBAAmB;CAEnB,aAAa;CAEb,cAAc;CACd,eAAe;CAEf,gBAAgB;CAEhB,UAAU;CACV,gBAAgB;CAChB,eAAe;CACf,WAAW;CACX,eAAe;CACf,gBAAgB;CAChB,kBAAkB;CAElB,mBAAmB;CAEnB,2BAA2B;CAC3B,iBAAiB;CAEjB,yBAAyB;CACzB,oBAAoB;CAEpB,mBAAmB;CAEnB,2BAA2B;CAC3B,eAAe;CAEf,wBAAwB;CAExB,mBAAmB;CACnB,oBAAoB;CAEpB,sBAAsB;CACtB,aAAa;CAEb,kBAAkB;CAElB,qBAAqB;CACrB,cAAc;CAEd,wBAAwB;CACxB,sBAAsB;CAEtB,wBAAwB;CAExB,0BAA0B;CAC1B,sBAAsB;CAEtB,iBAAiB;CAEjB,mBAAmB;CAEnB,iBAAiB;CAEjB,kBAAkB;CAClB,qBAAqB;CACrB,sBAAsB;CAEtB,oBAAoB;CACpB,sBAAsB;CACtB,kBAAkB;CAClB,qBAAqB;CACrB,sBAAsB;CAEtB,sBAAsB;CACtB,uBAAuB;CAEvB,kBAAkB;CAElB,gBAAgB;CAChB,uBAAuB;CAEvB,uBAAuB;CAEvB,mBAAmB;CAEnB,sBAAsB;CAEtB,sBAAsB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mBACD,QAAO;GACX,QACI,QAAO;;EAInB,QACI"} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1767257
8.93%17773
6.08%221
26.29%68
44.68%62
3.33%