@cloudflare/sandbox 0.12.2 → 0.12.3
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.
- package/dist/bridge/index.js +2 -2
- package/dist/{contexts-B0_bcx9f.d.ts → contexts-mjA8ZsDG.d.ts} +65 -2
- package/dist/contexts-mjA8ZsDG.d.ts.map +1 -0
- package/dist/{errors-aRUdk9K8.js → errors-CpkKPbWC.js} +8 -2
- package/dist/errors-CpkKPbWC.js.map +1 -0
- package/dist/index.d.ts +42 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/openai/index.d.ts +1 -1
- package/dist/opencode/index.d.ts +2 -2
- package/dist/opencode/index.js +1 -1
- package/dist/{sandbox-C8l-pMlL.d.ts → sandbox-BhIQBik-.d.ts} +78 -8
- package/dist/sandbox-BhIQBik-.d.ts.map +1 -0
- package/dist/{sandbox-BXMrasVs.js → sandbox-DI6suZAc.js} +965 -241
- package/dist/sandbox-DI6suZAc.js.map +1 -0
- package/package.json +1 -1
- package/dist/contexts-B0_bcx9f.d.ts.map +0 -1
- package/dist/errors-aRUdk9K8.js.map +0 -1
- package/dist/sandbox-BXMrasVs.js.map +0 -1
- package/dist/sandbox-C8l-pMlL.d.ts.map +0 -1
package/dist/bridge/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../dist-B_eXrP83.js";
|
|
2
|
-
import "../errors-
|
|
3
|
-
import { S as validateTunnelName, r as getSandbox, w as streamFile, x as validatePort, y as SandboxSecurityError } from "../sandbox-
|
|
2
|
+
import "../errors-CpkKPbWC.js";
|
|
3
|
+
import { S as validateTunnelName, r as getSandbox, w as streamFile, x as validatePort, y as SandboxSecurityError } from "../sandbox-DI6suZAc.js";
|
|
4
4
|
import { DurableObject, env } from "cloudflare:workers";
|
|
5
5
|
import { Hono } from "hono";
|
|
6
6
|
|
|
@@ -70,6 +70,8 @@ declare const ErrorCode: {
|
|
|
70
70
|
readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
|
|
71
71
|
readonly INTERNAL_ERROR: "INTERNAL_ERROR";
|
|
72
72
|
readonly RPC_TRANSPORT_ERROR: "RPC_TRANSPORT_ERROR";
|
|
73
|
+
readonly CONTAINER_UNAVAILABLE: "CONTAINER_UNAVAILABLE";
|
|
74
|
+
readonly OPERATION_INTERRUPTED: "OPERATION_INTERRUPTED";
|
|
73
75
|
};
|
|
74
76
|
type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
|
|
75
77
|
//#endregion
|
|
@@ -198,6 +200,26 @@ interface OpencodeStartupContext {
|
|
|
198
200
|
stderr?: string;
|
|
199
201
|
command?: string;
|
|
200
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Container availability error context. Surfaced when the sandbox container
|
|
205
|
+
* cannot accept the incoming RPC connection. The container may be starting
|
|
206
|
+
* up, undergoing a runtime replacement, or temporarily unhealthy. The
|
|
207
|
+
* caller should retry the same operation.
|
|
208
|
+
*/
|
|
209
|
+
interface ContainerUnavailableContext {
|
|
210
|
+
/**
|
|
211
|
+
* Categorical reason distinguishing startup unavailability from runtime
|
|
212
|
+
* replacement and exhausted upgrade retries.
|
|
213
|
+
*/
|
|
214
|
+
reason: 'container_starting' | 'container_unhealthy' | 'container_replaced' | 'rpc_upgrade_failed';
|
|
215
|
+
/**
|
|
216
|
+
* Always true — this error represents a transient unavailability, not a
|
|
217
|
+
* permanent failure. Callers should retry the same operation.
|
|
218
|
+
*/
|
|
219
|
+
retryable: true;
|
|
220
|
+
/** Suggested delay in milliseconds before the next retry attempt. */
|
|
221
|
+
retryAfterMs?: number;
|
|
222
|
+
}
|
|
201
223
|
/**
|
|
202
224
|
* RPC transport error contexts. Surfaced when the capnweb WebSocket session
|
|
203
225
|
* fails on the SDK side rather than the container reporting a structured
|
|
@@ -227,6 +249,47 @@ interface RPCTransportContext {
|
|
|
227
249
|
/** WebSocket close reason, when available (kind === 'peer_closed'). */
|
|
228
250
|
closeReason?: string;
|
|
229
251
|
}
|
|
252
|
+
/**
|
|
253
|
+
* Reason a sandbox-owned operation was interrupted. Callers may branch on
|
|
254
|
+
* this to decide whether to retry the full operation.
|
|
255
|
+
*/
|
|
256
|
+
type OperationInterruptedReason = /** The container runtime was replaced while the operation was in progress. */
|
|
257
|
+
'runtime_replaced'
|
|
258
|
+
/** The RPC session was disposed mid-operation. */ | 'transport_disposed'
|
|
259
|
+
/** The sandbox lifetime changed (destroy() was called). Not retryable. */ | 'sandbox_lifetime_changed'
|
|
260
|
+
/** Internal recovery attempts were exhausted. Not retryable. */ | 'recovery_exhausted';
|
|
261
|
+
/**
|
|
262
|
+
* Operation interruption context. Surfaced when a sandbox-owned operation
|
|
263
|
+
* (such as backup restore) was interrupted by a runtime replacement or
|
|
264
|
+
* sandbox lifetime change. Public-safe: does not include internal ids.
|
|
265
|
+
*/
|
|
266
|
+
interface OperationInterruptedContext {
|
|
267
|
+
/**
|
|
268
|
+
* Categorical reason. Use `retryable` to decide whether to retry rather
|
|
269
|
+
* than branching on the reason string.
|
|
270
|
+
*/
|
|
271
|
+
reason: OperationInterruptedReason;
|
|
272
|
+
/** Name of the operation that was interrupted (e.g. 'backup.restore'). */
|
|
273
|
+
operation: string;
|
|
274
|
+
/** Lifecycle phase at which the interruption was detected. */
|
|
275
|
+
phase: string;
|
|
276
|
+
/**
|
|
277
|
+
* Whether the operation's container-local side effects reached the runtime.
|
|
278
|
+
* `false` means the operation was interrupted before admission; `true`
|
|
279
|
+
* means effects were committed; `'unknown'` means the operation may or may
|
|
280
|
+
* not have committed.
|
|
281
|
+
*/
|
|
282
|
+
admitted: boolean | 'unknown';
|
|
283
|
+
/**
|
|
284
|
+
* Whether the caller can safely retry the full operation from the beginning.
|
|
285
|
+
* `sandbox_lifetime_changed` and `recovery_exhausted` set this to false.
|
|
286
|
+
*/
|
|
287
|
+
retryable: boolean;
|
|
288
|
+
/** Number of internal recovery attempts made before surfacing this error. */
|
|
289
|
+
recoveryAttempts?: number;
|
|
290
|
+
/** Maximum number of internal recovery attempts allowed. */
|
|
291
|
+
maxRecoveryAttempts?: number;
|
|
292
|
+
}
|
|
230
293
|
//#endregion
|
|
231
|
-
export {
|
|
232
|
-
//# sourceMappingURL=contexts-
|
|
294
|
+
export { ErrorCode as _, ContainerUnavailableContext as a, OperationInterruptedContext as c, ProcessReadyTimeoutContext as d, RPCTransportContext as f, OperationType as g, ErrorResponse as h, BackupRestoreContext as i, OperationInterruptedReason as l, SessionTerminatedContext as m, BackupExpiredContext as n, InvalidBackupConfigContext as o, RPCTransportErrorKind as p, BackupNotFoundContext as r, OpencodeStartupContext as s, BackupCreateContext as t, ProcessExitedBeforeReadyContext as u };
|
|
295
|
+
//# sourceMappingURL=contexts-mjA8ZsDG.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contexts-mjA8ZsDG.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","ContainerUnavailableContext","RPCTransportErrorKind","RPCTransportContext","OperationInterruptedReason","OperationInterruptedContext"],"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 RPC_TRANSPORT_ERROR: \"RPC_TRANSPORT_ERROR\";\n readonly CONTAINER_UNAVAILABLE: \"CONTAINER_UNAVAILABLE\";\n readonly OPERATION_INTERRUPTED: \"OPERATION_INTERRUPTED\";\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}\n/**\n * Container availability error context. Surfaced when the sandbox container\n * cannot accept the incoming RPC connection. The container may be starting\n * up, undergoing a runtime replacement, or temporarily unhealthy. The\n * caller should retry the same operation.\n */\nexport interface ContainerUnavailableContext {\n /**\n * Categorical reason distinguishing startup unavailability from runtime\n * replacement and exhausted upgrade retries.\n */\n reason: 'container_starting' | 'container_unhealthy' | 'container_replaced' | 'rpc_upgrade_failed';\n /**\n * Always true — this error represents a transient unavailability, not a\n * permanent failure. Callers should retry the same operation.\n */\n retryable: true;\n /** Suggested delay in milliseconds before the next retry attempt. */\n retryAfterMs?: number;\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/**\n * Reason a sandbox-owned operation was interrupted. Callers may branch on\n * this to decide whether to retry the full operation.\n */\nexport type OperationInterruptedReason = \n/** The container runtime was replaced while the operation was in progress. */\n'runtime_replaced'\n/** The RPC session was disposed mid-operation. */\n | 'transport_disposed'\n/** The sandbox lifetime changed (destroy() was called). Not retryable. */\n | 'sandbox_lifetime_changed'\n/** Internal recovery attempts were exhausted. Not retryable. */\n | 'recovery_exhausted';\n/**\n * Operation interruption context. Surfaced when a sandbox-owned operation\n * (such as backup restore) was interrupted by a runtime replacement or\n * sandbox lifetime change. Public-safe: does not include internal ids.\n */\nexport interface OperationInterruptedContext {\n /**\n * Categorical reason. Use `retryable` to decide whether to retry rather\n * than branching on the reason string.\n */\n reason: OperationInterruptedReason;\n /** Name of the operation that was interrupted (e.g. 'backup.restore'). */\n operation: string;\n /** Lifecycle phase at which the interruption was detected. */\n phase: string;\n /**\n * Whether the operation's container-local side effects reached the runtime.\n * `false` means the operation was interrupted before admission; `true`\n * means effects were committed; `'unknown'` means the operation may or may\n * not have committed.\n */\n admitted: boolean | 'unknown';\n /**\n * Whether the caller can safely retry the full operation from the beginning.\n * `sandbox_lifetime_changed` and `recovery_exhausted` set this to false.\n */\n retryable: boolean;\n /** Number of internal recovery attempts made before surfacing this error. */\n recoveryAttempts?: number;\n /** Maximum number of internal recovery attempts allowed. */\n maxRecoveryAttempts?: number;\n}\n//# sourceMappingURL=contexts.d.ts.map"],"mappings":";;AAIA;AAsEA;;cAtEqBA;;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;EAmBtBE,SAAAA,sBAA2B,EAAA,wBAAA;EAmBhCC,SAAAA,iBAAqB,EAAA,mBAAA;EAehBC,SAAAA,kBAAmB,EAAA,oBAE1BD;EAkBEE,SAAAA,oBAA0B,EAAA,sBAAA;EAcrBC,SAAAA,WAAAA,EAAAA,aAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KF9MhCnD,SAAAA,WAAoBA,wBAAwBA;;;AAtExD;AAsEA;;cCtEqBE;;EAAAA,SAAAA,UAyBpB,EAAA,YAAA;EACWC,SAAAA,WAAa,EAAA,aAAWD;EAKnBE,SAAAA,SAAa,EAAA,WAAAC;E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,9 @@ const ErrorCode = {
|
|
|
69
69
|
INVALID_JSON_RESPONSE: "INVALID_JSON_RESPONSE",
|
|
70
70
|
UNKNOWN_ERROR: "UNKNOWN_ERROR",
|
|
71
71
|
INTERNAL_ERROR: "INTERNAL_ERROR",
|
|
72
|
-
RPC_TRANSPORT_ERROR: "RPC_TRANSPORT_ERROR"
|
|
72
|
+
RPC_TRANSPORT_ERROR: "RPC_TRANSPORT_ERROR",
|
|
73
|
+
CONTAINER_UNAVAILABLE: "CONTAINER_UNAVAILABLE",
|
|
74
|
+
OPERATION_INTERRUPTED: "OPERATION_INTERRUPTED"
|
|
73
75
|
};
|
|
74
76
|
|
|
75
77
|
//#endregion
|
|
@@ -109,6 +111,7 @@ const ERROR_STATUS_MAP = {
|
|
|
109
111
|
[ErrorCode.PORT_IN_USE]: 409,
|
|
110
112
|
[ErrorCode.RESOURCE_BUSY]: 409,
|
|
111
113
|
[ErrorCode.SESSION_ALREADY_EXISTS]: 409,
|
|
114
|
+
[ErrorCode.OPERATION_INTERRUPTED]: 409,
|
|
112
115
|
[ErrorCode.SESSION_DESTROYED]: 410,
|
|
113
116
|
[ErrorCode.SESSION_TERMINATED]: 410,
|
|
114
117
|
[ErrorCode.FILE_TOO_LARGE]: 413,
|
|
@@ -124,6 +127,7 @@ const ERROR_STATUS_MAP = {
|
|
|
124
127
|
[ErrorCode.INTERPRETER_NOT_READY]: 503,
|
|
125
128
|
[ErrorCode.OPENCODE_STARTUP_FAILED]: 503,
|
|
126
129
|
[ErrorCode.RPC_TRANSPORT_ERROR]: 503,
|
|
130
|
+
[ErrorCode.CONTAINER_UNAVAILABLE]: 503,
|
|
127
131
|
[ErrorCode.PROCESS_READY_TIMEOUT]: 408,
|
|
128
132
|
[ErrorCode.PROCESS_EXITED_BEFORE_READY]: 500,
|
|
129
133
|
[ErrorCode.NO_SPACE]: 500,
|
|
@@ -191,6 +195,8 @@ function getSuggestion(code, context) {
|
|
|
191
195
|
case ErrorCode.INVALID_BACKUP_CONFIG: return `Invalid backup configuration: ${context.reason}`;
|
|
192
196
|
case ErrorCode.BACKUP_CREATE_FAILED: return "Backup creation failed. Check that the directory exists and you have sufficient disk space";
|
|
193
197
|
case ErrorCode.BACKUP_RESTORE_FAILED: return "Backup restoration failed. The archive may be corrupted or the target directory may be in use";
|
|
198
|
+
case ErrorCode.CONTAINER_UNAVAILABLE: return "The sandbox container is temporarily unavailable. Retry the same operation — it will succeed once the container is ready.";
|
|
199
|
+
case ErrorCode.OPERATION_INTERRUPTED: return "The sandbox operation was interrupted by a runtime change. Retry only if the operation is idempotent, or verify sandbox state before retrying.";
|
|
194
200
|
case ErrorCode.RPC_TRANSPORT_ERROR: switch (context.kind) {
|
|
195
201
|
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
202
|
case "connection_failed": return "The WebSocket connection failed. Retry the call; if the failure persists, check container health and network connectivity.";
|
|
@@ -206,4 +212,4 @@ function getSuggestion(code, context) {
|
|
|
206
212
|
|
|
207
213
|
//#endregion
|
|
208
214
|
export { getHttpStatus as n, ErrorCode as r, getSuggestion as t };
|
|
209
|
-
//# sourceMappingURL=errors-
|
|
215
|
+
//# sourceMappingURL=errors-CpkKPbWC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-CpkKPbWC.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 // 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 // Container Availability Errors (503) — raised when the sandbox container\n // is not yet ready to accept requests or was replaced while a connection\n // attempt was in progress. Always retryable from the caller's perspective.\n CONTAINER_UNAVAILABLE: 'CONTAINER_UNAVAILABLE',\n // Operation Lifecycle Errors (409) — raised when a sandbox-owned operation\n // (e.g. backup restore) was interrupted by a runtime replacement or sandbox\n // lifetime change after the operation had already been admitted. The caller\n // should retry the full operation from the beginning.\n OPERATION_INTERRUPTED: 'OPERATION_INTERRUPTED'\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 [ErrorCode.OPERATION_INTERRUPTED]: 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.RPC_TRANSPORT_ERROR]: 503,\n [ErrorCode.CONTAINER_UNAVAILABLE]: 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 return 'The sandbox container is temporarily unavailable. Retry the same operation — it will succeed once the container is ready.';\n case ErrorCode.OPERATION_INTERRUPTED:\n return 'The sandbox operation was interrupted by a runtime change. Retry only if the operation is idempotent, or verify sandbox state before retrying.';\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;CAElB,gBAAgB;CAChB,uBAAuB;CAEvB,uBAAuB;CAEvB,mBAAmB;CAEnB,sBAAsB;CAEtB,sBAAsB;CACtB,0BAA0B;CAE1B,yBAAyB;CAEzB,uBAAuB;CACvB,6BAA6B;CAE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W,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,sBACX,QAAO;EACX,KAAK,UAAU,sBACX,QAAO;EACX,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,8 +1,22 @@
|
|
|
1
|
-
import { $ as FileStreamEvent, A as RequestConfig, At as CreateContextOptions, B as BackupOptions, C as CommandClient, Ct as WaitForPortOptions, D as ContainerStub, Dt as isProcessStatus, E as BaseApiResponse, Et as isProcess, F as SandboxInterpreterAPI, G as CheckChangesResult, H as BucketCredentials, I as TunnelInfo, J as ExecOptions, K as DirectoryBackup, L as TunnelOptions, M as SessionRequest, Mt as ExecutionResult, N as NamedTunnelInfo, Nt as RunCodeOptions, O as ErrorResponse, Ot as PtyOptions, P as QuickTunnelInfo, Q as FileMetadata, R as ExecuteRequest, S as WriteFileRequest, St as WaitForLogResult, T as BackupClient, Tt as isExecResult, U as BucketProvider, V as BaseExecOptions, W as CheckChangesOptions, X as ExecutionSession, Y as ExecResult, Z as FileChunk, _ as GitClient, _t as RestoreBackupResult, a as CommandsResponse, at as LogEvent, b as MkdirRequest, bt as SessionOptions, c as DeleteSessionRequest, ct as ProcessCleanupResult, d as UtilityClient, dt as ProcessListResult, et as FileWatchSSEEvent, f as ProcessClient, ft as ProcessLogsResult, g as GitCheckoutRequest, gt as RemoteMountBucketOptions, h as InterpreterClient, ht as ProcessStatus, i as SandboxClient, it as LocalMountBucketOptions, j as ResponseHandler, jt as Execution, k as HttpClientOptions, kt as CodeContext, l as DeleteSessionResponse, lt as ProcessInfoResult, m as ExecutionCallbacks, mt as ProcessStartResult, n as Sandbox, nt as ISandbox, o as CreateSessionRequest, ot as MountBucketOptions, p as PortClient, pt as ProcessOptions, q as ExecEvent, r as getSandbox, rt as ListFilesOptions, s as CreateSessionResponse, st as Process, t as ContainerProxy, tt as GitCheckoutResult, u as PingResponse, ut as ProcessKillResult, v as FileClient, vt as SandboxOptions, w as ExecuteResponse, wt as WatchOptions, x as ReadFileRequest, xt as StreamOptions, y as FileOperationRequest, yt as SandboxTransport, z as StartProcessRequest } from "./sandbox-
|
|
2
|
-
import { a as
|
|
1
|
+
import { $ as FileStreamEvent, A as RequestConfig, At as CreateContextOptions, B as BackupOptions, C as CommandClient, Ct as WaitForPortOptions, D as ContainerStub, Dt as isProcessStatus, E as BaseApiResponse, Et as isProcess, F as SandboxInterpreterAPI, G as CheckChangesResult, H as BucketCredentials, I as TunnelInfo, J as ExecOptions, K as DirectoryBackup, L as TunnelOptions, M as SessionRequest, Mt as ExecutionResult, N as NamedTunnelInfo, Nt as RunCodeOptions, O as ErrorResponse, Ot as PtyOptions, P as QuickTunnelInfo, Q as FileMetadata, R as ExecuteRequest, S as WriteFileRequest, St as WaitForLogResult, T as BackupClient, Tt as isExecResult, U as BucketProvider, V as BaseExecOptions, W as CheckChangesOptions, X as ExecutionSession, Y as ExecResult, Z as FileChunk, _ as GitClient, _t as RestoreBackupResult, a as CommandsResponse, at as LogEvent, b as MkdirRequest, bt as SessionOptions, c as DeleteSessionRequest, ct as ProcessCleanupResult, d as UtilityClient, dt as ProcessListResult, et as FileWatchSSEEvent, f as ProcessClient, ft as ProcessLogsResult, g as GitCheckoutRequest, gt as RemoteMountBucketOptions, h as InterpreterClient, ht as ProcessStatus, i as SandboxClient, it as LocalMountBucketOptions, j as ResponseHandler, jt as Execution, k as HttpClientOptions, kt as CodeContext, l as DeleteSessionResponse, lt as ProcessInfoResult, m as ExecutionCallbacks, mt as ProcessStartResult, n as Sandbox, nt as ISandbox, o as CreateSessionRequest, ot as MountBucketOptions, p as PortClient, pt as ProcessOptions, q as ExecEvent, r as getSandbox, rt as ListFilesOptions, s as CreateSessionResponse, st as Process, t as ContainerProxy, tt as GitCheckoutResult, u as PingResponse, ut as ProcessKillResult, v as FileClient, vt as SandboxOptions, w as ExecuteResponse, wt as WatchOptions, x as ReadFileRequest, xt as StreamOptions, y as FileOperationRequest, yt as SandboxTransport, z as StartProcessRequest } from "./sandbox-BhIQBik-.js";
|
|
2
|
+
import { _ as ErrorCode, a as ContainerUnavailableContext, c as OperationInterruptedContext, d as ProcessReadyTimeoutContext, f as RPCTransportContext, g as OperationType, h as ErrorResponse$1, i as BackupRestoreContext, l as OperationInterruptedReason, m as SessionTerminatedContext, n as BackupExpiredContext, o as InvalidBackupConfigContext, p as RPCTransportErrorKind, r as BackupNotFoundContext, t as BackupCreateContext, u as ProcessExitedBeforeReadyContext } from "./contexts-mjA8ZsDG.js";
|
|
3
3
|
|
|
4
|
-
//#region src/errors
|
|
4
|
+
//#region src/platform-errors.d.ts
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Whether an error was raised because the current Durable Object isolate was
|
|
8
|
+
* superseded by a deploy/code update. In-process retries are futile for this
|
|
9
|
+
* class because the invocation keeps running on the old isolate; callers
|
|
10
|
+
* should return control to the platform or retry from a fresh request.
|
|
11
|
+
*/
|
|
12
|
+
declare function isDurableObjectCodeUpdateReset(error: unknown): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Whether an error represents a transient platform lifecycle/storage failure,
|
|
15
|
+
* not an application-level sandbox failure.
|
|
16
|
+
*/
|
|
17
|
+
declare function isPlatformTransientError(error: unknown): boolean;
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/errors/classes.d.ts
|
|
6
20
|
/**
|
|
7
21
|
* Base SDK error that wraps ErrorResponse
|
|
8
22
|
* Preserves all error information from container
|
|
@@ -101,6 +115,19 @@ declare class BackupRestoreError extends SandboxError<BackupRestoreContext> {
|
|
|
101
115
|
get dir(): string;
|
|
102
116
|
get backupId(): string;
|
|
103
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Raised when the sandbox container cannot accept an incoming RPC connection.
|
|
120
|
+
* The container may be starting up, temporarily unhealthy, or was replaced
|
|
121
|
+
* while the connection attempt was in progress.
|
|
122
|
+
*
|
|
123
|
+
* Always retryable: the operation that triggered the connection attempt can
|
|
124
|
+
* be retried once the container is ready.
|
|
125
|
+
*/
|
|
126
|
+
declare class ContainerUnavailableError extends SandboxError<ContainerUnavailableContext> {
|
|
127
|
+
constructor(errorResponse: ErrorResponse$1<ContainerUnavailableContext>);
|
|
128
|
+
get reason(): ContainerUnavailableContext['reason'];
|
|
129
|
+
get retryAfterMs(): number | undefined;
|
|
130
|
+
}
|
|
104
131
|
/**
|
|
105
132
|
* Raised when the capnweb WebSocket session itself fails on the SDK side.
|
|
106
133
|
* Unlike the rest of the SandboxError tree, the container never produces
|
|
@@ -120,6 +147,17 @@ declare class RPCTransportError extends SandboxError<RPCTransportContext> {
|
|
|
120
147
|
get kind(): RPCTransportErrorKind;
|
|
121
148
|
get originalMessage(): string;
|
|
122
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Raised when a sandbox-owned operation was interrupted by a runtime
|
|
152
|
+
* replacement or sandbox lifetime change after the operation was admitted.
|
|
153
|
+
* The caller can retry the full operation when `context.retryable` is true.
|
|
154
|
+
*/
|
|
155
|
+
declare class OperationInterruptedError extends SandboxError<OperationInterruptedContext> {
|
|
156
|
+
constructor(errorResponse: ErrorResponse$1<OperationInterruptedContext>, options?: {
|
|
157
|
+
cause?: unknown;
|
|
158
|
+
});
|
|
159
|
+
get reason(): OperationInterruptedContext['reason'];
|
|
160
|
+
}
|
|
123
161
|
//#endregion
|
|
124
162
|
//#region src/file-stream.d.ts
|
|
125
163
|
/**
|
|
@@ -262,5 +300,5 @@ declare class InvalidMountConfigError extends BucketMountError {
|
|
|
262
300
|
constructor(message: string);
|
|
263
301
|
}
|
|
264
302
|
//#endregion
|
|
265
|
-
export { BackupClient, BackupCreateError, BackupExpiredError, BackupNotFoundError, type BackupOptions, BackupRestoreError, type BaseApiResponse, type BaseExecOptions, type BucketCredentials, BucketMountError, type BucketProvider, BucketUnmountError, type CheckChangesOptions, type CheckChangesResult, type CodeContext, CodeInterpreter, CommandClient, type ExecuteResponse as CommandExecuteResponse, type CommandsResponse, ContainerProxy, type ContainerStub, type CreateContextOptions, type CreateSessionRequest, type CreateSessionResponse, type DeleteSessionRequest, type DeleteSessionResponse, type DirectoryBackup, type ErrorResponse, type ExecEvent, type ExecOptions, type ExecResult, type ExecuteRequest, type ExecutionCallbacks, type ExecutionResult, type ExecutionSession, type FileChunk, FileClient, type FileMetadata, type FileOperationRequest, type FileStreamEvent, type FileWatchSSEEvent, type GitCheckoutRequest, type GitCheckoutResult, GitClient, type ISandbox, type InterpreterClient, InvalidBackupConfigError, InvalidMountConfigError, type ListFilesOptions, type LocalMountBucketOptions, type LogEvent, MissingCredentialsError, type MkdirRequest, type MountBucketOptions, type NamedTunnelInfo, type PingResponse, PortClient, type Process, type ProcessCleanupResult, ProcessClient, ProcessExitedBeforeReadyError, type ProcessInfoResult, type ProcessKillResult, type ProcessListResult, type ProcessLogsResult, type ProcessOptions, ProcessReadyTimeoutError, type ProcessStartResult, type ProcessStatus, type PtyOptions, type QuickTunnelInfo, type RPCTransportContext, RPCTransportError, type RPCTransportErrorKind, type ReadFileRequest, type RemoteMountBucketOptions, type RequestConfig, type ResponseHandler, type RestoreBackupResult, type RunCodeOptions, S3FSMountError, Sandbox, SandboxClient, type HttpClientOptions as SandboxClientOptions, type SandboxEnv, type SandboxOptions, type SandboxTransport, type SessionOptions, type SessionRequest, SessionTerminatedError, type StartProcessRequest, type StreamOptions, type TunnelInfo, type TunnelOptions, UtilityClient, type WaitForLogResult, type WaitForPortOptions, type WatchOptions, type WriteFileRequest, asyncIterableToSSEStream, collectFile, getSandbox, isExecResult, isProcess, isProcessStatus, parseSSEStream, proxyTerminal, proxyToSandbox, responseToAsyncIterable, streamFile };
|
|
303
|
+
export { BackupClient, BackupCreateError, BackupExpiredError, BackupNotFoundError, type BackupOptions, BackupRestoreError, type BaseApiResponse, type BaseExecOptions, type BucketCredentials, BucketMountError, type BucketProvider, BucketUnmountError, type CheckChangesOptions, type CheckChangesResult, type CodeContext, CodeInterpreter, CommandClient, type ExecuteResponse as CommandExecuteResponse, type CommandsResponse, ContainerProxy, type ContainerStub, type ContainerUnavailableContext, ContainerUnavailableError, type CreateContextOptions, type CreateSessionRequest, type CreateSessionResponse, type DeleteSessionRequest, type DeleteSessionResponse, type DirectoryBackup, type ErrorResponse, type ExecEvent, type ExecOptions, type ExecResult, type ExecuteRequest, type ExecutionCallbacks, type ExecutionResult, type ExecutionSession, type FileChunk, FileClient, type FileMetadata, type FileOperationRequest, type FileStreamEvent, type FileWatchSSEEvent, type GitCheckoutRequest, type GitCheckoutResult, GitClient, type ISandbox, type InterpreterClient, InvalidBackupConfigError, InvalidMountConfigError, type ListFilesOptions, type LocalMountBucketOptions, type LogEvent, MissingCredentialsError, type MkdirRequest, type MountBucketOptions, type NamedTunnelInfo, type OperationInterruptedContext, OperationInterruptedError, type OperationInterruptedReason, type PingResponse, PortClient, type Process, type ProcessCleanupResult, ProcessClient, ProcessExitedBeforeReadyError, type ProcessInfoResult, type ProcessKillResult, type ProcessListResult, type ProcessLogsResult, type ProcessOptions, ProcessReadyTimeoutError, type ProcessStartResult, type ProcessStatus, type PtyOptions, type QuickTunnelInfo, type RPCTransportContext, RPCTransportError, type RPCTransportErrorKind, type ReadFileRequest, type RemoteMountBucketOptions, type RequestConfig, type ResponseHandler, type RestoreBackupResult, type RunCodeOptions, S3FSMountError, Sandbox, SandboxClient, type HttpClientOptions as SandboxClientOptions, type SandboxEnv, type SandboxOptions, type SandboxTransport, type SessionOptions, type SessionRequest, SessionTerminatedError, type StartProcessRequest, type StreamOptions, type TunnelInfo, type TunnelOptions, UtilityClient, type WaitForLogResult, type WaitForPortOptions, type WatchOptions, type WriteFileRequest, asyncIterableToSSEStream, collectFile, getSandbox, isDurableObjectCodeUpdateReset, isExecResult, isPlatformTransientError, isProcess, isProcessStatus, parseSSEStream, proxyTerminal, proxyToSandbox, responseToAsyncIterable, streamFile };
|
|
266
304
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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"],"sourcesContent":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/platform-errors.ts","../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":";;;;;;;;;AA0CA;AAaA;iBAbgB,8BAAA;;;ACQhB;;AAEiD,iBDGjC,wBAAA,CCHiC,KAAA,EAAA,OAAA,CAAA,EAAA,OAAA;;;;;AAFjD;;AAEiD,cAFpC,YAEoC,CAAA,WAFZ,MAEY,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA,SAFqB,KAAA,CAErB;EAAd,SAAA,aAAA,EAAA,eAAA,CAAc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CN4pBmB;EACrB,WAAA,CAAA,OAAA,EAAA,MAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as isExecResult, f as TraceContext, o as isProcess, s as isProcessStatus, u as createLogger } from "./dist-B_eXrP83.js";
|
|
2
|
-
import "./errors-
|
|
3
|
-
import { A as
|
|
2
|
+
import "./errors-CpkKPbWC.js";
|
|
3
|
+
import { A as PortClient, B as InvalidBackupConfigError, C as collectFile, D as SandboxClient, E as isPlatformTransientError, F as BackupCreateError, G as SessionTerminatedError, H as ProcessExitedBeforeReadyError, I as BackupExpiredError, L as BackupNotFoundError, M as FileClient, N as CommandClient, O as UtilityClient, P as BackupClient, R as BackupRestoreError, T as isDurableObjectCodeUpdateReset, U as ProcessReadyTimeoutError, V as OperationInterruptedError, W as RPCTransportError, _ as responseToAsyncIterable, a as PREVIEW_PROXY_HEADER, b as sanitizeSandboxId, c as PREVIEW_PROXY_SANDBOX_ID_HEADER, d as BucketUnmountError, f as InvalidMountConfigError, g as parseSSEStream, h as asyncIterableToSSEStream, i as proxyTerminal, j as GitClient, k as ProcessClient, l as PREVIEW_PROXY_TOKEN_HEADER, m as S3FSMountError, n as Sandbox, o as PREVIEW_PROXY_HEADERS, p as MissingCredentialsError, r as getSandbox, s as PREVIEW_PROXY_PORT_HEADER, t as ContainerProxy, u as BucketMountError, v as CodeInterpreter, w as streamFile, x as validatePort, z as ContainerUnavailableError } from "./sandbox-DI6suZAc.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 { BackupClient, BackupCreateError, BackupExpiredError, BackupNotFoundError, BackupRestoreError, BucketMountError, BucketUnmountError, CodeInterpreter, CommandClient, ContainerProxy, 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 };
|
|
63
|
+
export { BackupClient, BackupCreateError, BackupExpiredError, BackupNotFoundError, BackupRestoreError, BucketMountError, BucketUnmountError, CodeInterpreter, CommandClient, ContainerProxy, ContainerUnavailableError, FileClient, GitClient, InvalidBackupConfigError, InvalidMountConfigError, MissingCredentialsError, OperationInterruptedError, PortClient, ProcessClient, ProcessExitedBeforeReadyError, ProcessReadyTimeoutError, RPCTransportError, S3FSMountError, Sandbox, SandboxClient, SessionTerminatedError, UtilityClient, asyncIterableToSSEStream, collectFile, getSandbox, isDurableObjectCodeUpdateReset, isExecResult, isPlatformTransientError, isProcess, isProcessStatus, parseSSEStream, proxyTerminal, proxyToSandbox, responseToAsyncIterable, streamFile };
|
|
64
64
|
//# sourceMappingURL=index.js.map
|
package/dist/openai/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Sandbox } from "../sandbox-
|
|
1
|
+
import { n as Sandbox } from "../sandbox-BhIQBik-.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
|
package/dist/opencode/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as Sandbox } from "../sandbox-
|
|
2
|
-
import {
|
|
1
|
+
import { n as Sandbox } from "../sandbox-BhIQBik-.js";
|
|
2
|
+
import { s as OpencodeStartupContext } from "../contexts-mjA8ZsDG.js";
|
|
3
3
|
import { OpencodeClient } from "@opencode-ai/sdk/v2/client";
|
|
4
4
|
import { Config } from "@opencode-ai/sdk/v2";
|
|
5
5
|
|
package/dist/opencode/index.js
CHANGED
|
@@ -1733,6 +1733,63 @@ interface TunnelOptions {
|
|
|
1733
1733
|
*/
|
|
1734
1734
|
name?: string;
|
|
1735
1735
|
}
|
|
1736
|
+
/**
|
|
1737
|
+
* Stable logical identity for a single cloudflared process run.
|
|
1738
|
+
* `tunnelId` is SDK-issued; `runId` is a per-run nonce minted by the SDK
|
|
1739
|
+
* to support idempotent admission and stale-callback fencing.
|
|
1740
|
+
*/
|
|
1741
|
+
interface TunnelRunIdentity {
|
|
1742
|
+
tunnelId: string;
|
|
1743
|
+
runId: string;
|
|
1744
|
+
}
|
|
1745
|
+
/** Discriminator for quick vs. named cloudflared modes. */
|
|
1746
|
+
type TunnelRunMode = 'quick' | 'named';
|
|
1747
|
+
/** Request to start or replay a quick tunnel run. */
|
|
1748
|
+
interface EnsureQuickTunnelRunRequest {
|
|
1749
|
+
tunnelId: string;
|
|
1750
|
+
runId: string;
|
|
1751
|
+
mode: 'quick';
|
|
1752
|
+
port: number;
|
|
1753
|
+
}
|
|
1754
|
+
/**
|
|
1755
|
+
* Request to start or replay a named tunnel run.
|
|
1756
|
+
* `token` is named-mode only and must never be persisted or logged.
|
|
1757
|
+
*/
|
|
1758
|
+
interface EnsureNamedTunnelRunRequest {
|
|
1759
|
+
tunnelId: string;
|
|
1760
|
+
runId: string;
|
|
1761
|
+
mode: 'named';
|
|
1762
|
+
port: number;
|
|
1763
|
+
/** Opaque Cloudflare tunnel token. Never logged or stored. */
|
|
1764
|
+
token: string;
|
|
1765
|
+
}
|
|
1766
|
+
type EnsureTunnelRunRequest = EnsureQuickTunnelRunRequest | EnsureNamedTunnelRunRequest;
|
|
1767
|
+
/**
|
|
1768
|
+
* Runtime-local snapshot of a running cloudflared process.
|
|
1769
|
+
* Quick tunnels carry `url` and `hostname`; named tunnels leave them absent
|
|
1770
|
+
* because the SDK owns the hostname via the Cloudflare API.
|
|
1771
|
+
*/
|
|
1772
|
+
interface TunnelRunSnapshot {
|
|
1773
|
+
tunnelId: string;
|
|
1774
|
+
runId: string;
|
|
1775
|
+
mode: TunnelRunMode;
|
|
1776
|
+
port: number;
|
|
1777
|
+
/** Public URL for quick tunnels (absent on named). */
|
|
1778
|
+
url?: string;
|
|
1779
|
+
/** Hostname portion of `url` for quick tunnels (absent on named). */
|
|
1780
|
+
hostname?: string;
|
|
1781
|
+
startedAt: string;
|
|
1782
|
+
}
|
|
1783
|
+
interface EnsureTunnelRunResult {
|
|
1784
|
+
run: TunnelRunSnapshot;
|
|
1785
|
+
/** `true` when this call spawned the process; `false` on idempotent replay. */
|
|
1786
|
+
started: boolean;
|
|
1787
|
+
}
|
|
1788
|
+
type StopTunnelRunRequest = TunnelRunIdentity;
|
|
1789
|
+
interface StopTunnelRunResult {
|
|
1790
|
+
/** `true` when the exact run was found and stopped; `false` otherwise. */
|
|
1791
|
+
stopped: boolean;
|
|
1792
|
+
}
|
|
1736
1793
|
interface SandboxTunnelsAPI {
|
|
1737
1794
|
/** Spawn `cloudflared tunnel --url`. No credentials required. */
|
|
1738
1795
|
runQuickTunnel(id: string, port: number): Promise<TunnelInfo>;
|
|
@@ -1755,6 +1812,19 @@ interface SandboxTunnelsAPI {
|
|
|
1755
1812
|
}>;
|
|
1756
1813
|
/** List tunnels currently running inside the container. */
|
|
1757
1814
|
listTunnels(): Promise<TunnelInfo[]>;
|
|
1815
|
+
/**
|
|
1816
|
+
* Start or replay a cloudflared process run identified by `(tunnelId, runId)`.
|
|
1817
|
+
* Same `runId` with same params is idempotent (`started: false`).
|
|
1818
|
+
* Same `runId` with different params, or a different active run on the
|
|
1819
|
+
* same port or tunnelId, returns a `TUNNEL_RUN_CONFLICT` error.
|
|
1820
|
+
*/
|
|
1821
|
+
ensureTunnelRun(request: EnsureTunnelRunRequest): Promise<EnsureTunnelRunResult>;
|
|
1822
|
+
/**
|
|
1823
|
+
* Stop the cloudflared process identified by the exact `(tunnelId, runId)` pair.
|
|
1824
|
+
* Returns `{ stopped: true }` when the run was found and stopped;
|
|
1825
|
+
* `{ stopped: false }` when no matching run is active (service success).
|
|
1826
|
+
*/
|
|
1827
|
+
stopTunnelRun(request: StopTunnelRunRequest): Promise<StopTunnelRunResult>;
|
|
1758
1828
|
}
|
|
1759
1829
|
//#endregion
|
|
1760
1830
|
//#region src/clients/types.d.ts
|
|
@@ -2469,14 +2539,12 @@ interface ContainerControlConnectionOptions {
|
|
|
2469
2539
|
*/
|
|
2470
2540
|
localMain?: any;
|
|
2471
2541
|
/**
|
|
2472
|
-
* Invoked when an active WebSocket transitions
|
|
2473
|
-
* Fired at most once per
|
|
2474
|
-
*
|
|
2475
|
-
*
|
|
2476
|
-
* inside what may be an idle isolate.
|
|
2542
|
+
* Invoked when connection setup fails or an active WebSocket transitions
|
|
2543
|
+
* to closed/errored. Fired at most once per connection attempt. Gives
|
|
2544
|
+
* owners a synchronous teardown signal so recovery doesn't depend on a
|
|
2545
|
+
* periodic poller running inside what may be an idle isolate.
|
|
2477
2546
|
*
|
|
2478
|
-
* Not fired for `
|
|
2479
|
-
* promise is the signal in that case) nor for `disconnect()`.
|
|
2547
|
+
* Not fired for `disconnect()`.
|
|
2480
2548
|
*/
|
|
2481
2549
|
onClose?: () => void;
|
|
2482
2550
|
}
|
|
@@ -2637,6 +2705,7 @@ declare class Sandbox<Env = unknown> extends Container<Env> implements ISandbox
|
|
|
2637
2705
|
private activeMounts;
|
|
2638
2706
|
private mountOperationQueue;
|
|
2639
2707
|
private currentRuntime;
|
|
2708
|
+
private currentLifetime;
|
|
2640
2709
|
private transport;
|
|
2641
2710
|
/**
|
|
2642
2711
|
* True once transport has been written to storage at least once (either
|
|
@@ -3416,6 +3485,7 @@ declare class Sandbox<Env = unknown> extends Container<Env> implements ISandbox
|
|
|
3416
3485
|
* Concurrent backup/restore calls on the same sandbox are serialized.
|
|
3417
3486
|
*/
|
|
3418
3487
|
restoreBackup(backup: DirectoryBackup): Promise<RestoreBackupResult>;
|
|
3488
|
+
private doRestoreBackupWithRecovery;
|
|
3419
3489
|
private doRestoreBackup;
|
|
3420
3490
|
/**
|
|
3421
3491
|
* Local-dev implementation of restoreBackup.
|
|
@@ -3428,4 +3498,4 @@ declare class Sandbox<Env = unknown> extends Container<Env> implements ISandbox
|
|
|
3428
3498
|
}
|
|
3429
3499
|
//#endregion
|
|
3430
3500
|
export { FileStreamEvent as $, RequestConfig as A, CreateContextOptions as At, BackupOptions as B, CommandClient as C, WaitForPortOptions as Ct, ContainerStub as D, isProcessStatus as Dt, BaseApiResponse as E, isProcess as Et, SandboxInterpreterAPI as F, CheckChangesResult as G, BucketCredentials as H, TunnelInfo as I, ExecOptions as J, DirectoryBackup as K, TunnelOptions as L, SessionRequest as M, ExecutionResult as Mt, NamedTunnelInfo as N, RunCodeOptions as Nt, ErrorResponse as O, PtyOptions as Ot, QuickTunnelInfo as P, FileMetadata as Q, ExecuteRequest as R, WriteFileRequest as S, WaitForLogResult as St, BackupClient as T, isExecResult as Tt, BucketProvider as U, BaseExecOptions as V, CheckChangesOptions as W, ExecutionSession as X, ExecResult as Y, FileChunk as Z, GitClient as _, RestoreBackupResult as _t, CommandsResponse as a, LogEvent as at, MkdirRequest as b, SessionOptions as bt, DeleteSessionRequest as c, ProcessCleanupResult as ct, UtilityClient as d, ProcessListResult as dt, FileWatchSSEEvent as et, ProcessClient as f, ProcessLogsResult as ft, GitCheckoutRequest as g, RemoteMountBucketOptions as gt, InterpreterClient as h, ProcessStatus as ht, SandboxClient as i, LocalMountBucketOptions as it, ResponseHandler as j, Execution as jt, HttpClientOptions as k, CodeContext as kt, DeleteSessionResponse as l, ProcessInfoResult as lt, ExecutionCallbacks as m, ProcessStartResult as mt, Sandbox as n, ISandbox as nt, CreateSessionRequest as o, MountBucketOptions as ot, PortClient as p, ProcessOptions as pt, ExecEvent as q, getSandbox as r, ListFilesOptions as rt, CreateSessionResponse as s, Process as st, ContainerProxy$1 as t, GitCheckoutResult as tt, PingResponse as u, ProcessKillResult as ut, FileClient as v, SandboxOptions as vt, ExecuteResponse as w, WatchOptions as wt, ReadFileRequest as x, StreamOptions as xt, FileOperationRequest as y, SandboxTransport as yt, StartProcessRequest as z };
|
|
3431
|
-
//# sourceMappingURL=sandbox-
|
|
3501
|
+
//# sourceMappingURL=sandbox-BhIQBik-.d.ts.map
|