tensorlake 0.5.5 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/darwin-arm64/tensorlake +0 -0
- package/dist/bin/darwin-arm64/tl +0 -0
- package/dist/bin/linux-x64/tensorlake +0 -0
- package/dist/bin/linux-x64/tl +0 -0
- package/dist/bin/win32-x64/tensorlake.exe +0 -0
- package/dist/bin/win32-x64/tl.exe +0 -0
- package/dist/index.cjs +120 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -22
- package/dist/index.d.ts +34 -22
- package/dist/index.js +120 -35
- package/dist/index.js.map +1 -1
- package/dist/{sandbox-image-BmhjX2bC.d.cts → sandbox-image-BMDaNpZ2.d.cts} +1 -1
- package/dist/{sandbox-image-BmhjX2bC.d.ts → sandbox-image-BMDaNpZ2.d.ts} +1 -1
- package/dist/sandbox-image.cjs +120 -35
- package/dist/sandbox-image.cjs.map +1 -1
- package/dist/sandbox-image.d.cts +1 -1
- package/dist/sandbox-image.d.ts +1 -1
- package/dist/sandbox-image.js +120 -35
- package/dist/sandbox-image.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CreatePtySessionOptions, S as SandboxOptions, a as CreateAndConnectOptions, b as SandboxClientOptions, c as ConnectOptions, d as SnapshotInfo, e as
|
|
2
|
-
export { x as CheckpointType, y as ContainerResourcesInfo, z as ContainerState, A as CreateSandboxImageOptions, B as DirectoryEntry, E as DockerfileBuildPlan, F as DockerfileInstruction, I as Image, G as ImageBuildOperation, J as ImageBuildOperationType, J as ImageBuildOperationTypeValue, K as ImageOptions, N as NetworkConfig, M as OutputMode, Q as PoolContainerInfo, T as ProcessStatus, V as SandboxImageSource, W as SnapshotStatus, X as SnapshotType, Y as StdinMode, Z as createSandboxImage, _ as dockerfileContent } from './sandbox-image-
|
|
1
|
+
import { C as CreatePtySessionOptions, S as SandboxOptions, a as CreateAndConnectOptions, b as SandboxClientOptions, c as ConnectOptions, d as SnapshotInfo, e as SandboxInfo, f as SandboxStatus, U as UpdateSandboxOptions, g as SuspendResumeOptions, h as CheckpointOptions, R as RunOptions, i as CommandResult, j as StartProcessOptions, P as ProcessInfo, k as SendSignalResponse, O as OutputResponse, l as OutputEvent, L as ListDirectoryResponse, m as PtySessionInfo, H as HealthResponse, D as DaemonInfo, n as CreateSandboxOptions, o as CreateSandboxResponse, p as SandboxPortAccess, q as SnapshotOptions, r as CreateSnapshotResponse, s as SnapshotAndWaitOptions, t as CreatePoolOptions, u as CreateSandboxPoolResponse, v as SandboxPoolInfo, w as UpdatePoolOptions } from './sandbox-image-BMDaNpZ2.cjs';
|
|
2
|
+
export { x as CheckpointType, y as ContainerResourcesInfo, z as ContainerState, A as CreateSandboxImageOptions, B as DirectoryEntry, E as DockerfileBuildPlan, F as DockerfileInstruction, I as Image, G as ImageBuildOperation, J as ImageBuildOperationType, J as ImageBuildOperationTypeValue, K as ImageOptions, N as NetworkConfig, M as OutputMode, Q as PoolContainerInfo, T as ProcessStatus, V as SandboxImageSource, W as SnapshotStatus, X as SnapshotType, Y as StdinMode, Z as createSandboxImage, _ as dockerfileContent } from './sandbox-image-BMDaNpZ2.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The return value of every SDK operation. Carries the W3C `trace_id` so callers
|
|
@@ -191,8 +191,8 @@ declare class Sandbox {
|
|
|
191
191
|
/**
|
|
192
192
|
* Attach to an existing sandbox and return a connected handle.
|
|
193
193
|
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
194
|
+
* Returns immediately without contacting the server. Call `sandbox.info()`
|
|
195
|
+
* to fetch the current state on demand. Does **not** auto-resume a suspended
|
|
196
196
|
* sandbox — call `sandbox.resume()` explicitly.
|
|
197
197
|
*/
|
|
198
198
|
static connect(options: ConnectOptions & Partial<SandboxClientOptions>): Promise<Sandbox>;
|
|
@@ -200,7 +200,13 @@ declare class Sandbox {
|
|
|
200
200
|
static getSnapshot(snapshotId: string, options?: Partial<SandboxClientOptions>): Promise<SnapshotInfo>;
|
|
201
201
|
/** Delete a snapshot by ID. No sandbox handle needed. */
|
|
202
202
|
static deleteSnapshot(snapshotId: string, options?: Partial<SandboxClientOptions>): Promise<void>;
|
|
203
|
+
/** List all sandboxes. No sandbox handle needed. */
|
|
204
|
+
static list(options?: Partial<SandboxClientOptions>): Promise<SandboxInfo[]>;
|
|
205
|
+
/** List all snapshots in the project. No sandbox handle needed. */
|
|
206
|
+
static listSnapshots(options?: Partial<SandboxClientOptions>): Promise<SnapshotInfo[]>;
|
|
203
207
|
private requireLifecycleClient;
|
|
208
|
+
/** Fetch the current sandbox information from the server on demand. */
|
|
209
|
+
info(): Promise<Traced<SandboxInfo>>;
|
|
204
210
|
/**
|
|
205
211
|
* Fetch the current sandbox status from the server.
|
|
206
212
|
*
|
|
@@ -214,7 +220,7 @@ declare class Sandbox {
|
|
|
214
220
|
* Naming an ephemeral sandbox makes it non-ephemeral and enables
|
|
215
221
|
* suspend/resume.
|
|
216
222
|
*/
|
|
217
|
-
update(options: UpdateSandboxOptions): Promise<SandboxInfo
|
|
223
|
+
update(options: UpdateSandboxOptions): Promise<Traced<SandboxInfo>>;
|
|
218
224
|
/**
|
|
219
225
|
* Suspend this sandbox.
|
|
220
226
|
*
|
|
@@ -237,7 +243,7 @@ declare class Sandbox {
|
|
|
237
243
|
* the completed `SnapshotInfo`. Pass `{ wait: false }` to fire-and-return
|
|
238
244
|
* (returns `undefined`).
|
|
239
245
|
*/
|
|
240
|
-
checkpoint(options?: CheckpointOptions): Promise<SnapshotInfo | undefined>;
|
|
246
|
+
checkpoint(options?: CheckpointOptions): Promise<Traced<SnapshotInfo> | undefined>;
|
|
241
247
|
/**
|
|
242
248
|
* List snapshots taken from this sandbox.
|
|
243
249
|
*/
|
|
@@ -252,7 +258,7 @@ declare class Sandbox {
|
|
|
252
258
|
* Uses a single streaming `POST /api/v1/processes/run` request that starts
|
|
253
259
|
* the process, streams output, and delivers the exit code over one connection.
|
|
254
260
|
*/
|
|
255
|
-
run(command: string, options?: RunOptions): Promise<CommandResult
|
|
261
|
+
run(command: string, options?: RunOptions): Promise<Traced<CommandResult>>;
|
|
256
262
|
/**
|
|
257
263
|
* Start a process in the sandbox without waiting for it to exit.
|
|
258
264
|
*
|
|
@@ -261,25 +267,25 @@ declare class Sandbox {
|
|
|
261
267
|
* until the process exits. Use `run()` instead to block until completion
|
|
262
268
|
* and get combined output in one call.
|
|
263
269
|
*/
|
|
264
|
-
startProcess(command: string, options?: StartProcessOptions): Promise<ProcessInfo
|
|
270
|
+
startProcess(command: string, options?: StartProcessOptions): Promise<Traced<ProcessInfo>>;
|
|
265
271
|
/** List all processes (running and exited) tracked by the sandbox daemon. */
|
|
266
272
|
listProcesses(): Promise<Traced<ProcessInfo[]>>;
|
|
267
273
|
/** Get current status and metadata for a process by PID. */
|
|
268
|
-
getProcess(pid: number): Promise<ProcessInfo
|
|
274
|
+
getProcess(pid: number): Promise<Traced<ProcessInfo>>;
|
|
269
275
|
/** Send SIGKILL to a process. */
|
|
270
276
|
killProcess(pid: number): Promise<void>;
|
|
271
277
|
/** Send an arbitrary signal to a process (e.g. `15` for SIGTERM, `9` for SIGKILL). */
|
|
272
|
-
sendSignal(pid: number, signal: number): Promise<SendSignalResponse
|
|
278
|
+
sendSignal(pid: number, signal: number): Promise<Traced<SendSignalResponse>>;
|
|
273
279
|
/** Write bytes to a process's stdin. The process must have been started with `stdinMode: StdinMode.PIPE`. */
|
|
274
280
|
writeStdin(pid: number, data: Uint8Array): Promise<void>;
|
|
275
281
|
/** Close a process's stdin pipe, signalling EOF to the process. */
|
|
276
282
|
closeStdin(pid: number): Promise<void>;
|
|
277
283
|
/** Return all captured stdout lines produced so far by a process. */
|
|
278
|
-
getStdout(pid: number): Promise<OutputResponse
|
|
284
|
+
getStdout(pid: number): Promise<Traced<OutputResponse>>;
|
|
279
285
|
/** Return all captured stderr lines produced so far by a process. */
|
|
280
|
-
getStderr(pid: number): Promise<OutputResponse
|
|
286
|
+
getStderr(pid: number): Promise<Traced<OutputResponse>>;
|
|
281
287
|
/** Return all captured stdout+stderr lines produced so far by a process. */
|
|
282
|
-
getOutput(pid: number): Promise<OutputResponse
|
|
288
|
+
getOutput(pid: number): Promise<Traced<OutputResponse>>;
|
|
283
289
|
/** Stream stdout events from a process until it exits. Yields one `OutputEvent` per line. */
|
|
284
290
|
followStdout(pid: number, options?: {
|
|
285
291
|
signal?: AbortSignal;
|
|
@@ -293,15 +299,15 @@ declare class Sandbox {
|
|
|
293
299
|
signal?: AbortSignal;
|
|
294
300
|
}): AsyncIterable<OutputEvent>;
|
|
295
301
|
/** Read a file from the sandbox and return its raw bytes. */
|
|
296
|
-
readFile(path: string): Promise<Uint8Array
|
|
302
|
+
readFile(path: string): Promise<Traced<Uint8Array>>;
|
|
297
303
|
/** Write raw bytes to a file in the sandbox, creating it if it does not exist. */
|
|
298
304
|
writeFile(path: string, content: Uint8Array): Promise<void>;
|
|
299
305
|
/** Delete a file from the sandbox. */
|
|
300
306
|
deleteFile(path: string): Promise<void>;
|
|
301
307
|
/** List the contents of a directory in the sandbox. */
|
|
302
|
-
listDirectory(path: string): Promise<ListDirectoryResponse
|
|
308
|
+
listDirectory(path: string): Promise<Traced<ListDirectoryResponse>>;
|
|
303
309
|
/** Create an interactive PTY session. Returns a `sessionId` and `token` for WebSocket connection via `connectPty()`. */
|
|
304
|
-
createPtySession(options: CreatePtySessionOptions): Promise<PtySessionInfo
|
|
310
|
+
createPtySession(options: CreatePtySessionOptions): Promise<Traced<PtySessionInfo>>;
|
|
305
311
|
/** Create a PTY session and connect to it immediately. Cleans up the session if the WebSocket connection fails. */
|
|
306
312
|
createPty(options: CreatePtyOptions): Promise<Pty>;
|
|
307
313
|
/** Attach to an existing PTY session by ID and token and return a connected `Pty` handle. */
|
|
@@ -310,11 +316,17 @@ declare class Sandbox {
|
|
|
310
316
|
createTunnel(remotePort: number, options?: CreateTunnelOptions): Promise<TcpTunnel>;
|
|
311
317
|
/** Connect to a sandbox VNC session for programmatic desktop control. */
|
|
312
318
|
connectDesktop(options?: ConnectDesktopOptions): Promise<Desktop>;
|
|
319
|
+
/**
|
|
320
|
+
* Poll the in-sandbox daemon until `127.0.0.1:port` accepts a TCP connection.
|
|
321
|
+
* Uses `bash`'s `/dev/tcp` builtin via `processes/run` — no extra deps in
|
|
322
|
+
* the sandbox image. `bash` is present on every image we ship.
|
|
323
|
+
*/
|
|
324
|
+
private waitForPortReady;
|
|
313
325
|
ptyWsUrl(sessionId: string, token: string): string;
|
|
314
326
|
/** Check the sandbox daemon health. */
|
|
315
|
-
health(): Promise<HealthResponse
|
|
327
|
+
health(): Promise<Traced<HealthResponse>>;
|
|
316
328
|
/** Get sandbox daemon info (version, uptime, process counts). */
|
|
317
|
-
|
|
329
|
+
daemonInfo(): Promise<Traced<DaemonInfo>>;
|
|
318
330
|
}
|
|
319
331
|
|
|
320
332
|
/**
|
|
@@ -350,11 +362,11 @@ declare class SandboxClient {
|
|
|
350
362
|
/** Create a new sandbox. Returns immediately; the sandbox may still be starting. Use `createAndConnect()` for a blocking, ready-to-use handle. */
|
|
351
363
|
create(options?: CreateSandboxOptions): Promise<Traced<CreateSandboxResponse>>;
|
|
352
364
|
/** Get current state and metadata for a sandbox by ID. */
|
|
353
|
-
get(sandboxId: string): Promise<SandboxInfo
|
|
365
|
+
get(sandboxId: string): Promise<Traced<SandboxInfo>>;
|
|
354
366
|
/** List all sandboxes in the namespace. */
|
|
355
367
|
list(): Promise<Traced<SandboxInfo[]>>;
|
|
356
368
|
/** Update sandbox properties such as name, exposed ports, and proxy auth settings. */
|
|
357
|
-
update(sandboxId: string, options: UpdateSandboxOptions): Promise<SandboxInfo
|
|
369
|
+
update(sandboxId: string, options: UpdateSandboxOptions): Promise<Traced<SandboxInfo>>;
|
|
358
370
|
/** Get the current proxy port settings for a sandbox. */
|
|
359
371
|
getPortAccess(sandboxId: string): Promise<SandboxPortAccess>;
|
|
360
372
|
/** Add one or more user ports to the sandbox proxy allowlist. */
|
|
@@ -408,7 +420,7 @@ declare class SandboxClient {
|
|
|
408
420
|
*/
|
|
409
421
|
snapshot(sandboxId: string, options?: SnapshotOptions): Promise<CreateSnapshotResponse>;
|
|
410
422
|
/** Get current status and metadata for a snapshot by ID. */
|
|
411
|
-
getSnapshot(snapshotId: string): Promise<SnapshotInfo
|
|
423
|
+
getSnapshot(snapshotId: string): Promise<Traced<SnapshotInfo>>;
|
|
412
424
|
/** List all snapshots in the namespace. */
|
|
413
425
|
listSnapshots(): Promise<Traced<SnapshotInfo[]>>;
|
|
414
426
|
/** Delete a snapshot by ID. */
|
|
@@ -426,7 +438,7 @@ declare class SandboxClient {
|
|
|
426
438
|
* @param options.snapshotType - Snapshot type passed through to `snapshot()`.
|
|
427
439
|
* @throws {SandboxError} If the snapshot fails or `timeout` elapses.
|
|
428
440
|
*/
|
|
429
|
-
snapshotAndWait(sandboxId: string, options?: SnapshotAndWaitOptions): Promise<SnapshotInfo
|
|
441
|
+
snapshotAndWait(sandboxId: string, options?: SnapshotAndWaitOptions): Promise<Traced<SnapshotInfo>>;
|
|
430
442
|
/** Create a new sandbox pool with warm pre-booted containers. */
|
|
431
443
|
createPool(options: CreatePoolOptions): Promise<CreateSandboxPoolResponse>;
|
|
432
444
|
/** Get current state and metadata for a sandbox pool by ID. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CreatePtySessionOptions, S as SandboxOptions, a as CreateAndConnectOptions, b as SandboxClientOptions, c as ConnectOptions, d as SnapshotInfo, e as
|
|
2
|
-
export { x as CheckpointType, y as ContainerResourcesInfo, z as ContainerState, A as CreateSandboxImageOptions, B as DirectoryEntry, E as DockerfileBuildPlan, F as DockerfileInstruction, I as Image, G as ImageBuildOperation, J as ImageBuildOperationType, J as ImageBuildOperationTypeValue, K as ImageOptions, N as NetworkConfig, M as OutputMode, Q as PoolContainerInfo, T as ProcessStatus, V as SandboxImageSource, W as SnapshotStatus, X as SnapshotType, Y as StdinMode, Z as createSandboxImage, _ as dockerfileContent } from './sandbox-image-
|
|
1
|
+
import { C as CreatePtySessionOptions, S as SandboxOptions, a as CreateAndConnectOptions, b as SandboxClientOptions, c as ConnectOptions, d as SnapshotInfo, e as SandboxInfo, f as SandboxStatus, U as UpdateSandboxOptions, g as SuspendResumeOptions, h as CheckpointOptions, R as RunOptions, i as CommandResult, j as StartProcessOptions, P as ProcessInfo, k as SendSignalResponse, O as OutputResponse, l as OutputEvent, L as ListDirectoryResponse, m as PtySessionInfo, H as HealthResponse, D as DaemonInfo, n as CreateSandboxOptions, o as CreateSandboxResponse, p as SandboxPortAccess, q as SnapshotOptions, r as CreateSnapshotResponse, s as SnapshotAndWaitOptions, t as CreatePoolOptions, u as CreateSandboxPoolResponse, v as SandboxPoolInfo, w as UpdatePoolOptions } from './sandbox-image-BMDaNpZ2.js';
|
|
2
|
+
export { x as CheckpointType, y as ContainerResourcesInfo, z as ContainerState, A as CreateSandboxImageOptions, B as DirectoryEntry, E as DockerfileBuildPlan, F as DockerfileInstruction, I as Image, G as ImageBuildOperation, J as ImageBuildOperationType, J as ImageBuildOperationTypeValue, K as ImageOptions, N as NetworkConfig, M as OutputMode, Q as PoolContainerInfo, T as ProcessStatus, V as SandboxImageSource, W as SnapshotStatus, X as SnapshotType, Y as StdinMode, Z as createSandboxImage, _ as dockerfileContent } from './sandbox-image-BMDaNpZ2.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The return value of every SDK operation. Carries the W3C `trace_id` so callers
|
|
@@ -191,8 +191,8 @@ declare class Sandbox {
|
|
|
191
191
|
/**
|
|
192
192
|
* Attach to an existing sandbox and return a connected handle.
|
|
193
193
|
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
194
|
+
* Returns immediately without contacting the server. Call `sandbox.info()`
|
|
195
|
+
* to fetch the current state on demand. Does **not** auto-resume a suspended
|
|
196
196
|
* sandbox — call `sandbox.resume()` explicitly.
|
|
197
197
|
*/
|
|
198
198
|
static connect(options: ConnectOptions & Partial<SandboxClientOptions>): Promise<Sandbox>;
|
|
@@ -200,7 +200,13 @@ declare class Sandbox {
|
|
|
200
200
|
static getSnapshot(snapshotId: string, options?: Partial<SandboxClientOptions>): Promise<SnapshotInfo>;
|
|
201
201
|
/** Delete a snapshot by ID. No sandbox handle needed. */
|
|
202
202
|
static deleteSnapshot(snapshotId: string, options?: Partial<SandboxClientOptions>): Promise<void>;
|
|
203
|
+
/** List all sandboxes. No sandbox handle needed. */
|
|
204
|
+
static list(options?: Partial<SandboxClientOptions>): Promise<SandboxInfo[]>;
|
|
205
|
+
/** List all snapshots in the project. No sandbox handle needed. */
|
|
206
|
+
static listSnapshots(options?: Partial<SandboxClientOptions>): Promise<SnapshotInfo[]>;
|
|
203
207
|
private requireLifecycleClient;
|
|
208
|
+
/** Fetch the current sandbox information from the server on demand. */
|
|
209
|
+
info(): Promise<Traced<SandboxInfo>>;
|
|
204
210
|
/**
|
|
205
211
|
* Fetch the current sandbox status from the server.
|
|
206
212
|
*
|
|
@@ -214,7 +220,7 @@ declare class Sandbox {
|
|
|
214
220
|
* Naming an ephemeral sandbox makes it non-ephemeral and enables
|
|
215
221
|
* suspend/resume.
|
|
216
222
|
*/
|
|
217
|
-
update(options: UpdateSandboxOptions): Promise<SandboxInfo
|
|
223
|
+
update(options: UpdateSandboxOptions): Promise<Traced<SandboxInfo>>;
|
|
218
224
|
/**
|
|
219
225
|
* Suspend this sandbox.
|
|
220
226
|
*
|
|
@@ -237,7 +243,7 @@ declare class Sandbox {
|
|
|
237
243
|
* the completed `SnapshotInfo`. Pass `{ wait: false }` to fire-and-return
|
|
238
244
|
* (returns `undefined`).
|
|
239
245
|
*/
|
|
240
|
-
checkpoint(options?: CheckpointOptions): Promise<SnapshotInfo | undefined>;
|
|
246
|
+
checkpoint(options?: CheckpointOptions): Promise<Traced<SnapshotInfo> | undefined>;
|
|
241
247
|
/**
|
|
242
248
|
* List snapshots taken from this sandbox.
|
|
243
249
|
*/
|
|
@@ -252,7 +258,7 @@ declare class Sandbox {
|
|
|
252
258
|
* Uses a single streaming `POST /api/v1/processes/run` request that starts
|
|
253
259
|
* the process, streams output, and delivers the exit code over one connection.
|
|
254
260
|
*/
|
|
255
|
-
run(command: string, options?: RunOptions): Promise<CommandResult
|
|
261
|
+
run(command: string, options?: RunOptions): Promise<Traced<CommandResult>>;
|
|
256
262
|
/**
|
|
257
263
|
* Start a process in the sandbox without waiting for it to exit.
|
|
258
264
|
*
|
|
@@ -261,25 +267,25 @@ declare class Sandbox {
|
|
|
261
267
|
* until the process exits. Use `run()` instead to block until completion
|
|
262
268
|
* and get combined output in one call.
|
|
263
269
|
*/
|
|
264
|
-
startProcess(command: string, options?: StartProcessOptions): Promise<ProcessInfo
|
|
270
|
+
startProcess(command: string, options?: StartProcessOptions): Promise<Traced<ProcessInfo>>;
|
|
265
271
|
/** List all processes (running and exited) tracked by the sandbox daemon. */
|
|
266
272
|
listProcesses(): Promise<Traced<ProcessInfo[]>>;
|
|
267
273
|
/** Get current status and metadata for a process by PID. */
|
|
268
|
-
getProcess(pid: number): Promise<ProcessInfo
|
|
274
|
+
getProcess(pid: number): Promise<Traced<ProcessInfo>>;
|
|
269
275
|
/** Send SIGKILL to a process. */
|
|
270
276
|
killProcess(pid: number): Promise<void>;
|
|
271
277
|
/** Send an arbitrary signal to a process (e.g. `15` for SIGTERM, `9` for SIGKILL). */
|
|
272
|
-
sendSignal(pid: number, signal: number): Promise<SendSignalResponse
|
|
278
|
+
sendSignal(pid: number, signal: number): Promise<Traced<SendSignalResponse>>;
|
|
273
279
|
/** Write bytes to a process's stdin. The process must have been started with `stdinMode: StdinMode.PIPE`. */
|
|
274
280
|
writeStdin(pid: number, data: Uint8Array): Promise<void>;
|
|
275
281
|
/** Close a process's stdin pipe, signalling EOF to the process. */
|
|
276
282
|
closeStdin(pid: number): Promise<void>;
|
|
277
283
|
/** Return all captured stdout lines produced so far by a process. */
|
|
278
|
-
getStdout(pid: number): Promise<OutputResponse
|
|
284
|
+
getStdout(pid: number): Promise<Traced<OutputResponse>>;
|
|
279
285
|
/** Return all captured stderr lines produced so far by a process. */
|
|
280
|
-
getStderr(pid: number): Promise<OutputResponse
|
|
286
|
+
getStderr(pid: number): Promise<Traced<OutputResponse>>;
|
|
281
287
|
/** Return all captured stdout+stderr lines produced so far by a process. */
|
|
282
|
-
getOutput(pid: number): Promise<OutputResponse
|
|
288
|
+
getOutput(pid: number): Promise<Traced<OutputResponse>>;
|
|
283
289
|
/** Stream stdout events from a process until it exits. Yields one `OutputEvent` per line. */
|
|
284
290
|
followStdout(pid: number, options?: {
|
|
285
291
|
signal?: AbortSignal;
|
|
@@ -293,15 +299,15 @@ declare class Sandbox {
|
|
|
293
299
|
signal?: AbortSignal;
|
|
294
300
|
}): AsyncIterable<OutputEvent>;
|
|
295
301
|
/** Read a file from the sandbox and return its raw bytes. */
|
|
296
|
-
readFile(path: string): Promise<Uint8Array
|
|
302
|
+
readFile(path: string): Promise<Traced<Uint8Array>>;
|
|
297
303
|
/** Write raw bytes to a file in the sandbox, creating it if it does not exist. */
|
|
298
304
|
writeFile(path: string, content: Uint8Array): Promise<void>;
|
|
299
305
|
/** Delete a file from the sandbox. */
|
|
300
306
|
deleteFile(path: string): Promise<void>;
|
|
301
307
|
/** List the contents of a directory in the sandbox. */
|
|
302
|
-
listDirectory(path: string): Promise<ListDirectoryResponse
|
|
308
|
+
listDirectory(path: string): Promise<Traced<ListDirectoryResponse>>;
|
|
303
309
|
/** Create an interactive PTY session. Returns a `sessionId` and `token` for WebSocket connection via `connectPty()`. */
|
|
304
|
-
createPtySession(options: CreatePtySessionOptions): Promise<PtySessionInfo
|
|
310
|
+
createPtySession(options: CreatePtySessionOptions): Promise<Traced<PtySessionInfo>>;
|
|
305
311
|
/** Create a PTY session and connect to it immediately. Cleans up the session if the WebSocket connection fails. */
|
|
306
312
|
createPty(options: CreatePtyOptions): Promise<Pty>;
|
|
307
313
|
/** Attach to an existing PTY session by ID and token and return a connected `Pty` handle. */
|
|
@@ -310,11 +316,17 @@ declare class Sandbox {
|
|
|
310
316
|
createTunnel(remotePort: number, options?: CreateTunnelOptions): Promise<TcpTunnel>;
|
|
311
317
|
/** Connect to a sandbox VNC session for programmatic desktop control. */
|
|
312
318
|
connectDesktop(options?: ConnectDesktopOptions): Promise<Desktop>;
|
|
319
|
+
/**
|
|
320
|
+
* Poll the in-sandbox daemon until `127.0.0.1:port` accepts a TCP connection.
|
|
321
|
+
* Uses `bash`'s `/dev/tcp` builtin via `processes/run` — no extra deps in
|
|
322
|
+
* the sandbox image. `bash` is present on every image we ship.
|
|
323
|
+
*/
|
|
324
|
+
private waitForPortReady;
|
|
313
325
|
ptyWsUrl(sessionId: string, token: string): string;
|
|
314
326
|
/** Check the sandbox daemon health. */
|
|
315
|
-
health(): Promise<HealthResponse
|
|
327
|
+
health(): Promise<Traced<HealthResponse>>;
|
|
316
328
|
/** Get sandbox daemon info (version, uptime, process counts). */
|
|
317
|
-
|
|
329
|
+
daemonInfo(): Promise<Traced<DaemonInfo>>;
|
|
318
330
|
}
|
|
319
331
|
|
|
320
332
|
/**
|
|
@@ -350,11 +362,11 @@ declare class SandboxClient {
|
|
|
350
362
|
/** Create a new sandbox. Returns immediately; the sandbox may still be starting. Use `createAndConnect()` for a blocking, ready-to-use handle. */
|
|
351
363
|
create(options?: CreateSandboxOptions): Promise<Traced<CreateSandboxResponse>>;
|
|
352
364
|
/** Get current state and metadata for a sandbox by ID. */
|
|
353
|
-
get(sandboxId: string): Promise<SandboxInfo
|
|
365
|
+
get(sandboxId: string): Promise<Traced<SandboxInfo>>;
|
|
354
366
|
/** List all sandboxes in the namespace. */
|
|
355
367
|
list(): Promise<Traced<SandboxInfo[]>>;
|
|
356
368
|
/** Update sandbox properties such as name, exposed ports, and proxy auth settings. */
|
|
357
|
-
update(sandboxId: string, options: UpdateSandboxOptions): Promise<SandboxInfo
|
|
369
|
+
update(sandboxId: string, options: UpdateSandboxOptions): Promise<Traced<SandboxInfo>>;
|
|
358
370
|
/** Get the current proxy port settings for a sandbox. */
|
|
359
371
|
getPortAccess(sandboxId: string): Promise<SandboxPortAccess>;
|
|
360
372
|
/** Add one or more user ports to the sandbox proxy allowlist. */
|
|
@@ -408,7 +420,7 @@ declare class SandboxClient {
|
|
|
408
420
|
*/
|
|
409
421
|
snapshot(sandboxId: string, options?: SnapshotOptions): Promise<CreateSnapshotResponse>;
|
|
410
422
|
/** Get current status and metadata for a snapshot by ID. */
|
|
411
|
-
getSnapshot(snapshotId: string): Promise<SnapshotInfo
|
|
423
|
+
getSnapshot(snapshotId: string): Promise<Traced<SnapshotInfo>>;
|
|
412
424
|
/** List all snapshots in the namespace. */
|
|
413
425
|
listSnapshots(): Promise<Traced<SnapshotInfo[]>>;
|
|
414
426
|
/** Delete a snapshot by ID. */
|
|
@@ -426,7 +438,7 @@ declare class SandboxClient {
|
|
|
426
438
|
* @param options.snapshotType - Snapshot type passed through to `snapshot()`.
|
|
427
439
|
* @throws {SandboxError} If the snapshot fails or `timeout` elapses.
|
|
428
440
|
*/
|
|
429
|
-
snapshotAndWait(sandboxId: string, options?: SnapshotAndWaitOptions): Promise<SnapshotInfo
|
|
441
|
+
snapshotAndWait(sandboxId: string, options?: SnapshotAndWaitOptions): Promise<Traced<SnapshotInfo>>;
|
|
430
442
|
/** Create a new sandbox pool with warm pre-booted containers. */
|
|
431
443
|
createPool(options: CreatePoolOptions): Promise<CreateSandboxPoolResponse>;
|
|
432
444
|
/** Get current state and metadata for a sandbox pool by ID. */
|