@cloudflare/sandbox 0.12.0 → 0.12.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.
package/README.md CHANGED
@@ -200,6 +200,7 @@ See the [examples directory](./examples) for complete working examples:
200
200
  - [Claude Code](./examples/claude-code) - Run [Claude Code](https://claude.ai/code) headless on any repo
201
201
  - [OpenAI Agents](./examples/openai-agents) - `Shell` and `Editor` tools for [OpenAI Agents SDK](https://openai.github.io/openai-agents-js/)
202
202
  - [OpenCode](./examples/opencode) - [OpenCode](https://github.com/sst/opencode) web UI or [SDK](https://opencode.ai/docs/sdk/) in a sandbox
203
+ - [Git Repo Per Sandbox](./examples/git-repo-per-sandbox) - One Artifacts Git repo per sandbox
203
204
  - [TypeScript Validator](./examples/typescript-validator) - Build with npm in sandbox, execute in [isolates](https://developers.cloudflare.com/workers/runtime-apis/bindings/worker-loader/)
204
205
 
205
206
  ## Status
@@ -1,6 +1,6 @@
1
1
  import "../dist-B_eXrP83.js";
2
2
  import "../errors-aRUdk9K8.js";
3
- import { S as validateTunnelName, r as getSandbox, w as streamFile, x as validatePort, y as SandboxSecurityError } from "../sandbox-Duj2gvUC.js";
3
+ import { S as validateTunnelName, r as getSandbox, w as streamFile, x as validatePort, y as SandboxSecurityError } from "../sandbox-DKG3H156.js";
4
4
  import { DurableObject, env } from "cloudflare:workers";
5
5
  import { Hono } from "hono";
6
6
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
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-D3N9M5EI.js";
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-C8l-pMlL.js";
2
2
  import { a as InvalidBackupConfigContext, c as ProcessReadyTimeoutContext, d as SessionTerminatedContext, f as ErrorResponse$1, 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";
3
3
 
4
4
  //#region src/errors/classes.d.ts
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
2
  import "./errors-aRUdk9K8.js";
3
- import { A as FileClient, B as RPCTransportError, C as collectFile, D as ProcessClient, E as UtilityClient, F as BackupNotFoundError, I as BackupRestoreError, L as InvalidBackupConfigError, M as BackupClient, N as BackupCreateError, O as PortClient, P as BackupExpiredError, R as ProcessExitedBeforeReadyError, T as SandboxClient, V as SessionTerminatedError, _ 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 CommandClient, k as GitClient, 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 ProcessReadyTimeoutError } from "./sandbox-Duj2gvUC.js";
3
+ import { A as FileClient, B as RPCTransportError, C as collectFile, D as ProcessClient, E as UtilityClient, F as BackupNotFoundError, I as BackupRestoreError, L as InvalidBackupConfigError, M as BackupClient, N as BackupCreateError, O as PortClient, P as BackupExpiredError, R as ProcessExitedBeforeReadyError, T as SandboxClient, V as SessionTerminatedError, _ 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 CommandClient, k as GitClient, 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 ProcessReadyTimeoutError } from "./sandbox-DKG3H156.js";
4
4
 
5
5
  //#region src/request-handler.ts
6
6
  function createProxyLogger(request) {
@@ -1,4 +1,4 @@
1
- import { n as Sandbox } from "../sandbox-D3N9M5EI.js";
1
+ import { n as Sandbox } from "../sandbox-C8l-pMlL.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,4 +1,4 @@
1
- import { n as Sandbox } from "../sandbox-D3N9M5EI.js";
1
+ import { n as Sandbox } from "../sandbox-C8l-pMlL.js";
2
2
  import { o as OpencodeStartupContext } from "../contexts-B0_bcx9f.js";
3
3
  import { OpencodeClient } from "@opencode-ai/sdk/v2/client";
4
4
  import { Config } from "@opencode-ai/sdk/v2";
@@ -1795,7 +1795,8 @@ interface HttpClientOptions {
1795
1795
  */
1796
1796
  transport?: ITransport;
1797
1797
  /**
1798
- * Total retry budget in milliseconds for 503 retries during container startup.
1798
+ * Total retry budget in milliseconds for retryable transport responses.
1799
+ * Used for WebSocket upgrade retries and HTTP 503 startup retries.
1799
1800
  * Passed through to the transport layer. Defaults to 120_000 (2 minutes).
1800
1801
  */
1801
1802
  retryTimeoutMs?: number;
@@ -1883,7 +1884,7 @@ interface ITransport {
1883
1884
  */
1884
1885
  isConnected(): boolean;
1885
1886
  /**
1886
- * Update the 503 retry budget without recreating the transport
1887
+ * Update the upgrade retry budget without recreating the transport
1887
1888
  */
1888
1889
  setRetryTimeoutMs(ms: number): void;
1889
1890
  }
@@ -2416,7 +2417,7 @@ declare class SandboxClient {
2416
2417
  private transport;
2417
2418
  constructor(options: HttpClientOptions);
2418
2419
  /**
2419
- * Update the 503 retry budget on all transports without recreating the client.
2420
+ * Update the transport retry budget without recreating the client.
2420
2421
  *
2421
2422
  * In WebSocket mode a single shared transport is used, so one update covers
2422
2423
  * every sub-client. In HTTP mode each sub-client owns its own transport, so
@@ -2454,9 +2455,9 @@ interface ContainerControlConnectionOptions {
2454
2455
  port?: number;
2455
2456
  logger?: Logger;
2456
2457
  /**
2457
- * Total retry budget (ms) for 503 upgrade responses while the container
2458
- * is starting. Defaults to 120 000 (2 minutes), matching the route-based
2459
- * `WebSocketTransport`. Set to 0 to disable retries.
2458
+ * Total retry budget (ms) for retryable upgrade responses while the
2459
+ * container is unavailable. Defaults to 120 000 (2 minutes), matching the
2460
+ * route-based `WebSocketTransport`. Set to 0 to disable retries.
2460
2461
  */
2461
2462
  retryTimeoutMs?: number;
2462
2463
  /**
@@ -2574,7 +2575,7 @@ declare class ContainerControlClient {
2574
2575
  get tunnels(): SandboxTunnelsAPI;
2575
2576
  get interpreter(): SandboxInterpreterAPI;
2576
2577
  /**
2577
- * Update the 503 upgrade-retry budget. Applies to the current connection
2578
+ * Update the upgrade retry budget. Applies to the current connection
2578
2579
  * (if any) and is remembered for any future connections created after the
2579
2580
  * client is torn down and reconnected.
2580
2581
  */
@@ -3427,4 +3428,4 @@ declare class Sandbox<Env = unknown> extends Container<Env> implements ISandbox
3427
3428
  }
3428
3429
  //#endregion
3429
3430
  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 };
3430
- //# sourceMappingURL=sandbox-D3N9M5EI.d.ts.map
3431
+ //# sourceMappingURL=sandbox-C8l-pMlL.d.ts.map