@cloudflare/sandbox 0.13.0-next.632.1 → 0.13.0-next.649.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import "../dist-mAH_7Ui7.js";
2
- import "../errors-aRUdk9K8.js";
3
- import { S as validateTunnelName, r as getSandbox, w as streamFile, x as validatePort, y as SandboxSecurityError } from "../sandbox-B7ewRruX.js";
2
+ import "../errors-CpoDEfUZ.js";
3
+ import { S as validateTunnelName, r as getSandbox, w as streamFile, x as validatePort, y as SandboxSecurityError } from "../sandbox-B-FLGbkP.js";
4
4
  import { DurableObject, env } from "cloudflare:workers";
5
5
  import { Hono } from "hono";
6
6
 
@@ -69,6 +69,7 @@ declare const ErrorCode: {
69
69
  readonly INVALID_JSON_RESPONSE: "INVALID_JSON_RESPONSE";
70
70
  readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
71
71
  readonly INTERNAL_ERROR: "INTERNAL_ERROR";
72
+ readonly CONTAINER_UNAVAILABLE: "CONTAINER_UNAVAILABLE";
72
73
  readonly RPC_TRANSPORT_ERROR: "RPC_TRANSPORT_ERROR";
73
74
  };
74
75
  type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
@@ -198,6 +199,11 @@ interface OpencodeStartupContext {
198
199
  stderr?: string;
199
200
  command?: string;
200
201
  }
202
+ type ContainerUnavailableReason = 'provisioning' | 'startup' | 'container_restarted';
203
+ interface ContainerUnavailableContext {
204
+ reason?: ContainerUnavailableReason;
205
+ sessionId?: string;
206
+ }
201
207
  /**
202
208
  * RPC transport error contexts. Surfaced when the capnweb WebSocket session
203
209
  * fails on the SDK side rather than the container reporting a structured
@@ -228,5 +234,5 @@ interface RPCTransportContext {
228
234
  closeReason?: string;
229
235
  }
230
236
  //#endregion
231
- export { InvalidBackupConfigContext as a, ProcessReadyTimeoutContext as c, SessionTerminatedContext as d, ErrorResponse as f, BackupRestoreContext as i, RPCTransportContext as l, ErrorCode as m, BackupExpiredContext as n, OpencodeStartupContext as o, OperationType as p, BackupNotFoundContext as r, ProcessExitedBeforeReadyContext as s, BackupCreateContext as t, RPCTransportErrorKind as u };
232
- //# sourceMappingURL=contexts-B0_bcx9f.d.ts.map
237
+ export { ContainerUnavailableContext as a, ProcessExitedBeforeReadyContext as c, RPCTransportErrorKind as d, SessionTerminatedContext as f, ErrorCode as h, BackupRestoreContext as i, ProcessReadyTimeoutContext as l, OperationType as m, BackupExpiredContext as n, InvalidBackupConfigContext as o, ErrorResponse as p, BackupNotFoundContext as r, OpencodeStartupContext as s, BackupCreateContext as t, RPCTransportContext as u };
238
+ //# sourceMappingURL=contexts-DPFhc2nR.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contexts-DPFhc2nR.d.ts","names":["ErrorCode","ErrorCode","Operation","OperationType","ErrorResponse","TContext","Record","ServiceError","ServiceResult","T","OperationType","FileNotFoundContext","FileExistsContext","FileTooLargeContext","FileSystemContext","CommandNotFoundContext","CommandErrorContext","ProcessNotFoundContext","ProcessErrorContext","SessionAlreadyExistsContext","SessionDestroyedContext","SessionTerminatedContext","ProcessReadyTimeoutContext","ProcessExitedBeforeReadyContext","PortAlreadyExposedContext","PortNotExposedContext","InvalidPortContext","PortErrorContext","GitRepositoryNotFoundContext","GitAuthFailedContext","GitBranchNotFoundContext","GitErrorContext","InterpreterNotReadyContext","ContextNotFoundContext","CodeExecutionContext","ValidationFailedContext","Array","BucketMountContext","MissingCredentialsContext","InvalidMountConfigContext","BackupCreateContext","BackupRestoreContext","BackupNotFoundContext","BackupExpiredContext","InvalidBackupConfigContext","OpencodeStartupContext","InternalErrorContext","ContainerUnavailableReason","ContainerUnavailableContext","RPCTransportErrorKind","RPCTransportContext"],"sources":["../../shared/dist/errors/codes.d.ts","../../shared/dist/errors/types.d.ts","../../shared/dist/errors/contexts.d.ts"],"sourcesContent":["/**\n * Centralized error code registry\n * Each code maps to a specific error type with consistent semantics\n */\nexport declare const ErrorCode: {\n readonly FILE_NOT_FOUND: \"FILE_NOT_FOUND\";\n readonly PERMISSION_DENIED: \"PERMISSION_DENIED\";\n readonly FILE_EXISTS: \"FILE_EXISTS\";\n readonly IS_DIRECTORY: \"IS_DIRECTORY\";\n readonly NOT_DIRECTORY: \"NOT_DIRECTORY\";\n readonly FILE_TOO_LARGE: \"FILE_TOO_LARGE\";\n readonly NO_SPACE: \"NO_SPACE\";\n readonly TOO_MANY_FILES: \"TOO_MANY_FILES\";\n readonly RESOURCE_BUSY: \"RESOURCE_BUSY\";\n readonly READ_ONLY: \"READ_ONLY\";\n readonly NAME_TOO_LONG: \"NAME_TOO_LONG\";\n readonly TOO_MANY_LINKS: \"TOO_MANY_LINKS\";\n readonly FILESYSTEM_ERROR: \"FILESYSTEM_ERROR\";\n readonly COMMAND_NOT_FOUND: \"COMMAND_NOT_FOUND\";\n readonly COMMAND_PERMISSION_DENIED: \"COMMAND_PERMISSION_DENIED\";\n readonly INVALID_COMMAND: \"INVALID_COMMAND\";\n readonly COMMAND_EXECUTION_ERROR: \"COMMAND_EXECUTION_ERROR\";\n readonly STREAM_START_ERROR: \"STREAM_START_ERROR\";\n readonly PROCESS_NOT_FOUND: \"PROCESS_NOT_FOUND\";\n readonly PROCESS_PERMISSION_DENIED: \"PROCESS_PERMISSION_DENIED\";\n readonly PROCESS_ERROR: \"PROCESS_ERROR\";\n readonly SESSION_ALREADY_EXISTS: \"SESSION_ALREADY_EXISTS\";\n readonly SESSION_DESTROYED: \"SESSION_DESTROYED\";\n readonly SESSION_TERMINATED: \"SESSION_TERMINATED\";\n readonly PORT_ALREADY_EXPOSED: \"PORT_ALREADY_EXPOSED\";\n readonly PORT_IN_USE: \"PORT_IN_USE\";\n readonly PORT_NOT_EXPOSED: \"PORT_NOT_EXPOSED\";\n readonly INVALID_PORT_NUMBER: \"INVALID_PORT_NUMBER\";\n readonly INVALID_PORT: \"INVALID_PORT\";\n readonly SERVICE_NOT_RESPONDING: \"SERVICE_NOT_RESPONDING\";\n readonly PORT_OPERATION_ERROR: \"PORT_OPERATION_ERROR\";\n readonly CUSTOM_DOMAIN_REQUIRED: \"CUSTOM_DOMAIN_REQUIRED\";\n readonly GIT_REPOSITORY_NOT_FOUND: \"GIT_REPOSITORY_NOT_FOUND\";\n readonly GIT_BRANCH_NOT_FOUND: \"GIT_BRANCH_NOT_FOUND\";\n readonly GIT_AUTH_FAILED: \"GIT_AUTH_FAILED\";\n readonly GIT_NETWORK_ERROR: \"GIT_NETWORK_ERROR\";\n readonly INVALID_GIT_URL: \"INVALID_GIT_URL\";\n readonly GIT_CLONE_FAILED: \"GIT_CLONE_FAILED\";\n readonly GIT_CHECKOUT_FAILED: \"GIT_CHECKOUT_FAILED\";\n readonly GIT_OPERATION_FAILED: \"GIT_OPERATION_FAILED\";\n readonly BUCKET_MOUNT_ERROR: \"BUCKET_MOUNT_ERROR\";\n readonly BUCKET_UNMOUNT_ERROR: \"BUCKET_UNMOUNT_ERROR\";\n readonly S3FS_MOUNT_ERROR: \"S3FS_MOUNT_ERROR\";\n readonly MISSING_CREDENTIALS: \"MISSING_CREDENTIALS\";\n readonly INVALID_MOUNT_CONFIG: \"INVALID_MOUNT_CONFIG\";\n readonly BACKUP_CREATE_FAILED: \"BACKUP_CREATE_FAILED\";\n readonly BACKUP_RESTORE_FAILED: \"BACKUP_RESTORE_FAILED\";\n readonly BACKUP_NOT_FOUND: \"BACKUP_NOT_FOUND\";\n readonly BACKUP_EXPIRED: \"BACKUP_EXPIRED\";\n readonly INVALID_BACKUP_CONFIG: \"INVALID_BACKUP_CONFIG\";\n readonly INTERPRETER_NOT_READY: \"INTERPRETER_NOT_READY\";\n readonly CONTEXT_NOT_FOUND: \"CONTEXT_NOT_FOUND\";\n readonly CODE_EXECUTION_ERROR: \"CODE_EXECUTION_ERROR\";\n readonly PYTHON_NOT_AVAILABLE: \"PYTHON_NOT_AVAILABLE\";\n readonly JAVASCRIPT_NOT_AVAILABLE: \"JAVASCRIPT_NOT_AVAILABLE\";\n readonly OPENCODE_STARTUP_FAILED: \"OPENCODE_STARTUP_FAILED\";\n readonly PROCESS_READY_TIMEOUT: \"PROCESS_READY_TIMEOUT\";\n readonly PROCESS_EXITED_BEFORE_READY: \"PROCESS_EXITED_BEFORE_READY\";\n readonly WATCH_NOT_FOUND: \"WATCH_NOT_FOUND\";\n readonly WATCH_START_ERROR: \"WATCH_START_ERROR\";\n readonly WATCH_STOP_ERROR: \"WATCH_STOP_ERROR\";\n readonly VALIDATION_FAILED: \"VALIDATION_FAILED\";\n readonly INVALID_JSON_RESPONSE: \"INVALID_JSON_RESPONSE\";\n readonly UNKNOWN_ERROR: \"UNKNOWN_ERROR\";\n readonly INTERNAL_ERROR: \"INTERNAL_ERROR\";\n readonly CONTAINER_UNAVAILABLE: \"CONTAINER_UNAVAILABLE\";\n readonly RPC_TRANSPORT_ERROR: \"RPC_TRANSPORT_ERROR\";\n};\nexport type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];\n//# sourceMappingURL=codes.d.ts.map","import type { ErrorCode } from './codes';\n/**\n * Standard operation types\n */\nexport declare const Operation: {\n readonly FILE_READ: \"file.read\";\n readonly FILE_WRITE: \"file.write\";\n readonly FILE_DELETE: \"file.delete\";\n readonly FILE_MOVE: \"file.move\";\n readonly FILE_RENAME: \"file.rename\";\n readonly FILE_STAT: \"file.stat\";\n readonly DIRECTORY_CREATE: \"directory.create\";\n readonly DIRECTORY_LIST: \"directory.list\";\n readonly COMMAND_EXECUTE: \"command.execute\";\n readonly COMMAND_STREAM: \"command.stream\";\n readonly PROCESS_START: \"process.start\";\n readonly PROCESS_KILL: \"process.kill\";\n readonly PROCESS_LIST: \"process.list\";\n readonly PROCESS_GET: \"process.get\";\n readonly PROCESS_LOGS: \"process.logs\";\n readonly GIT_CLONE: \"git.clone\";\n readonly GIT_CHECKOUT: \"git.checkout\";\n readonly GIT_OPERATION: \"git.operation\";\n readonly BACKUP_CREATE: \"backup.create\";\n readonly BACKUP_RESTORE: \"backup.restore\";\n readonly BACKUP_UNMOUNT: \"backup.unmount\";\n readonly CODE_EXECUTE: \"code.execute\";\n readonly CODE_CONTEXT_CREATE: \"code.context.create\";\n readonly CODE_CONTEXT_DELETE: \"code.context.delete\";\n};\nexport type OperationType = (typeof Operation)[keyof typeof Operation];\n/**\n * Standard error response format with generic context type\n * TContext allows type-safe access to error-specific context\n */\nexport interface ErrorResponse<TContext = Record<string, unknown>> {\n /**\n * Error type code (machine-readable)\n */\n code: ErrorCode;\n /**\n * Human-readable error message\n */\n message: string;\n /**\n * Operation that was attempted (useful for debugging and logging)\n */\n operation?: OperationType;\n /**\n * Structured error context with relevant details\n * Type varies based on error code\n */\n context: TContext;\n /**\n * HTTP status code (for client SDK)\n */\n httpStatus: number;\n /**\n * Timestamp when error occurred\n */\n timestamp: string;\n /**\n * Actionable suggestion for fixing the error\n */\n suggestion?: string;\n /**\n * Link to documentation\n */\n documentation?: string;\n}\n/**\n * Container ServiceError (lightweight, enriched by handlers)\n */\nexport interface ServiceError {\n message: string;\n code: ErrorCode;\n details?: Record<string, unknown>;\n}\n/**\n * ServiceResult type for container services\n */\nexport type ServiceResult<T> = {\n success: true;\n data: T;\n} | {\n success: false;\n error: ServiceError;\n};\n//# sourceMappingURL=types.d.ts.map","import type { OperationType } from './types';\n/**\n * File system error contexts\n */\nexport interface FileNotFoundContext {\n path: string;\n operation: OperationType;\n}\nexport interface FileExistsContext {\n path: string;\n operation: OperationType;\n}\nexport interface FileTooLargeContext {\n path: string;\n operation: OperationType;\n maxSize: number;\n actualSize: number;\n}\nexport interface FileSystemContext {\n path: string;\n operation: OperationType;\n stderr?: string;\n exitCode?: number;\n}\n/**\n * Command error contexts\n */\nexport interface CommandNotFoundContext {\n command: string;\n}\nexport interface CommandErrorContext {\n command: string;\n exitCode?: number;\n stdout?: string;\n stderr?: string;\n}\n/**\n * Process error contexts\n */\nexport interface ProcessNotFoundContext {\n processId: string;\n}\nexport interface ProcessErrorContext {\n processId: string;\n pid?: number;\n exitCode?: number;\n stderr?: string;\n}\nexport interface SessionAlreadyExistsContext {\n sessionId: string;\n /**\n * `CLOUDFLARE_PLACEMENT_ID` captured from the container at the moment the\n * duplicate create was detected. Included so a restarted DO can learn the\n * container's placement ID from an idempotent session-create. `null` when\n * the env var is not set (for example, in local development).\n */\n containerPlacementId?: string | null;\n}\nexport interface SessionDestroyedContext {\n sessionId: string;\n}\nexport interface SessionTerminatedContext {\n sessionId: string;\n exitCode: number | null;\n}\n/**\n * Process readiness error contexts\n */\nexport interface ProcessReadyTimeoutContext {\n processId: string;\n command: string;\n condition: string;\n timeout: number;\n}\nexport interface ProcessExitedBeforeReadyContext {\n processId: string;\n command: string;\n condition: string;\n exitCode: number;\n}\n/**\n * Port error contexts\n */\nexport interface PortAlreadyExposedContext {\n port: number;\n portName?: string;\n}\nexport interface PortNotExposedContext {\n port: number;\n}\nexport interface InvalidPortContext {\n port: number;\n reason: string;\n}\nexport interface PortErrorContext {\n port: number;\n portName?: string;\n stderr?: string;\n}\n/**\n * Git error contexts\n */\nexport interface GitRepositoryNotFoundContext {\n repository: string;\n}\nexport interface GitAuthFailedContext {\n repository: string;\n}\nexport interface GitBranchNotFoundContext {\n branch: string;\n repository?: string;\n}\nexport interface GitErrorContext {\n repository?: string;\n branch?: string;\n targetDir?: string;\n stderr?: string;\n exitCode?: number;\n}\n/**\n * Code interpreter error contexts\n */\nexport interface InterpreterNotReadyContext {\n retryAfter?: number;\n progress?: number;\n}\nexport interface ContextNotFoundContext {\n contextId: string;\n}\nexport interface CodeExecutionContext {\n contextId?: string;\n ename?: string;\n evalue?: string;\n traceback?: string[];\n}\n/**\n * Validation error contexts\n */\nexport interface ValidationFailedContext {\n validationErrors: Array<{\n field: string;\n message: string;\n code?: string;\n }>;\n}\n/**\n * Bucket mounting error contexts\n */\nexport interface BucketMountContext {\n bucket: string;\n mountPath: string;\n endpoint: string;\n stderr?: string;\n exitCode?: number;\n}\nexport interface MissingCredentialsContext {\n bucket: string;\n endpoint: string;\n}\nexport interface InvalidMountConfigContext {\n bucket?: string;\n mountPath?: string;\n endpoint?: string;\n reason?: string;\n}\n/**\n * Backup error contexts\n */\nexport interface BackupCreateContext {\n dir: string;\n backupId?: string;\n stderr?: string;\n exitCode?: number;\n}\nexport interface BackupRestoreContext {\n dir: string;\n backupId: string;\n stderr?: string;\n exitCode?: number;\n}\nexport interface BackupNotFoundContext {\n backupId: string;\n}\nexport interface BackupExpiredContext {\n backupId: string;\n expiredAt?: string;\n}\nexport interface InvalidBackupConfigContext {\n reason: string;\n}\n/**\n * OpenCode error contexts\n */\nexport interface OpencodeStartupContext {\n port: number;\n stderr?: string;\n command?: string;\n}\n/**\n * Generic error contexts\n */\nexport interface InternalErrorContext {\n originalError?: string;\n stack?: string;\n [key: string]: unknown;\n}\nexport type ContainerUnavailableReason = 'provisioning' | 'startup' | 'container_restarted';\nexport interface ContainerUnavailableContext {\n reason?: ContainerUnavailableReason;\n sessionId?: string;\n}\n/**\n * RPC transport error contexts. Surfaced when the capnweb WebSocket session\n * fails on the SDK side rather than the container reporting a structured\n * error. Always retryable — the next call will open a fresh connection.\n */\nexport type RPCTransportErrorKind = \n/** Server closed the WebSocket (container crash, DO eviction, network blip). */\n'peer_closed'\n/** Underlying socket fired the `error` event. */\n | 'connection_failed'\n/** WebSocket upgrade failed before the session was established. */\n | 'upgrade_failed'\n/** Peer sent a non-string frame; capnweb's wire format is JSON text only. */\n | 'invalid_frame'\n/** Peer sent a frame the wire-format parser rejected (capnweb readLoop SyntaxError). */\n | 'protocol_error'\n/** Session was disposed (locally or remotely) while a call was pending. */\n | 'session_disposed'\n/** Anything else that bubbled up from the transport with no recognisable shape. */\n | 'unknown';\nexport interface RPCTransportContext {\n /** Categorical bucket so callers can branch on `peer_closed` vs `upgrade_failed` etc. */\n kind: RPCTransportErrorKind;\n /** Original error message, verbatim from capnweb / our DeferredTransport. */\n originalMessage: string;\n /**\n * The underlying Error's `name` property. capnweb preserves this across\n * the wire for the standard built-ins (TypeError, SyntaxError, etc.), so\n * it's a more reliable hint than the message string for those cases.\n */\n errorName: string;\n /** WebSocket close code, when available (kind === 'peer_closed'). */\n closeCode?: number;\n /** WebSocket close reason, when available (kind === 'peer_closed'). */\n closeReason?: string;\n}\n//# sourceMappingURL=contexts.d.ts.map"],"mappings":";;AAIA;AAqEA;;cArEqBA;;ECAAE,SAAAA,iBAyBpB,EAAA,mBAAA;EACWC,SAAAA,WAAa,EAAA,aAAWD;EAKnBE,SAAAA,YAAa,EAAAC,cAAA;EAAYC,SAAAA,aAAAA,EAAAA,eAAAA;EAIhCL,SAAAA,cAAAA,EAAAA,gBAAAA;EAQME,SAAAA,QAAAA,EAAAA,UAAAA;EAKHE,SAAAA,cAAAA,EAAAA,gBAAAA;EAAQ,SAAA,aAAA,EAAA,eAAA;;;;ECSJgB,SAAAA,gBAAAA,EAAwB,kBAAA;EAOxBC,SAAAA,iBAAAA,EAAAA,mBAA0B;EAM1BC,SAAAA,yBAA+B,EAAA,2BAAA;EA8F/BiB,SAAAA,eAAmB,EAAA,iBAAA;EAMnBC,SAAAA,uBAAoB,EAAA,yBAAA;EAMpBC,SAAAA,kBAAqB,EAAA,oBAAA;EAGrBC,SAAAA,iBAAoB,EAAA,mBAAA;EAIpBC,SAAAA,yBAA0B,EAAA,2BAAA;EAM1BC,SAAAA,aAAAA,EAAAA,eAAsB;EAa3BE,SAAAA,sBAA0B,EAAA,wBAAA;EACrBC,SAAAA,iBAAAA,EAAAA,mBACJD;EAQDE,SAAAA,kBAAqB,EAAA,oBAAA;EAehBC,SAAAA,oBAAmB,EAAA,sBAE1BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KFhKEjD,SAAAA,WAAoBA,wBAAwBA;;;AArExD;AAqEA;;cCrEqBE;;EAAAA,SAAAA,UAyBpB,EAAA,YAAA;EACWC,SAAAA,WAAa,EAAA,aAAWD;EAKnBE,SAAAA,SAAa,EAAA,WAAAC;EAAYC,SAAAA,WAAAA,EAAAA,aAAAA;EAIh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ANSPORT_ERROR: "RPC_TRANSPORT_ERROR"
73
74
  };
74
75
 
@@ -123,6 +124,7 @@ const ERROR_STATUS_MAP = {
123
124
  [ErrorCode.JAVASCRIPT_NOT_AVAILABLE]: 501,
124
125
  [ErrorCode.INTERPRETER_NOT_READY]: 503,
125
126
  [ErrorCode.OPENCODE_STARTUP_FAILED]: 503,
127
+ [ErrorCode.CONTAINER_UNAVAILABLE]: 503,
126
128
  [ErrorCode.RPC_TRANSPORT_ERROR]: 503,
127
129
  [ErrorCode.PROCESS_READY_TIMEOUT]: 408,
128
130
  [ErrorCode.PROCESS_EXITED_BEFORE_READY]: 500,
@@ -191,6 +193,11 @@ function getSuggestion(code, context) {
191
193
  case ErrorCode.INVALID_BACKUP_CONFIG: return `Invalid backup configuration: ${context.reason}`;
192
194
  case ErrorCode.BACKUP_CREATE_FAILED: return "Backup creation failed. Check that the directory exists and you have sufficient disk space";
193
195
  case ErrorCode.BACKUP_RESTORE_FAILED: return "Backup restoration failed. The archive may be corrupted or the target directory may be in use";
196
+ case ErrorCode.CONTAINER_UNAVAILABLE: switch (context.reason) {
197
+ case "provisioning": return "The container is still being provisioned. Retry the operation in a moment.";
198
+ case "container_restarted": return "The container restarted while the SDK was preparing the default session. Retry the operation to use the new container.";
199
+ default: return "The container is not ready yet. Retry the operation in a moment.";
200
+ }
194
201
  case ErrorCode.RPC_TRANSPORT_ERROR: switch (context.kind) {
195
202
  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.";
196
203
  case "connection_failed": return "The WebSocket connection failed. Retry the call; if the failure persists, check container health and network connectivity.";
@@ -206,4 +213,4 @@ function getSuggestion(code, context) {
206
213
 
207
214
  //#endregion
208
215
  export { getHttpStatus as n, ErrorCode as r, getSuggestion as t };
209
- //# sourceMappingURL=errors-aRUdk9K8.js.map
216
+ //# sourceMappingURL=errors-CpoDEfUZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors-CpoDEfUZ.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 // 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 // Container Availability Errors (503)\n CONTAINER_UNAVAILABLE: 'CONTAINER_UNAVAILABLE',\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 // 503 Service Unavailable\n [ErrorCode.INTERPRETER_NOT_READY]: 503,\n [ErrorCode.OPENCODE_STARTUP_FAILED]: 503,\n [ErrorCode.CONTAINER_UNAVAILABLE]: 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 available for this operation`;\n case ErrorCode.PORT_ALREADY_EXPOSED:\n return `Port ${context.port} already has preview URL authorization or activation state`;\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.CONTAINER_UNAVAILABLE: {\n const reason = context.reason;\n switch (reason) {\n case 'provisioning':\n return 'The container is still being provisioned. Retry the operation in a moment.';\n case 'container_restarted':\n return 'The container restarted while the SDK was preparing the default session. Retry the operation to use the new container.';\n default:\n return 'The container is not ready yet. Retry the operation in a moment.';\n }\n }\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,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;CAEl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,QAAO;EACX,KAAK,UAAU,qBACX,QAAO,WAAW,QAAQ,OAAO;EACrC,KAAK,UAAU,sBACX,QAAO,QAAQ,aACT,gDAAgD,QAAQ,WAAW,YACnE;EACV,KAAK,UAAU,kBACX,QAAO,YAAY,QAAQ,UAAU;EACzC,KAAK,UAAU,kBACX,QAAO;EACX,KAAK,UAAU,SACX,QAAO;EACX,KAAK,UAAU,kBACX,QAAO;EACX,KAAK,UAAU,aACX,QAAO,sDAAsD,QAAQ,KAAK;EAC9E,KAAK,UAAU,cACX,QAAO,4CAA4C,QAAQ;EAC/D,KAAK,UAAU,cACX,QAAO;EACX,KAAK,UAAU,UACX,QAAO;EACX,KAAK,UAAU,uBACX,QAAO;EACX,KAAK,UAAU,iBACX,QAAO,WAAW,QAAQ,SAAS;EACvC,KAAK,UAAU,eACX,QAAO,WAAW,QAAQ,SAAS;EACvC,KAAK,UAAU,sBACX,QAAO,iCAAiC,QAAQ;EACpD,KAAK,UAAU,qBACX,QAAO;EACX,KAAK,UAAU,sBACX,QAAO;EACX,KAAK,UAAU,sBAEX,SADe,QAAQ,QACvB;GACI,KAAK,eACD,QAAO;GACX,KAAK,sBACD,QAAO;GACX,QACI,QAAO;;EAGnB,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"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as Process, B as WatchOptions, C as FileWatchSSEEvent, D as LocalMountBucketOptions, E as ListFilesOptions, F as SandboxOptions, G as CodeContext, H as isProcess, I as SessionOptions, J as ExecutionResult, K as CreateContextOptions, L as StreamOptions, M as ProcessStatus, N as RemoteMountBucketOptions, O as LogEvent, P as RestoreBackupResult, R as WaitForLogResult, S as FileStreamEvent, T as ISandbox, U as isProcessStatus, V as isExecResult, W as PtyOptions, Y as RunCodeOptions, _ as ExecOptions, a as QuickTunnelInfo, b as FileChunk, c as TunnelOptions, d as BucketCredentials, f as BucketProvider, g as ExecEvent, h as DirectoryBackup, i as NamedTunnelInfo, j as ProcessOptions, k as MountBucketOptions, l as BackupOptions, m as CheckChangesResult, n as Sandbox, o as SandboxInterpreterAPI, p as CheckChangesOptions, q as Execution, r as getSandbox, s as TunnelInfo, t as ContainerProxy, u as BaseExecOptions, v as ExecResult, w as GitCheckoutResult, x as FileMetadata, y as ExecutionSession, z as WaitForPortOptions } from "./sandbox-Cz8DRoAm.js";
2
- import { a as InvalidBackupConfigContext, c as ProcessReadyTimeoutContext, d as SessionTerminatedContext, f as ErrorResponse, i as BackupRestoreContext, l as RPCTransportContext, m as ErrorCode, n as BackupExpiredContext, p as OperationType, r as BackupNotFoundContext, s as ProcessExitedBeforeReadyContext, t as BackupCreateContext, u as RPCTransportErrorKind } from "./contexts-B0_bcx9f.js";
1
+ import { A as Process, B as WatchOptions, C as FileWatchSSEEvent, D as LocalMountBucketOptions, E as ListFilesOptions, F as SandboxOptions, G as CodeContext, H as isProcess, I as SessionOptions, J as ExecutionResult, K as CreateContextOptions, L as StreamOptions, M as ProcessStatus, N as RemoteMountBucketOptions, O as LogEvent, P as RestoreBackupResult, R as WaitForLogResult, S as FileStreamEvent, T as ISandbox, U as isProcessStatus, V as isExecResult, W as PtyOptions, Y as RunCodeOptions, _ as ExecOptions, a as QuickTunnelInfo, b as FileChunk, c as TunnelOptions, d as BucketCredentials, f as BucketProvider, g as ExecEvent, h as DirectoryBackup, i as NamedTunnelInfo, j as ProcessOptions, k as MountBucketOptions, l as BackupOptions, m as CheckChangesResult, n as Sandbox, o as SandboxInterpreterAPI, p as CheckChangesOptions, q as Execution, r as getSandbox, s as TunnelInfo, t as ContainerProxy, u as BaseExecOptions, v as ExecResult, w as GitCheckoutResult, x as FileMetadata, y as ExecutionSession, z as WaitForPortOptions } from "./sandbox-44kEJjAc.js";
2
+ import { a as ContainerUnavailableContext, c as ProcessExitedBeforeReadyContext, d as RPCTransportErrorKind, f as SessionTerminatedContext, h as ErrorCode, i as BackupRestoreContext, l as ProcessReadyTimeoutContext, m as OperationType, n as BackupExpiredContext, o as InvalidBackupConfigContext, p as ErrorResponse, r as BackupNotFoundContext, t as BackupCreateContext, u as RPCTransportContext } from "./contexts-DPFhc2nR.js";
3
3
 
4
4
  //#region src/errors/classes.d.ts
5
5
 
@@ -101,6 +101,9 @@ declare class BackupRestoreError extends SandboxError<BackupRestoreContext> {
101
101
  get dir(): string;
102
102
  get backupId(): string;
103
103
  }
104
+ declare class ContainerUnavailableError extends SandboxError<ContainerUnavailableContext> {
105
+ constructor(errorResponse: ErrorResponse<ContainerUnavailableContext>);
106
+ }
104
107
  /**
105
108
  * Raised when the capnweb WebSocket session itself fails on the SDK side.
106
109
  * Unlike the rest of the SandboxError tree, the container never produces
@@ -262,5 +265,5 @@ declare class InvalidMountConfigError extends BucketMountError {
262
265
  constructor(message: string);
263
266
  }
264
267
  //#endregion
265
- export { BackupCreateError, BackupExpiredError, BackupNotFoundError, type BackupOptions, BackupRestoreError, type BaseExecOptions, type BucketCredentials, BucketMountError, type BucketProvider, BucketUnmountError, type CheckChangesOptions, type CheckChangesResult, type CodeContext, CodeInterpreter, ContainerProxy, type CreateContextOptions, type DirectoryBackup, type ExecEvent, type ExecOptions, type ExecResult, type ExecutionResult, type ExecutionSession, type FileChunk, type FileMetadata, type FileStreamEvent, type FileWatchSSEEvent, type GitCheckoutResult, type ISandbox, InvalidBackupConfigError, InvalidMountConfigError, type ListFilesOptions, type LocalMountBucketOptions, type LogEvent, MissingCredentialsError, type MountBucketOptions, type NamedTunnelInfo, type Process, ProcessExitedBeforeReadyError, type ProcessOptions, ProcessReadyTimeoutError, type ProcessStatus, type PtyOptions, type QuickTunnelInfo, type RPCTransportContext, RPCTransportError, type RPCTransportErrorKind, type RemoteMountBucketOptions, type RestoreBackupResult, type RunCodeOptions, S3FSMountError, Sandbox, type SandboxEnv, type SandboxOptions, type SessionOptions, SessionTerminatedError, type StreamOptions, type TunnelInfo, type TunnelOptions, type WaitForLogResult, type WaitForPortOptions, type WatchOptions, asyncIterableToSSEStream, collectFile, getSandbox, isExecResult, isProcess, isProcessStatus, parseSSEStream, proxyTerminal, proxyToSandbox, responseToAsyncIterable, streamFile };
268
+ export { BackupCreateError, BackupExpiredError, BackupNotFoundError, type BackupOptions, BackupRestoreError, type BaseExecOptions, type BucketCredentials, BucketMountError, type BucketProvider, BucketUnmountError, type CheckChangesOptions, type CheckChangesResult, type CodeContext, CodeInterpreter, ContainerProxy, ContainerUnavailableError, type CreateContextOptions, type DirectoryBackup, type ExecEvent, type ExecOptions, type ExecResult, type ExecutionResult, type ExecutionSession, type FileChunk, type FileMetadata, type FileStreamEvent, type FileWatchSSEEvent, type GitCheckoutResult, type ISandbox, InvalidBackupConfigError, InvalidMountConfigError, type ListFilesOptions, type LocalMountBucketOptions, type LogEvent, MissingCredentialsError, type MountBucketOptions, type NamedTunnelInfo, type Process, ProcessExitedBeforeReadyError, type ProcessOptions, ProcessReadyTimeoutError, type ProcessStatus, type PtyOptions, type QuickTunnelInfo, type RPCTransportContext, RPCTransportError, type RPCTransportErrorKind, type RemoteMountBucketOptions, type RestoreBackupResult, type RunCodeOptions, S3FSMountError, Sandbox, type SandboxEnv, type SandboxOptions, type SessionOptions, SessionTerminatedError, type StreamOptions, type TunnelInfo, type TunnelOptions, type WaitForLogResult, type WaitForPortOptions, type WatchOptions, asyncIterableToSSEStream, collectFile, getSandbox, isExecResult, isProcess, isProcessStatus, parseSSEStream, proxyTerminal, proxyToSandbox, responseToAsyncIterable, streamFile };
266
269
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/errors/classes.ts","../src/file-stream.ts","../src/interpreter.ts","../src/pty/proxy.ts","../src/request-handler.ts","../src/sse-parser.ts","../src/storage-mount/errors.ts"],"s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SA;EAAqB,WAAA,CAAA,OAAA,EAAA,MAAA;;;;;AA6X5C,cMtpBA,kBAAA,SAA2B,gBAAA,CNspBF;EAAqB,WAAA,CAAA,OAAA,EAAA,MAAA;;;;;AAwB9C,cMpqBA,uBAAA,SAAgC,gBAAA,CNoqBF;EAAqB,WAAA,CAAA,OAAA,EAAA,MAAA;;;;;AA4BnD,cMtrBA,uBAAA,SAAgC,gBAAA,CNsrBZ;EAAqB,WAAA,CAAA,OAAA,EAAA,MAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/errors/classes.ts","../src/file-stream.ts","../src/interpreter.ts","../src/pty/proxy.ts","../src/request-handler.ts","../src/sse-parser.ts","../src/storage-mount/errors.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAoEa,cAnBA,YAmBA,CAAA,WAnBwB,MAmBxB,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA,SAnByD,KAAA,CAmBzD;EAAA,SAAA,aAAA,EAjBsB,aAiBtB,CAjBoC,QAiBpC,CAAA;EAME,WAAA,CAAA,aAAA,EAvBoB,aAuBpB,CAvBkC,QAuBlC,CAAA,EAAA,QAAA,EAAA;;;EAzBuD,IAAA,IAAA,CAAA,CAAA,EAEtB,SAFsB;EAAK,IAAA,OAAA,CAAA,CAAA,EAmB9D,QAnB8D;EA6Q9D,IAAA,UAAA,CAAA,CAAA,EAAA,MAAA;EAA4C,IAAA,SAAA,CAAA,CAAA,EA1P5C,aAAA,GA0P4C,SAAA;EACd,IAAA,UAAA,CAAA,CAAA,EAAA,MAAA,GAAA,SAAA;EAAd,IAAA,SAAA,CAAA,CAAA,EAAA,MAAA;EADe,IAAA,aAAA,CAAA,CAAA,EAAA,MAAA,GAAA,SAAA;EAAY,MAAA,CAAA,CAAA,EAAA;IA6X3C,IAAA,EAAA,MAAA;IAA8C,OAAA,EAAA,MAAA;IAChB,IAAA,EAlnB5B,SAknB4B;IAAd,OAAA,UAAA;IADiB,UAAA,EAAA,MAAA;IAAY,SA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,CL+LoB,CAAA,EAAA,OA6Xe,CA7Xf,EAAA;EAAY,MAAA,CAAA,EK7L3C,WL6L2C;EA6X3C,SAAA,CAAA,EAAA,CAAA,KAAA,EKzjBW,CLyjBX,EAAA,GAAA,MAAyB;CAAqB,CAAA,EKvjBxD,cLujBwD,CKvjBzC,ULujByC,CAAA;;;;;;AAvnB9C,cMvDA,gBAAA,SAAyB,KAAA,CNuDzB;EAAA,SAAA,IAAA,EMtDW,SNsDX;EAME,WAAA,CAAA,OAAA,EAAA,MAAA,EAAA,IAAA,CAAA,EM1DsB,SN0DtB;;;;;AAoPF,cMpSA,cAAA,SAAuB,gBAAA,CNoSA;EAAqB,WAAA,CAAA,OAAA,EAAA,MAAA;;;;;AA6X5C,cMvpBA,kBAAA,SAA2B,gBAAA,CNupBF;EAAqB,WAAA,CAAA,OAAA,EAAA,MAAA;;;;;AAwB9C,cMrqBA,uBAAA,SAAgC,gBAAA,CNqqBF;EAAqB,WAAA,CAAA,OAAA,EAAA,MAAA;;;;;AA4BnD,cMvrBA,uBAAA,SAAgC,gBAAA,CNurBZ;EAAqB,WAAA,CAAA,OAAA,EAAA,MAAA"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { c as TraceContext, n as isProcess, o as createLogger, r as isProcessStatus, t as isExecResult } from "./dist-mAH_7Ui7.js";
2
- import "./errors-aRUdk9K8.js";
3
- import { A as ProcessExitedBeforeReadyError, C as collectFile, D as BackupNotFoundError, E as BackupExpiredError, M as RPCTransportError, N as SessionTerminatedError, O as BackupRestoreError, T as BackupCreateError, _ as proxyTerminal, a as BucketUnmountError, b as sanitizeSandboxId, c as S3FSMountError, d as responseToAsyncIterable, f as PREVIEW_PROXY_HEADER, g as PREVIEW_PROXY_TOKEN_HEADER, h as PREVIEW_PROXY_SANDBOX_ID_HEADER, i as BucketMountError, j as ProcessReadyTimeoutError, k as InvalidBackupConfigError, l as asyncIterableToSSEStream, m as PREVIEW_PROXY_PORT_HEADER, n as Sandbox, o as InvalidMountConfigError, p as PREVIEW_PROXY_HEADERS, r as getSandbox, s as MissingCredentialsError, t as ContainerProxy, u as parseSSEStream, v as CodeInterpreter, w as streamFile, x as validatePort } from "./sandbox-B7ewRruX.js";
2
+ import "./errors-CpoDEfUZ.js";
3
+ import { A as InvalidBackupConfigError, C as collectFile, D as BackupNotFoundError, E as BackupExpiredError, M as ProcessReadyTimeoutError, N as RPCTransportError, O as BackupRestoreError, P as SessionTerminatedError, T as BackupCreateError, _ as proxyTerminal, a as BucketUnmountError, b as sanitizeSandboxId, c as S3FSMountError, d as responseToAsyncIterable, f as PREVIEW_PROXY_HEADER, g as PREVIEW_PROXY_TOKEN_HEADER, h as PREVIEW_PROXY_SANDBOX_ID_HEADER, i as BucketMountError, j as ProcessExitedBeforeReadyError, k as ContainerUnavailableError, l as asyncIterableToSSEStream, m as PREVIEW_PROXY_PORT_HEADER, n as Sandbox, o as InvalidMountConfigError, p as PREVIEW_PROXY_HEADERS, r as getSandbox, s as MissingCredentialsError, t as ContainerProxy, u as parseSSEStream, v as CodeInterpreter, w as streamFile, x as validatePort } from "./sandbox-B-FLGbkP.js";
4
4
 
5
5
  //#region src/request-handler.ts
6
6
  function createProxyLogger(request) {
@@ -60,5 +60,5 @@ function extractSandboxRoute(url) {
60
60
  }
61
61
 
62
62
  //#endregion
63
- export { BackupCreateError, BackupExpiredError, BackupNotFoundError, BackupRestoreError, BucketMountError, BucketUnmountError, CodeInterpreter, ContainerProxy, InvalidBackupConfigError, InvalidMountConfigError, MissingCredentialsError, ProcessExitedBeforeReadyError, ProcessReadyTimeoutError, RPCTransportError, S3FSMountError, Sandbox, SessionTerminatedError, asyncIterableToSSEStream, collectFile, getSandbox, isExecResult, isProcess, isProcessStatus, parseSSEStream, proxyTerminal, proxyToSandbox, responseToAsyncIterable, streamFile };
63
+ export { BackupCreateError, BackupExpiredError, BackupNotFoundError, BackupRestoreError, BucketMountError, BucketUnmountError, CodeInterpreter, ContainerProxy, ContainerUnavailableError, InvalidBackupConfigError, InvalidMountConfigError, MissingCredentialsError, ProcessExitedBeforeReadyError, ProcessReadyTimeoutError, RPCTransportError, S3FSMountError, Sandbox, SessionTerminatedError, asyncIterableToSSEStream, collectFile, getSandbox, isExecResult, isProcess, isProcessStatus, parseSSEStream, proxyTerminal, proxyToSandbox, responseToAsyncIterable, streamFile };
64
64
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { n as Sandbox } from "../sandbox-Cz8DRoAm.js";
1
+ import { n as Sandbox } from "../sandbox-44kEJjAc.js";
2
2
  import { ApplyPatchOperation, ApplyPatchResult, Editor as Editor$1, Shell as Shell$1, ShellAction, ShellResult } from "@openai/agents";
3
3
 
4
4
  //#region src/openai/index.d.ts
@@ -1,5 +1,5 @@
1
- import { n as Sandbox } from "../sandbox-Cz8DRoAm.js";
2
- import { o as OpencodeStartupContext } from "../contexts-B0_bcx9f.js";
1
+ import { n as Sandbox } from "../sandbox-44kEJjAc.js";
2
+ import { s as OpencodeStartupContext } from "../contexts-DPFhc2nR.js";
3
3
  import { OpencodeClient } from "@opencode-ai/sdk/v2/client";
4
4
  import { Config } from "@opencode-ai/sdk/v2";
5
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/opencode/types.ts","../../src/opencode/opencode.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAOiB,UAAA,eAAA,CAAe;EAcf;EAaA,IAAA,CAAA,EAAA,MAAA;EAAyB;EAEhC,SAAA,CAAA,EAAA,MAAA;EAEA;EAAc,MAAA,CAAA,EAzBb,MAyBa;EAMX;EAEc,GAAA,CAAA,EA/BnB,MA+BmB,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;UAzBV,cAAA;;;ECsSK;EACX,GAAA,EAAA,MAAA;EACC;EACD,KAAA,EAAA,EDnSA,OCmSA,CAAA,IAAA,CAAA;;;AAqEX;;;AAEY,UDnWK,cCmWL,CAAA,UDnW8B,cCmW9B,CAAA,CAAA;EACc;EAAf,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,cCmWL,CAAA,UDnW8B,cCmW9B,CAAA,CAAA;EACc;EAAf,MAAA,EDlWD,OCkWC;EAAR;EAAO,MAAA,EDhWA,cCgWA;AA0BV;;;;AAIW,cDxXE,oBAAA,SAA6B,KAAA,CCwX/B;EAAR,SAAA,IAAA,EAAA,yBAAA;EAAO,SAAA,OAAA,EDtXiB,sBCsXjB;EAmDM,WAAA,CAAA,OAAe,EAAA,MAAA,EAAA,OAAA,EDralB,sBCqakB,EAAA,OAAA,CAAA,EDpajB,YCoaiB;;;;;;;ADhd/B;AAcA;AAaA;;;;;AAUA;;;;;;;;;AC+QA;;;;;;AAwEA;;;;;;;;AA6BA;;;;;;;AAuDA;;;;;;AAIc,iBAhKQ,oBAAA,CAgKR,OAAA,EA/JH,OA+JG,CAAA,OAAA,CAAA,EAAA,OAAA,CAAA,EA9JF,eA8JE,CAAA,EA7JX,OA6JW,CA7JH,cA6JG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAxFQ,yBAAyB,yBACpC,4BACC,kBACT,QAAQ,eAAe;;;;;;;;iBA0BV,qBAAA,UACL,kBACA,0BACD,iBACP,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmDK,eAAA,UACL,kBACA,0BACD,iBACP,WAAW,QAAQ"}
@@ -1,5 +1,5 @@
1
1
  import { o as createLogger } from "../dist-mAH_7Ui7.js";
2
- import { r as ErrorCode } from "../errors-aRUdk9K8.js";
2
+ import { r as ErrorCode } from "../errors-CpoDEfUZ.js";
3
3
 
4
4
  //#region src/opencode/types.ts
5
5
  /**
@@ -2142,6 +2142,8 @@ declare class Sandbox<Env = unknown> extends Container<Env> implements ISandbox
2142
2142
  * in-flight initialization promise.
2143
2143
  */
2144
2144
  private ensureDefaultSession;
2145
+ private getOrInitializeDefaultSession;
2146
+ private isDefaultSessionInitContainerRestart;
2145
2147
  private initializeDefaultSession;
2146
2148
  /**
2147
2149
  * Persist the container's placement ID in DO storage.
@@ -2647,4 +2649,4 @@ declare class Sandbox<Env = unknown> extends Container<Env> implements ISandbox
2647
2649
  }
2648
2650
  //#endregion
2649
2651
  export { Process as A, WatchOptions as B, FileWatchSSEEvent as C, LocalMountBucketOptions as D, ListFilesOptions as E, SandboxOptions as F, CodeContext as G, isProcess as H, SessionOptions as I, ExecutionResult as J, CreateContextOptions as K, StreamOptions as L, ProcessStatus as M, RemoteMountBucketOptions as N, LogEvent as O, RestoreBackupResult as P, WaitForLogResult as R, FileStreamEvent as S, ISandbox as T, isProcessStatus as U, isExecResult as V, PtyOptions as W, RunCodeOptions as Y, ExecOptions as _, QuickTunnelInfo as a, FileChunk as b, TunnelOptions as c, BucketCredentials as d, BucketProvider as f, ExecEvent as g, DirectoryBackup as h, NamedTunnelInfo as i, ProcessOptions as j, MountBucketOptions as k, BackupOptions as l, CheckChangesResult as m, Sandbox as n, SandboxInterpreterAPI as o, CheckChangesOptions as p, Execution as q, getSandbox as r, TunnelInfo as s, ContainerProxy$1 as t, BaseExecOptions as u, ExecResult as v, GitCheckoutResult as w, FileMetadata as x, ExecutionSession as y, WaitForPortOptions as z };
2650
- //# sourceMappingURL=sandbox-Cz8DRoAm.d.ts.map
2652
+ //# sourceMappingURL=sandbox-44kEJjAc.d.ts.map