disk 0.11.0 → 1.0.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/README.md +37 -8
- package/dist/cli.mjs +16 -31
- package/dist/common-DQ7T-_Xl.mjs +306 -0
- package/dist/index.cjs +5 -111
- package/dist/index.d.cts +4 -57
- package/dist/index.d.mts +4 -57
- package/dist/index.mjs +2 -2
- package/dist/sandbox-cli.mjs +523 -0
- package/dist/{src-Cpv1TIWC.mjs → src-Cw7ldF_H.mjs} +6 -111
- package/package.json +7 -3
package/dist/index.d.cts
CHANGED
|
@@ -191,10 +191,7 @@ declare class SandboxFiles {
|
|
|
191
191
|
//#region src/sandbox.d.ts
|
|
192
192
|
/** @internal */
|
|
193
193
|
type SandboxWire = components["schemas"]["Sandbox"];
|
|
194
|
-
/** @internal */
|
|
195
|
-
type SandboxExecWire = components["schemas"]["SandboxExec"];
|
|
196
194
|
type SandboxStatus = components["schemas"]["SandboxState"];
|
|
197
|
-
type SandboxExecStatus = components["schemas"]["SandboxExecState"];
|
|
198
195
|
interface SandboxEndpoint {
|
|
199
196
|
port: number;
|
|
200
197
|
hostname: string;
|
|
@@ -208,7 +205,7 @@ interface SandboxResponse {
|
|
|
208
205
|
baseImage: string;
|
|
209
206
|
platform?: "arm64" | "amd64";
|
|
210
207
|
maxTtlSeconds: number;
|
|
211
|
-
/** Maximum concurrently attached
|
|
208
|
+
/** Maximum concurrently attached process sessions. Detached processes and one-shot controls do not count. */
|
|
212
209
|
maxConcurrentExecs: number;
|
|
213
210
|
endpoints?: SandboxEndpoint[];
|
|
214
211
|
createdAt: Date;
|
|
@@ -218,19 +215,6 @@ interface SandboxResponse {
|
|
|
218
215
|
expiresAt?: Date;
|
|
219
216
|
exitReason?: string;
|
|
220
217
|
}
|
|
221
|
-
interface SandboxExecResponse {
|
|
222
|
-
sandboxId: string;
|
|
223
|
-
id: string;
|
|
224
|
-
command: string;
|
|
225
|
-
status: SandboxExecStatus;
|
|
226
|
-
exitCode?: number;
|
|
227
|
-
stdout?: string;
|
|
228
|
-
stderr?: string;
|
|
229
|
-
exitReason?: string;
|
|
230
|
-
executeTimeMs?: number;
|
|
231
|
-
startedAt: Date;
|
|
232
|
-
finishedAt?: Date;
|
|
233
|
-
}
|
|
234
218
|
interface SandboxWaitOptions {
|
|
235
219
|
/**
|
|
236
220
|
* Wait for the operation to finish. Defaults to true.
|
|
@@ -242,39 +226,6 @@ interface SandboxForkOptions extends SandboxWaitOptions {
|
|
|
242
226
|
/** Name for the fork. The server generates one when omitted. */
|
|
243
227
|
name?: string;
|
|
244
228
|
}
|
|
245
|
-
interface SandboxConnectionInfo {
|
|
246
|
-
url: string;
|
|
247
|
-
expiresAt: Date;
|
|
248
|
-
}
|
|
249
|
-
type SandboxExecOptions = {
|
|
250
|
-
commandTty?: boolean;
|
|
251
|
-
env?: Record<string, string>;
|
|
252
|
-
timeoutSeconds?: number;
|
|
253
|
-
} & SandboxWaitOptions;
|
|
254
|
-
declare class SandboxExec {
|
|
255
|
-
sandboxId: string;
|
|
256
|
-
id: string;
|
|
257
|
-
command: string;
|
|
258
|
-
status: SandboxExecStatus;
|
|
259
|
-
exitCode?: number;
|
|
260
|
-
stdout?: string;
|
|
261
|
-
stderr?: string;
|
|
262
|
-
exitReason?: string;
|
|
263
|
-
executeTimeMs?: number;
|
|
264
|
-
startedAt: Date;
|
|
265
|
-
finishedAt?: Date;
|
|
266
|
-
/** @internal */
|
|
267
|
-
private readonly _client;
|
|
268
|
-
/** @internal */
|
|
269
|
-
constructor(data: SandboxExecWire, client: ApiClient);
|
|
270
|
-
/** @internal Overwrite this exec's fields in place from a fresh wire snapshot. */
|
|
271
|
-
private _apply;
|
|
272
|
-
toJSON(): SandboxExecResponse;
|
|
273
|
-
/** Re-fetch this exec and update it in place, returning the same object. */
|
|
274
|
-
refresh(): Promise<SandboxExec>;
|
|
275
|
-
/** Cancel this exec and update it in place, returning the same object. */
|
|
276
|
-
cancel(): Promise<SandboxExec>;
|
|
277
|
-
}
|
|
278
229
|
declare class Sandbox {
|
|
279
230
|
id: string;
|
|
280
231
|
name: string;
|
|
@@ -301,6 +252,8 @@ declare class Sandbox {
|
|
|
301
252
|
/** @internal Overwrite this sandbox's fields in place from a fresh wire snapshot. */
|
|
302
253
|
private _apply;
|
|
303
254
|
toJSON(): SandboxResponse;
|
|
255
|
+
/** Run a process and wait for it to exit. */
|
|
256
|
+
exec(command: string, options?: SandboxProcessStartOptions): Promise<SandboxProcessResult>;
|
|
304
257
|
/** Re-fetch this sandbox. */
|
|
305
258
|
refresh(): Promise<this>;
|
|
306
259
|
/** Start this sandbox. */
|
|
@@ -313,14 +266,8 @@ declare class Sandbox {
|
|
|
313
266
|
resume(options?: SandboxWaitOptions): Promise<Sandbox | this>;
|
|
314
267
|
/** Create an isolated writable branch from this sandbox's current state. */
|
|
315
268
|
fork(options?: SandboxForkOptions): Promise<Sandbox>;
|
|
316
|
-
/** Create a short-lived signed WebSocket URL for a sandbox process connection. */
|
|
317
|
-
createConnection(): Promise<SandboxConnectionInfo>;
|
|
318
269
|
/** Delete this sandbox and its backing disk. */
|
|
319
270
|
delete(): Promise<void>;
|
|
320
|
-
exec(command: string, options?: SandboxExecOptions): Promise<SandboxExec>;
|
|
321
|
-
listExecs(): Promise<SandboxExec[]>;
|
|
322
|
-
getExec(execId: string): Promise<SandboxExec>;
|
|
323
|
-
cancelExec(execId: string): Promise<SandboxExec>;
|
|
324
271
|
}
|
|
325
272
|
//#endregion
|
|
326
273
|
//#region src/sandboxes.d.ts
|
|
@@ -601,4 +548,4 @@ declare function exec(opts: ExecOptions): Promise<ExecDiskResult>;
|
|
|
601
548
|
*/
|
|
602
549
|
declare function workspace(mounts: Record<string, ExecMount>): Workspace;
|
|
603
550
|
//#endregion
|
|
604
|
-
export { type ApiTokenResponse, type AppendObjectOptions, Archil, ArchilApiError, ArchilError, type ArchilOptions, ArchilS3Error, type AuthorizedUser, type AwsStsUser, type AzureBlobMount, type CompletedMultipartUpload, type ConnectedClient, type CreateApiTokenRequest, type CreateDiskRequest, type CreateDiskResult, type CreateSandboxRequest, type Delegation, type DeleteObjectsError, type DeleteObjectsOptions, type DeleteObjectsResult, Disk, type DiskListPage, type DiskMetrics, DiskMultipart, type DiskResponse, type DiskStatus, type DiskUser, Disks, type ExecMount, type ExecMountSpec, type ExecOptions, type ExecRequest, type ExecResult, type FileSystem, type GCSMount, type GrepMatch, type GrepOptions, type GrepResult, type GrepStoppedReason, type ListDisksOptions, type ListMultipartUploadsOptions, type ListObjectsOptions, type ListObjectsResult, type ListPartsOptions, type ListSandboxesOptions, type ListTokensOptions, type MountConfig, type MountConfigResponse, type MountOptions, type MountResponse, type MultipartUpload, type MultipartUploadListing, type MultipartUploadSummary, type ObjectMetadata, type PartInfo, type PartListing, type PosixCreateAttrs, type PutObjectOptions, type PutObjectResult, type R2Mount, type RootAttrs, type S3CompatibleMount, type S3Mount, type S3Object, Sandbox, type
|
|
551
|
+
export { type ApiTokenResponse, type AppendObjectOptions, Archil, ArchilApiError, ArchilError, type ArchilOptions, ArchilS3Error, type AuthorizedUser, type AwsStsUser, type AzureBlobMount, type CompletedMultipartUpload, type ConnectedClient, type CreateApiTokenRequest, type CreateDiskRequest, type CreateDiskResult, type CreateSandboxRequest, type Delegation, type DeleteObjectsError, type DeleteObjectsOptions, type DeleteObjectsResult, Disk, type DiskListPage, type DiskMetrics, DiskMultipart, type DiskResponse, type DiskStatus, type DiskUser, Disks, type ExecMount, type ExecMountSpec, type ExecOptions, type ExecRequest, type ExecResult, type FileSystem, type GCSMount, type GrepMatch, type GrepOptions, type GrepResult, type GrepStoppedReason, type ListDisksOptions, type ListMultipartUploadsOptions, type ListObjectsOptions, type ListObjectsResult, type ListPartsOptions, type ListSandboxesOptions, type ListTokensOptions, type MountConfig, type MountConfigResponse, type MountOptions, type MountResponse, type MultipartUpload, type MultipartUploadListing, type MultipartUploadSummary, type ObjectMetadata, type PartInfo, type PartListing, type PosixCreateAttrs, type PutObjectOptions, type PutObjectResult, type R2Mount, type RootAttrs, type S3CompatibleMount, type S3Mount, type S3Object, Sandbox, type SandboxEndpoint, type SandboxFileSource, SandboxFileTransferError, type SandboxFileUploadOptions, type SandboxFileWriter, SandboxFiles, type SandboxForkOptions, SandboxProcess, type SandboxProcessConnectOptions, type SandboxProcessOutput, type SandboxProcessOutputHandler, type SandboxProcessResult, type SandboxProcessStartOptions, type SandboxProcessStatus, type SandboxProcessStream, SandboxProcesses, type SandboxResponse, type SandboxStatus, type SandboxTerminalOptions, type SandboxWaitOptions, Sandboxes, type ShareUrlOptions, type ShareUrlResult, type TokenUser, Tokens, USER_AGENT, type UploadPart, VERSION, Workspace, configure, createApiKey, createDisk, createSandbox, deleteApiKey, effectiveUploadPartSize, exec, getDisk, getSandbox, listApiKeys, listDisks, listSandboxes, workspace };
|
package/dist/index.d.mts
CHANGED
|
@@ -191,10 +191,7 @@ declare class SandboxFiles {
|
|
|
191
191
|
//#region src/sandbox.d.ts
|
|
192
192
|
/** @internal */
|
|
193
193
|
type SandboxWire = components["schemas"]["Sandbox"];
|
|
194
|
-
/** @internal */
|
|
195
|
-
type SandboxExecWire = components["schemas"]["SandboxExec"];
|
|
196
194
|
type SandboxStatus = components["schemas"]["SandboxState"];
|
|
197
|
-
type SandboxExecStatus = components["schemas"]["SandboxExecState"];
|
|
198
195
|
interface SandboxEndpoint {
|
|
199
196
|
port: number;
|
|
200
197
|
hostname: string;
|
|
@@ -208,7 +205,7 @@ interface SandboxResponse {
|
|
|
208
205
|
baseImage: string;
|
|
209
206
|
platform?: "arm64" | "amd64";
|
|
210
207
|
maxTtlSeconds: number;
|
|
211
|
-
/** Maximum concurrently attached
|
|
208
|
+
/** Maximum concurrently attached process sessions. Detached processes and one-shot controls do not count. */
|
|
212
209
|
maxConcurrentExecs: number;
|
|
213
210
|
endpoints?: SandboxEndpoint[];
|
|
214
211
|
createdAt: Date;
|
|
@@ -218,19 +215,6 @@ interface SandboxResponse {
|
|
|
218
215
|
expiresAt?: Date;
|
|
219
216
|
exitReason?: string;
|
|
220
217
|
}
|
|
221
|
-
interface SandboxExecResponse {
|
|
222
|
-
sandboxId: string;
|
|
223
|
-
id: string;
|
|
224
|
-
command: string;
|
|
225
|
-
status: SandboxExecStatus;
|
|
226
|
-
exitCode?: number;
|
|
227
|
-
stdout?: string;
|
|
228
|
-
stderr?: string;
|
|
229
|
-
exitReason?: string;
|
|
230
|
-
executeTimeMs?: number;
|
|
231
|
-
startedAt: Date;
|
|
232
|
-
finishedAt?: Date;
|
|
233
|
-
}
|
|
234
218
|
interface SandboxWaitOptions {
|
|
235
219
|
/**
|
|
236
220
|
* Wait for the operation to finish. Defaults to true.
|
|
@@ -242,39 +226,6 @@ interface SandboxForkOptions extends SandboxWaitOptions {
|
|
|
242
226
|
/** Name for the fork. The server generates one when omitted. */
|
|
243
227
|
name?: string;
|
|
244
228
|
}
|
|
245
|
-
interface SandboxConnectionInfo {
|
|
246
|
-
url: string;
|
|
247
|
-
expiresAt: Date;
|
|
248
|
-
}
|
|
249
|
-
type SandboxExecOptions = {
|
|
250
|
-
commandTty?: boolean;
|
|
251
|
-
env?: Record<string, string>;
|
|
252
|
-
timeoutSeconds?: number;
|
|
253
|
-
} & SandboxWaitOptions;
|
|
254
|
-
declare class SandboxExec {
|
|
255
|
-
sandboxId: string;
|
|
256
|
-
id: string;
|
|
257
|
-
command: string;
|
|
258
|
-
status: SandboxExecStatus;
|
|
259
|
-
exitCode?: number;
|
|
260
|
-
stdout?: string;
|
|
261
|
-
stderr?: string;
|
|
262
|
-
exitReason?: string;
|
|
263
|
-
executeTimeMs?: number;
|
|
264
|
-
startedAt: Date;
|
|
265
|
-
finishedAt?: Date;
|
|
266
|
-
/** @internal */
|
|
267
|
-
private readonly _client;
|
|
268
|
-
/** @internal */
|
|
269
|
-
constructor(data: SandboxExecWire, client: ApiClient);
|
|
270
|
-
/** @internal Overwrite this exec's fields in place from a fresh wire snapshot. */
|
|
271
|
-
private _apply;
|
|
272
|
-
toJSON(): SandboxExecResponse;
|
|
273
|
-
/** Re-fetch this exec and update it in place, returning the same object. */
|
|
274
|
-
refresh(): Promise<SandboxExec>;
|
|
275
|
-
/** Cancel this exec and update it in place, returning the same object. */
|
|
276
|
-
cancel(): Promise<SandboxExec>;
|
|
277
|
-
}
|
|
278
229
|
declare class Sandbox {
|
|
279
230
|
id: string;
|
|
280
231
|
name: string;
|
|
@@ -301,6 +252,8 @@ declare class Sandbox {
|
|
|
301
252
|
/** @internal Overwrite this sandbox's fields in place from a fresh wire snapshot. */
|
|
302
253
|
private _apply;
|
|
303
254
|
toJSON(): SandboxResponse;
|
|
255
|
+
/** Run a process and wait for it to exit. */
|
|
256
|
+
exec(command: string, options?: SandboxProcessStartOptions): Promise<SandboxProcessResult>;
|
|
304
257
|
/** Re-fetch this sandbox. */
|
|
305
258
|
refresh(): Promise<this>;
|
|
306
259
|
/** Start this sandbox. */
|
|
@@ -313,14 +266,8 @@ declare class Sandbox {
|
|
|
313
266
|
resume(options?: SandboxWaitOptions): Promise<Sandbox | this>;
|
|
314
267
|
/** Create an isolated writable branch from this sandbox's current state. */
|
|
315
268
|
fork(options?: SandboxForkOptions): Promise<Sandbox>;
|
|
316
|
-
/** Create a short-lived signed WebSocket URL for a sandbox process connection. */
|
|
317
|
-
createConnection(): Promise<SandboxConnectionInfo>;
|
|
318
269
|
/** Delete this sandbox and its backing disk. */
|
|
319
270
|
delete(): Promise<void>;
|
|
320
|
-
exec(command: string, options?: SandboxExecOptions): Promise<SandboxExec>;
|
|
321
|
-
listExecs(): Promise<SandboxExec[]>;
|
|
322
|
-
getExec(execId: string): Promise<SandboxExec>;
|
|
323
|
-
cancelExec(execId: string): Promise<SandboxExec>;
|
|
324
271
|
}
|
|
325
272
|
//#endregion
|
|
326
273
|
//#region src/sandboxes.d.ts
|
|
@@ -601,4 +548,4 @@ declare function exec(opts: ExecOptions): Promise<ExecDiskResult>;
|
|
|
601
548
|
*/
|
|
602
549
|
declare function workspace(mounts: Record<string, ExecMount>): Workspace;
|
|
603
550
|
//#endregion
|
|
604
|
-
export { type ApiTokenResponse, type AppendObjectOptions, Archil, ArchilApiError, ArchilError, type ArchilOptions, ArchilS3Error, type AuthorizedUser, type AwsStsUser, type AzureBlobMount, type CompletedMultipartUpload, type ConnectedClient, type CreateApiTokenRequest, type CreateDiskRequest, type CreateDiskResult, type CreateSandboxRequest, type Delegation, type DeleteObjectsError, type DeleteObjectsOptions, type DeleteObjectsResult, Disk, type DiskListPage, type DiskMetrics, DiskMultipart, type DiskResponse, type DiskStatus, type DiskUser, Disks, type ExecMount, type ExecMountSpec, type ExecOptions, type ExecRequest, type ExecResult, type FileSystem, type GCSMount, type GrepMatch, type GrepOptions, type GrepResult, type GrepStoppedReason, type ListDisksOptions, type ListMultipartUploadsOptions, type ListObjectsOptions, type ListObjectsResult, type ListPartsOptions, type ListSandboxesOptions, type ListTokensOptions, type MountConfig, type MountConfigResponse, type MountOptions, type MountResponse, type MultipartUpload, type MultipartUploadListing, type MultipartUploadSummary, type ObjectMetadata, type PartInfo, type PartListing, type PosixCreateAttrs, type PutObjectOptions, type PutObjectResult, type R2Mount, type RootAttrs, type S3CompatibleMount, type S3Mount, type S3Object, Sandbox, type
|
|
551
|
+
export { type ApiTokenResponse, type AppendObjectOptions, Archil, ArchilApiError, ArchilError, type ArchilOptions, ArchilS3Error, type AuthorizedUser, type AwsStsUser, type AzureBlobMount, type CompletedMultipartUpload, type ConnectedClient, type CreateApiTokenRequest, type CreateDiskRequest, type CreateDiskResult, type CreateSandboxRequest, type Delegation, type DeleteObjectsError, type DeleteObjectsOptions, type DeleteObjectsResult, Disk, type DiskListPage, type DiskMetrics, DiskMultipart, type DiskResponse, type DiskStatus, type DiskUser, Disks, type ExecMount, type ExecMountSpec, type ExecOptions, type ExecRequest, type ExecResult, type FileSystem, type GCSMount, type GrepMatch, type GrepOptions, type GrepResult, type GrepStoppedReason, type ListDisksOptions, type ListMultipartUploadsOptions, type ListObjectsOptions, type ListObjectsResult, type ListPartsOptions, type ListSandboxesOptions, type ListTokensOptions, type MountConfig, type MountConfigResponse, type MountOptions, type MountResponse, type MultipartUpload, type MultipartUploadListing, type MultipartUploadSummary, type ObjectMetadata, type PartInfo, type PartListing, type PosixCreateAttrs, type PutObjectOptions, type PutObjectResult, type R2Mount, type RootAttrs, type S3CompatibleMount, type S3Mount, type S3Object, Sandbox, type SandboxEndpoint, type SandboxFileSource, SandboxFileTransferError, type SandboxFileUploadOptions, type SandboxFileWriter, SandboxFiles, type SandboxForkOptions, SandboxProcess, type SandboxProcessConnectOptions, type SandboxProcessOutput, type SandboxProcessOutputHandler, type SandboxProcessResult, type SandboxProcessStartOptions, type SandboxProcessStatus, type SandboxProcessStream, SandboxProcesses, type SandboxResponse, type SandboxStatus, type SandboxTerminalOptions, type SandboxWaitOptions, Sandboxes, type ShareUrlOptions, type ShareUrlResult, type TokenUser, Tokens, USER_AGENT, type UploadPart, VERSION, Workspace, configure, createApiKey, createDisk, createSandbox, deleteApiKey, effectiveUploadPartSize, exec, getDisk, getSandbox, listApiKeys, listDisks, listSandboxes, workspace };
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as ArchilS3Error, C as
|
|
2
|
-
export { Archil, ArchilApiError, ArchilError, ArchilS3Error, Disk, DiskMultipart, Disks, Sandbox,
|
|
1
|
+
import { A as ArchilS3Error, C as DiskMultipart, E as VERSION, O as ArchilApiError, S as Disk, T as USER_AGENT, _ as Sandbox, a as deleteApiKey, b as SandboxProcesses, c as getSandbox, d as listSandboxes, f as workspace, g as Sandboxes, h as Tokens, i as createSandbox, j as SandboxFileTransferError, k as ArchilError, l as listApiKeys, m as Workspace, n as createApiKey, o as exec, p as Archil, r as createDisk, s as getDisk, t as configure, u as listDisks, v as SandboxFiles, w as effectiveUploadPartSize, x as Disks, y as SandboxProcess } from "./src-Cw7ldF_H.mjs";
|
|
2
|
+
export { Archil, ArchilApiError, ArchilError, ArchilS3Error, Disk, DiskMultipart, Disks, Sandbox, SandboxFileTransferError, SandboxFiles, SandboxProcess, SandboxProcesses, Sandboxes, Tokens, USER_AGENT, VERSION, Workspace, configure, createApiKey, createDisk, createSandbox, deleteApiKey, effectiveUploadPartSize, exec, getDisk, getSandbox, listApiKeys, listDisks, listSandboxes, workspace };
|