@cloudflare/sandbox 0.8.2 → 0.8.4

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/Dockerfile CHANGED
@@ -222,7 +222,7 @@ ENTRYPOINT ["/container-server/sandbox"]
222
222
  # ============================================================================
223
223
  # Desktop variant — full Linux desktop with robotgo native control
224
224
  # ============================================================================
225
- FROM golang:1.24-bookworm AS go-builder
225
+ FROM golang:1.25-bookworm AS go-builder
226
226
 
227
227
  RUN mkdir -p /usr/local/share/ca-certificates
228
228
  RUN --mount=type=secret,id=wrangler_ca \
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as DirectoryBackup, A as DesktopStopResponse, At as StreamOptions, B as ExecuteResponse, Bt as PtyOptions, C as ClickOptions, Ct as ProcessOptions, D as DesktopStartOptions, Dt as RestoreBackupResult, E as DesktopClient, Et as RemoteMountBucketOptions, F as ScreenshotRegion, Ft as isProcess, G as HttpClientOptions, Gt as RunCodeOptions, H as BaseApiResponse, Ht as CreateContextOptions, I as ScreenshotResponse, It as isProcessStatus, J as SessionRequest, K as RequestConfig, L as ScrollDirection, Lt as ExecuteRequest, M as ScreenSizeResponse, Mt as WaitForPortOptions, N as ScreenshotBytesResponse, Nt as WatchOptions, O as DesktopStartResponse, Ot as SandboxOptions, P as ScreenshotOptions, Pt as isExecResult, Q as BucketProvider, R as TypeOptions, Rt as ExposePortRequest, S as WriteFileRequest, St as ProcessLogsResult, T as Desktop, Tt as ProcessStatus, U as ContainerStub, Ut as Execution, V as BackupClient, Vt as CodeContext, W as ErrorResponse, Wt as ExecutionResult, X as BaseExecOptions, Y as BackupOptions, Z as BucketCredentials, _ as GitClient, _t as Process, a as CreateSessionRequest, at as FileMetadata, b as MkdirRequest, bt as ProcessKillResult, c as DeleteSessionResponse, ct as GitCheckoutResult, d as ProcessClient, dt as LocalMountBucketOptions, et as ExecEvent, f as PortClient, ft as LogEvent, g as GitCheckoutRequest, gt as PortListResult, h as InterpreterClient, ht as PortExposeResult, i as CommandsResponse, it as FileChunk, j as KeyInput, jt as WaitForLogResult, k as DesktopStatusResponse, kt as SessionOptions, l as PingResponse, lt as ISandbox, m as ExecutionCallbacks, mt as PortCloseResult, n as getSandbox, nt as ExecResult, o as CreateSessionResponse, ot as FileStreamEvent, p as UnexposePortRequest, pt as MountBucketOptions, q as ResponseHandler, r as SandboxClient, rt as ExecutionSession, s as DeleteSessionRequest, st as FileWatchSSEEvent, t as Sandbox, tt as ExecOptions, u as UtilityClient, ut as ListFilesOptions, v as FileClient, vt as ProcessCleanupResult, w as CursorPositionResponse, wt as ProcessStartResult, x as ReadFileRequest, xt as ProcessListResult, y as FileOperationRequest, yt as ProcessInfoResult, z as CommandClient, zt as StartProcessRequest } from "./sandbox-DDDSuWA6.js";
1
+ import { $ as CheckChangesOptions, A as DesktopStopResponse, At as SandboxOptions, B as ExecuteResponse, Bt as ExposePortRequest, C as ClickOptions, Ct as ProcessListResult, D as DesktopStartOptions, Dt as ProcessStatus, E as DesktopClient, Et as ProcessStartResult, F as ScreenshotRegion, Ft as WatchOptions, G as HttpClientOptions, Gt as Execution, H as BaseApiResponse, Ht as PtyOptions, I as ScreenshotResponse, It as isExecResult, J as SessionRequest, K as RequestConfig, Kt as ExecutionResult, L as ScrollDirection, Lt as isProcess, M as ScreenSizeResponse, Mt as StreamOptions, N as ScreenshotBytesResponse, Nt as WaitForLogResult, O as DesktopStartResponse, Ot as RemoteMountBucketOptions, P as ScreenshotOptions, Pt as WaitForPortOptions, Q as BucketProvider, R as TypeOptions, Rt as isProcessStatus, S as WriteFileRequest, St as ProcessKillResult, T as Desktop, Tt as ProcessOptions, U as ContainerStub, Ut as CodeContext, V as BackupClient, Vt as StartProcessRequest, W as ErrorResponse, Wt as CreateContextOptions, X as BaseExecOptions, Y as BackupOptions, Z as BucketCredentials, _ as GitClient, _t as PortExposeResult, a as CreateSessionRequest, at as ExecutionSession, b as MkdirRequest, bt as ProcessCleanupResult, c as DeleteSessionResponse, ct as FileStreamEvent, d as ProcessClient, dt as ISandbox, et as CheckChangesResult, f as PortClient, ft as ListFilesOptions, g as GitCheckoutRequest, gt as PortCloseResult, h as InterpreterClient, ht as MountBucketOptions, i as CommandsResponse, it as ExecResult, j as KeyInput, jt as SessionOptions, k as DesktopStatusResponse, kt as RestoreBackupResult, l as PingResponse, lt as FileWatchSSEEvent, m as ExecutionCallbacks, mt as LogEvent, n as getSandbox, nt as ExecEvent, o as CreateSessionResponse, ot as FileChunk, p as UnexposePortRequest, pt as LocalMountBucketOptions, q as ResponseHandler, qt as RunCodeOptions, r as SandboxClient, rt as ExecOptions, s as DeleteSessionRequest, st as FileMetadata, t as Sandbox, tt as DirectoryBackup, u as UtilityClient, ut as GitCheckoutResult, v as FileClient, vt as PortListResult, w as CursorPositionResponse, wt as ProcessLogsResult, x as ReadFileRequest, xt as ProcessInfoResult, y as FileOperationRequest, yt as Process, z as CommandClient, zt as ExecuteRequest } from "./sandbox-BoLbdjOe.js";
2
2
  import { a as DesktopCoordinateErrorContext, d as ErrorResponse$1, f as OperationType, i as BackupRestoreContext, l as ProcessExitedBeforeReadyContext, n as BackupExpiredContext, o as DesktopErrorContext, p as ErrorCode, r as BackupNotFoundContext, s as InvalidBackupConfigContext, t as BackupCreateContext, u as ProcessReadyTimeoutContext } from "./contexts-CeQR115r.js";
3
3
  import { ContainerProxy } from "@cloudflare/containers";
4
4
 
@@ -249,5 +249,5 @@ declare class InvalidMountConfigError extends BucketMountError {
249
249
  constructor(message: string);
250
250
  }
251
251
  //#endregion
252
- export { BackupClient, BackupCreateError, BackupExpiredError, BackupNotFoundError, type BackupOptions, BackupRestoreError, type BaseApiResponse, type BaseExecOptions, type BucketCredentials, BucketMountError, type BucketProvider, type ClickOptions, type CodeContext, CodeInterpreter, CommandClient, type ExecuteResponse as CommandExecuteResponse, type CommandsResponse, ContainerProxy, type ContainerStub, type CreateContextOptions, type CreateSessionRequest, type CreateSessionResponse, type CursorPositionResponse, type DeleteSessionRequest, type DeleteSessionResponse, type Desktop, DesktopClient, DesktopInvalidCoordinatesError, DesktopInvalidOptionsError, DesktopNotStartedError, DesktopProcessCrashedError, DesktopStartFailedError, type DesktopStartOptions, type DesktopStartResponse, type DesktopStatusResponse, type DesktopStopResponse, DesktopUnavailableError, type DirectoryBackup, type ErrorResponse, type ExecEvent, type ExecOptions, type ExecResult, type ExecuteRequest, type ExecutionCallbacks, type ExecutionResult, type ExecutionSession, type ExposePortRequest, type FileChunk, FileClient, type FileMetadata, type FileOperationRequest, type FileStreamEvent, type FileWatchSSEEvent, type GitCheckoutRequest, type GitCheckoutResult, GitClient, type ISandbox, type InterpreterClient, InvalidBackupConfigError, InvalidMountConfigError, type KeyInput, type ListFilesOptions, type LocalMountBucketOptions, type LogEvent, MissingCredentialsError, type MkdirRequest, type MountBucketOptions, type PingResponse, PortClient, type PortCloseResult, type PortExposeResult, type PortListResult, type Process, type ProcessCleanupResult, ProcessClient, ProcessExitedBeforeReadyError, type ProcessInfoResult, type ProcessKillResult, type ProcessListResult, type ProcessLogsResult, type ProcessOptions, ProcessReadyTimeoutError, type ProcessStartResult, type ProcessStatus, type PtyOptions, type ReadFileRequest, type RemoteMountBucketOptions, type RequestConfig, type ResponseHandler, type RestoreBackupResult, type RouteInfo, type RunCodeOptions, S3FSMountError, Sandbox, SandboxClient, type HttpClientOptions as SandboxClientOptions, type SandboxEnv, type SandboxOptions, type ScreenSizeResponse, type ScreenshotBytesResponse, type ScreenshotOptions, type ScreenshotRegion, type ScreenshotResponse, type ScrollDirection, type SessionOptions, type SessionRequest, type StartProcessRequest, type StreamOptions, type TypeOptions, type UnexposePortRequest, UtilityClient, type WaitForLogResult, type WaitForPortOptions, type WatchOptions, type WriteFileRequest, asyncIterableToSSEStream, collectFile, getSandbox, isExecResult, isProcess, isProcessStatus, parseSSEStream, proxyTerminal, proxyToSandbox, responseToAsyncIterable, streamFile };
252
+ export { BackupClient, BackupCreateError, BackupExpiredError, BackupNotFoundError, type BackupOptions, BackupRestoreError, type BaseApiResponse, type BaseExecOptions, type BucketCredentials, BucketMountError, type BucketProvider, type CheckChangesOptions, type CheckChangesResult, type ClickOptions, type CodeContext, CodeInterpreter, CommandClient, type ExecuteResponse as CommandExecuteResponse, type CommandsResponse, ContainerProxy, type ContainerStub, type CreateContextOptions, type CreateSessionRequest, type CreateSessionResponse, type CursorPositionResponse, type DeleteSessionRequest, type DeleteSessionResponse, type Desktop, DesktopClient, DesktopInvalidCoordinatesError, DesktopInvalidOptionsError, DesktopNotStartedError, DesktopProcessCrashedError, DesktopStartFailedError, type DesktopStartOptions, type DesktopStartResponse, type DesktopStatusResponse, type DesktopStopResponse, DesktopUnavailableError, type DirectoryBackup, type ErrorResponse, type ExecEvent, type ExecOptions, type ExecResult, type ExecuteRequest, type ExecutionCallbacks, type ExecutionResult, type ExecutionSession, type ExposePortRequest, type FileChunk, FileClient, type FileMetadata, type FileOperationRequest, type FileStreamEvent, type FileWatchSSEEvent, type GitCheckoutRequest, type GitCheckoutResult, GitClient, type ISandbox, type InterpreterClient, InvalidBackupConfigError, InvalidMountConfigError, type KeyInput, type ListFilesOptions, type LocalMountBucketOptions, type LogEvent, MissingCredentialsError, type MkdirRequest, type MountBucketOptions, type PingResponse, PortClient, type PortCloseResult, type PortExposeResult, type PortListResult, type Process, type ProcessCleanupResult, ProcessClient, ProcessExitedBeforeReadyError, type ProcessInfoResult, type ProcessKillResult, type ProcessListResult, type ProcessLogsResult, type ProcessOptions, ProcessReadyTimeoutError, type ProcessStartResult, type ProcessStatus, type PtyOptions, type ReadFileRequest, type RemoteMountBucketOptions, type RequestConfig, type ResponseHandler, type RestoreBackupResult, type RouteInfo, type RunCodeOptions, S3FSMountError, Sandbox, SandboxClient, type HttpClientOptions as SandboxClientOptions, type SandboxEnv, type SandboxOptions, type ScreenSizeResponse, type ScreenshotBytesResponse, type ScreenshotOptions, type ScreenshotRegion, type ScreenshotResponse, type ScrollDirection, type SessionOptions, type SessionRequest, type StartProcessRequest, type StreamOptions, type TypeOptions, type UnexposePortRequest, UtilityClient, type WaitForLogResult, type WaitForPortOptions, type WatchOptions, type WriteFileRequest, asyncIterableToSSEStream, collectFile, getSandbox, isExecResult, isProcess, isProcessStatus, parseSSEStream, proxyTerminal, proxyToSandbox, responseToAsyncIterable, streamFile };
253
253
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -2616,9 +2616,15 @@ var UtilityClient = class extends BaseHttpClient {
2616
2616
  * Uses inotify under the hood for native filesystem event notifications
2617
2617
  *
2618
2618
  * @internal This client is used internally by the SDK.
2619
- * Users should use `sandbox.watch()` instead.
2619
+ * Users should use `sandbox.watch()` or `sandbox.checkChanges()` instead.
2620
2620
  */
2621
2621
  var WatchClient = class extends BaseHttpClient {
2622
+ /**
2623
+ * Check whether a path changed since a previously returned version.
2624
+ */
2625
+ async checkChanges(request) {
2626
+ return this.post("/api/watch/check", request);
2627
+ }
2622
2628
  /**
2623
2629
  * Start watching a directory for changes.
2624
2630
  * The returned promise resolves only after the watcher is established
@@ -3626,7 +3632,7 @@ function buildS3fsSource(bucket, prefix) {
3626
3632
  * This file is auto-updated by .github/changeset-version.ts during releases
3627
3633
  * DO NOT EDIT MANUALLY - Changes will be overwritten on the next version bump
3628
3634
  */
3629
- const SDK_VERSION = "0.8.2";
3635
+ const SDK_VERSION = "0.8.4";
3630
3636
 
3631
3637
  //#endregion
3632
3638
  //#region src/sandbox.ts
@@ -5209,6 +5215,27 @@ var Sandbox = class Sandbox extends Container {
5209
5215
  });
5210
5216
  }
5211
5217
  /**
5218
+ * Check whether a path changed while this caller was disconnected.
5219
+ *
5220
+ * Pass the `version` returned from a prior call in `options.since` to learn
5221
+ * whether the path is unchanged, changed, or needs a full resync because the
5222
+ * retained change state was reset.
5223
+ *
5224
+ * @param path - Path to check (absolute or relative to /workspace)
5225
+ * @param options - Change-check options
5226
+ */
5227
+ async checkChanges(path$1, options = {}) {
5228
+ const sessionId = options.sessionId ?? await this.ensureDefaultSession();
5229
+ return this.client.watch.checkChanges({
5230
+ path: path$1,
5231
+ recursive: options.recursive,
5232
+ include: options.include,
5233
+ exclude: options.exclude,
5234
+ since: options.since,
5235
+ sessionId
5236
+ });
5237
+ }
5238
+ /**
5212
5239
  * Expose a port and get a preview URL for accessing services running in the sandbox
5213
5240
  *
5214
5241
  * @param port - Port number to expose (1024-65535)
@@ -5460,6 +5487,10 @@ var Sandbox = class Sandbox extends Container {
5460
5487
  ...options,
5461
5488
  sessionId
5462
5489
  }),
5490
+ checkChanges: (path$1, options) => this.checkChanges(path$1, {
5491
+ ...options,
5492
+ sessionId
5493
+ }),
5463
5494
  mkdir: (path$1, options) => this.mkdir(path$1, {
5464
5495
  ...options,
5465
5496
  sessionId