@sylphx/sdk 0.28.0 → 0.30.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/LICENSE +21 -0
- package/README.md +30 -118
- package/dist/access.d.ts +659 -0
- package/dist/access.js +638 -0
- package/dist/access.js.map +1 -0
- package/dist/ai.d.ts +176 -0
- package/dist/ai.js +112 -0
- package/dist/ai.js.map +1 -0
- package/dist/artifacts.d.ts +165 -0
- package/dist/artifacts.js +129 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/auth.d.ts +896 -0
- package/dist/auth.js +828 -0
- package/dist/auth.js.map +1 -0
- package/dist/billing.d.ts +758 -0
- package/dist/billing.js +553 -0
- package/dist/billing.js.map +1 -0
- package/dist/broker.d.ts +226 -0
- package/dist/broker.js +187 -0
- package/dist/broker.js.map +1 -0
- package/dist/build.d.ts +313 -0
- package/dist/build.js +271 -0
- package/dist/build.js.map +1 -0
- package/dist/common.d.ts +162 -0
- package/dist/common.js +41 -0
- package/dist/common.js.map +1 -0
- package/dist/config.d.ts +198 -0
- package/dist/config.js +168 -0
- package/dist/config.js.map +1 -0
- package/dist/connections.d.ts +354 -0
- package/dist/connections.js +313 -0
- package/dist/connections.js.map +1 -0
- package/dist/data.d.ts +858 -0
- package/dist/data.js +814 -0
- package/dist/data.js.map +1 -0
- package/dist/entitlement.d.ts +172 -0
- package/dist/entitlement.js +116 -0
- package/dist/entitlement.js.map +1 -0
- package/dist/events.d.ts +1324 -0
- package/dist/events.js +1227 -0
- package/dist/events.js.map +1 -0
- package/dist/hosting.d.ts +709 -0
- package/dist/hosting.js +611 -0
- package/dist/hosting.js.map +1 -0
- package/dist/index.d.ts +79 -33656
- package/dist/index.js +113 -0
- package/dist/index.js.map +1 -0
- package/dist/keys.d.ts +438 -0
- package/dist/keys.js +406 -0
- package/dist/keys.js.map +1 -0
- package/dist/methods.d.ts +2 -0
- package/dist/methods.js +3995 -0
- package/dist/methods.js.map +1 -0
- package/dist/network.d.ts +733 -0
- package/dist/network.js +711 -0
- package/dist/network.js.map +1 -0
- package/dist/notify.d.ts +1359 -0
- package/dist/notify.js +1282 -0
- package/dist/notify.js.map +1 -0
- package/dist/observability.d.ts +509 -0
- package/dist/observability.js +437 -0
- package/dist/observability.js.map +1 -0
- package/dist/release.d.ts +303 -0
- package/dist/release.js +214 -0
- package/dist/release.js.map +1 -0
- package/dist/runners.d.ts +262 -0
- package/dist/runners.js +238 -0
- package/dist/runners.js.map +1 -0
- package/dist/runtime.d.ts +88 -0
- package/dist/runtime.js +226 -0
- package/dist/runtime.js.map +1 -0
- package/dist/sandboxes.d.ts +1705 -0
- package/dist/sandboxes.js +1226 -0
- package/dist/sandboxes.js.map +1 -0
- package/dist/secrets.d.ts +508 -0
- package/dist/secrets.js +474 -0
- package/dist/secrets.js.map +1 -0
- package/dist/workflows.d.ts +678 -0
- package/dist/workflows.js +595 -0
- package/dist/workflows.js.map +1 -0
- package/package.json +33 -112
- package/dist/connect.d.ts +0 -2838
- package/dist/connect.mjs +0 -220
- package/dist/connect.mjs.map +0 -1
- package/dist/health/index.d.ts +0 -1394
- package/dist/health/index.mjs +0 -1394
- package/dist/health/index.mjs.map +0 -1
- package/dist/index.mjs +0 -38429
- package/dist/index.mjs.map +0 -1
- package/dist/nextjs/index.d.ts +0 -724
- package/dist/nextjs/index.mjs +0 -3332
- package/dist/nextjs/index.mjs.map +0 -1
- package/dist/react/index.d.ts +0 -13066
- package/dist/react/index.mjs +0 -35329
- package/dist/react/index.mjs.map +0 -1
- package/dist/server/index.d.ts +0 -2000
- package/dist/server/index.mjs +0 -3446
- package/dist/server/index.mjs.map +0 -1
- package/dist/web-analytics.d.ts +0 -90
- package/dist/web-analytics.mjs +0 -225
- package/dist/web-analytics.mjs.map +0 -1
|
@@ -0,0 +1,1705 @@
|
|
|
1
|
+
import * as runtime from './runtime.js';
|
|
2
|
+
import './common.js';
|
|
3
|
+
import type * as common from './common.js';
|
|
4
|
+
/** The request of AcquireLeaseControl. */
|
|
5
|
+
export interface AcquireLeaseControlRequest {
|
|
6
|
+
/** The name of the lease. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** HUMAN or AGENT. */
|
|
9
|
+
holder: ControlHolder;
|
|
10
|
+
/** How long; default 10 minutes, capped at 30 minutes in the Cell. */
|
|
11
|
+
ttl?: string;
|
|
12
|
+
/**
|
|
13
|
+
* A label for the holder, for example the person's user id; recorded in
|
|
14
|
+
* the audit events.
|
|
15
|
+
*/
|
|
16
|
+
holderLabel?: string;
|
|
17
|
+
/** For HUMAN: take control from another human. */
|
|
18
|
+
preempt?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** The response of AcquireLeaseControl. */
|
|
21
|
+
export interface AcquireLeaseControlResponse {
|
|
22
|
+
/** The control now held. */
|
|
23
|
+
control?: ControlState;
|
|
24
|
+
/** For HUMAN: the controller stream bound to this epoch. */
|
|
25
|
+
stream?: StreamSession;
|
|
26
|
+
}
|
|
27
|
+
/** The request of ActLease. */
|
|
28
|
+
export interface ActLeaseRequest {
|
|
29
|
+
/** The name of the lease. */
|
|
30
|
+
name: string;
|
|
31
|
+
/**
|
|
32
|
+
* The actions, performed in order; at most 64. An empty list with
|
|
33
|
+
* `screenshot` set only takes a screenshot.
|
|
34
|
+
*/
|
|
35
|
+
actions?: ComputerAction[];
|
|
36
|
+
/** Take a screenshot after the last action and return it. */
|
|
37
|
+
screenshot?: ScreenshotOptions;
|
|
38
|
+
/**
|
|
39
|
+
* Refuse STALE_GENERATION unless the lease is at this generation; 0 skips
|
|
40
|
+
* the check.
|
|
41
|
+
*/
|
|
42
|
+
leaseGeneration?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Act under this AGENT control epoch; 0 acts only while nobody holds
|
|
45
|
+
* control.
|
|
46
|
+
*/
|
|
47
|
+
controlEpoch?: string;
|
|
48
|
+
}
|
|
49
|
+
/** The response of ActLease. */
|
|
50
|
+
export interface ActLeaseResponse {
|
|
51
|
+
/** One result per action, in order. */
|
|
52
|
+
results?: ActionResult[];
|
|
53
|
+
/** The screenshot after the last action, when requested. */
|
|
54
|
+
screenshot?: Screenshot;
|
|
55
|
+
/** The lease generation the actions ran under. */
|
|
56
|
+
leaseGeneration?: string;
|
|
57
|
+
/** The control the actions ran under. */
|
|
58
|
+
control?: ControlState;
|
|
59
|
+
}
|
|
60
|
+
/** ActionResult is the outcome of one ComputerAction. */
|
|
61
|
+
export interface ActionResult {
|
|
62
|
+
/**
|
|
63
|
+
* The pointer position after the action (and the answer of
|
|
64
|
+
* `cursor_position`).
|
|
65
|
+
*/
|
|
66
|
+
cursor?: Point;
|
|
67
|
+
/** For `take_screenshot` and `zoom`. */
|
|
68
|
+
image?: Screenshot;
|
|
69
|
+
}
|
|
70
|
+
/** BrowserSpec configures the Chromium of a BROWSER lease. */
|
|
71
|
+
export interface BrowserSpec {
|
|
72
|
+
/**
|
|
73
|
+
* Run headless instead of on the display. A headless browser has no stream
|
|
74
|
+
* and no computer actions; CDP only.
|
|
75
|
+
*/
|
|
76
|
+
headless?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* The profile directory; put it on a volume to keep cookies and storage
|
|
79
|
+
* across leases. Default a fresh profile.
|
|
80
|
+
*/
|
|
81
|
+
userDataDir?: string;
|
|
82
|
+
/** The page opened at start; default `about:blank`. */
|
|
83
|
+
startUrl?: string;
|
|
84
|
+
}
|
|
85
|
+
/** ButtonAction presses or releases one button. */
|
|
86
|
+
export interface ButtonAction {
|
|
87
|
+
/** Where; unset acts at the current pointer position. */
|
|
88
|
+
position?: Point;
|
|
89
|
+
/** Default LEFT. */
|
|
90
|
+
button?: MouseButton;
|
|
91
|
+
}
|
|
92
|
+
/** ClickAction clicks a button one to three times. */
|
|
93
|
+
export interface ClickAction {
|
|
94
|
+
/** Where; unset clicks at the current pointer position. */
|
|
95
|
+
position?: Point;
|
|
96
|
+
/** Default LEFT. */
|
|
97
|
+
button?: MouseButton;
|
|
98
|
+
/** 1 (default), 2 (double), or 3 (triple). */
|
|
99
|
+
count?: number;
|
|
100
|
+
/**
|
|
101
|
+
* Keys held during the click, xdotool names (`shift`, `ctrl`, `alt`,
|
|
102
|
+
* `super`).
|
|
103
|
+
*/
|
|
104
|
+
modifiers?: string[];
|
|
105
|
+
}
|
|
106
|
+
/** The request of CloseLeasePort. */
|
|
107
|
+
export interface CloseLeasePortRequest {
|
|
108
|
+
/** The name of the lease. */
|
|
109
|
+
name: string;
|
|
110
|
+
/** The guest port. */
|
|
111
|
+
port: number;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* ComputerAction is one input or observation. Coordinates are logical display
|
|
115
|
+
* pixels (`status.display`), origin top-left.
|
|
116
|
+
*/
|
|
117
|
+
export interface ComputerAction {
|
|
118
|
+
/** Capture the display (Anthropic `screenshot`, OpenAI `screenshot`). */
|
|
119
|
+
takeScreenshot?: ScreenshotAction;
|
|
120
|
+
/** Capture a region at full resolution (Anthropic `zoom`). */
|
|
121
|
+
zoom?: ZoomAction;
|
|
122
|
+
/** Move the pointer (Anthropic `mouse_move`, OpenAI `move`). */
|
|
123
|
+
move?: PointerMove;
|
|
124
|
+
/**
|
|
125
|
+
* Click (Anthropic `left_click`, `right_click`, `middle_click`,
|
|
126
|
+
* `double_click`, `triple_click`; OpenAI `click`, `double_click`; Android
|
|
127
|
+
* tap).
|
|
128
|
+
*/
|
|
129
|
+
click?: ClickAction;
|
|
130
|
+
/** Press a button without releasing it (Anthropic `left_mouse_down`). */
|
|
131
|
+
mouseDown?: ButtonAction;
|
|
132
|
+
/** Release a button (Anthropic `left_mouse_up`). */
|
|
133
|
+
mouseUp?: ButtonAction;
|
|
134
|
+
/**
|
|
135
|
+
* Press, move along a path, release (Anthropic `left_click_drag`, OpenAI
|
|
136
|
+
* `drag`; Android swipe).
|
|
137
|
+
*/
|
|
138
|
+
drag?: DragAction;
|
|
139
|
+
/** Scroll (Anthropic `scroll`, OpenAI `scroll`). */
|
|
140
|
+
scroll?: ScrollAction;
|
|
141
|
+
/**
|
|
142
|
+
* Press a key combination (Anthropic `key`, OpenAI `keypress`; Android
|
|
143
|
+
* key events).
|
|
144
|
+
*/
|
|
145
|
+
key?: KeyAction;
|
|
146
|
+
/** Hold a key combination for a duration (Anthropic `hold_key`). */
|
|
147
|
+
holdKey?: HoldKeyAction;
|
|
148
|
+
/** Type text (Anthropic `type`, OpenAI `type`). */
|
|
149
|
+
type?: TypeAction;
|
|
150
|
+
/** Report the pointer position (Anthropic `cursor_position`). */
|
|
151
|
+
cursorPosition?: CursorPositionAction;
|
|
152
|
+
/** Wait (Anthropic `wait`, OpenAI `wait`). */
|
|
153
|
+
wait?: WaitAction;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* ControlState says who holds input control of a lease's display. Control is
|
|
157
|
+
* an exclusive lock with a hard time limit enforced in the Cell. While a
|
|
158
|
+
* HUMAN holds it, agent actions are refused CONTROL_HELD_BY_HUMAN.
|
|
159
|
+
*/
|
|
160
|
+
export interface ControlState {
|
|
161
|
+
/** Who holds control; UNSPECIFIED when nobody does (agent actions allowed). */
|
|
162
|
+
readonly holder?: ControlHolder;
|
|
163
|
+
/** Increases on every acquire; release names it. */
|
|
164
|
+
readonly epoch?: string;
|
|
165
|
+
/** The Access principal that acquired control. */
|
|
166
|
+
readonly principal?: string;
|
|
167
|
+
/** The caller's label for the person or agent, for example a user id. */
|
|
168
|
+
readonly holderLabel?: string;
|
|
169
|
+
/** When control was acquired. */
|
|
170
|
+
readonly acquireTime?: string;
|
|
171
|
+
/** When control lapses unless re-acquired. */
|
|
172
|
+
readonly expireTime?: string;
|
|
173
|
+
}
|
|
174
|
+
/** The request of CreateLease. */
|
|
175
|
+
export interface CreateLeaseRequest {
|
|
176
|
+
/** The parent to create in. */
|
|
177
|
+
parent: string;
|
|
178
|
+
/** The lease to create; only spec and caller-writable metadata are read. */
|
|
179
|
+
lease: Lease;
|
|
180
|
+
/** The id segment of the name; the server assigns one when unset. */
|
|
181
|
+
leaseId?: string;
|
|
182
|
+
/** Validate and return the result without writing anything. */
|
|
183
|
+
validateOnly?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Return as soon as the machine is granted instead of when the guest is
|
|
186
|
+
* ready. Default false: wait for READY, at most 60 seconds.
|
|
187
|
+
*/
|
|
188
|
+
skipWaitReady?: boolean;
|
|
189
|
+
}
|
|
190
|
+
/** The request of CreatePool. */
|
|
191
|
+
export interface CreatePoolRequest {
|
|
192
|
+
/** The parent to create in. */
|
|
193
|
+
parent: string;
|
|
194
|
+
/** The pool to create; only spec and caller-writable metadata are read. */
|
|
195
|
+
pool: Pool;
|
|
196
|
+
/** The id segment of the name; the server assigns one when unset. */
|
|
197
|
+
poolId?: string;
|
|
198
|
+
/** Validate and return the result without writing anything. */
|
|
199
|
+
validateOnly?: boolean;
|
|
200
|
+
}
|
|
201
|
+
/** The request of CreateSnapshot. */
|
|
202
|
+
export interface CreateSnapshotRequest {
|
|
203
|
+
/** The parent to create in. */
|
|
204
|
+
parent: string;
|
|
205
|
+
/** The snapshot to create; only spec and caller-writable metadata are read. */
|
|
206
|
+
snapshot: Snapshot;
|
|
207
|
+
/** The id segment of the name; the server assigns one when unset. */
|
|
208
|
+
snapshotId?: string;
|
|
209
|
+
/** Validate and return the result without writing anything. */
|
|
210
|
+
validateOnly?: boolean;
|
|
211
|
+
}
|
|
212
|
+
/** The request of CreateVolume. */
|
|
213
|
+
export interface CreateVolumeRequest {
|
|
214
|
+
/** The parent to create in. */
|
|
215
|
+
parent: string;
|
|
216
|
+
/** The volume to create; only spec and caller-writable metadata are read. */
|
|
217
|
+
volume: Volume;
|
|
218
|
+
/** The id segment of the name; the server assigns one when unset. */
|
|
219
|
+
volumeId?: string;
|
|
220
|
+
/** Validate and return the result without writing anything. */
|
|
221
|
+
validateOnly?: boolean;
|
|
222
|
+
}
|
|
223
|
+
/** CursorPositionAction reports the pointer position in its result. */
|
|
224
|
+
export interface CursorPositionAction {
|
|
225
|
+
}
|
|
226
|
+
/** The request of DeletePool. */
|
|
227
|
+
export interface DeletePoolRequest {
|
|
228
|
+
/** The name of the pool to delete. */
|
|
229
|
+
name: string;
|
|
230
|
+
/** Delete only if the current etag matches. */
|
|
231
|
+
etag?: string;
|
|
232
|
+
/** Succeed when the Resource does not exist. */
|
|
233
|
+
allowMissing?: boolean;
|
|
234
|
+
/** Validate without deleting anything. */
|
|
235
|
+
validateOnly?: boolean;
|
|
236
|
+
}
|
|
237
|
+
/** The request of DeleteSnapshot. */
|
|
238
|
+
export interface DeleteSnapshotRequest {
|
|
239
|
+
/** The name of the snapshot to delete. */
|
|
240
|
+
name: string;
|
|
241
|
+
/** Delete only if the current etag matches. */
|
|
242
|
+
etag?: string;
|
|
243
|
+
/** Succeed when the Resource does not exist. */
|
|
244
|
+
allowMissing?: boolean;
|
|
245
|
+
/** Validate without deleting anything. */
|
|
246
|
+
validateOnly?: boolean;
|
|
247
|
+
}
|
|
248
|
+
/** The request of DeleteVolume. */
|
|
249
|
+
export interface DeleteVolumeRequest {
|
|
250
|
+
/** The name of the volume to delete. */
|
|
251
|
+
name: string;
|
|
252
|
+
/** Delete only if the current etag matches. */
|
|
253
|
+
etag?: string;
|
|
254
|
+
/** Succeed when the Resource does not exist. */
|
|
255
|
+
allowMissing?: boolean;
|
|
256
|
+
/** Validate without deleting anything. */
|
|
257
|
+
validateOnly?: boolean;
|
|
258
|
+
}
|
|
259
|
+
/** DisplayInfo is a lease's effective display. */
|
|
260
|
+
export interface DisplayInfo {
|
|
261
|
+
/** Logical width in pixels; action coordinates are in this space. */
|
|
262
|
+
readonly width?: number;
|
|
263
|
+
/** Logical height in pixels. */
|
|
264
|
+
readonly height?: number;
|
|
265
|
+
/** Dots per inch. */
|
|
266
|
+
readonly dpi?: number;
|
|
267
|
+
}
|
|
268
|
+
/** DisplaySpec is a lease's requested display. */
|
|
269
|
+
export interface DisplaySpec {
|
|
270
|
+
/** Logical width in pixels; default 1280. */
|
|
271
|
+
width?: number;
|
|
272
|
+
/** Logical height in pixels; default 800. */
|
|
273
|
+
height?: number;
|
|
274
|
+
/** Dots per inch; default 96. */
|
|
275
|
+
dpi?: number;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* DragAction presses at the first point, moves through the rest, and
|
|
279
|
+
* releases at the last.
|
|
280
|
+
*/
|
|
281
|
+
export interface DragAction {
|
|
282
|
+
/** At least two points. */
|
|
283
|
+
path?: Point[];
|
|
284
|
+
/** Default LEFT. */
|
|
285
|
+
button?: MouseButton;
|
|
286
|
+
/** Keys held during the drag, xdotool names. */
|
|
287
|
+
modifiers?: string[];
|
|
288
|
+
/** Total time of the move; default 300 ms (Android swipe duration). */
|
|
289
|
+
duration?: string;
|
|
290
|
+
}
|
|
291
|
+
/** The request of ExecLease. */
|
|
292
|
+
export interface ExecLeaseRequest {
|
|
293
|
+
/** The name of the lease. */
|
|
294
|
+
name: string;
|
|
295
|
+
/** The program and its arguments. Use `["bash", "-lc", "…"]` for a shell. */
|
|
296
|
+
command: string[];
|
|
297
|
+
/** The working directory; default the user's home. */
|
|
298
|
+
workingDirectory?: string;
|
|
299
|
+
/** Extra environment variables. */
|
|
300
|
+
env?: Record<string, string>;
|
|
301
|
+
/** Bytes written to standard input. */
|
|
302
|
+
stdin?: string;
|
|
303
|
+
/**
|
|
304
|
+
* Kill the process after this long; default 60 seconds, at most 10
|
|
305
|
+
* minutes.
|
|
306
|
+
*/
|
|
307
|
+
timeout?: string;
|
|
308
|
+
/**
|
|
309
|
+
* The guest user; default `user`. `root` is allowed: the whole machine
|
|
310
|
+
* belongs to the lessee.
|
|
311
|
+
*/
|
|
312
|
+
user?: string;
|
|
313
|
+
}
|
|
314
|
+
/** The response of ExecLease. */
|
|
315
|
+
export interface ExecLeaseResponse {
|
|
316
|
+
/** The exit code; -1 when killed. */
|
|
317
|
+
exitCode?: number;
|
|
318
|
+
/** Standard output. */
|
|
319
|
+
stdout?: string;
|
|
320
|
+
/** Standard error. */
|
|
321
|
+
stderr?: string;
|
|
322
|
+
/** Whether either stream exceeded the cap. */
|
|
323
|
+
truncated?: boolean;
|
|
324
|
+
/** Whether the process was killed at `timeout`. */
|
|
325
|
+
timedOut?: boolean;
|
|
326
|
+
}
|
|
327
|
+
/** FileEntry is one entry of a guest directory. */
|
|
328
|
+
export interface FileEntry {
|
|
329
|
+
/** The absolute path. */
|
|
330
|
+
path?: string;
|
|
331
|
+
/** Whether it is a directory. */
|
|
332
|
+
directory?: boolean;
|
|
333
|
+
/** Size in bytes. */
|
|
334
|
+
sizeBytes?: string;
|
|
335
|
+
/** The mode bits. */
|
|
336
|
+
mode?: number;
|
|
337
|
+
/** When it last changed. */
|
|
338
|
+
modifyTime?: string;
|
|
339
|
+
}
|
|
340
|
+
/** The request of GetLeaseControl. */
|
|
341
|
+
export interface GetLeaseControlRequest {
|
|
342
|
+
/** The name of the lease. */
|
|
343
|
+
name: string;
|
|
344
|
+
}
|
|
345
|
+
/** The request of GetLeaseEvent. */
|
|
346
|
+
export interface GetLeaseEventRequest {
|
|
347
|
+
/** The name of the event to get. */
|
|
348
|
+
name: string;
|
|
349
|
+
}
|
|
350
|
+
/** The request of GetLease. */
|
|
351
|
+
export interface GetLeaseRequest {
|
|
352
|
+
/** The name of the lease to get. */
|
|
353
|
+
name: string;
|
|
354
|
+
}
|
|
355
|
+
/** The request of GetPool. */
|
|
356
|
+
export interface GetPoolRequest {
|
|
357
|
+
/** The name of the pool to get. */
|
|
358
|
+
name: string;
|
|
359
|
+
}
|
|
360
|
+
/** The request of GetShape. */
|
|
361
|
+
export interface GetShapeRequest {
|
|
362
|
+
/** The name of the shape to get. */
|
|
363
|
+
name: string;
|
|
364
|
+
}
|
|
365
|
+
/** The request of GetSnapshot. */
|
|
366
|
+
export interface GetSnapshotRequest {
|
|
367
|
+
/** The name of the snapshot to get. */
|
|
368
|
+
name: string;
|
|
369
|
+
}
|
|
370
|
+
/** The request of GetVolume. */
|
|
371
|
+
export interface GetVolumeRequest {
|
|
372
|
+
/** The name of the volume to get. */
|
|
373
|
+
name: string;
|
|
374
|
+
}
|
|
375
|
+
/** HoldKeyAction holds a combination down, then releases it. */
|
|
376
|
+
export interface HoldKeyAction {
|
|
377
|
+
/** The combination, xdotool syntax. */
|
|
378
|
+
combo?: string;
|
|
379
|
+
/** How long; at most 10 seconds. */
|
|
380
|
+
duration?: string;
|
|
381
|
+
}
|
|
382
|
+
/** IceServer is one RTCIceServer. */
|
|
383
|
+
export interface IceServer {
|
|
384
|
+
/** `stun:`, `turn:`, or `turns:` URLs. */
|
|
385
|
+
urls?: string[];
|
|
386
|
+
/** The TURN username. */
|
|
387
|
+
username?: string;
|
|
388
|
+
/** The TURN credential. */
|
|
389
|
+
credential?: string;
|
|
390
|
+
}
|
|
391
|
+
/** The request of InstallLeaseApp. */
|
|
392
|
+
export interface InstallLeaseAppRequest {
|
|
393
|
+
/** The name of the lease. */
|
|
394
|
+
name: string;
|
|
395
|
+
/** The APK's path in the lease (write it with WriteLeaseFile first). */
|
|
396
|
+
apkPath: string;
|
|
397
|
+
/** Grant every runtime permission the app declares. */
|
|
398
|
+
grantPermissions?: boolean;
|
|
399
|
+
}
|
|
400
|
+
/** The response of InstallLeaseApp. */
|
|
401
|
+
export interface InstallLeaseAppResponse {
|
|
402
|
+
/** The installed package name. */
|
|
403
|
+
packageName?: string;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* KeyAction presses a key combination, xdotool syntax: `Return`, `ctrl+c`,
|
|
407
|
+
* `ctrl+shift+t`, `super`, `F5`. On Android, `home`, `back`, `app_switch`,
|
|
408
|
+
* `power`, `volume_up`, `volume_down`, `enter`, or `KEYCODE_*`.
|
|
409
|
+
*/
|
|
410
|
+
export interface KeyAction {
|
|
411
|
+
/** The combination. */
|
|
412
|
+
combo?: string;
|
|
413
|
+
/** Press it this many times; default 1. */
|
|
414
|
+
repeat?: number;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* A Lease is one isolated machine of a shape, region, and image for a bounded
|
|
418
|
+
* time. It is granted immediately from a warm or cold machine, or refused with
|
|
419
|
+
* a typed reason; its end destroys the machine. Sandboxes is its only writer.
|
|
420
|
+
* Put the caller's own correlation (agent id, work id) in `meta.labels`; List
|
|
421
|
+
* filters on them.
|
|
422
|
+
*/
|
|
423
|
+
export interface Lease {
|
|
424
|
+
/** `orgs/{org}/projects/{project}/envs/{env}/leases/{lease}`. */
|
|
425
|
+
name?: string;
|
|
426
|
+
/** `sbx_<cell><ulid>`; never reused. */
|
|
427
|
+
readonly uid?: string;
|
|
428
|
+
/** Resource metadata. */
|
|
429
|
+
meta?: common.ResourceMeta;
|
|
430
|
+
/** Desired state. */
|
|
431
|
+
spec?: LeaseSpec;
|
|
432
|
+
/** Observed state. */
|
|
433
|
+
readonly status?: LeaseStatus;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* LeaseBudget bounds what one lease may consume. Reaching a bound ends the
|
|
437
|
+
* lease with the matching EndReason; the Cell enforces it without the
|
|
438
|
+
* control plane.
|
|
439
|
+
*/
|
|
440
|
+
export interface LeaseBudget {
|
|
441
|
+
/** End CPU_BUDGET after this many vCPU-seconds of guest CPU time. */
|
|
442
|
+
maxCpuSeconds?: string;
|
|
443
|
+
/**
|
|
444
|
+
* End COST_BUDGET once the shape's list price times wall seconds reaches
|
|
445
|
+
* this many millionths of a US dollar.
|
|
446
|
+
*/
|
|
447
|
+
maxCostMicros?: string;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* LeaseEndpoints are a lease's data-plane addresses. Each accepts an Access
|
|
451
|
+
* key with `sandboxes:exec` or a lease token of the matching scope.
|
|
452
|
+
*/
|
|
453
|
+
export interface LeaseEndpoints {
|
|
454
|
+
/**
|
|
455
|
+
* The guest daemon: the E2B envd protocol (Connect-RPC `process.Process`,
|
|
456
|
+
* `filesystem.Filesystem`, HTTP `/files`), routed by the `E2b-Sandbox-Id`
|
|
457
|
+
* header, for streaming exec and PTYs.
|
|
458
|
+
*/
|
|
459
|
+
readonly guestUri?: string;
|
|
460
|
+
/** The Chrome DevTools Protocol WebSocket of a BROWSER lease. */
|
|
461
|
+
readonly cdpUri?: string;
|
|
462
|
+
/** The E2B sandbox id this lease answers to on the E2B-compatible API. */
|
|
463
|
+
readonly e2bSandboxId?: string;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* A LeaseEvent is one immutable fact in a lease's life: grant, ready, end,
|
|
467
|
+
* control changes, network changes. Events are listed in order and
|
|
468
|
+
* long-polled with `wait`.
|
|
469
|
+
*/
|
|
470
|
+
export interface LeaseEvent {
|
|
471
|
+
/** `orgs/{org}/projects/{project}/envs/{env}/leases/{lease}/lease_events/{lease_event}`. */
|
|
472
|
+
name?: string;
|
|
473
|
+
/** `lev_<cell><ulid>`; never reused. */
|
|
474
|
+
readonly uid?: string;
|
|
475
|
+
/** Resource metadata. */
|
|
476
|
+
meta?: common.ResourceMeta;
|
|
477
|
+
/** What happened. */
|
|
478
|
+
readonly kind?: LeaseEventKind;
|
|
479
|
+
/** The position in the lease's event sequence, from 1. */
|
|
480
|
+
readonly sequence?: string;
|
|
481
|
+
/** When it happened. */
|
|
482
|
+
readonly occurTime?: string;
|
|
483
|
+
/** The lease generation after the event. */
|
|
484
|
+
readonly leaseGeneration?: string;
|
|
485
|
+
/** The lease state after the event. */
|
|
486
|
+
readonly state?: LeaseState;
|
|
487
|
+
/** For LEASE_ENDED. */
|
|
488
|
+
readonly endReason?: EndReason;
|
|
489
|
+
/** For LEASE_ENDED: final usage. */
|
|
490
|
+
readonly usage?: LeaseUsage;
|
|
491
|
+
/** For CONTROL_* events: the control after the event. */
|
|
492
|
+
readonly control?: ControlState;
|
|
493
|
+
/** For CONTROL_RELEASED and CONTROL_EXPIRED: how long control was held. */
|
|
494
|
+
readonly controlDuration?: string;
|
|
495
|
+
/** The principal that caused it, when a caller did. */
|
|
496
|
+
readonly principal?: string;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* LeaseNetwork is a lease's outbound policy. Link-local and cloud metadata
|
|
500
|
+
* addresses (169.254.0.0/16, fd00:ec2::254), RFC 1918, CGNAT
|
|
501
|
+
* (100.64.0.0/10), loopback, and the Cell's pod, service, and node ranges are
|
|
502
|
+
* blocked under every policy and cannot be allowlisted.
|
|
503
|
+
*/
|
|
504
|
+
export interface LeaseNetwork {
|
|
505
|
+
/** Default ALLOW. */
|
|
506
|
+
egress?: EgressPolicy;
|
|
507
|
+
/**
|
|
508
|
+
* Hosts reachable when `egress` is ALLOWLIST: exact names or one leading
|
|
509
|
+
* `*.` wildcard label, for example `api.openai.com`, `*.github.com`.
|
|
510
|
+
*/
|
|
511
|
+
allowedDomains?: string[];
|
|
512
|
+
/** Public CIDRs reachable when `egress` is ALLOWLIST. */
|
|
513
|
+
allowedCidrs?: string[];
|
|
514
|
+
/** The ranges blocked under every policy. */
|
|
515
|
+
readonly blockedCidrs?: string[];
|
|
516
|
+
}
|
|
517
|
+
/** LeasePort is a guest port reachable through the lease's data plane. */
|
|
518
|
+
export interface LeasePort {
|
|
519
|
+
/** The guest port. */
|
|
520
|
+
port?: number;
|
|
521
|
+
/**
|
|
522
|
+
* Default PRIVATE: a lease token or an Access key with `sandboxes:exec` is
|
|
523
|
+
* required.
|
|
524
|
+
*/
|
|
525
|
+
visibility?: PortVisibility;
|
|
526
|
+
/** The port's URL. */
|
|
527
|
+
readonly uri?: string;
|
|
528
|
+
}
|
|
529
|
+
/** LeaseSpec is the caller-writable state of a Lease. */
|
|
530
|
+
export interface LeaseSpec {
|
|
531
|
+
/** The shape. */
|
|
532
|
+
shape?: string;
|
|
533
|
+
/**
|
|
534
|
+
* The image: a Kernel Artifact by digest, or `template:<name>` (`base`,
|
|
535
|
+
* `desktop`, `browser`, `android`). Ignored when `source_snapshot` is set.
|
|
536
|
+
*/
|
|
537
|
+
image?: string;
|
|
538
|
+
/** What the machine serves; default GENERAL. */
|
|
539
|
+
kind?: LeaseKind;
|
|
540
|
+
/** The region; default the project's home region. */
|
|
541
|
+
region?: string;
|
|
542
|
+
/**
|
|
543
|
+
* The Pool to take a warm machine from; default the platform pool for the
|
|
544
|
+
* shape and image.
|
|
545
|
+
*/
|
|
546
|
+
pool?: string;
|
|
547
|
+
/**
|
|
548
|
+
* The maximum wall time from grant: 1 minute to 24 hours for microVMs, 24
|
|
549
|
+
* hours to 30 days for macOS. `:renew` extends it within the shape's bound.
|
|
550
|
+
* Reaching it ends the lease EXPIRED.
|
|
551
|
+
*/
|
|
552
|
+
ttl?: string;
|
|
553
|
+
/**
|
|
554
|
+
* End the lease IDLE after no data-plane call, stream input, or exec for
|
|
555
|
+
* this long; unset never idles out.
|
|
556
|
+
*/
|
|
557
|
+
idleTimeout?: string;
|
|
558
|
+
/** The outbound policy. Change it on a running lease with `:setNetwork`. */
|
|
559
|
+
network?: LeaseNetwork;
|
|
560
|
+
/** Guest ports to expose. */
|
|
561
|
+
ports?: LeasePort[];
|
|
562
|
+
/**
|
|
563
|
+
* Plain environment variables. Secrets bind through Kernel Secrets, never
|
|
564
|
+
* here.
|
|
565
|
+
*/
|
|
566
|
+
env?: Record<string, string>;
|
|
567
|
+
/**
|
|
568
|
+
* Volumes attached at grant, each by name. A volume is attached to at most
|
|
569
|
+
* one lease at a time; a volume already attached refuses the lease with
|
|
570
|
+
* RESOURCE_IN_USE.
|
|
571
|
+
*/
|
|
572
|
+
volumes?: VolumeMount[];
|
|
573
|
+
/** Spend bounds beyond `ttl` and `idle_timeout`. */
|
|
574
|
+
budget?: LeaseBudget;
|
|
575
|
+
/** The display of a DESKTOP, BROWSER, or ANDROID lease. */
|
|
576
|
+
display?: DisplaySpec;
|
|
577
|
+
/** The browser of a BROWSER lease. */
|
|
578
|
+
browser?: BrowserSpec;
|
|
579
|
+
/** Boot from this Snapshot's disk and image instead of `image`. */
|
|
580
|
+
sourceSnapshot?: string;
|
|
581
|
+
/**
|
|
582
|
+
* Where lease events are delivered as signed webhooks, in addition to
|
|
583
|
+
* `leases/*\/events`.
|
|
584
|
+
*/
|
|
585
|
+
webhook?: LeaseWebhook;
|
|
586
|
+
}
|
|
587
|
+
/** LeaseStatus is the observed state of a Lease. */
|
|
588
|
+
export interface LeaseStatus {
|
|
589
|
+
/** The generation this status was computed from. */
|
|
590
|
+
readonly observedGeneration?: string;
|
|
591
|
+
/** Ready, Reconciling, Stalled. */
|
|
592
|
+
readonly conditions?: common.Condition[];
|
|
593
|
+
/** The state machine. */
|
|
594
|
+
readonly state?: LeaseState;
|
|
595
|
+
/**
|
|
596
|
+
* Increases on grant, pause, resume, and end; every token and Cell command
|
|
597
|
+
* carries it, and a stale one is refused STALE_GENERATION.
|
|
598
|
+
*/
|
|
599
|
+
readonly leaseGeneration?: string;
|
|
600
|
+
/** Eight Crockford base32 characters naming the lease in data-plane routes. */
|
|
601
|
+
readonly shortId?: string;
|
|
602
|
+
/** Data-plane addresses. */
|
|
603
|
+
readonly endpoints?: LeaseEndpoints;
|
|
604
|
+
/** Why the lease was refused, when `state` is REFUSED. */
|
|
605
|
+
readonly refusal?: LeaseRefusal;
|
|
606
|
+
/** Why the lease ended, once `state` is ENDING or ENDED. */
|
|
607
|
+
readonly endReason?: EndReason;
|
|
608
|
+
/** When a machine was assigned. */
|
|
609
|
+
readonly grantTime?: string;
|
|
610
|
+
/** When the guest became ready. */
|
|
611
|
+
readonly readyTime?: string;
|
|
612
|
+
/** When the lease ends unless renewed. */
|
|
613
|
+
readonly expireTime?: string;
|
|
614
|
+
/** When the lease ended. */
|
|
615
|
+
readonly endTime?: string;
|
|
616
|
+
/** What the lease has consumed so far. */
|
|
617
|
+
readonly usage?: LeaseUsage;
|
|
618
|
+
/** Who holds input control of the display. */
|
|
619
|
+
readonly control?: ControlState;
|
|
620
|
+
/** The effective display, for kinds that have one. */
|
|
621
|
+
readonly display?: DisplayInfo;
|
|
622
|
+
/** The effective outbound policy, including the ranges always blocked. */
|
|
623
|
+
readonly network?: LeaseNetwork;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* LeaseUsage is what a lease has consumed, refreshed at least every 60
|
|
627
|
+
* seconds while it runs and final once it ends.
|
|
628
|
+
*/
|
|
629
|
+
export interface LeaseUsage {
|
|
630
|
+
/** Wall seconds from grant. */
|
|
631
|
+
readonly wallSeconds?: string;
|
|
632
|
+
/** Guest vCPU-seconds. */
|
|
633
|
+
readonly cpuSeconds?: string;
|
|
634
|
+
/**
|
|
635
|
+
* List-price cost so far, in millionths of a US dollar; 0 on classes that
|
|
636
|
+
* are not priced.
|
|
637
|
+
*/
|
|
638
|
+
readonly costMicros?: string;
|
|
639
|
+
/** When this usage was measured. */
|
|
640
|
+
readonly measureTime?: string;
|
|
641
|
+
/** Memory GiB-seconds (shape memory times wall seconds). */
|
|
642
|
+
readonly memoryGibSeconds?: string;
|
|
643
|
+
/** Bytes sent to the internet. */
|
|
644
|
+
readonly egressBytes?: string;
|
|
645
|
+
/** Seconds of live stream viewing, summed over viewers. */
|
|
646
|
+
readonly streamSeconds?: string;
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* LeaseWebhook delivers lease events as Standard Webhooks, signed Ed25519
|
|
650
|
+
* (`webhook-signature: v1a,…`) with the key published at
|
|
651
|
+
* `/.well-known/sandboxes-webhook-keys.json`.
|
|
652
|
+
*/
|
|
653
|
+
export interface LeaseWebhook {
|
|
654
|
+
/** The HTTPS URL that receives the POSTs. */
|
|
655
|
+
uri?: string;
|
|
656
|
+
/** Deliver only these kinds; default every kind. */
|
|
657
|
+
kinds?: LeaseEventKind[];
|
|
658
|
+
}
|
|
659
|
+
/** The request of ListLeaseEvents. */
|
|
660
|
+
export interface ListLeaseEventsRequest {
|
|
661
|
+
/** The lease. */
|
|
662
|
+
parent: string;
|
|
663
|
+
/** At most this many; default 50, clamped to 1000. */
|
|
664
|
+
pageSize?: number;
|
|
665
|
+
/** `next_page_token` of the previous page. */
|
|
666
|
+
pageToken?: string;
|
|
667
|
+
/** AIP-160 filter over `kind`. */
|
|
668
|
+
filter?: string;
|
|
669
|
+
/**
|
|
670
|
+
* Block up to this long (at most 60 seconds) when there is no event after
|
|
671
|
+
* `page_token`.
|
|
672
|
+
*/
|
|
673
|
+
wait?: string;
|
|
674
|
+
}
|
|
675
|
+
/** The response of ListLeaseEvents. */
|
|
676
|
+
export interface ListLeaseEventsResponse {
|
|
677
|
+
/** The page, oldest first. */
|
|
678
|
+
leaseEvents?: LeaseEvent[];
|
|
679
|
+
/**
|
|
680
|
+
* Pass it back to continue after the last event; set on every page, so a
|
|
681
|
+
* caller can long-poll from it.
|
|
682
|
+
*/
|
|
683
|
+
nextPageToken?: string;
|
|
684
|
+
}
|
|
685
|
+
/** The request of ListLeaseFiles. */
|
|
686
|
+
export interface ListLeaseFilesRequest {
|
|
687
|
+
/** The name of the lease. */
|
|
688
|
+
name: string;
|
|
689
|
+
/** The absolute directory path in the guest. */
|
|
690
|
+
path: string;
|
|
691
|
+
/** Descend this many levels; default 1. */
|
|
692
|
+
depth?: number;
|
|
693
|
+
}
|
|
694
|
+
/** The response of ListLeaseFiles. */
|
|
695
|
+
export interface ListLeaseFilesResponse {
|
|
696
|
+
/** The entries. */
|
|
697
|
+
entries?: FileEntry[];
|
|
698
|
+
}
|
|
699
|
+
/** The request of ListLeases. */
|
|
700
|
+
export interface ListLeasesRequest {
|
|
701
|
+
/** The parent to list in. */
|
|
702
|
+
parent: string;
|
|
703
|
+
/** At most this many; default 50, clamped to 1000. */
|
|
704
|
+
pageSize?: number;
|
|
705
|
+
/** `next_page_token` of the previous page. */
|
|
706
|
+
pageToken?: string;
|
|
707
|
+
/** AIP-160 filter over labels, filterable fields, and Ready. */
|
|
708
|
+
filter?: string;
|
|
709
|
+
/** AIP-132 ordering over filterable fields. */
|
|
710
|
+
orderBy?: string;
|
|
711
|
+
}
|
|
712
|
+
/** The response of ListLeases. */
|
|
713
|
+
export interface ListLeasesResponse {
|
|
714
|
+
/** The page. */
|
|
715
|
+
leases?: Lease[];
|
|
716
|
+
/** The token of the next page; empty on the last page. */
|
|
717
|
+
nextPageToken?: string;
|
|
718
|
+
}
|
|
719
|
+
/** The request of ListPools. */
|
|
720
|
+
export interface ListPoolsRequest {
|
|
721
|
+
/** The parent to list in. */
|
|
722
|
+
parent: string;
|
|
723
|
+
/** At most this many; default 50, clamped to 1000. */
|
|
724
|
+
pageSize?: number;
|
|
725
|
+
/** `next_page_token` of the previous page. */
|
|
726
|
+
pageToken?: string;
|
|
727
|
+
/** AIP-160 filter over labels, filterable fields, and Ready. */
|
|
728
|
+
filter?: string;
|
|
729
|
+
/** AIP-132 ordering over filterable fields. */
|
|
730
|
+
orderBy?: string;
|
|
731
|
+
}
|
|
732
|
+
/** The response of ListPools. */
|
|
733
|
+
export interface ListPoolsResponse {
|
|
734
|
+
/** The page. */
|
|
735
|
+
pools?: Pool[];
|
|
736
|
+
/** The token of the next page; empty on the last page. */
|
|
737
|
+
nextPageToken?: string;
|
|
738
|
+
}
|
|
739
|
+
/** The request of ListSandboxShapes. */
|
|
740
|
+
export interface ListSandboxShapesRequest {
|
|
741
|
+
/** At most this many; default 50, clamped to 1000. */
|
|
742
|
+
pageSize?: number;
|
|
743
|
+
/** `next_page_token` of the previous page. */
|
|
744
|
+
pageToken?: string;
|
|
745
|
+
/** AIP-160 filter over labels, filterable fields, and Ready. */
|
|
746
|
+
filter?: string;
|
|
747
|
+
/** AIP-132 ordering over filterable fields. */
|
|
748
|
+
orderBy?: string;
|
|
749
|
+
}
|
|
750
|
+
/** The response of ListSandboxShapes. */
|
|
751
|
+
export interface ListSandboxShapesResponse {
|
|
752
|
+
/** The page. */
|
|
753
|
+
sandboxShapes?: Shape[];
|
|
754
|
+
/** The token of the next page; empty on the last page. */
|
|
755
|
+
nextPageToken?: string;
|
|
756
|
+
}
|
|
757
|
+
/** The request of ListSnapshots. */
|
|
758
|
+
export interface ListSnapshotsRequest {
|
|
759
|
+
/** The parent to list in. */
|
|
760
|
+
parent: string;
|
|
761
|
+
/** At most this many; default 50, clamped to 1000. */
|
|
762
|
+
pageSize?: number;
|
|
763
|
+
/** `next_page_token` of the previous page. */
|
|
764
|
+
pageToken?: string;
|
|
765
|
+
/** AIP-160 filter over labels, filterable fields, and Ready. */
|
|
766
|
+
filter?: string;
|
|
767
|
+
/** AIP-132 ordering over filterable fields. */
|
|
768
|
+
orderBy?: string;
|
|
769
|
+
}
|
|
770
|
+
/** The response of ListSnapshots. */
|
|
771
|
+
export interface ListSnapshotsResponse {
|
|
772
|
+
/** The page. */
|
|
773
|
+
snapshots?: Snapshot[];
|
|
774
|
+
/** The token of the next page; empty on the last page. */
|
|
775
|
+
nextPageToken?: string;
|
|
776
|
+
}
|
|
777
|
+
/** The request of ListVolumes. */
|
|
778
|
+
export interface ListVolumesRequest {
|
|
779
|
+
/** The parent to list in. */
|
|
780
|
+
parent: string;
|
|
781
|
+
/** At most this many; default 50, clamped to 1000. */
|
|
782
|
+
pageSize?: number;
|
|
783
|
+
/** `next_page_token` of the previous page. */
|
|
784
|
+
pageToken?: string;
|
|
785
|
+
/** AIP-160 filter over labels, filterable fields, and Ready. */
|
|
786
|
+
filter?: string;
|
|
787
|
+
/** AIP-132 ordering over filterable fields. */
|
|
788
|
+
orderBy?: string;
|
|
789
|
+
}
|
|
790
|
+
/** The response of ListVolumes. */
|
|
791
|
+
export interface ListVolumesResponse {
|
|
792
|
+
/** The page. */
|
|
793
|
+
volumes?: Volume[];
|
|
794
|
+
/** The token of the next page; empty on the last page. */
|
|
795
|
+
nextPageToken?: string;
|
|
796
|
+
}
|
|
797
|
+
/** The request of MintLeaseToken. */
|
|
798
|
+
export interface MintLeaseTokenRequest {
|
|
799
|
+
/** The name of the lease. */
|
|
800
|
+
name: string;
|
|
801
|
+
/** What the token admits. */
|
|
802
|
+
scopes: TokenScope[];
|
|
803
|
+
/** At most 1 hour and never past the lease's `expire_time`. */
|
|
804
|
+
ttl?: string;
|
|
805
|
+
}
|
|
806
|
+
/** The response of MintLeaseToken. */
|
|
807
|
+
export interface MintLeaseTokenResponse {
|
|
808
|
+
/** The lease token; sent as a bearer token to the data plane. */
|
|
809
|
+
token?: string;
|
|
810
|
+
/** The lease generation the token is bound to. */
|
|
811
|
+
generation?: string;
|
|
812
|
+
/** When the token stops verifying. */
|
|
813
|
+
expireTime?: string;
|
|
814
|
+
}
|
|
815
|
+
/** The request of OpenLeasePort. */
|
|
816
|
+
export interface OpenLeasePortRequest {
|
|
817
|
+
/** The name of the lease. */
|
|
818
|
+
name: string;
|
|
819
|
+
/** The port to expose. */
|
|
820
|
+
port: LeasePort;
|
|
821
|
+
}
|
|
822
|
+
/** The request of OpenLeaseStream. */
|
|
823
|
+
export interface OpenLeaseStreamRequest {
|
|
824
|
+
/** The name of the lease. */
|
|
825
|
+
name: string;
|
|
826
|
+
/**
|
|
827
|
+
* How long the token admits a new connection; at most and default 5
|
|
828
|
+
* minutes. A connected stream ends when the lease generation changes or the
|
|
829
|
+
* token is revoked.
|
|
830
|
+
*/
|
|
831
|
+
ttl?: string;
|
|
832
|
+
}
|
|
833
|
+
/** The request of PauseLease. */
|
|
834
|
+
export interface PauseLeaseRequest {
|
|
835
|
+
/** The name of the lease. */
|
|
836
|
+
name: string;
|
|
837
|
+
/** Act only if the current etag matches. */
|
|
838
|
+
etag?: string;
|
|
839
|
+
/** Validate without acting. */
|
|
840
|
+
validateOnly?: boolean;
|
|
841
|
+
}
|
|
842
|
+
/** Point is a position in logical display pixels. */
|
|
843
|
+
export interface Point {
|
|
844
|
+
/** Pixels from the left edge. */
|
|
845
|
+
x?: number;
|
|
846
|
+
/** Pixels from the top edge. */
|
|
847
|
+
y?: number;
|
|
848
|
+
}
|
|
849
|
+
/** PointerMove moves the pointer. */
|
|
850
|
+
export interface PointerMove {
|
|
851
|
+
/** Where to. */
|
|
852
|
+
position?: Point;
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* A Pool keeps never-leased machines of one shape and image warm, so a lease
|
|
856
|
+
* starts in seconds. An empty pool makes a lease slower, never different.
|
|
857
|
+
*/
|
|
858
|
+
export interface Pool {
|
|
859
|
+
/** `orgs/{org}/projects/{project}/envs/{env}/pools/{pool}`. */
|
|
860
|
+
name?: string;
|
|
861
|
+
/** `pol_<cell><ulid>`; never reused. */
|
|
862
|
+
readonly uid?: string;
|
|
863
|
+
/** Resource metadata. */
|
|
864
|
+
meta?: common.ResourceMeta;
|
|
865
|
+
/** Desired state. */
|
|
866
|
+
spec?: PoolSpec;
|
|
867
|
+
/** Observed state. */
|
|
868
|
+
readonly status?: PoolStatus;
|
|
869
|
+
}
|
|
870
|
+
/** PoolSpec is the caller-writable state of a Pool. */
|
|
871
|
+
export interface PoolSpec {
|
|
872
|
+
/** The shape. */
|
|
873
|
+
shape?: string;
|
|
874
|
+
/** The image: a Kernel Artifact by digest, or `template:<name>`. */
|
|
875
|
+
image?: string;
|
|
876
|
+
/** Warm machine bounds. */
|
|
877
|
+
warm?: PoolWarm;
|
|
878
|
+
/** Warm machines older than this are recycled; 5 minutes to 2 hours. */
|
|
879
|
+
maxAge?: string;
|
|
880
|
+
}
|
|
881
|
+
/** PoolStatus is the observed state of a Pool. */
|
|
882
|
+
export interface PoolStatus {
|
|
883
|
+
/** The generation this status was computed from. */
|
|
884
|
+
readonly observedGeneration?: string;
|
|
885
|
+
/** Ready, Reconciling, Stalled. */
|
|
886
|
+
readonly conditions?: common.Condition[];
|
|
887
|
+
/** Booted, never-leased machines ready now. */
|
|
888
|
+
readonly warmMachines?: number;
|
|
889
|
+
/** Machines booting into the pool. */
|
|
890
|
+
readonly bootingMachines?: number;
|
|
891
|
+
}
|
|
892
|
+
/** PoolWarm bounds a Pool's warm machines. */
|
|
893
|
+
export interface PoolWarm {
|
|
894
|
+
/** Warm machines kept booted. */
|
|
895
|
+
min?: number;
|
|
896
|
+
/** Warm machines at most; at most 10 on free and 100 on Pro. */
|
|
897
|
+
max?: number;
|
|
898
|
+
}
|
|
899
|
+
/** The request of ReadLeaseFile. */
|
|
900
|
+
export interface ReadLeaseFileRequest {
|
|
901
|
+
/** The name of the lease. */
|
|
902
|
+
name: string;
|
|
903
|
+
/** The absolute path in the guest. */
|
|
904
|
+
path: string;
|
|
905
|
+
}
|
|
906
|
+
/** The response of ReadLeaseFile. */
|
|
907
|
+
export interface ReadLeaseFileResponse {
|
|
908
|
+
/** The file's bytes. */
|
|
909
|
+
content?: string;
|
|
910
|
+
/** The file mode bits. */
|
|
911
|
+
mode?: number;
|
|
912
|
+
}
|
|
913
|
+
/** Region is a rectangle in logical display pixels. */
|
|
914
|
+
export interface Region {
|
|
915
|
+
/** Left edge. */
|
|
916
|
+
x?: number;
|
|
917
|
+
/** Top edge. */
|
|
918
|
+
y?: number;
|
|
919
|
+
/** Width. */
|
|
920
|
+
width?: number;
|
|
921
|
+
/** Height. */
|
|
922
|
+
height?: number;
|
|
923
|
+
}
|
|
924
|
+
/** The request of ReleaseLeaseControl. */
|
|
925
|
+
export interface ReleaseLeaseControlRequest {
|
|
926
|
+
/** The name of the lease. */
|
|
927
|
+
name: string;
|
|
928
|
+
/** The epoch AcquireLeaseControl returned. */
|
|
929
|
+
epoch: string;
|
|
930
|
+
}
|
|
931
|
+
/** The request of ReleaseLease. */
|
|
932
|
+
export interface ReleaseLeaseRequest {
|
|
933
|
+
/** The name of the lease. */
|
|
934
|
+
name: string;
|
|
935
|
+
/** Act only if the current etag matches. */
|
|
936
|
+
etag?: string;
|
|
937
|
+
/** Validate without acting. */
|
|
938
|
+
validateOnly?: boolean;
|
|
939
|
+
}
|
|
940
|
+
/** The request of RemoveLeaseFile. */
|
|
941
|
+
export interface RemoveLeaseFileRequest {
|
|
942
|
+
/** The name of the lease. */
|
|
943
|
+
name: string;
|
|
944
|
+
/** The absolute path in the guest. */
|
|
945
|
+
path: string;
|
|
946
|
+
}
|
|
947
|
+
/** The response of RemoveLeaseFile. */
|
|
948
|
+
export interface RemoveLeaseFileResponse {
|
|
949
|
+
}
|
|
950
|
+
/** The request of RenewLease. */
|
|
951
|
+
export interface RenewLeaseRequest {
|
|
952
|
+
/** The name of the lease. */
|
|
953
|
+
name: string;
|
|
954
|
+
/** The new time to live from now. */
|
|
955
|
+
ttl: string;
|
|
956
|
+
/** Act only if the current etag matches. */
|
|
957
|
+
etag?: string;
|
|
958
|
+
/** Validate without acting. */
|
|
959
|
+
validateOnly?: boolean;
|
|
960
|
+
}
|
|
961
|
+
/** The request of ResumeLease. */
|
|
962
|
+
export interface ResumeLeaseRequest {
|
|
963
|
+
/** The name of the lease. */
|
|
964
|
+
name: string;
|
|
965
|
+
/** Act only if the current etag matches. */
|
|
966
|
+
etag?: string;
|
|
967
|
+
/** Validate without acting. */
|
|
968
|
+
validateOnly?: boolean;
|
|
969
|
+
}
|
|
970
|
+
/** Screenshot is an encoded capture. */
|
|
971
|
+
export interface Screenshot {
|
|
972
|
+
/** The encoded image. */
|
|
973
|
+
data?: string;
|
|
974
|
+
/** `image/png`, `image/jpeg`, or `image/webp`. */
|
|
975
|
+
mediaType?: string;
|
|
976
|
+
/** Image width in pixels. */
|
|
977
|
+
width?: number;
|
|
978
|
+
/** Image height in pixels. */
|
|
979
|
+
height?: number;
|
|
980
|
+
/**
|
|
981
|
+
* The display's logical width; divide to map image pixels to action
|
|
982
|
+
* coordinates.
|
|
983
|
+
*/
|
|
984
|
+
displayWidth?: number;
|
|
985
|
+
/** The display's logical height. */
|
|
986
|
+
displayHeight?: number;
|
|
987
|
+
/** When it was captured. */
|
|
988
|
+
captureTime?: string;
|
|
989
|
+
}
|
|
990
|
+
/** ScreenshotAction captures the display into this action's result. */
|
|
991
|
+
export interface ScreenshotAction {
|
|
992
|
+
/** How to encode it. */
|
|
993
|
+
options?: ScreenshotOptions;
|
|
994
|
+
}
|
|
995
|
+
/** ScreenshotOptions says how a screenshot is encoded. */
|
|
996
|
+
export interface ScreenshotOptions {
|
|
997
|
+
/** Default PNG. */
|
|
998
|
+
format?: ImageFormat;
|
|
999
|
+
/** JPEG and WebP quality 1 to 100; default 80. */
|
|
1000
|
+
quality?: number;
|
|
1001
|
+
/**
|
|
1002
|
+
* Downscale to at most this width, keeping the aspect ratio; 0 keeps the
|
|
1003
|
+
* display size.
|
|
1004
|
+
*/
|
|
1005
|
+
maxWidth?: number;
|
|
1006
|
+
/**
|
|
1007
|
+
* Wait this long after the last action before capturing, so the screen
|
|
1008
|
+
* settles; default 300 ms, at most 5 seconds.
|
|
1009
|
+
*/
|
|
1010
|
+
settle?: string;
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* ScrollAction scrolls at a position. Positive `delta_y` scrolls down,
|
|
1014
|
+
* positive `delta_x` right.
|
|
1015
|
+
*/
|
|
1016
|
+
export interface ScrollAction {
|
|
1017
|
+
/** Where; unset scrolls at the current pointer position. */
|
|
1018
|
+
position?: Point;
|
|
1019
|
+
/** Horizontal amount in `unit`. */
|
|
1020
|
+
deltaX?: number;
|
|
1021
|
+
/** Vertical amount in `unit`. */
|
|
1022
|
+
deltaY?: number;
|
|
1023
|
+
/**
|
|
1024
|
+
* Default CLICKS (wheel notches, Anthropic `scroll_amount`); PIXELS (OpenAI
|
|
1025
|
+
* `scroll_x`/`scroll_y`) are converted at 100 pixels per notch on desktops.
|
|
1026
|
+
*/
|
|
1027
|
+
unit?: ScrollUnit;
|
|
1028
|
+
/** Keys held during the scroll, xdotool names. */
|
|
1029
|
+
modifiers?: string[];
|
|
1030
|
+
}
|
|
1031
|
+
/** The request of SetLeaseNetwork. */
|
|
1032
|
+
export interface SetLeaseNetworkRequest {
|
|
1033
|
+
/** The name of the lease. */
|
|
1034
|
+
name: string;
|
|
1035
|
+
/** The new outbound policy; replaces the old one whole. */
|
|
1036
|
+
network: LeaseNetwork;
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
* A Shape is one entry of the platform's machine catalog: OS, size, the Cell
|
|
1040
|
+
* capability it needs, and its lease bounds. The catalog is read-only; adding
|
|
1041
|
+
* a shape is a Release of the catalog.
|
|
1042
|
+
*/
|
|
1043
|
+
export interface Shape {
|
|
1044
|
+
/** `sandbox_shapes/{shape}`. */
|
|
1045
|
+
name?: string;
|
|
1046
|
+
/** `shp_<cell><ulid>`; never reused. */
|
|
1047
|
+
readonly uid?: string;
|
|
1048
|
+
/** Resource metadata. */
|
|
1049
|
+
meta?: common.ResourceMeta;
|
|
1050
|
+
/** The operating system. */
|
|
1051
|
+
readonly os?: ShapeOs;
|
|
1052
|
+
/** vCPUs; for a whole host, its cores. */
|
|
1053
|
+
readonly vcpuCount?: number;
|
|
1054
|
+
/** Memory in MiB. */
|
|
1055
|
+
readonly memoryMib?: number;
|
|
1056
|
+
/** Disk in GiB. */
|
|
1057
|
+
readonly diskGib?: number;
|
|
1058
|
+
/** The Cell capability Placement matches, for example `kata` or `macos`. */
|
|
1059
|
+
readonly capability?: string;
|
|
1060
|
+
/** The shortest lease; 24 hours for macOS. */
|
|
1061
|
+
readonly minLeaseDuration?: string;
|
|
1062
|
+
/** The longest lease. */
|
|
1063
|
+
readonly maxLeaseDuration?: string;
|
|
1064
|
+
/**
|
|
1065
|
+
* Whether the shape is sold now. A lease of an unsold shape is refused
|
|
1066
|
+
* SHAPE_NOT_OFFERED.
|
|
1067
|
+
*/
|
|
1068
|
+
readonly offered?: boolean;
|
|
1069
|
+
/**
|
|
1070
|
+
* The list price of one second of this shape, in millionths of a US
|
|
1071
|
+
* dollar; 0 for a class that is not priced. `spec.budget.max_cost_micros` is
|
|
1072
|
+
* measured against it; the invoice is Kernel Billing's.
|
|
1073
|
+
*/
|
|
1074
|
+
readonly priceMicrosPerSecond?: string;
|
|
1075
|
+
/** The lease kinds this shape can serve. */
|
|
1076
|
+
readonly kinds?: LeaseKind[];
|
|
1077
|
+
}
|
|
1078
|
+
/**
|
|
1079
|
+
* A Snapshot is a lease's disk and image captured at one moment. A lease
|
|
1080
|
+
* created with `source_snapshot` boots from it. Process memory is not
|
|
1081
|
+
* captured.
|
|
1082
|
+
*/
|
|
1083
|
+
export interface Snapshot {
|
|
1084
|
+
/** `orgs/{org}/projects/{project}/envs/{env}/snapshots/{snapshot}`. */
|
|
1085
|
+
name?: string;
|
|
1086
|
+
/** `snp_<cell><ulid>`; never reused. */
|
|
1087
|
+
readonly uid?: string;
|
|
1088
|
+
/** Resource metadata. */
|
|
1089
|
+
meta?: common.ResourceMeta;
|
|
1090
|
+
/** Desired state. */
|
|
1091
|
+
spec?: SnapshotSpec;
|
|
1092
|
+
/** Observed state. */
|
|
1093
|
+
readonly status?: SnapshotStatus;
|
|
1094
|
+
}
|
|
1095
|
+
/** SnapshotSpec is the caller-writable state of a Snapshot. */
|
|
1096
|
+
export interface SnapshotSpec {
|
|
1097
|
+
/** The running lease to capture. */
|
|
1098
|
+
sourceLease?: string;
|
|
1099
|
+
/**
|
|
1100
|
+
* Capture process memory too. Refused UNIMPLEMENTED until the microVM
|
|
1101
|
+
* runtime exposes memory snapshots (sandboxes-e2b.md D1).
|
|
1102
|
+
*/
|
|
1103
|
+
includeMemory?: boolean;
|
|
1104
|
+
/** Delete the snapshot after this long; default 7 days, at most 30 days. */
|
|
1105
|
+
retention?: string;
|
|
1106
|
+
}
|
|
1107
|
+
/** SnapshotStatus is the observed state of a Snapshot. */
|
|
1108
|
+
export interface SnapshotStatus {
|
|
1109
|
+
/** The generation this status was computed from. */
|
|
1110
|
+
readonly observedGeneration?: string;
|
|
1111
|
+
/** Ready, Reconciling, Stalled. */
|
|
1112
|
+
readonly conditions?: common.Condition[];
|
|
1113
|
+
/** The state machine. */
|
|
1114
|
+
readonly state?: SnapshotState;
|
|
1115
|
+
/** The source lease's shape. */
|
|
1116
|
+
readonly shape?: string;
|
|
1117
|
+
/** The source lease's image, by digest. */
|
|
1118
|
+
readonly image?: string;
|
|
1119
|
+
/** The source lease's kind. */
|
|
1120
|
+
readonly kind?: LeaseKind;
|
|
1121
|
+
/** Captured bytes. */
|
|
1122
|
+
readonly sizeBytes?: string;
|
|
1123
|
+
/** When the snapshot is deleted. */
|
|
1124
|
+
readonly expireTime?: string;
|
|
1125
|
+
}
|
|
1126
|
+
/**
|
|
1127
|
+
* StreamSession is how a browser or webview connects to a lease's display.
|
|
1128
|
+
* The token is short-lived, bound to the lease and its generation, and never
|
|
1129
|
+
* contains an Access key; stream traffic is never recorded or logged.
|
|
1130
|
+
*/
|
|
1131
|
+
export interface StreamSession {
|
|
1132
|
+
/** VIEWER (frames) or CONTROLLER (frames and input). */
|
|
1133
|
+
role?: StreamRole;
|
|
1134
|
+
/** The stream token. */
|
|
1135
|
+
token?: string;
|
|
1136
|
+
/**
|
|
1137
|
+
* An embeddable page (web, Telegram Mini App webview) that connects on
|
|
1138
|
+
* load; the token rides in the URL fragment and never reaches a server log.
|
|
1139
|
+
*/
|
|
1140
|
+
viewerUri?: string;
|
|
1141
|
+
/** The WebRTC signaling WebSocket; send the token as the first message. */
|
|
1142
|
+
signalingUri?: string;
|
|
1143
|
+
/** ICE servers, TURN credentials included, valid until `expire_time`. */
|
|
1144
|
+
iceServers?: IceServer[];
|
|
1145
|
+
/** The noVNC/websockify fallback WebSocket for networks that block WebRTC. */
|
|
1146
|
+
vncUri?: string;
|
|
1147
|
+
/** When the token stops admitting new connections. */
|
|
1148
|
+
expireTime?: string;
|
|
1149
|
+
/** The lease generation the token is bound to. */
|
|
1150
|
+
leaseGeneration?: string;
|
|
1151
|
+
/** For CONTROLLER: the control epoch the token is bound to. */
|
|
1152
|
+
controlEpoch?: string;
|
|
1153
|
+
/** Revokes the token early: `POST` it with the token as bearer. */
|
|
1154
|
+
revokeUri?: string;
|
|
1155
|
+
}
|
|
1156
|
+
/** TypeAction types Unicode text, including CJK and emoji. */
|
|
1157
|
+
export interface TypeAction {
|
|
1158
|
+
/** The text; at most 64 KiB. */
|
|
1159
|
+
text?: string;
|
|
1160
|
+
/** Delay between keystrokes; default 12 ms. */
|
|
1161
|
+
keystrokeDelay?: string;
|
|
1162
|
+
}
|
|
1163
|
+
/** The request of UpdatePool. */
|
|
1164
|
+
export interface UpdatePoolRequest {
|
|
1165
|
+
/** The pool to update; `name` identifies it. */
|
|
1166
|
+
pool: Pool;
|
|
1167
|
+
/** The fields to write; unset writes every populated field. */
|
|
1168
|
+
updateMask?: string;
|
|
1169
|
+
/** Create the Resource when it does not exist (declarative upsert). */
|
|
1170
|
+
allowMissing?: boolean;
|
|
1171
|
+
/** Validate and return the result without writing anything. */
|
|
1172
|
+
validateOnly?: boolean;
|
|
1173
|
+
}
|
|
1174
|
+
/** The request of UpdateVolume. */
|
|
1175
|
+
export interface UpdateVolumeRequest {
|
|
1176
|
+
/** The volume to update; `name` identifies it. */
|
|
1177
|
+
volume: Volume;
|
|
1178
|
+
/** The fields to write; unset writes every populated field. */
|
|
1179
|
+
updateMask?: string;
|
|
1180
|
+
/** Validate and return the result without writing anything. */
|
|
1181
|
+
validateOnly?: boolean;
|
|
1182
|
+
}
|
|
1183
|
+
/**
|
|
1184
|
+
* A Volume is a persistent disk scoped to one environment, encrypted at rest,
|
|
1185
|
+
* attached by name when a lease is created. It has one writer: the lease it is
|
|
1186
|
+
* attached to, fenced by that lease's generation. It survives the lease's end
|
|
1187
|
+
* and is destroyed only by Delete.
|
|
1188
|
+
*/
|
|
1189
|
+
export interface Volume {
|
|
1190
|
+
/** `orgs/{org}/projects/{project}/envs/{env}/volumes/{volume}`. */
|
|
1191
|
+
name?: string;
|
|
1192
|
+
/** `vol_<cell><ulid>`; never reused. */
|
|
1193
|
+
readonly uid?: string;
|
|
1194
|
+
/** Resource metadata. */
|
|
1195
|
+
meta?: common.ResourceMeta;
|
|
1196
|
+
/** Desired state. */
|
|
1197
|
+
spec?: VolumeSpec;
|
|
1198
|
+
/** Observed state. */
|
|
1199
|
+
readonly status?: VolumeStatus;
|
|
1200
|
+
}
|
|
1201
|
+
/** VolumeMount attaches a Volume to a lease. */
|
|
1202
|
+
export interface VolumeMount {
|
|
1203
|
+
/** The volume. */
|
|
1204
|
+
volume?: string;
|
|
1205
|
+
/** The absolute guest path; default `/home/user/volumes/{volume id}`. */
|
|
1206
|
+
mountPath?: string;
|
|
1207
|
+
/** Mount read-only. */
|
|
1208
|
+
readOnly?: boolean;
|
|
1209
|
+
}
|
|
1210
|
+
/** VolumeSpec is the caller-writable state of a Volume. */
|
|
1211
|
+
export interface VolumeSpec {
|
|
1212
|
+
/** Size in GiB, 1 to 1024; it may grow and never shrink. */
|
|
1213
|
+
sizeGib?: number;
|
|
1214
|
+
}
|
|
1215
|
+
/** VolumeStatus is the observed state of a Volume. */
|
|
1216
|
+
export interface VolumeStatus {
|
|
1217
|
+
/** The generation this status was computed from. */
|
|
1218
|
+
readonly observedGeneration?: string;
|
|
1219
|
+
/** Ready, Reconciling, Stalled. */
|
|
1220
|
+
readonly conditions?: common.Condition[];
|
|
1221
|
+
/** The state machine. */
|
|
1222
|
+
readonly state?: VolumeState;
|
|
1223
|
+
/** The lease the volume is attached to. */
|
|
1224
|
+
readonly attachedLease?: string;
|
|
1225
|
+
/** The generation of `attached_lease` that holds the write fence. */
|
|
1226
|
+
readonly attachedGeneration?: string;
|
|
1227
|
+
/** Always true: every volume is encrypted at rest with its own key. */
|
|
1228
|
+
readonly encrypted?: boolean;
|
|
1229
|
+
}
|
|
1230
|
+
/** WaitAction sleeps. */
|
|
1231
|
+
export interface WaitAction {
|
|
1232
|
+
/** How long; at most 30 seconds. */
|
|
1233
|
+
duration?: string;
|
|
1234
|
+
}
|
|
1235
|
+
/** The request of WriteLeaseFile. */
|
|
1236
|
+
export interface WriteLeaseFileRequest {
|
|
1237
|
+
/** The name of the lease. */
|
|
1238
|
+
name: string;
|
|
1239
|
+
/** The absolute path in the guest. */
|
|
1240
|
+
path: string;
|
|
1241
|
+
/** The file's bytes. */
|
|
1242
|
+
content: string;
|
|
1243
|
+
/** The file mode bits; default 0644. */
|
|
1244
|
+
mode?: number;
|
|
1245
|
+
}
|
|
1246
|
+
/** The response of WriteLeaseFile. */
|
|
1247
|
+
export interface WriteLeaseFileResponse {
|
|
1248
|
+
/** Bytes written. */
|
|
1249
|
+
sizeBytes?: string;
|
|
1250
|
+
}
|
|
1251
|
+
/** ZoomAction captures one region of the display. */
|
|
1252
|
+
export interface ZoomAction {
|
|
1253
|
+
/** The region, in display pixels. */
|
|
1254
|
+
region?: Region;
|
|
1255
|
+
/** How to encode it; the region is scaled to `options.max_width` when set. */
|
|
1256
|
+
options?: ScreenshotOptions;
|
|
1257
|
+
}
|
|
1258
|
+
/** ControlHolder is who holds a lease's input control. */
|
|
1259
|
+
export type ControlHolder = 'agent' | 'human' | (string & {});
|
|
1260
|
+
/** EgressPolicy is a lease's outbound rule. */
|
|
1261
|
+
export type EgressPolicy = 'allow' | 'deny' | 'allowlist' | (string & {});
|
|
1262
|
+
/** EndReason is why a lease ended. */
|
|
1263
|
+
export type EndReason = 'released' | 'expired' | 'idle' | 'cpu_budget' | 'cost_budget' | 'abuse' | 'quota' | 'org_deleted' | 'machine_lost' | 'boot_failed' | (string & {});
|
|
1264
|
+
/** ImageFormat is a screenshot encoding. */
|
|
1265
|
+
export type ImageFormat = 'png' | 'jpeg' | 'webp' | (string & {});
|
|
1266
|
+
/** LeaseEventKind is what a LeaseEvent records. */
|
|
1267
|
+
export type LeaseEventKind = 'granted' | 'ready' | 'refused' | 'ended' | 'renewed' | 'network_changed' | 'control_acquired' | 'control_released' | 'control_expired' | 'budget_warning' | 'paused' | 'resumed' | (string & {});
|
|
1268
|
+
/** LeaseKind is what a lease's machine serves. */
|
|
1269
|
+
export type LeaseKind = 'general' | 'browser' | 'desktop' | 'android' | (string & {});
|
|
1270
|
+
/**
|
|
1271
|
+
* LeaseRefusal is the typed reason a lease was not granted. There is no global
|
|
1272
|
+
* queue: a lease is granted now or refused.
|
|
1273
|
+
*/
|
|
1274
|
+
export type LeaseRefusal = 'no_capacity' | 'no_matching_cell' | 'shape_not_offered' | 'shape_not_entitled' | 'image_not_found' | 'abuse_hold' | (string & {});
|
|
1275
|
+
/** LeaseState is the lease state machine (sandboxes-e2b.md §5.4). */
|
|
1276
|
+
export type LeaseState = 'requested' | 'granted' | 'ready' | 'paused' | 'ending' | 'ended' | 'refused' | (string & {});
|
|
1277
|
+
/** MouseButton is a pointer button. */
|
|
1278
|
+
export type MouseButton = 'left' | 'right' | 'middle' | 'back' | 'forward' | (string & {});
|
|
1279
|
+
/** PortVisibility is who can reach a lease port. */
|
|
1280
|
+
export type PortVisibility = 'private' | 'public' | (string & {});
|
|
1281
|
+
/** ScrollUnit is the unit of a scroll amount. */
|
|
1282
|
+
export type ScrollUnit = 'clicks' | 'pixels' | (string & {});
|
|
1283
|
+
/** ShapeOs is the operating system of a shape. */
|
|
1284
|
+
export type ShapeOs = 'linux' | 'macos' | (string & {});
|
|
1285
|
+
/** SnapshotState is the snapshot state machine. */
|
|
1286
|
+
export type SnapshotState = 'creating' | 'ready' | 'failed' | 'deleting' | (string & {});
|
|
1287
|
+
/** StreamRole is what a stream token admits. */
|
|
1288
|
+
export type StreamRole = 'viewer' | 'controller' | (string & {});
|
|
1289
|
+
/** TokenScope is what a lease token admits. */
|
|
1290
|
+
export type TokenScope = 'guest' | 'ports' | 'cdp' | 'computer' | (string & {});
|
|
1291
|
+
/** VolumeState is the volume state machine. */
|
|
1292
|
+
export type VolumeState = 'creating' | 'available' | 'attached' | 'deleting' | 'failed' | (string & {});
|
|
1293
|
+
/**
|
|
1294
|
+
* SandboxesService is Sylphx Sandboxes: isolated machines leased for a bounded
|
|
1295
|
+
* time, granted immediately or refused with a typed reason, and destroyed
|
|
1296
|
+
* before anyone else can touch them (docs/specs/one-platform/sandboxes-e2b.md).
|
|
1297
|
+
* Every agent-computer surface is here: exec and files, computer actions that
|
|
1298
|
+
* map one-to-one onto the Anthropic computer tool and OpenAI computer-use
|
|
1299
|
+
* actions and return the post-action screenshot in the same call, CDP, live
|
|
1300
|
+
* streams, and human takeover. The streaming guest protocol (E2B envd) is
|
|
1301
|
+
* served at `status.endpoints.guest_uri`.
|
|
1302
|
+
*
|
|
1303
|
+
* Namespace of Sylphx Sandboxes on `Sylphx`.
|
|
1304
|
+
*/
|
|
1305
|
+
export declare class SandboxesApi {
|
|
1306
|
+
/** The `sandbox_shapes` collection. */
|
|
1307
|
+
readonly sandboxShapes: SandboxShapesCollection;
|
|
1308
|
+
/** The `pools` collection. */
|
|
1309
|
+
readonly pools: PoolsCollection;
|
|
1310
|
+
/** The `leases` collection. */
|
|
1311
|
+
readonly leases: LeasesCollection;
|
|
1312
|
+
/** The `lease_events` collection. */
|
|
1313
|
+
readonly leaseEvents: LeaseEventsCollection;
|
|
1314
|
+
/** The `volumes` collection. */
|
|
1315
|
+
readonly volumes: VolumesCollection;
|
|
1316
|
+
/** The `snapshots` collection. */
|
|
1317
|
+
readonly snapshots: SnapshotsCollection;
|
|
1318
|
+
constructor(client: runtime.Client);
|
|
1319
|
+
}
|
|
1320
|
+
/** `sandbox_shapes` of Sylphx Sandboxes: Resource type `sandboxes.sylphx.com/Shape`. */
|
|
1321
|
+
export declare class SandboxShapesCollection {
|
|
1322
|
+
private readonly client;
|
|
1323
|
+
constructor(client: runtime.Client);
|
|
1324
|
+
/**
|
|
1325
|
+
* Gets a shape.
|
|
1326
|
+
*
|
|
1327
|
+
* `GET /v1/{name=sandbox_shapes/*}` · permission `sandboxes:read` · effect `read`
|
|
1328
|
+
*
|
|
1329
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
1330
|
+
*/
|
|
1331
|
+
get(request: GetShapeRequest): Promise<Shape>;
|
|
1332
|
+
/**
|
|
1333
|
+
* Lists shapes.
|
|
1334
|
+
*
|
|
1335
|
+
* `GET /v1/sandbox_shapes` · permission `sandboxes:read` · effect `read`
|
|
1336
|
+
*
|
|
1337
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
|
|
1338
|
+
*/
|
|
1339
|
+
list(request: ListSandboxShapesRequest): Promise<ListSandboxShapesResponse>;
|
|
1340
|
+
/** Every item of every page of `list`. */
|
|
1341
|
+
listAll(request: ListSandboxShapesRequest): AsyncGenerator<Shape>;
|
|
1342
|
+
}
|
|
1343
|
+
/** `pools` of Sylphx Sandboxes: Resource type `sandboxes.sylphx.com/Pool`. */
|
|
1344
|
+
export declare class PoolsCollection {
|
|
1345
|
+
private readonly client;
|
|
1346
|
+
constructor(client: runtime.Client);
|
|
1347
|
+
/**
|
|
1348
|
+
* Gets a pool.
|
|
1349
|
+
*
|
|
1350
|
+
* `GET /v1/{name=orgs/*\/projects/*\/envs/*\/pools/*}` · permission `sandboxes:read` · effect `read`
|
|
1351
|
+
*
|
|
1352
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
1353
|
+
*/
|
|
1354
|
+
get(request: GetPoolRequest): Promise<Pool>;
|
|
1355
|
+
/**
|
|
1356
|
+
* Lists pools in a environment.
|
|
1357
|
+
*
|
|
1358
|
+
* `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/pools` · permission `sandboxes:read` · effect `read`
|
|
1359
|
+
*
|
|
1360
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
|
|
1361
|
+
*/
|
|
1362
|
+
list(request: ListPoolsRequest): Promise<ListPoolsResponse>;
|
|
1363
|
+
/** Every item of every page of `list`. */
|
|
1364
|
+
listAll(request: ListPoolsRequest): AsyncGenerator<Pool>;
|
|
1365
|
+
/**
|
|
1366
|
+
* Creates a pool. The Operation is done when the controller settles it.
|
|
1367
|
+
*
|
|
1368
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/pools` · permission `sandboxes:write` · effect `write`
|
|
1369
|
+
*
|
|
1370
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`, `SPEND_LIMIT_REACHED`.
|
|
1371
|
+
*/
|
|
1372
|
+
create(request: CreatePoolRequest): Promise<runtime.Operation<Pool>>;
|
|
1373
|
+
/**
|
|
1374
|
+
* Updates a pool.
|
|
1375
|
+
*
|
|
1376
|
+
* `PATCH /v1/{pool.name=orgs/*\/projects/*\/envs/*\/pools/*}` · permission `sandboxes:write` · effect `write`
|
|
1377
|
+
*
|
|
1378
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1379
|
+
*/
|
|
1380
|
+
update(request: UpdatePoolRequest): Promise<runtime.Operation<Pool>>;
|
|
1381
|
+
/**
|
|
1382
|
+
* Deletes a pool.
|
|
1383
|
+
*
|
|
1384
|
+
* `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/pools/*}` · permission `sandboxes:write` · effect `destructive`
|
|
1385
|
+
*
|
|
1386
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1387
|
+
*/
|
|
1388
|
+
delete(request: DeletePoolRequest): Promise<runtime.Operation<Record<string, never>>>;
|
|
1389
|
+
}
|
|
1390
|
+
/** `leases` of Sylphx Sandboxes: Resource type `sandboxes.sylphx.com/Lease`. */
|
|
1391
|
+
export declare class LeasesCollection {
|
|
1392
|
+
private readonly client;
|
|
1393
|
+
constructor(client: runtime.Client);
|
|
1394
|
+
/**
|
|
1395
|
+
* Gets a lease.
|
|
1396
|
+
*
|
|
1397
|
+
* `GET /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}` · permission `sandboxes:read` · effect `read`
|
|
1398
|
+
*
|
|
1399
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
1400
|
+
*/
|
|
1401
|
+
get(request: GetLeaseRequest): Promise<Lease>;
|
|
1402
|
+
/**
|
|
1403
|
+
* Lists leases in a environment. Filter on `meta.labels` (for example
|
|
1404
|
+
* `labels.agent = "a_123"`), `status.state`, and `spec.kind`.
|
|
1405
|
+
*
|
|
1406
|
+
* `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/leases` · permission `sandboxes:read` · effect `read`
|
|
1407
|
+
*
|
|
1408
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
|
|
1409
|
+
*/
|
|
1410
|
+
list(request: ListLeasesRequest): Promise<ListLeasesResponse>;
|
|
1411
|
+
/** Every item of every page of `list`. */
|
|
1412
|
+
listAll(request: ListLeasesRequest): AsyncGenerator<Lease>;
|
|
1413
|
+
/**
|
|
1414
|
+
* Creates a lease: granted now and returned READY (or GRANTED when
|
|
1415
|
+
* `wait_ready` is false), or refused with a typed error. There is no queue.
|
|
1416
|
+
*
|
|
1417
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/leases` · permission `sandboxes:write` · effect `write`
|
|
1418
|
+
*
|
|
1419
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `RESOURCE_NOT_FOUND`, `RESOURCE_IN_USE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `NO_CAPACITY`, `SHAPE_NOT_OFFERED`, `PLAN_LIMIT_REACHED`, `SPEND_LIMIT_REACHED`.
|
|
1420
|
+
*/
|
|
1421
|
+
create(request: CreateLeaseRequest): Promise<Lease>;
|
|
1422
|
+
/**
|
|
1423
|
+
* Extends `expire_time`, never past the shape's longest lease. Does not
|
|
1424
|
+
* change the generation.
|
|
1425
|
+
*
|
|
1426
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:renew` · permission `sandboxes:write` · effect `write`
|
|
1427
|
+
*
|
|
1428
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1429
|
+
*/
|
|
1430
|
+
renew(request: RenewLeaseRequest): Promise<Lease>;
|
|
1431
|
+
/**
|
|
1432
|
+
* Ends a lease with END_REASON_RELEASED; the machine is destroyed and never
|
|
1433
|
+
* leased again, and attached volumes are detached.
|
|
1434
|
+
*
|
|
1435
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:release` · permission `sandboxes:write` · effect `destructive`
|
|
1436
|
+
*
|
|
1437
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1438
|
+
*/
|
|
1439
|
+
release(request: ReleaseLeaseRequest): Promise<Lease>;
|
|
1440
|
+
/**
|
|
1441
|
+
* Pauses a lease: its disk is kept and its machine destroyed; the
|
|
1442
|
+
* generation increases. Process memory is not kept.
|
|
1443
|
+
*
|
|
1444
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:pause` · permission `sandboxes:write` · effect `write`
|
|
1445
|
+
*
|
|
1446
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNIMPLEMENTED`.
|
|
1447
|
+
*/
|
|
1448
|
+
pause(request: PauseLeaseRequest): Promise<Lease>;
|
|
1449
|
+
/**
|
|
1450
|
+
* Resumes a paused lease on a machine granted now, or refuses it; the
|
|
1451
|
+
* generation increases.
|
|
1452
|
+
*
|
|
1453
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:resume` · permission `sandboxes:write` · effect `write`
|
|
1454
|
+
*
|
|
1455
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `NO_CAPACITY`, `UNIMPLEMENTED`.
|
|
1456
|
+
*/
|
|
1457
|
+
resume(request: ResumeLeaseRequest): Promise<Lease>;
|
|
1458
|
+
/**
|
|
1459
|
+
* Replaces a running lease's outbound policy. The generation does not
|
|
1460
|
+
* change; the Cell applies it before the call returns.
|
|
1461
|
+
*
|
|
1462
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:setNetwork` · permission `sandboxes:write` · effect `write`
|
|
1463
|
+
*
|
|
1464
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1465
|
+
*/
|
|
1466
|
+
setNetwork(request: SetLeaseNetworkRequest): Promise<Lease>;
|
|
1467
|
+
/**
|
|
1468
|
+
* Mints a lease token for the data plane, bound to the current generation.
|
|
1469
|
+
* Hand it to a process that must not hold the Access key.
|
|
1470
|
+
*
|
|
1471
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:mintToken` · permission `sandboxes:exec` · effect `write`
|
|
1472
|
+
*
|
|
1473
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1474
|
+
*/
|
|
1475
|
+
mintToken(request: MintLeaseTokenRequest): Promise<MintLeaseTokenResponse>;
|
|
1476
|
+
/**
|
|
1477
|
+
* Runs one command in the lease to completion and returns its output, capped
|
|
1478
|
+
* at 1 MiB per stream. Long-running or interactive processes use the guest
|
|
1479
|
+
* protocol at `status.endpoints.guest_uri`.
|
|
1480
|
+
*
|
|
1481
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:exec` · permission `sandboxes:exec` · effect `write`
|
|
1482
|
+
*
|
|
1483
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `STALE_GENERATION`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1484
|
+
*/
|
|
1485
|
+
exec(request: ExecLeaseRequest): Promise<ExecLeaseResponse>;
|
|
1486
|
+
/**
|
|
1487
|
+
* Reads one file from the lease, at most 16 MiB; larger files use the
|
|
1488
|
+
* guest's `/files`.
|
|
1489
|
+
*
|
|
1490
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:readFile` · permission `sandboxes:exec` · effect `read`
|
|
1491
|
+
*
|
|
1492
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `NOT_FOUND`, `INVALID_STATE`.
|
|
1493
|
+
*/
|
|
1494
|
+
readFile(request: ReadLeaseFileRequest): Promise<ReadLeaseFileResponse>;
|
|
1495
|
+
/**
|
|
1496
|
+
* Writes one file in the lease, at most 16 MiB, creating parent directories.
|
|
1497
|
+
*
|
|
1498
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:writeFile` · permission `sandboxes:exec` · effect `write`
|
|
1499
|
+
*
|
|
1500
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1501
|
+
*/
|
|
1502
|
+
writeFile(request: WriteLeaseFileRequest): Promise<WriteLeaseFileResponse>;
|
|
1503
|
+
/**
|
|
1504
|
+
* Lists one directory in the lease.
|
|
1505
|
+
*
|
|
1506
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:listFiles` · permission `sandboxes:exec` · effect `read`
|
|
1507
|
+
*
|
|
1508
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `NOT_FOUND`, `INVALID_STATE`.
|
|
1509
|
+
*/
|
|
1510
|
+
listFiles(request: ListLeaseFilesRequest): Promise<ListLeaseFilesResponse>;
|
|
1511
|
+
/**
|
|
1512
|
+
* Removes one file or directory tree in the lease.
|
|
1513
|
+
*
|
|
1514
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:removeFile` · permission `sandboxes:exec` · effect `destructive`
|
|
1515
|
+
*
|
|
1516
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1517
|
+
*/
|
|
1518
|
+
removeFile(request: RemoveLeaseFileRequest): Promise<RemoveLeaseFileResponse>;
|
|
1519
|
+
/**
|
|
1520
|
+
* Exposes a guest port.
|
|
1521
|
+
*
|
|
1522
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:openPort` · permission `sandboxes:exec` · effect `write`
|
|
1523
|
+
*
|
|
1524
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNIMPLEMENTED`.
|
|
1525
|
+
*/
|
|
1526
|
+
openPort(request: OpenLeasePortRequest): Promise<Lease>;
|
|
1527
|
+
/**
|
|
1528
|
+
* Stops exposing a guest port.
|
|
1529
|
+
*
|
|
1530
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:closePort` · permission `sandboxes:exec` · effect `write`
|
|
1531
|
+
*
|
|
1532
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNIMPLEMENTED`.
|
|
1533
|
+
*/
|
|
1534
|
+
closePort(request: CloseLeasePortRequest): Promise<Lease>;
|
|
1535
|
+
/**
|
|
1536
|
+
* Performs computer actions on a DESKTOP, BROWSER, or ANDROID lease, in
|
|
1537
|
+
* order, and returns each action's result and, when `screenshot` is set,
|
|
1538
|
+
* the screenshot taken after the last action. The actions are the Anthropic
|
|
1539
|
+
* computer tool's and OpenAI computer use's, one-to-one
|
|
1540
|
+
* (docs/services/sandboxes/computer-use.md). Refused CONTROL_HELD_BY_HUMAN
|
|
1541
|
+
* while a human holds control.
|
|
1542
|
+
*
|
|
1543
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:act` · permission `sandboxes:exec` · effect `write`
|
|
1544
|
+
*
|
|
1545
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `STALE_GENERATION`, `CONTROL_HELD`, `CONTROL_HELD_BY_HUMAN`.
|
|
1546
|
+
*/
|
|
1547
|
+
act(request: ActLeaseRequest): Promise<ActLeaseResponse>;
|
|
1548
|
+
/**
|
|
1549
|
+
* Opens a read-only live view of a lease's display: a short-lived viewer
|
|
1550
|
+
* token bound to the lease and its generation, an embeddable URL, and the
|
|
1551
|
+
* WebRTC signaling endpoint with ICE servers. Input needs control
|
|
1552
|
+
* (AcquireLeaseControl).
|
|
1553
|
+
*
|
|
1554
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:openStream` · permission `sandboxes:exec` · effect `write`
|
|
1555
|
+
*
|
|
1556
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`.
|
|
1557
|
+
*/
|
|
1558
|
+
openStream(request: OpenLeaseStreamRequest): Promise<StreamSession>;
|
|
1559
|
+
/**
|
|
1560
|
+
* Takes exclusive input control of a lease's display. A HUMAN acquire
|
|
1561
|
+
* preempts an AGENT holder and returns a controller stream; an AGENT acquire
|
|
1562
|
+
* is refused CONTROL_HELD_BY_HUMAN while a human holds control. Control
|
|
1563
|
+
* lapses at `ttl`, which the Cell caps at 30 minutes.
|
|
1564
|
+
*
|
|
1565
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:acquireControl` · permission `sandboxes:exec` · effect `write`
|
|
1566
|
+
*
|
|
1567
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `CONTROL_HELD`, `CONTROL_HELD_BY_HUMAN`.
|
|
1568
|
+
*/
|
|
1569
|
+
acquireControl(request: AcquireLeaseControlRequest): Promise<AcquireLeaseControlResponse>;
|
|
1570
|
+
/**
|
|
1571
|
+
* Releases control held under `epoch`; its controller tokens stop working.
|
|
1572
|
+
*
|
|
1573
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:releaseControl` · permission `sandboxes:exec` · effect `write`
|
|
1574
|
+
*
|
|
1575
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `STALE_GENERATION`.
|
|
1576
|
+
*/
|
|
1577
|
+
releaseControl(request: ReleaseLeaseControlRequest): Promise<ControlState>;
|
|
1578
|
+
/**
|
|
1579
|
+
* Gets who holds control of a lease's display.
|
|
1580
|
+
*
|
|
1581
|
+
* `GET /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:getControl` · permission `sandboxes:read` · effect `read`
|
|
1582
|
+
*
|
|
1583
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
1584
|
+
*/
|
|
1585
|
+
getControl(request: GetLeaseControlRequest): Promise<ControlState>;
|
|
1586
|
+
/**
|
|
1587
|
+
* Installs an Android app (APK) on an ANDROID lease.
|
|
1588
|
+
*
|
|
1589
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:installApp` · permission `sandboxes:exec` · effect `write`
|
|
1590
|
+
*
|
|
1591
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `NOT_FOUND`, `UNIMPLEMENTED`.
|
|
1592
|
+
*/
|
|
1593
|
+
installApp(request: InstallLeaseAppRequest): Promise<InstallLeaseAppResponse>;
|
|
1594
|
+
}
|
|
1595
|
+
/** `lease_events` of Sylphx Sandboxes: Resource type `sandboxes.sylphx.com/LeaseEvent`. */
|
|
1596
|
+
export declare class LeaseEventsCollection {
|
|
1597
|
+
private readonly client;
|
|
1598
|
+
constructor(client: runtime.Client);
|
|
1599
|
+
/**
|
|
1600
|
+
* Gets one lease event.
|
|
1601
|
+
*
|
|
1602
|
+
* `GET /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*\/lease_events/*}` · permission `sandboxes:read` · effect `read`
|
|
1603
|
+
*
|
|
1604
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
1605
|
+
*/
|
|
1606
|
+
get(request: GetLeaseEventRequest): Promise<LeaseEvent>;
|
|
1607
|
+
/**
|
|
1608
|
+
* Lists a lease's events in order. With `wait`, blocks up to that long
|
|
1609
|
+
* for an event after `page_token` (long poll).
|
|
1610
|
+
*
|
|
1611
|
+
* `GET /v1/{parent=orgs/*\/projects/*\/envs/*\/leases/*}/lease_events` · permission `sandboxes:read` · effect `read`
|
|
1612
|
+
*
|
|
1613
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
|
|
1614
|
+
*/
|
|
1615
|
+
list(request: ListLeaseEventsRequest): Promise<ListLeaseEventsResponse>;
|
|
1616
|
+
/** Every item of every page of `list`. */
|
|
1617
|
+
listAll(request: ListLeaseEventsRequest): AsyncGenerator<LeaseEvent>;
|
|
1618
|
+
}
|
|
1619
|
+
/** `volumes` of Sylphx Sandboxes: Resource type `sandboxes.sylphx.com/Volume`. */
|
|
1620
|
+
export declare class VolumesCollection {
|
|
1621
|
+
private readonly client;
|
|
1622
|
+
constructor(client: runtime.Client);
|
|
1623
|
+
/**
|
|
1624
|
+
* Gets a volume.
|
|
1625
|
+
*
|
|
1626
|
+
* `GET /v1/{name=orgs/*\/projects/*\/envs/*\/volumes/*}` · permission `sandboxes:read` · effect `read`
|
|
1627
|
+
*
|
|
1628
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
1629
|
+
*/
|
|
1630
|
+
get(request: GetVolumeRequest): Promise<Volume>;
|
|
1631
|
+
/**
|
|
1632
|
+
* Lists volumes in a environment.
|
|
1633
|
+
*
|
|
1634
|
+
* `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/volumes` · permission `sandboxes:read` · effect `read`
|
|
1635
|
+
*
|
|
1636
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
|
|
1637
|
+
*/
|
|
1638
|
+
list(request: ListVolumesRequest): Promise<ListVolumesResponse>;
|
|
1639
|
+
/** Every item of every page of `list`. */
|
|
1640
|
+
listAll(request: ListVolumesRequest): AsyncGenerator<Volume>;
|
|
1641
|
+
/**
|
|
1642
|
+
* Creates a volume.
|
|
1643
|
+
*
|
|
1644
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/volumes` · permission `sandboxes:write` · effect `write`
|
|
1645
|
+
*
|
|
1646
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`.
|
|
1647
|
+
*/
|
|
1648
|
+
create(request: CreateVolumeRequest): Promise<Volume>;
|
|
1649
|
+
/**
|
|
1650
|
+
* Updates a volume: grows `spec.size_gib` and edits metadata.
|
|
1651
|
+
*
|
|
1652
|
+
* `PATCH /v1/{volume.name=orgs/*\/projects/*\/envs/*\/volumes/*}` · permission `sandboxes:write` · effect `write`
|
|
1653
|
+
*
|
|
1654
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1655
|
+
*/
|
|
1656
|
+
update(request: UpdateVolumeRequest): Promise<Volume>;
|
|
1657
|
+
/**
|
|
1658
|
+
* Deletes a volume and destroys its data. Refused RESOURCE_IN_USE while it
|
|
1659
|
+
* is attached.
|
|
1660
|
+
*
|
|
1661
|
+
* `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/volumes/*}` · permission `sandboxes:write` · effect `destructive`
|
|
1662
|
+
*
|
|
1663
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `RESOURCE_IN_USE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1664
|
+
*/
|
|
1665
|
+
delete(request: DeleteVolumeRequest): Promise<Volume>;
|
|
1666
|
+
}
|
|
1667
|
+
/** `snapshots` of Sylphx Sandboxes: Resource type `sandboxes.sylphx.com/Snapshot`. */
|
|
1668
|
+
export declare class SnapshotsCollection {
|
|
1669
|
+
private readonly client;
|
|
1670
|
+
constructor(client: runtime.Client);
|
|
1671
|
+
/**
|
|
1672
|
+
* Gets a snapshot.
|
|
1673
|
+
*
|
|
1674
|
+
* `GET /v1/{name=orgs/*\/projects/*\/envs/*\/snapshots/*}` · permission `sandboxes:read` · effect `read`
|
|
1675
|
+
*
|
|
1676
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
1677
|
+
*/
|
|
1678
|
+
get(request: GetSnapshotRequest): Promise<Snapshot>;
|
|
1679
|
+
/**
|
|
1680
|
+
* Lists snapshots in a environment.
|
|
1681
|
+
*
|
|
1682
|
+
* `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/snapshots` · permission `sandboxes:read` · effect `read`
|
|
1683
|
+
*
|
|
1684
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
|
|
1685
|
+
*/
|
|
1686
|
+
list(request: ListSnapshotsRequest): Promise<ListSnapshotsResponse>;
|
|
1687
|
+
/** Every item of every page of `list`. */
|
|
1688
|
+
listAll(request: ListSnapshotsRequest): AsyncGenerator<Snapshot>;
|
|
1689
|
+
/**
|
|
1690
|
+
* Captures a running lease's disk as a snapshot.
|
|
1691
|
+
*
|
|
1692
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/snapshots` · permission `sandboxes:write` · effect `write`
|
|
1693
|
+
*
|
|
1694
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `RESOURCE_NOT_FOUND`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`, `UNIMPLEMENTED`.
|
|
1695
|
+
*/
|
|
1696
|
+
create(request: CreateSnapshotRequest): Promise<Snapshot>;
|
|
1697
|
+
/**
|
|
1698
|
+
* Deletes a snapshot.
|
|
1699
|
+
*
|
|
1700
|
+
* `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/snapshots/*}` · permission `sandboxes:write` · effect `destructive`
|
|
1701
|
+
*
|
|
1702
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1703
|
+
*/
|
|
1704
|
+
delete(request: DeleteSnapshotRequest): Promise<Snapshot>;
|
|
1705
|
+
}
|