disk 0.11.0 → 1.1.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/dist/index.d.cts CHANGED
@@ -189,12 +189,12 @@ declare class SandboxFiles {
189
189
  }
190
190
  //#endregion
191
191
  //#region src/sandbox.d.ts
192
+ type SandboxNetworkAction = components["schemas"]["SandboxNetworkAction"];
193
+ type SandboxEgressPolicy = components["schemas"]["SandboxEgressPolicy"];
194
+ type SandboxNetwork = components["schemas"]["SandboxNetwork"];
192
195
  /** @internal */
193
196
  type SandboxWire = components["schemas"]["Sandbox"];
194
- /** @internal */
195
- type SandboxExecWire = components["schemas"]["SandboxExec"];
196
197
  type SandboxStatus = components["schemas"]["SandboxState"];
197
- type SandboxExecStatus = components["schemas"]["SandboxExecState"];
198
198
  interface SandboxEndpoint {
199
199
  port: number;
200
200
  hostname: string;
@@ -208,7 +208,7 @@ interface SandboxResponse {
208
208
  baseImage: string;
209
209
  platform?: "arm64" | "amd64";
210
210
  maxTtlSeconds: number;
211
- /** Maximum concurrently attached exec sessions. Detached processes and one-shot controls do not count. */
211
+ /** Maximum concurrently attached process sessions. Detached processes and one-shot controls do not count. */
212
212
  maxConcurrentExecs: number;
213
213
  endpoints?: SandboxEndpoint[];
214
214
  createdAt: Date;
@@ -218,19 +218,6 @@ interface SandboxResponse {
218
218
  expiresAt?: Date;
219
219
  exitReason?: string;
220
220
  }
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
221
  interface SandboxWaitOptions {
235
222
  /**
236
223
  * Wait for the operation to finish. Defaults to true.
@@ -242,39 +229,6 @@ interface SandboxForkOptions extends SandboxWaitOptions {
242
229
  /** Name for the fork. The server generates one when omitted. */
243
230
  name?: string;
244
231
  }
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
232
  declare class Sandbox {
279
233
  id: string;
280
234
  name: string;
@@ -301,6 +255,8 @@ declare class Sandbox {
301
255
  /** @internal Overwrite this sandbox's fields in place from a fresh wire snapshot. */
302
256
  private _apply;
303
257
  toJSON(): SandboxResponse;
258
+ /** Run a process and wait for it to exit. */
259
+ exec(command: string, options?: SandboxProcessStartOptions): Promise<SandboxProcessResult>;
304
260
  /** Re-fetch this sandbox. */
305
261
  refresh(): Promise<this>;
306
262
  /** Start this sandbox. */
@@ -313,14 +269,12 @@ declare class Sandbox {
313
269
  resume(options?: SandboxWaitOptions): Promise<Sandbox | this>;
314
270
  /** Create an isolated writable branch from this sandbox's current state. */
315
271
  fork(options?: SandboxForkOptions): Promise<Sandbox>;
316
- /** Create a short-lived signed WebSocket URL for a sandbox process connection. */
317
- createConnection(): Promise<SandboxConnectionInfo>;
272
+ /** Get this running sandbox's effective network policy. */
273
+ getNetwork(): Promise<SandboxNetwork>;
274
+ /** Replace this running sandbox's complete network policy and return the effective policy. */
275
+ updateNetwork(network: SandboxNetwork): Promise<SandboxNetwork>;
318
276
  /** Delete this sandbox and its backing disk. */
319
277
  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
278
  }
325
279
  //#endregion
326
280
  //#region src/sandboxes.d.ts
@@ -345,6 +299,8 @@ interface CreateSandboxRequest {
345
299
  maxTtlSeconds?: number;
346
300
  /** Maximum concurrently attached exec sessions. Detached processes and one-shot controls do not count. */
347
301
  maxConcurrentExecs?: number;
302
+ /** Creation-time network policy. Egress is unrestricted when omitted. */
303
+ network?: SandboxNetwork;
348
304
  }
349
305
  interface ListSandboxesOptions {
350
306
  /** Only return sandboxes that mount this disk. */
@@ -601,4 +557,4 @@ declare function exec(opts: ExecOptions): Promise<ExecDiskResult>;
601
557
  */
602
558
  declare function workspace(mounts: Record<string, ExecMount>): Workspace;
603
559
  //#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 SandboxConnectionInfo, type SandboxEndpoint, SandboxExec, type SandboxExecOptions, type SandboxExecResponse, type SandboxExecStatus, 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 };
560
+ 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 SandboxEgressPolicy, type SandboxEndpoint, type SandboxFileSource, SandboxFileTransferError, type SandboxFileUploadOptions, type SandboxFileWriter, SandboxFiles, type SandboxForkOptions, type SandboxNetwork, type SandboxNetworkAction, 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
@@ -189,12 +189,12 @@ declare class SandboxFiles {
189
189
  }
190
190
  //#endregion
191
191
  //#region src/sandbox.d.ts
192
+ type SandboxNetworkAction = components["schemas"]["SandboxNetworkAction"];
193
+ type SandboxEgressPolicy = components["schemas"]["SandboxEgressPolicy"];
194
+ type SandboxNetwork = components["schemas"]["SandboxNetwork"];
192
195
  /** @internal */
193
196
  type SandboxWire = components["schemas"]["Sandbox"];
194
- /** @internal */
195
- type SandboxExecWire = components["schemas"]["SandboxExec"];
196
197
  type SandboxStatus = components["schemas"]["SandboxState"];
197
- type SandboxExecStatus = components["schemas"]["SandboxExecState"];
198
198
  interface SandboxEndpoint {
199
199
  port: number;
200
200
  hostname: string;
@@ -208,7 +208,7 @@ interface SandboxResponse {
208
208
  baseImage: string;
209
209
  platform?: "arm64" | "amd64";
210
210
  maxTtlSeconds: number;
211
- /** Maximum concurrently attached exec sessions. Detached processes and one-shot controls do not count. */
211
+ /** Maximum concurrently attached process sessions. Detached processes and one-shot controls do not count. */
212
212
  maxConcurrentExecs: number;
213
213
  endpoints?: SandboxEndpoint[];
214
214
  createdAt: Date;
@@ -218,19 +218,6 @@ interface SandboxResponse {
218
218
  expiresAt?: Date;
219
219
  exitReason?: string;
220
220
  }
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
221
  interface SandboxWaitOptions {
235
222
  /**
236
223
  * Wait for the operation to finish. Defaults to true.
@@ -242,39 +229,6 @@ interface SandboxForkOptions extends SandboxWaitOptions {
242
229
  /** Name for the fork. The server generates one when omitted. */
243
230
  name?: string;
244
231
  }
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
232
  declare class Sandbox {
279
233
  id: string;
280
234
  name: string;
@@ -301,6 +255,8 @@ declare class Sandbox {
301
255
  /** @internal Overwrite this sandbox's fields in place from a fresh wire snapshot. */
302
256
  private _apply;
303
257
  toJSON(): SandboxResponse;
258
+ /** Run a process and wait for it to exit. */
259
+ exec(command: string, options?: SandboxProcessStartOptions): Promise<SandboxProcessResult>;
304
260
  /** Re-fetch this sandbox. */
305
261
  refresh(): Promise<this>;
306
262
  /** Start this sandbox. */
@@ -313,14 +269,12 @@ declare class Sandbox {
313
269
  resume(options?: SandboxWaitOptions): Promise<Sandbox | this>;
314
270
  /** Create an isolated writable branch from this sandbox's current state. */
315
271
  fork(options?: SandboxForkOptions): Promise<Sandbox>;
316
- /** Create a short-lived signed WebSocket URL for a sandbox process connection. */
317
- createConnection(): Promise<SandboxConnectionInfo>;
272
+ /** Get this running sandbox's effective network policy. */
273
+ getNetwork(): Promise<SandboxNetwork>;
274
+ /** Replace this running sandbox's complete network policy and return the effective policy. */
275
+ updateNetwork(network: SandboxNetwork): Promise<SandboxNetwork>;
318
276
  /** Delete this sandbox and its backing disk. */
319
277
  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
278
  }
325
279
  //#endregion
326
280
  //#region src/sandboxes.d.ts
@@ -345,6 +299,8 @@ interface CreateSandboxRequest {
345
299
  maxTtlSeconds?: number;
346
300
  /** Maximum concurrently attached exec sessions. Detached processes and one-shot controls do not count. */
347
301
  maxConcurrentExecs?: number;
302
+ /** Creation-time network policy. Egress is unrestricted when omitted. */
303
+ network?: SandboxNetwork;
348
304
  }
349
305
  interface ListSandboxesOptions {
350
306
  /** Only return sandboxes that mount this disk. */
@@ -601,4 +557,4 @@ declare function exec(opts: ExecOptions): Promise<ExecDiskResult>;
601
557
  */
602
558
  declare function workspace(mounts: Record<string, ExecMount>): Workspace;
603
559
  //#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 SandboxConnectionInfo, type SandboxEndpoint, SandboxExec, type SandboxExecOptions, type SandboxExecResponse, type SandboxExecStatus, 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 };
560
+ 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 SandboxEgressPolicy, type SandboxEndpoint, type SandboxFileSource, SandboxFileTransferError, type SandboxFileUploadOptions, type SandboxFileWriter, SandboxFiles, type SandboxForkOptions, type SandboxNetwork, type SandboxNetworkAction, 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 Disk, D as VERSION, E as USER_AGENT, O as ArchilApiError, S as Disks, T as effectiveUploadPartSize, _ as Sandbox, a as deleteApiKey, b as SandboxProcess, 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 SandboxExec, w as DiskMultipart, x as SandboxProcesses, y as SandboxFiles } from "./src-Cpv1TIWC.mjs";
2
- export { Archil, ArchilApiError, ArchilError, ArchilS3Error, Disk, DiskMultipart, Disks, Sandbox, SandboxExec, SandboxFileTransferError, SandboxFiles, SandboxProcess, SandboxProcesses, Sandboxes, Tokens, USER_AGENT, VERSION, Workspace, configure, createApiKey, createDisk, createSandbox, deleteApiKey, effectiveUploadPartSize, exec, getDisk, getSandbox, listApiKeys, listDisks, listSandboxes, workspace };
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-B_Vucedi.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 };