@cloudflare/sandbox 0.11.0 → 0.12.0
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 +0 -55
- package/dist/bridge/index.js +9 -2
- package/dist/bridge/index.js.map +1 -1
- package/dist/{contexts-XHAo64dB.d.ts → contexts-B0_bcx9f.d.ts} +2 -29
- package/dist/contexts-B0_bcx9f.d.ts.map +1 -0
- package/dist/{errors-COsTRno_.js → errors-aRUdk9K8.js} +1 -19
- package/dist/errors-aRUdk9K8.js.map +1 -0
- package/dist/index.d.ts +3 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/openai/index.d.ts +1 -1
- package/dist/opencode/index.d.ts +2 -2
- package/dist/opencode/index.d.ts.map +1 -1
- package/dist/opencode/index.js +1 -1
- package/dist/{sandbox-B9LOT0cg.d.ts → sandbox-D3N9M5EI.d.ts} +43 -377
- package/dist/sandbox-D3N9M5EI.d.ts.map +1 -0
- package/dist/{sandbox-DQxTkLyY.js → sandbox-Duj2gvUC.js} +724 -441
- package/dist/sandbox-Duj2gvUC.js.map +1 -0
- package/package.json +1 -1
- package/dist/contexts-XHAo64dB.d.ts.map +0 -1
- package/dist/errors-COsTRno_.js.map +0 -1
- package/dist/sandbox-B9LOT0cg.d.ts.map +0 -1
- package/dist/sandbox-DQxTkLyY.js.map +0 -1
|
@@ -1,81 +1,8 @@
|
|
|
1
|
-
import { Container } from "@cloudflare/containers";
|
|
1
|
+
import { Container, ContainerProxy } from "@cloudflare/containers";
|
|
2
2
|
import "capnweb";
|
|
3
3
|
|
|
4
|
-
//#region ../shared/dist/desktop-types.d.ts
|
|
5
|
-
|
|
6
|
-
interface DesktopStartResult {
|
|
7
|
-
success: boolean;
|
|
8
|
-
resolution: [number, number];
|
|
9
|
-
dpi: number;
|
|
10
|
-
}
|
|
11
|
-
interface DesktopStopResult {
|
|
12
|
-
success: boolean;
|
|
13
|
-
}
|
|
14
|
-
interface DesktopStatusResult {
|
|
15
|
-
success: boolean;
|
|
16
|
-
status: 'active' | 'partial' | 'inactive';
|
|
17
|
-
processes: Record<string, DesktopProcessHealth>;
|
|
18
|
-
resolution: [number, number] | null;
|
|
19
|
-
dpi: number | null;
|
|
20
|
-
}
|
|
21
|
-
interface DesktopProcessHealth {
|
|
22
|
-
running: boolean;
|
|
23
|
-
pid?: number;
|
|
24
|
-
uptime?: number;
|
|
25
|
-
}
|
|
26
|
-
type DesktopImageFormat = 'png' | 'jpeg' | 'webp';
|
|
27
|
-
interface DesktopScreenshotOptions {
|
|
28
|
-
/**
|
|
29
|
-
* How the SDK returns the screenshot payload to the caller.
|
|
30
|
-
* - `'base64'` (default): `data` is a base64-encoded string (also the wire format).
|
|
31
|
-
* - `'bytes'`: client-side convenience that base64-decodes the wire payload
|
|
32
|
-
* into a `Uint8Array` before returning. The wire/server contract is
|
|
33
|
-
* always base64.
|
|
34
|
-
*/
|
|
35
|
-
format?: 'base64' | 'bytes';
|
|
36
|
-
imageFormat?: DesktopImageFormat;
|
|
37
|
-
quality?: number;
|
|
38
|
-
showCursor?: boolean;
|
|
39
|
-
}
|
|
40
|
-
interface DesktopScreenshotRegion {
|
|
41
|
-
x: number;
|
|
42
|
-
y: number;
|
|
43
|
-
width: number;
|
|
44
|
-
height: number;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Screenshot payload returned to the SDK caller when `format` is `'base64'`
|
|
48
|
-
* (the default). Matches the wire shape sent by the container.
|
|
49
|
-
*/
|
|
50
|
-
interface DesktopScreenshotResult {
|
|
51
|
-
success: boolean;
|
|
52
|
-
data: string;
|
|
53
|
-
imageFormat: DesktopImageFormat;
|
|
54
|
-
width: number;
|
|
55
|
-
height: number;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Screenshot payload returned to the SDK caller when `format: 'bytes'` is
|
|
59
|
-
* requested. The SDK client decodes the base64 wire payload into a
|
|
60
|
-
* `Uint8Array`; the server/wire contract is unchanged.
|
|
61
|
-
*/
|
|
62
|
-
interface DesktopScreenshotBytesResult extends Omit<DesktopScreenshotResult, 'data'> {
|
|
63
|
-
data: Uint8Array;
|
|
64
|
-
}
|
|
65
|
-
type DesktopMouseButton = 'left' | 'right' | 'middle';
|
|
66
|
-
type DesktopScrollDirection = 'up' | 'down' | 'left' | 'right';
|
|
67
|
-
interface DesktopCursorPosition {
|
|
68
|
-
success: boolean;
|
|
69
|
-
x: number;
|
|
70
|
-
y: number;
|
|
71
|
-
}
|
|
72
|
-
interface DesktopScreenSize {
|
|
73
|
-
success: boolean;
|
|
74
|
-
width: number;
|
|
75
|
-
height: number;
|
|
76
|
-
}
|
|
77
|
-
//#endregion
|
|
78
4
|
//#region ../shared/dist/logger/types.d.ts
|
|
5
|
+
|
|
79
6
|
type LogComponent = 'container' | 'sandbox-do' | 'executor';
|
|
80
7
|
/**
|
|
81
8
|
* Context metadata included in every log entry
|
|
@@ -1391,6 +1318,15 @@ interface RemoteMountBucketOptions {
|
|
|
1391
1318
|
* Must start with '/' (e.g., '/workspaces/project123' or '/data/uploads/')
|
|
1392
1319
|
*/
|
|
1393
1320
|
prefix?: string;
|
|
1321
|
+
/**
|
|
1322
|
+
* Keep real credentials in the Durable Object; write dummy credentials into
|
|
1323
|
+
* the container-side s3fs password file. Outbound s3fs requests are
|
|
1324
|
+
* intercepted by the DO, signed with real credentials, and forwarded to the
|
|
1325
|
+
* configured endpoint.
|
|
1326
|
+
*
|
|
1327
|
+
* Default: false (real credentials are written into the container)
|
|
1328
|
+
*/
|
|
1329
|
+
credentialProxy?: boolean;
|
|
1394
1330
|
}
|
|
1395
1331
|
/**
|
|
1396
1332
|
* Options for mounting a local R2 binding via bidirectional sync (local dev)
|
|
@@ -1752,56 +1688,6 @@ interface SandboxBackupAPI {
|
|
|
1752
1688
|
sessionId?: string;
|
|
1753
1689
|
}): Promise<UploadPartsResponse>;
|
|
1754
1690
|
}
|
|
1755
|
-
interface SandboxDesktopAPI {
|
|
1756
|
-
start(options?: {
|
|
1757
|
-
resolution?: [number, number];
|
|
1758
|
-
dpi?: number;
|
|
1759
|
-
}): Promise<DesktopStartResult>;
|
|
1760
|
-
stop(): Promise<DesktopStopResult>;
|
|
1761
|
-
status(): Promise<DesktopStatusResult>;
|
|
1762
|
-
screenshot(options?: DesktopScreenshotOptions & {
|
|
1763
|
-
format?: 'base64';
|
|
1764
|
-
}): Promise<DesktopScreenshotResult>;
|
|
1765
|
-
screenshot(options: DesktopScreenshotOptions & {
|
|
1766
|
-
format: 'bytes';
|
|
1767
|
-
}): Promise<DesktopScreenshotBytesResult>;
|
|
1768
|
-
screenshot(options?: DesktopScreenshotOptions): Promise<DesktopScreenshotResult | DesktopScreenshotBytesResult>;
|
|
1769
|
-
screenshotRegion(region: DesktopScreenshotRegion, options?: DesktopScreenshotOptions & {
|
|
1770
|
-
format?: 'base64';
|
|
1771
|
-
}): Promise<DesktopScreenshotResult>;
|
|
1772
|
-
screenshotRegion(region: DesktopScreenshotRegion, options: DesktopScreenshotOptions & {
|
|
1773
|
-
format: 'bytes';
|
|
1774
|
-
}): Promise<DesktopScreenshotBytesResult>;
|
|
1775
|
-
screenshotRegion(region: DesktopScreenshotRegion, options?: DesktopScreenshotOptions): Promise<DesktopScreenshotResult | DesktopScreenshotBytesResult>;
|
|
1776
|
-
click(x: number, y: number, options?: {
|
|
1777
|
-
button?: DesktopMouseButton;
|
|
1778
|
-
clickCount?: number;
|
|
1779
|
-
}): Promise<void>;
|
|
1780
|
-
doubleClick(x: number, y: number): Promise<void>;
|
|
1781
|
-
tripleClick(x: number, y: number): Promise<void>;
|
|
1782
|
-
rightClick(x: number, y: number): Promise<void>;
|
|
1783
|
-
middleClick(x: number, y: number): Promise<void>;
|
|
1784
|
-
mouseDown(x?: number, y?: number, options?: {
|
|
1785
|
-
button?: DesktopMouseButton;
|
|
1786
|
-
}): Promise<void>;
|
|
1787
|
-
mouseUp(x?: number, y?: number, options?: {
|
|
1788
|
-
button?: DesktopMouseButton;
|
|
1789
|
-
}): Promise<void>;
|
|
1790
|
-
moveMouse(x: number, y: number): Promise<void>;
|
|
1791
|
-
drag(startX: number, startY: number, endX: number, endY: number, options?: {
|
|
1792
|
-
button?: DesktopMouseButton;
|
|
1793
|
-
}): Promise<void>;
|
|
1794
|
-
scroll(x: number, y: number, direction: DesktopScrollDirection, amount?: number): Promise<void>;
|
|
1795
|
-
getCursorPosition(): Promise<DesktopCursorPosition>;
|
|
1796
|
-
type(text: string, options?: {
|
|
1797
|
-
delayMs?: number;
|
|
1798
|
-
}): Promise<void>;
|
|
1799
|
-
press(key: string): Promise<void>;
|
|
1800
|
-
keyDown(key: string): Promise<void>;
|
|
1801
|
-
keyUp(key: string): Promise<void>;
|
|
1802
|
-
getScreenSize(): Promise<DesktopScreenSize>;
|
|
1803
|
-
getProcessStatus(name: string): Promise<DesktopProcessHealth>;
|
|
1804
|
-
}
|
|
1805
1691
|
interface SandboxWatchAPI {
|
|
1806
1692
|
watch(request: WatchRequest): Promise<ReadableStream<Uint8Array>>;
|
|
1807
1693
|
checkChanges(request: CheckChangesRequest): Promise<CheckChangesResult>;
|
|
@@ -2140,217 +2026,6 @@ declare class CommandClient extends BaseHttpClient implements SandboxCommandsAPI
|
|
|
2140
2026
|
}): Promise<ReadableStream<Uint8Array>>;
|
|
2141
2027
|
}
|
|
2142
2028
|
//#endregion
|
|
2143
|
-
//#region src/clients/desktop-client.d.ts
|
|
2144
|
-
interface DesktopStartOptions {
|
|
2145
|
-
resolution?: [number, number];
|
|
2146
|
-
dpi?: number;
|
|
2147
|
-
}
|
|
2148
|
-
interface ScreenshotOptions {
|
|
2149
|
-
format?: 'base64' | 'bytes';
|
|
2150
|
-
imageFormat?: 'png' | 'jpeg' | 'webp';
|
|
2151
|
-
quality?: number;
|
|
2152
|
-
showCursor?: boolean;
|
|
2153
|
-
}
|
|
2154
|
-
interface ScreenshotRegion {
|
|
2155
|
-
x: number;
|
|
2156
|
-
y: number;
|
|
2157
|
-
width: number;
|
|
2158
|
-
height: number;
|
|
2159
|
-
}
|
|
2160
|
-
interface ClickOptions {
|
|
2161
|
-
button?: 'left' | 'right' | 'middle';
|
|
2162
|
-
}
|
|
2163
|
-
type ScrollDirection = 'up' | 'down' | 'left' | 'right';
|
|
2164
|
-
type KeyInput = string;
|
|
2165
|
-
interface TypeOptions {
|
|
2166
|
-
delayMs?: number;
|
|
2167
|
-
}
|
|
2168
|
-
interface DesktopStartResponse extends BaseApiResponse {
|
|
2169
|
-
resolution: [number, number];
|
|
2170
|
-
dpi: number;
|
|
2171
|
-
}
|
|
2172
|
-
interface DesktopStopResponse extends BaseApiResponse {}
|
|
2173
|
-
interface DesktopStatusResponse extends BaseApiResponse {
|
|
2174
|
-
status: 'active' | 'partial' | 'inactive';
|
|
2175
|
-
processes: Record<string, {
|
|
2176
|
-
running: boolean;
|
|
2177
|
-
pid?: number;
|
|
2178
|
-
uptime?: number;
|
|
2179
|
-
}>;
|
|
2180
|
-
resolution: [number, number] | null;
|
|
2181
|
-
dpi: number | null;
|
|
2182
|
-
}
|
|
2183
|
-
interface ScreenshotResponse extends BaseApiResponse {
|
|
2184
|
-
data: string;
|
|
2185
|
-
imageFormat: 'png' | 'jpeg' | 'webp';
|
|
2186
|
-
width: number;
|
|
2187
|
-
height: number;
|
|
2188
|
-
}
|
|
2189
|
-
interface ScreenshotBytesResponse extends BaseApiResponse {
|
|
2190
|
-
data: Uint8Array;
|
|
2191
|
-
imageFormat: 'png' | 'jpeg' | 'webp';
|
|
2192
|
-
width: number;
|
|
2193
|
-
height: number;
|
|
2194
|
-
}
|
|
2195
|
-
interface CursorPositionResponse extends BaseApiResponse {
|
|
2196
|
-
x: number;
|
|
2197
|
-
y: number;
|
|
2198
|
-
}
|
|
2199
|
-
interface ScreenSizeResponse extends BaseApiResponse {
|
|
2200
|
-
width: number;
|
|
2201
|
-
height: number;
|
|
2202
|
-
}
|
|
2203
|
-
/**
|
|
2204
|
-
* Public interface for desktop operations.
|
|
2205
|
-
* Returned by `sandbox.desktop` via an RpcTarget wrapper so that pipelined
|
|
2206
|
-
* method calls work across the Durable Object RPC boundary.
|
|
2207
|
-
*/
|
|
2208
|
-
interface Desktop {
|
|
2209
|
-
start(options?: DesktopStartOptions): Promise<DesktopStartResponse>;
|
|
2210
|
-
stop(): Promise<DesktopStopResponse>;
|
|
2211
|
-
status(): Promise<DesktopStatusResponse>;
|
|
2212
|
-
screenshot(options?: ScreenshotOptions & {
|
|
2213
|
-
format?: 'base64';
|
|
2214
|
-
}): Promise<ScreenshotResponse>;
|
|
2215
|
-
screenshot(options: ScreenshotOptions & {
|
|
2216
|
-
format: 'bytes';
|
|
2217
|
-
}): Promise<ScreenshotBytesResponse>;
|
|
2218
|
-
screenshot(options?: ScreenshotOptions): Promise<ScreenshotResponse | ScreenshotBytesResponse>;
|
|
2219
|
-
screenshotRegion(region: ScreenshotRegion, options?: ScreenshotOptions & {
|
|
2220
|
-
format?: 'base64';
|
|
2221
|
-
}): Promise<ScreenshotResponse>;
|
|
2222
|
-
screenshotRegion(region: ScreenshotRegion, options: ScreenshotOptions & {
|
|
2223
|
-
format: 'bytes';
|
|
2224
|
-
}): Promise<ScreenshotBytesResponse>;
|
|
2225
|
-
screenshotRegion(region: ScreenshotRegion, options?: ScreenshotOptions): Promise<ScreenshotResponse | ScreenshotBytesResponse>;
|
|
2226
|
-
click(x: number, y: number, options?: ClickOptions): Promise<void>;
|
|
2227
|
-
doubleClick(x: number, y: number, options?: ClickOptions): Promise<void>;
|
|
2228
|
-
tripleClick(x: number, y: number, options?: ClickOptions): Promise<void>;
|
|
2229
|
-
rightClick(x: number, y: number): Promise<void>;
|
|
2230
|
-
middleClick(x: number, y: number): Promise<void>;
|
|
2231
|
-
mouseDown(x?: number, y?: number, options?: ClickOptions): Promise<void>;
|
|
2232
|
-
mouseUp(x?: number, y?: number, options?: ClickOptions): Promise<void>;
|
|
2233
|
-
moveMouse(x: number, y: number): Promise<void>;
|
|
2234
|
-
drag(startX: number, startY: number, endX: number, endY: number, options?: ClickOptions): Promise<void>;
|
|
2235
|
-
scroll(x: number, y: number, direction: ScrollDirection, amount?: number): Promise<void>;
|
|
2236
|
-
getCursorPosition(): Promise<CursorPositionResponse>;
|
|
2237
|
-
type(text: string, options?: TypeOptions): Promise<void>;
|
|
2238
|
-
press(key: KeyInput): Promise<void>;
|
|
2239
|
-
keyDown(key: KeyInput): Promise<void>;
|
|
2240
|
-
keyUp(key: KeyInput): Promise<void>;
|
|
2241
|
-
getScreenSize(): Promise<ScreenSizeResponse>;
|
|
2242
|
-
getProcessStatus(name: string): Promise<DesktopProcessHealth>;
|
|
2243
|
-
}
|
|
2244
|
-
/**
|
|
2245
|
-
* Client for desktop environment lifecycle, input, and screen operations
|
|
2246
|
-
*/
|
|
2247
|
-
declare class DesktopClient extends BaseHttpClient implements SandboxDesktopAPI {
|
|
2248
|
-
/**
|
|
2249
|
-
* Start the desktop environment with optional resolution and DPI.
|
|
2250
|
-
*/
|
|
2251
|
-
start(options?: DesktopStartOptions): Promise<DesktopStartResponse>;
|
|
2252
|
-
/**
|
|
2253
|
-
* Stop the desktop environment and all related processes.
|
|
2254
|
-
*/
|
|
2255
|
-
stop(): Promise<DesktopStopResponse>;
|
|
2256
|
-
/**
|
|
2257
|
-
* Get desktop lifecycle and process health status.
|
|
2258
|
-
*/
|
|
2259
|
-
status(): Promise<DesktopStatusResponse>;
|
|
2260
|
-
/**
|
|
2261
|
-
* Capture a full-screen screenshot as base64 (default).
|
|
2262
|
-
*/
|
|
2263
|
-
screenshot(options?: ScreenshotOptions & {
|
|
2264
|
-
format?: 'base64';
|
|
2265
|
-
}): Promise<ScreenshotResponse>;
|
|
2266
|
-
/**
|
|
2267
|
-
* Capture a full-screen screenshot as bytes.
|
|
2268
|
-
*/
|
|
2269
|
-
screenshot(options: ScreenshotOptions & {
|
|
2270
|
-
format: 'bytes';
|
|
2271
|
-
}): Promise<ScreenshotBytesResponse>;
|
|
2272
|
-
/**
|
|
2273
|
-
* Capture a region screenshot as base64 (default).
|
|
2274
|
-
*/
|
|
2275
|
-
screenshotRegion(region: ScreenshotRegion, options?: ScreenshotOptions & {
|
|
2276
|
-
format?: 'base64';
|
|
2277
|
-
}): Promise<ScreenshotResponse>;
|
|
2278
|
-
/**
|
|
2279
|
-
* Capture a region screenshot as bytes.
|
|
2280
|
-
*/
|
|
2281
|
-
screenshotRegion(region: ScreenshotRegion, options: ScreenshotOptions & {
|
|
2282
|
-
format: 'bytes';
|
|
2283
|
-
}): Promise<ScreenshotBytesResponse>;
|
|
2284
|
-
/**
|
|
2285
|
-
* Single-click at the given coordinates.
|
|
2286
|
-
*/
|
|
2287
|
-
click(x: number, y: number, options?: ClickOptions): Promise<void>;
|
|
2288
|
-
/**
|
|
2289
|
-
* Double-click at the given coordinates.
|
|
2290
|
-
*/
|
|
2291
|
-
doubleClick(x: number, y: number, options?: ClickOptions): Promise<void>;
|
|
2292
|
-
/**
|
|
2293
|
-
* Triple-click at the given coordinates.
|
|
2294
|
-
*/
|
|
2295
|
-
tripleClick(x: number, y: number, options?: ClickOptions): Promise<void>;
|
|
2296
|
-
/**
|
|
2297
|
-
* Right-click at the given coordinates.
|
|
2298
|
-
*/
|
|
2299
|
-
rightClick(x: number, y: number): Promise<void>;
|
|
2300
|
-
/**
|
|
2301
|
-
* Middle-click at the given coordinates.
|
|
2302
|
-
*/
|
|
2303
|
-
middleClick(x: number, y: number): Promise<void>;
|
|
2304
|
-
/**
|
|
2305
|
-
* Press and hold a mouse button.
|
|
2306
|
-
*/
|
|
2307
|
-
mouseDown(x?: number, y?: number, options?: ClickOptions): Promise<void>;
|
|
2308
|
-
/**
|
|
2309
|
-
* Release a held mouse button.
|
|
2310
|
-
*/
|
|
2311
|
-
mouseUp(x?: number, y?: number, options?: ClickOptions): Promise<void>;
|
|
2312
|
-
/**
|
|
2313
|
-
* Move the mouse cursor to coordinates.
|
|
2314
|
-
*/
|
|
2315
|
-
moveMouse(x: number, y: number): Promise<void>;
|
|
2316
|
-
/**
|
|
2317
|
-
* Drag from start coordinates to end coordinates.
|
|
2318
|
-
*/
|
|
2319
|
-
drag(startX: number, startY: number, endX: number, endY: number, options?: ClickOptions): Promise<void>;
|
|
2320
|
-
/**
|
|
2321
|
-
* Scroll at coordinates in the specified direction.
|
|
2322
|
-
*/
|
|
2323
|
-
scroll(x: number, y: number, direction: ScrollDirection, amount?: number): Promise<void>;
|
|
2324
|
-
/**
|
|
2325
|
-
* Get the current cursor coordinates.
|
|
2326
|
-
*/
|
|
2327
|
-
getCursorPosition(): Promise<CursorPositionResponse>;
|
|
2328
|
-
/**
|
|
2329
|
-
* Type text into the focused element.
|
|
2330
|
-
*/
|
|
2331
|
-
type(text: string, options?: TypeOptions): Promise<void>;
|
|
2332
|
-
/**
|
|
2333
|
-
* Press and release a key or key combination.
|
|
2334
|
-
*/
|
|
2335
|
-
press(key: KeyInput): Promise<void>;
|
|
2336
|
-
/**
|
|
2337
|
-
* Press and hold a key.
|
|
2338
|
-
*/
|
|
2339
|
-
keyDown(key: KeyInput): Promise<void>;
|
|
2340
|
-
/**
|
|
2341
|
-
* Release a held key.
|
|
2342
|
-
*/
|
|
2343
|
-
keyUp(key: KeyInput): Promise<void>;
|
|
2344
|
-
/**
|
|
2345
|
-
* Get the active desktop screen size.
|
|
2346
|
-
*/
|
|
2347
|
-
getScreenSize(): Promise<ScreenSizeResponse>;
|
|
2348
|
-
/**
|
|
2349
|
-
* Get health status for a specific desktop process.
|
|
2350
|
-
*/
|
|
2351
|
-
getProcessStatus(name: string): Promise<DesktopProcessHealth>;
|
|
2352
|
-
}
|
|
2353
|
-
//#endregion
|
|
2354
2029
|
//#region src/clients/file-client.d.ts
|
|
2355
2030
|
/**
|
|
2356
2031
|
* Request interface for creating directories
|
|
@@ -2730,7 +2405,6 @@ declare class SandboxClient {
|
|
|
2730
2405
|
readonly git: GitClient;
|
|
2731
2406
|
readonly interpreter: InterpreterClient;
|
|
2732
2407
|
readonly utils: UtilityClient;
|
|
2733
|
-
readonly desktop: DesktopClient;
|
|
2734
2408
|
readonly watch: WatchClient;
|
|
2735
2409
|
/**
|
|
2736
2410
|
* Tunnels are RPC-only — the route-based transport does not implement them.
|
|
@@ -2896,7 +2570,6 @@ declare class ContainerControlClient {
|
|
|
2896
2570
|
get git(): SandboxGitAPI;
|
|
2897
2571
|
get utils(): SandboxUtilsAPI;
|
|
2898
2572
|
get backup(): SandboxBackupAPI;
|
|
2899
|
-
get desktop(): SandboxDesktopAPI;
|
|
2900
2573
|
get watch(): SandboxWatchAPI;
|
|
2901
2574
|
get tunnels(): SandboxTunnelsAPI;
|
|
2902
2575
|
get interpreter(): SandboxInterpreterAPI;
|
|
@@ -2930,6 +2603,18 @@ type SandboxConfiguration = {
|
|
|
2930
2603
|
containerTimeouts?: NonNullable<SandboxOptions['containerTimeouts']>;
|
|
2931
2604
|
transport?: SandboxTransport;
|
|
2932
2605
|
};
|
|
2606
|
+
/**
|
|
2607
|
+
* SDK-level ContainerProxy that directly dispatches SDK-internal mount hosts
|
|
2608
|
+
* (r2.internal, s3-credential-proxy.internal) without relying on
|
|
2609
|
+
* outboundHandlersRegistry lookups, which are NOT shared between the Durable
|
|
2610
|
+
* Object's execution context and the ContainerProxy WorkerEntrypoint context.
|
|
2611
|
+
*
|
|
2612
|
+
* Users must export this class from their Worker entrypoint so the Sandbox DO
|
|
2613
|
+
* can create outbound-interception fetchers that reference it.
|
|
2614
|
+
*/
|
|
2615
|
+
declare class ContainerProxy$1 extends ContainerProxy {
|
|
2616
|
+
fetch(request: Request): Promise<Response>;
|
|
2617
|
+
}
|
|
2933
2618
|
declare function getSandbox<T extends Sandbox<any>>(ns: DurableObjectNamespace<T>, id: string, options?: SandboxOptions): T;
|
|
2934
2619
|
declare class Sandbox<Env = unknown> extends Container<Env> implements ISandbox {
|
|
2935
2620
|
defaultPort: number;
|
|
@@ -2949,6 +2634,7 @@ declare class Sandbox<Env = unknown> extends Container<Env> implements ISandbox
|
|
|
2949
2634
|
private logger;
|
|
2950
2635
|
private keepAliveEnabled;
|
|
2951
2636
|
private activeMounts;
|
|
2637
|
+
private mountOperationQueue;
|
|
2952
2638
|
private currentRuntime;
|
|
2953
2639
|
private transport;
|
|
2954
2640
|
/**
|
|
@@ -3010,25 +2696,6 @@ declare class Sandbox<Env = unknown> extends Container<Env> implements ISandbox
|
|
|
3010
2696
|
* env/SDK defaults".
|
|
3011
2697
|
*/
|
|
3012
2698
|
private hasStoredContainerTimeouts;
|
|
3013
|
-
/**
|
|
3014
|
-
* Desktop environment operations.
|
|
3015
|
-
* Within the DO, this getter provides direct access to DesktopClient.
|
|
3016
|
-
* Over RPC, the getSandbox() proxy intercepts this property and routes
|
|
3017
|
-
* calls through callDesktop() instead.
|
|
3018
|
-
*/
|
|
3019
|
-
get desktop(): Desktop;
|
|
3020
|
-
/**
|
|
3021
|
-
* Allowed desktop methods — derived from the Desktop interface.
|
|
3022
|
-
* Restricts callDesktop() to a known set of operations.
|
|
3023
|
-
*/
|
|
3024
|
-
private static readonly DESKTOP_METHODS;
|
|
3025
|
-
/**
|
|
3026
|
-
* Dispatch method for desktop operations.
|
|
3027
|
-
* Called by the client-side proxy created in getSandbox() to provide
|
|
3028
|
-
* the `sandbox.desktop.status()` API without relying on RPC pipelining
|
|
3029
|
-
* through property getters which is broken when using vite-plugin.
|
|
3030
|
-
*/
|
|
3031
|
-
callDesktop(method: string, args: unknown[]): Promise<unknown>;
|
|
3032
2699
|
/**
|
|
3033
2700
|
* Dispatch method for tunnel operations.
|
|
3034
2701
|
* Called by the client-side proxy created in getSandbox() to provide
|
|
@@ -3081,12 +2748,16 @@ declare class Sandbox<Env = unknown> extends Container<Env> implements ISandbox
|
|
|
3081
2748
|
* @throws InvalidMountConfigError if bucket name, mount path, or endpoint is invalid
|
|
3082
2749
|
*/
|
|
3083
2750
|
mountBucket(bucket: string, mountPath: string, options: MountBucketOptions): Promise<void>;
|
|
2751
|
+
private runMountOperation;
|
|
2752
|
+
private mountBucketUnlocked;
|
|
3084
2753
|
/**
|
|
3085
2754
|
* Local dev mount: bidirectional sync via R2 binding + file/watch APIs
|
|
3086
2755
|
*/
|
|
3087
2756
|
private mountBucketLocal;
|
|
3088
2757
|
private getR2EgressParams;
|
|
3089
|
-
private
|
|
2758
|
+
private validateProtectedS3fsOptions;
|
|
2759
|
+
private getS3CredentialProxyParams;
|
|
2760
|
+
private resolveCredentialProxyAuthStrategy;
|
|
3090
2761
|
/**
|
|
3091
2762
|
* Credential-less R2 mount: egress interception routes s3fs requests to the
|
|
3092
2763
|
* R2 binding. No S3 credentials are needed in the container or Worker env.
|
|
@@ -3103,6 +2774,7 @@ declare class Sandbox<Env = unknown> extends Container<Env> implements ISandbox
|
|
|
3103
2774
|
* @throws InvalidMountConfigError if mount path doesn't exist or isn't mounted
|
|
3104
2775
|
*/
|
|
3105
2776
|
unmountBucket(mountPath: string): Promise<void>;
|
|
2777
|
+
private unmountBucketUnlocked;
|
|
3106
2778
|
/**
|
|
3107
2779
|
* Shared validation for mount path (absolute, not already in use).
|
|
3108
2780
|
*/
|
|
@@ -3115,6 +2787,15 @@ declare class Sandbox<Env = unknown> extends Container<Env> implements ISandbox
|
|
|
3115
2787
|
* Generate unique password file path for s3fs credentials
|
|
3116
2788
|
*/
|
|
3117
2789
|
private generatePasswordFilePath;
|
|
2790
|
+
/**
|
|
2791
|
+
* Generate unique ahbe_conf file path for s3fs additional header config
|
|
2792
|
+
*/
|
|
2793
|
+
private generateS3FSAdditionalHeaderFilePath;
|
|
2794
|
+
/**
|
|
2795
|
+
* Create s3fs ahbe_conf file that suppresses the Expect: 100-continue header.
|
|
2796
|
+
* Restricted to 0600 so s3fs will accept it (same requirement as passwd files).
|
|
2797
|
+
*/
|
|
2798
|
+
private createDisableExpectHeaderFile;
|
|
3118
2799
|
/**
|
|
3119
2800
|
* Create password file with s3fs credentials
|
|
3120
2801
|
* Format: bucket:accessKeyId:secretAccessKey
|
|
@@ -3124,6 +2805,7 @@ declare class Sandbox<Env = unknown> extends Container<Env> implements ISandbox
|
|
|
3124
2805
|
* Delete password file
|
|
3125
2806
|
*/
|
|
3126
2807
|
private deletePasswordFile;
|
|
2808
|
+
private deleteAdditionalHeaderFile;
|
|
3127
2809
|
/**
|
|
3128
2810
|
* Execute S3FS mount command
|
|
3129
2811
|
*/
|
|
@@ -3402,23 +3084,6 @@ declare class Sandbox<Env = unknown> extends Container<Env> implements ISandbox
|
|
|
3402
3084
|
}): Promise<ReadableStream<Uint8Array>>;
|
|
3403
3085
|
listFiles(path: string, options?: ListFilesOptions): Promise<ListFilesResult>;
|
|
3404
3086
|
exists(path: string, sessionId?: string): Promise<FileExistsResult>;
|
|
3405
|
-
/**
|
|
3406
|
-
* Get the noVNC preview URL for browser-based desktop viewing.
|
|
3407
|
-
* Confirms desktop is active, then uses exposePort() to generate
|
|
3408
|
-
* a token-authenticated preview URL for the noVNC port (6080).
|
|
3409
|
-
*
|
|
3410
|
-
* @param hostname - The custom domain hostname for preview URLs
|
|
3411
|
-
* (e.g., 'preview.example.com'). Required because preview URLs
|
|
3412
|
-
* use subdomain patterns that .workers.dev doesn't support.
|
|
3413
|
-
* @param options - Optional settings
|
|
3414
|
-
* @param options.token - Reuse an existing token instead of generating a new one
|
|
3415
|
-
* @returns The authenticated noVNC preview URL
|
|
3416
|
-
*/
|
|
3417
|
-
getDesktopStreamUrl(hostname: string, options?: {
|
|
3418
|
-
token?: string;
|
|
3419
|
-
}): Promise<{
|
|
3420
|
-
url: string;
|
|
3421
|
-
}>;
|
|
3422
3087
|
/**
|
|
3423
3088
|
* Watch a directory for file system changes using native inotify.
|
|
3424
3089
|
*
|
|
@@ -3758,7 +3423,8 @@ declare class Sandbox<Env = unknown> extends Container<Env> implements ISandbox
|
|
|
3758
3423
|
*/
|
|
3759
3424
|
private doRestoreBackupLocal;
|
|
3760
3425
|
private configureR2EgressOutbound;
|
|
3426
|
+
private configureS3CredentialProxyOutbound;
|
|
3761
3427
|
}
|
|
3762
3428
|
//#endregion
|
|
3763
|
-
export {
|
|
3764
|
-
//# sourceMappingURL=sandbox-
|
|
3429
|
+
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
|