disk 0.8.22 → 0.9.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 +85 -0
- package/dist/cli.mjs +3 -2
- package/dist/{disk-DEqV3mtA.d.cts → disk-DseHuBL7.d.cts} +14 -5
- package/dist/{disk-DEqV3mtA.d.mts → disk-DseHuBL7.d.mts} +14 -5
- package/dist/index.cjs +378 -8
- package/dist/index.d.cts +203 -2
- package/dist/index.d.mts +203 -2
- package/dist/index.mjs +2 -2
- package/dist/internal/tools.d.cts +1 -1
- package/dist/internal/tools.d.mts +1 -1
- package/dist/{src-BepELcl6.mjs → src-CR3Ksi_s.mjs} +372 -9
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { $ as TokenUser, A as ApiTokenResponse, B as DiskStatus, C as PutObjectOptions, D as ShareUrlResult, E as ShareUrlOptions, F as CreateApiTokenRequest, G as GrepMatch, H as ExecDiskResult, I as CreateDiskRequest, J as MountConfigResponse, K as GrepStoppedReason, L as Delegation, M as AwsStsUser, N as AzureBlobMount, O as UploadPart, P as ConnectedClient, Q as S3Mount, R as DiskMetrics, S as PosixCreateAttrs, T as S3Object, U as ExecRequest, V as DiskUser, W as GCSMount, X as R2Mount, Y as MountResponse, Z as S3CompatibleMount, _ as MultipartUploadListing, a as DeleteObjectsResult, b as PartInfo, c as ExecResult, d as ListMultipartUploadsOptions, et as FileSystem, f as ListObjectsOptions, g as MultipartUpload, h as MountOptions, i as DeleteObjectsOptions, j as AuthorizedUser, k as effectiveUploadPartSize, l as GrepOptions, m as ListPartsOptions, n as CompletedMultipartUpload, o as Disk, p as ListObjectsResult, q as MountConfig, r as DeleteObjectsError, s as DiskMultipart, t as AppendObjectOptions, tt as ApiClient, u as GrepResult, v as MultipartUploadSummary, w as PutObjectResult, x as PartListing, y as ObjectMetadata, z as DiskResponse } from "./disk-
|
|
1
|
+
import { $ as TokenUser, A as ApiTokenResponse, B as DiskStatus, C as PutObjectOptions, D as ShareUrlResult, E as ShareUrlOptions, F as CreateApiTokenRequest, G as GrepMatch, H as ExecDiskResult, I as CreateDiskRequest, J as MountConfigResponse, K as GrepStoppedReason, L as Delegation, M as AwsStsUser, N as AzureBlobMount, O as UploadPart, P as ConnectedClient, Q as S3Mount, R as DiskMetrics, S as PosixCreateAttrs, T as S3Object, U as ExecRequest, V as DiskUser, W as GCSMount, X as R2Mount, Y as MountResponse, Z as S3CompatibleMount, _ as MultipartUploadListing, a as DeleteObjectsResult, b as PartInfo, c as ExecResult, d as ListMultipartUploadsOptions, et as FileSystem, f as ListObjectsOptions, g as MultipartUpload, h as MountOptions, i as DeleteObjectsOptions, j as AuthorizedUser, k as effectiveUploadPartSize, l as GrepOptions, m as ListPartsOptions, n as CompletedMultipartUpload, o as Disk, p as ListObjectsResult, q as MountConfig, r as DeleteObjectsError, s as DiskMultipart, t as AppendObjectOptions, tt as ApiClient, u as GrepResult, v as MultipartUploadSummary, w as PutObjectResult, x as PartListing, y as ObjectMetadata, z as DiskResponse } from "./disk-DseHuBL7.cjs";
|
|
2
|
+
import { components } from "@archildata/api-types";
|
|
2
3
|
|
|
3
4
|
//#region src/disks.d.ts
|
|
4
5
|
interface ListDisksOptions {
|
|
@@ -53,6 +54,202 @@ declare class Disks {
|
|
|
53
54
|
create(req: CreateDiskRequest): Promise<CreateDiskResult>;
|
|
54
55
|
}
|
|
55
56
|
//#endregion
|
|
57
|
+
//#region src/sandbox.d.ts
|
|
58
|
+
/** @internal */
|
|
59
|
+
type SandboxWire = components["schemas"]["Sandbox"];
|
|
60
|
+
/** @internal */
|
|
61
|
+
type SandboxExecWire = components["schemas"]["SandboxExec"];
|
|
62
|
+
type SandboxStatus = components["schemas"]["SandboxState"];
|
|
63
|
+
type SandboxExecStatus = components["schemas"]["SandboxExecState"];
|
|
64
|
+
interface SandboxEndpoint {
|
|
65
|
+
port: number;
|
|
66
|
+
hostname: string;
|
|
67
|
+
}
|
|
68
|
+
interface SandboxResponse {
|
|
69
|
+
id: string;
|
|
70
|
+
name: string;
|
|
71
|
+
status: SandboxStatus;
|
|
72
|
+
vcpuCount: number;
|
|
73
|
+
memSizeMiB: number;
|
|
74
|
+
baseImage: string;
|
|
75
|
+
platform?: "arm64" | "amd64";
|
|
76
|
+
maxTtlSeconds: number;
|
|
77
|
+
maxConcurrentExecs: number;
|
|
78
|
+
endpoints?: SandboxEndpoint[];
|
|
79
|
+
createdAt: Date;
|
|
80
|
+
runningAt?: Date;
|
|
81
|
+
finishedAt?: Date;
|
|
82
|
+
lastActiveAt: Date;
|
|
83
|
+
expiresAt?: Date;
|
|
84
|
+
exitReason?: string;
|
|
85
|
+
}
|
|
86
|
+
interface SandboxExecResponse {
|
|
87
|
+
sandboxId: string;
|
|
88
|
+
id: string;
|
|
89
|
+
command: string;
|
|
90
|
+
status: SandboxExecStatus;
|
|
91
|
+
exitCode?: number;
|
|
92
|
+
stdout?: string;
|
|
93
|
+
stderr?: string;
|
|
94
|
+
exitReason?: string;
|
|
95
|
+
executeTimeMs?: number;
|
|
96
|
+
startedAt: Date;
|
|
97
|
+
finishedAt?: Date;
|
|
98
|
+
}
|
|
99
|
+
interface SandboxWaitOptions {
|
|
100
|
+
/**
|
|
101
|
+
* Wait for the operation to finish. Defaults to true.
|
|
102
|
+
* The SDK polls if the server's wait budget expires first.
|
|
103
|
+
*/
|
|
104
|
+
wait?: boolean;
|
|
105
|
+
}
|
|
106
|
+
interface SandboxForkOptions extends SandboxWaitOptions {
|
|
107
|
+
/** Name for the fork. The server generates one when omitted. */
|
|
108
|
+
name?: string;
|
|
109
|
+
}
|
|
110
|
+
interface SandboxConnectionInfo {
|
|
111
|
+
url: string;
|
|
112
|
+
expiresAt: Date;
|
|
113
|
+
}
|
|
114
|
+
type SandboxExecOptions = {
|
|
115
|
+
commandTty?: boolean;
|
|
116
|
+
env?: Record<string, string>;
|
|
117
|
+
timeoutSeconds?: number;
|
|
118
|
+
} & SandboxWaitOptions;
|
|
119
|
+
interface SandboxPtyOptions {
|
|
120
|
+
pty: true;
|
|
121
|
+
cols?: number;
|
|
122
|
+
rows?: number;
|
|
123
|
+
onData?: (data: string) => void;
|
|
124
|
+
}
|
|
125
|
+
interface SandboxPtyResult {
|
|
126
|
+
/** Unavailable when a runtime closes without reporting the process status. */
|
|
127
|
+
exitCode?: number;
|
|
128
|
+
}
|
|
129
|
+
declare class SandboxExec {
|
|
130
|
+
sandboxId: string;
|
|
131
|
+
id: string;
|
|
132
|
+
command: string;
|
|
133
|
+
status: SandboxExecStatus;
|
|
134
|
+
exitCode?: number;
|
|
135
|
+
stdout?: string;
|
|
136
|
+
stderr?: string;
|
|
137
|
+
exitReason?: string;
|
|
138
|
+
executeTimeMs?: number;
|
|
139
|
+
startedAt: Date;
|
|
140
|
+
finishedAt?: Date;
|
|
141
|
+
/** @internal */
|
|
142
|
+
private readonly _client;
|
|
143
|
+
/** @internal */
|
|
144
|
+
constructor(data: SandboxExecWire, client: ApiClient);
|
|
145
|
+
/** @internal Overwrite this exec's fields in place from a fresh wire snapshot. */
|
|
146
|
+
private _apply;
|
|
147
|
+
toJSON(): SandboxExecResponse;
|
|
148
|
+
/** Re-fetch this exec and update it in place, returning the same object. */
|
|
149
|
+
refresh(): Promise<SandboxExec>;
|
|
150
|
+
/** Cancel this exec and update it in place, returning the same object. */
|
|
151
|
+
cancel(): Promise<SandboxExec>;
|
|
152
|
+
}
|
|
153
|
+
declare class SandboxPty {
|
|
154
|
+
private readonly _socket;
|
|
155
|
+
private readonly _completion;
|
|
156
|
+
/** @internal */
|
|
157
|
+
constructor(socket: WebSocket, onData?: (data: string) => void);
|
|
158
|
+
/** @internal */
|
|
159
|
+
static connect(url: string, command: string, options: SandboxPtyOptions): Promise<SandboxPty>;
|
|
160
|
+
sendInput(data: string): Promise<void>;
|
|
161
|
+
resize(size: {
|
|
162
|
+
cols: number;
|
|
163
|
+
rows: number;
|
|
164
|
+
}): Promise<void>;
|
|
165
|
+
wait(): Promise<SandboxPtyResult>;
|
|
166
|
+
close(): void;
|
|
167
|
+
private _send;
|
|
168
|
+
}
|
|
169
|
+
declare class Sandbox {
|
|
170
|
+
id: string;
|
|
171
|
+
name: string;
|
|
172
|
+
status: SandboxStatus;
|
|
173
|
+
vcpuCount: number;
|
|
174
|
+
memSizeMiB: number;
|
|
175
|
+
baseImage: string;
|
|
176
|
+
platform?: "arm64" | "amd64";
|
|
177
|
+
maxTtlSeconds: number;
|
|
178
|
+
maxConcurrentExecs: number;
|
|
179
|
+
endpoints?: SandboxEndpoint[];
|
|
180
|
+
createdAt: Date;
|
|
181
|
+
runningAt?: Date;
|
|
182
|
+
finishedAt?: Date;
|
|
183
|
+
lastActiveAt: Date;
|
|
184
|
+
expiresAt?: Date;
|
|
185
|
+
exitReason?: string;
|
|
186
|
+
/** @internal */
|
|
187
|
+
private readonly _client;
|
|
188
|
+
/** @internal */
|
|
189
|
+
constructor(data: SandboxWire, client: ApiClient);
|
|
190
|
+
/** @internal Overwrite this sandbox's fields in place from a fresh wire snapshot. */
|
|
191
|
+
private _apply;
|
|
192
|
+
toJSON(): SandboxResponse;
|
|
193
|
+
/** Re-fetch this sandbox. */
|
|
194
|
+
refresh(): Promise<this>;
|
|
195
|
+
/** Start this sandbox. */
|
|
196
|
+
start(options?: SandboxWaitOptions): Promise<Sandbox | this>;
|
|
197
|
+
/** Stop this sandbox. */
|
|
198
|
+
stop(options?: SandboxWaitOptions): Promise<Sandbox | this>;
|
|
199
|
+
/** Pause this sandbox, preserving its CPU and memory state. */
|
|
200
|
+
pause(options?: SandboxWaitOptions): Promise<Sandbox | this>;
|
|
201
|
+
/** Resume this sandbox from its preserved CPU and memory state. */
|
|
202
|
+
resume(options?: SandboxWaitOptions): Promise<Sandbox | this>;
|
|
203
|
+
/** Create an isolated writable branch from this sandbox's current state. */
|
|
204
|
+
fork(options?: SandboxForkOptions): Promise<Sandbox>;
|
|
205
|
+
/** Create a short-lived signed WebSocket URL for an interactive shell. */
|
|
206
|
+
createConnection(): Promise<SandboxConnectionInfo>;
|
|
207
|
+
/** Delete this sandbox and its backing disk. */
|
|
208
|
+
delete(): Promise<void>;
|
|
209
|
+
exec(command: string, options: SandboxPtyOptions): Promise<SandboxPty>;
|
|
210
|
+
exec(command: string, options?: SandboxExecOptions): Promise<SandboxExec>;
|
|
211
|
+
listExecs(): Promise<SandboxExec[]>;
|
|
212
|
+
getExec(execId: string): Promise<SandboxExec>;
|
|
213
|
+
cancelExec(execId: string): Promise<SandboxExec>;
|
|
214
|
+
}
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region src/sandboxes.d.ts
|
|
217
|
+
interface CreateSandboxRequest {
|
|
218
|
+
/** Name for the sandbox. The server generates one when omitted. */
|
|
219
|
+
name?: string;
|
|
220
|
+
/** Number of virtual CPUs allocated to the sandbox, from 1 to 32. Defaults to 1. */
|
|
221
|
+
vcpuCount?: number;
|
|
222
|
+
/** Memory allocated to the sandbox in MiB, from 256 to 65536. Defaults to 2048. */
|
|
223
|
+
memSizeMiB?: number;
|
|
224
|
+
/**
|
|
225
|
+
* Public Linux OCI image reference for the sandbox's root filesystem.
|
|
226
|
+
* Docker Hub shorthand and any public registry are accepted; the tag
|
|
227
|
+
* defaults to `latest`, and mutable tags are pinned to immutable digests
|
|
228
|
+
* when the sandbox is created. Defaults to `ubuntu:26.04`.
|
|
229
|
+
*
|
|
230
|
+
* Examples: `ubuntu`, `node:24-bookworm`, `ghcr.io/owner/app:v2`,
|
|
231
|
+
* `alpine@sha256:<digest>`.
|
|
232
|
+
*/
|
|
233
|
+
baseImage?: string;
|
|
234
|
+
env?: Record<string, string>;
|
|
235
|
+
maxTtlSeconds?: number;
|
|
236
|
+
maxConcurrentExecs?: number;
|
|
237
|
+
}
|
|
238
|
+
interface ListSandboxesOptions {
|
|
239
|
+
/** Only return sandboxes that mount this disk. */
|
|
240
|
+
disk?: Disk | string;
|
|
241
|
+
}
|
|
242
|
+
declare class Sandboxes {
|
|
243
|
+
/** @internal */
|
|
244
|
+
private readonly _client;
|
|
245
|
+
/** @internal */
|
|
246
|
+
constructor(client: ApiClient);
|
|
247
|
+
/** List the account's sandboxes, oldest first. */
|
|
248
|
+
list(options?: ListSandboxesOptions): Promise<Sandbox[]>;
|
|
249
|
+
get(id: string): Promise<Sandbox>;
|
|
250
|
+
create(request?: CreateSandboxRequest, options?: SandboxWaitOptions): Promise<Sandbox>;
|
|
251
|
+
}
|
|
252
|
+
//#endregion
|
|
56
253
|
//#region src/tokens.d.ts
|
|
57
254
|
interface ListTokensOptions {
|
|
58
255
|
limit?: number;
|
|
@@ -199,6 +396,7 @@ interface ExecOptions {
|
|
|
199
396
|
}
|
|
200
397
|
declare class Archil {
|
|
201
398
|
readonly disks: Disks;
|
|
399
|
+
readonly sandboxes: Sandboxes;
|
|
202
400
|
readonly tokens: Tokens;
|
|
203
401
|
/** @internal */
|
|
204
402
|
private readonly _client;
|
|
@@ -267,6 +465,9 @@ declare function configure(options: ArchilOptions): void;
|
|
|
267
465
|
declare function createDisk(req: CreateDiskRequest): Promise<CreateDiskResult>;
|
|
268
466
|
declare function listDisks(opts?: ListDisksOptions): Promise<Disk[]>;
|
|
269
467
|
declare function getDisk(id: string): Promise<Disk>;
|
|
468
|
+
declare function createSandbox(req?: CreateSandboxRequest, opts?: SandboxWaitOptions): Promise<Sandbox>;
|
|
469
|
+
declare function listSandboxes(opts?: ListSandboxesOptions): Promise<Sandbox[]>;
|
|
470
|
+
declare function getSandbox(id: string): Promise<Sandbox>;
|
|
270
471
|
declare function listApiKeys(opts?: ListTokensOptions): Promise<ApiTokenResponse[]>;
|
|
271
472
|
declare function createApiKey(req: CreateApiTokenRequest): Promise<ApiTokenResponse & {
|
|
272
473
|
token?: string;
|
|
@@ -284,4 +485,4 @@ declare function exec(opts: ExecOptions): Promise<ExecDiskResult>;
|
|
|
284
485
|
*/
|
|
285
486
|
declare function workspace(mounts: Record<string, ExecMount>): Workspace;
|
|
286
487
|
//#endregion
|
|
287
|
-
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 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 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 S3CompatibleMount, type S3Mount, type S3Object, type ShareUrlOptions, type ShareUrlResult, type TokenUser, Tokens, USER_AGENT, type UploadPart, VERSION, Workspace, configure, createApiKey, createDisk, deleteApiKey, effectiveUploadPartSize, exec, getDisk, listApiKeys, listDisks, workspace };
|
|
488
|
+
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 S3CompatibleMount, type S3Mount, type S3Object, Sandbox, type SandboxConnectionInfo, type SandboxEndpoint, SandboxExec, type SandboxExecOptions, type SandboxExecResponse, type SandboxExecStatus, type SandboxForkOptions, SandboxPty, type SandboxPtyOptions, type SandboxPtyResult, type SandboxResponse, type SandboxStatus, 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
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { $ as TokenUser, A as ApiTokenResponse, B as DiskStatus, C as PutObjectOptions, D as ShareUrlResult, E as ShareUrlOptions, F as CreateApiTokenRequest, G as GrepMatch, H as ExecDiskResult, I as CreateDiskRequest, J as MountConfigResponse, K as GrepStoppedReason, L as Delegation, M as AwsStsUser, N as AzureBlobMount, O as UploadPart, P as ConnectedClient, Q as S3Mount, R as DiskMetrics, S as PosixCreateAttrs, T as S3Object, U as ExecRequest, V as DiskUser, W as GCSMount, X as R2Mount, Y as MountResponse, Z as S3CompatibleMount, _ as MultipartUploadListing, a as DeleteObjectsResult, b as PartInfo, c as ExecResult, d as ListMultipartUploadsOptions, et as FileSystem, f as ListObjectsOptions, g as MultipartUpload, h as MountOptions, i as DeleteObjectsOptions, j as AuthorizedUser, k as effectiveUploadPartSize, l as GrepOptions, m as ListPartsOptions, n as CompletedMultipartUpload, o as Disk, p as ListObjectsResult, q as MountConfig, r as DeleteObjectsError, s as DiskMultipart, t as AppendObjectOptions, tt as ApiClient, u as GrepResult, v as MultipartUploadSummary, w as PutObjectResult, x as PartListing, y as ObjectMetadata, z as DiskResponse } from "./disk-
|
|
1
|
+
import { $ as TokenUser, A as ApiTokenResponse, B as DiskStatus, C as PutObjectOptions, D as ShareUrlResult, E as ShareUrlOptions, F as CreateApiTokenRequest, G as GrepMatch, H as ExecDiskResult, I as CreateDiskRequest, J as MountConfigResponse, K as GrepStoppedReason, L as Delegation, M as AwsStsUser, N as AzureBlobMount, O as UploadPart, P as ConnectedClient, Q as S3Mount, R as DiskMetrics, S as PosixCreateAttrs, T as S3Object, U as ExecRequest, V as DiskUser, W as GCSMount, X as R2Mount, Y as MountResponse, Z as S3CompatibleMount, _ as MultipartUploadListing, a as DeleteObjectsResult, b as PartInfo, c as ExecResult, d as ListMultipartUploadsOptions, et as FileSystem, f as ListObjectsOptions, g as MultipartUpload, h as MountOptions, i as DeleteObjectsOptions, j as AuthorizedUser, k as effectiveUploadPartSize, l as GrepOptions, m as ListPartsOptions, n as CompletedMultipartUpload, o as Disk, p as ListObjectsResult, q as MountConfig, r as DeleteObjectsError, s as DiskMultipart, t as AppendObjectOptions, tt as ApiClient, u as GrepResult, v as MultipartUploadSummary, w as PutObjectResult, x as PartListing, y as ObjectMetadata, z as DiskResponse } from "./disk-DseHuBL7.mjs";
|
|
2
|
+
import { components } from "@archildata/api-types";
|
|
2
3
|
|
|
3
4
|
//#region src/disks.d.ts
|
|
4
5
|
interface ListDisksOptions {
|
|
@@ -53,6 +54,202 @@ declare class Disks {
|
|
|
53
54
|
create(req: CreateDiskRequest): Promise<CreateDiskResult>;
|
|
54
55
|
}
|
|
55
56
|
//#endregion
|
|
57
|
+
//#region src/sandbox.d.ts
|
|
58
|
+
/** @internal */
|
|
59
|
+
type SandboxWire = components["schemas"]["Sandbox"];
|
|
60
|
+
/** @internal */
|
|
61
|
+
type SandboxExecWire = components["schemas"]["SandboxExec"];
|
|
62
|
+
type SandboxStatus = components["schemas"]["SandboxState"];
|
|
63
|
+
type SandboxExecStatus = components["schemas"]["SandboxExecState"];
|
|
64
|
+
interface SandboxEndpoint {
|
|
65
|
+
port: number;
|
|
66
|
+
hostname: string;
|
|
67
|
+
}
|
|
68
|
+
interface SandboxResponse {
|
|
69
|
+
id: string;
|
|
70
|
+
name: string;
|
|
71
|
+
status: SandboxStatus;
|
|
72
|
+
vcpuCount: number;
|
|
73
|
+
memSizeMiB: number;
|
|
74
|
+
baseImage: string;
|
|
75
|
+
platform?: "arm64" | "amd64";
|
|
76
|
+
maxTtlSeconds: number;
|
|
77
|
+
maxConcurrentExecs: number;
|
|
78
|
+
endpoints?: SandboxEndpoint[];
|
|
79
|
+
createdAt: Date;
|
|
80
|
+
runningAt?: Date;
|
|
81
|
+
finishedAt?: Date;
|
|
82
|
+
lastActiveAt: Date;
|
|
83
|
+
expiresAt?: Date;
|
|
84
|
+
exitReason?: string;
|
|
85
|
+
}
|
|
86
|
+
interface SandboxExecResponse {
|
|
87
|
+
sandboxId: string;
|
|
88
|
+
id: string;
|
|
89
|
+
command: string;
|
|
90
|
+
status: SandboxExecStatus;
|
|
91
|
+
exitCode?: number;
|
|
92
|
+
stdout?: string;
|
|
93
|
+
stderr?: string;
|
|
94
|
+
exitReason?: string;
|
|
95
|
+
executeTimeMs?: number;
|
|
96
|
+
startedAt: Date;
|
|
97
|
+
finishedAt?: Date;
|
|
98
|
+
}
|
|
99
|
+
interface SandboxWaitOptions {
|
|
100
|
+
/**
|
|
101
|
+
* Wait for the operation to finish. Defaults to true.
|
|
102
|
+
* The SDK polls if the server's wait budget expires first.
|
|
103
|
+
*/
|
|
104
|
+
wait?: boolean;
|
|
105
|
+
}
|
|
106
|
+
interface SandboxForkOptions extends SandboxWaitOptions {
|
|
107
|
+
/** Name for the fork. The server generates one when omitted. */
|
|
108
|
+
name?: string;
|
|
109
|
+
}
|
|
110
|
+
interface SandboxConnectionInfo {
|
|
111
|
+
url: string;
|
|
112
|
+
expiresAt: Date;
|
|
113
|
+
}
|
|
114
|
+
type SandboxExecOptions = {
|
|
115
|
+
commandTty?: boolean;
|
|
116
|
+
env?: Record<string, string>;
|
|
117
|
+
timeoutSeconds?: number;
|
|
118
|
+
} & SandboxWaitOptions;
|
|
119
|
+
interface SandboxPtyOptions {
|
|
120
|
+
pty: true;
|
|
121
|
+
cols?: number;
|
|
122
|
+
rows?: number;
|
|
123
|
+
onData?: (data: string) => void;
|
|
124
|
+
}
|
|
125
|
+
interface SandboxPtyResult {
|
|
126
|
+
/** Unavailable when a runtime closes without reporting the process status. */
|
|
127
|
+
exitCode?: number;
|
|
128
|
+
}
|
|
129
|
+
declare class SandboxExec {
|
|
130
|
+
sandboxId: string;
|
|
131
|
+
id: string;
|
|
132
|
+
command: string;
|
|
133
|
+
status: SandboxExecStatus;
|
|
134
|
+
exitCode?: number;
|
|
135
|
+
stdout?: string;
|
|
136
|
+
stderr?: string;
|
|
137
|
+
exitReason?: string;
|
|
138
|
+
executeTimeMs?: number;
|
|
139
|
+
startedAt: Date;
|
|
140
|
+
finishedAt?: Date;
|
|
141
|
+
/** @internal */
|
|
142
|
+
private readonly _client;
|
|
143
|
+
/** @internal */
|
|
144
|
+
constructor(data: SandboxExecWire, client: ApiClient);
|
|
145
|
+
/** @internal Overwrite this exec's fields in place from a fresh wire snapshot. */
|
|
146
|
+
private _apply;
|
|
147
|
+
toJSON(): SandboxExecResponse;
|
|
148
|
+
/** Re-fetch this exec and update it in place, returning the same object. */
|
|
149
|
+
refresh(): Promise<SandboxExec>;
|
|
150
|
+
/** Cancel this exec and update it in place, returning the same object. */
|
|
151
|
+
cancel(): Promise<SandboxExec>;
|
|
152
|
+
}
|
|
153
|
+
declare class SandboxPty {
|
|
154
|
+
private readonly _socket;
|
|
155
|
+
private readonly _completion;
|
|
156
|
+
/** @internal */
|
|
157
|
+
constructor(socket: WebSocket, onData?: (data: string) => void);
|
|
158
|
+
/** @internal */
|
|
159
|
+
static connect(url: string, command: string, options: SandboxPtyOptions): Promise<SandboxPty>;
|
|
160
|
+
sendInput(data: string): Promise<void>;
|
|
161
|
+
resize(size: {
|
|
162
|
+
cols: number;
|
|
163
|
+
rows: number;
|
|
164
|
+
}): Promise<void>;
|
|
165
|
+
wait(): Promise<SandboxPtyResult>;
|
|
166
|
+
close(): void;
|
|
167
|
+
private _send;
|
|
168
|
+
}
|
|
169
|
+
declare class Sandbox {
|
|
170
|
+
id: string;
|
|
171
|
+
name: string;
|
|
172
|
+
status: SandboxStatus;
|
|
173
|
+
vcpuCount: number;
|
|
174
|
+
memSizeMiB: number;
|
|
175
|
+
baseImage: string;
|
|
176
|
+
platform?: "arm64" | "amd64";
|
|
177
|
+
maxTtlSeconds: number;
|
|
178
|
+
maxConcurrentExecs: number;
|
|
179
|
+
endpoints?: SandboxEndpoint[];
|
|
180
|
+
createdAt: Date;
|
|
181
|
+
runningAt?: Date;
|
|
182
|
+
finishedAt?: Date;
|
|
183
|
+
lastActiveAt: Date;
|
|
184
|
+
expiresAt?: Date;
|
|
185
|
+
exitReason?: string;
|
|
186
|
+
/** @internal */
|
|
187
|
+
private readonly _client;
|
|
188
|
+
/** @internal */
|
|
189
|
+
constructor(data: SandboxWire, client: ApiClient);
|
|
190
|
+
/** @internal Overwrite this sandbox's fields in place from a fresh wire snapshot. */
|
|
191
|
+
private _apply;
|
|
192
|
+
toJSON(): SandboxResponse;
|
|
193
|
+
/** Re-fetch this sandbox. */
|
|
194
|
+
refresh(): Promise<this>;
|
|
195
|
+
/** Start this sandbox. */
|
|
196
|
+
start(options?: SandboxWaitOptions): Promise<Sandbox | this>;
|
|
197
|
+
/** Stop this sandbox. */
|
|
198
|
+
stop(options?: SandboxWaitOptions): Promise<Sandbox | this>;
|
|
199
|
+
/** Pause this sandbox, preserving its CPU and memory state. */
|
|
200
|
+
pause(options?: SandboxWaitOptions): Promise<Sandbox | this>;
|
|
201
|
+
/** Resume this sandbox from its preserved CPU and memory state. */
|
|
202
|
+
resume(options?: SandboxWaitOptions): Promise<Sandbox | this>;
|
|
203
|
+
/** Create an isolated writable branch from this sandbox's current state. */
|
|
204
|
+
fork(options?: SandboxForkOptions): Promise<Sandbox>;
|
|
205
|
+
/** Create a short-lived signed WebSocket URL for an interactive shell. */
|
|
206
|
+
createConnection(): Promise<SandboxConnectionInfo>;
|
|
207
|
+
/** Delete this sandbox and its backing disk. */
|
|
208
|
+
delete(): Promise<void>;
|
|
209
|
+
exec(command: string, options: SandboxPtyOptions): Promise<SandboxPty>;
|
|
210
|
+
exec(command: string, options?: SandboxExecOptions): Promise<SandboxExec>;
|
|
211
|
+
listExecs(): Promise<SandboxExec[]>;
|
|
212
|
+
getExec(execId: string): Promise<SandboxExec>;
|
|
213
|
+
cancelExec(execId: string): Promise<SandboxExec>;
|
|
214
|
+
}
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region src/sandboxes.d.ts
|
|
217
|
+
interface CreateSandboxRequest {
|
|
218
|
+
/** Name for the sandbox. The server generates one when omitted. */
|
|
219
|
+
name?: string;
|
|
220
|
+
/** Number of virtual CPUs allocated to the sandbox, from 1 to 32. Defaults to 1. */
|
|
221
|
+
vcpuCount?: number;
|
|
222
|
+
/** Memory allocated to the sandbox in MiB, from 256 to 65536. Defaults to 2048. */
|
|
223
|
+
memSizeMiB?: number;
|
|
224
|
+
/**
|
|
225
|
+
* Public Linux OCI image reference for the sandbox's root filesystem.
|
|
226
|
+
* Docker Hub shorthand and any public registry are accepted; the tag
|
|
227
|
+
* defaults to `latest`, and mutable tags are pinned to immutable digests
|
|
228
|
+
* when the sandbox is created. Defaults to `ubuntu:26.04`.
|
|
229
|
+
*
|
|
230
|
+
* Examples: `ubuntu`, `node:24-bookworm`, `ghcr.io/owner/app:v2`,
|
|
231
|
+
* `alpine@sha256:<digest>`.
|
|
232
|
+
*/
|
|
233
|
+
baseImage?: string;
|
|
234
|
+
env?: Record<string, string>;
|
|
235
|
+
maxTtlSeconds?: number;
|
|
236
|
+
maxConcurrentExecs?: number;
|
|
237
|
+
}
|
|
238
|
+
interface ListSandboxesOptions {
|
|
239
|
+
/** Only return sandboxes that mount this disk. */
|
|
240
|
+
disk?: Disk | string;
|
|
241
|
+
}
|
|
242
|
+
declare class Sandboxes {
|
|
243
|
+
/** @internal */
|
|
244
|
+
private readonly _client;
|
|
245
|
+
/** @internal */
|
|
246
|
+
constructor(client: ApiClient);
|
|
247
|
+
/** List the account's sandboxes, oldest first. */
|
|
248
|
+
list(options?: ListSandboxesOptions): Promise<Sandbox[]>;
|
|
249
|
+
get(id: string): Promise<Sandbox>;
|
|
250
|
+
create(request?: CreateSandboxRequest, options?: SandboxWaitOptions): Promise<Sandbox>;
|
|
251
|
+
}
|
|
252
|
+
//#endregion
|
|
56
253
|
//#region src/tokens.d.ts
|
|
57
254
|
interface ListTokensOptions {
|
|
58
255
|
limit?: number;
|
|
@@ -199,6 +396,7 @@ interface ExecOptions {
|
|
|
199
396
|
}
|
|
200
397
|
declare class Archil {
|
|
201
398
|
readonly disks: Disks;
|
|
399
|
+
readonly sandboxes: Sandboxes;
|
|
202
400
|
readonly tokens: Tokens;
|
|
203
401
|
/** @internal */
|
|
204
402
|
private readonly _client;
|
|
@@ -267,6 +465,9 @@ declare function configure(options: ArchilOptions): void;
|
|
|
267
465
|
declare function createDisk(req: CreateDiskRequest): Promise<CreateDiskResult>;
|
|
268
466
|
declare function listDisks(opts?: ListDisksOptions): Promise<Disk[]>;
|
|
269
467
|
declare function getDisk(id: string): Promise<Disk>;
|
|
468
|
+
declare function createSandbox(req?: CreateSandboxRequest, opts?: SandboxWaitOptions): Promise<Sandbox>;
|
|
469
|
+
declare function listSandboxes(opts?: ListSandboxesOptions): Promise<Sandbox[]>;
|
|
470
|
+
declare function getSandbox(id: string): Promise<Sandbox>;
|
|
270
471
|
declare function listApiKeys(opts?: ListTokensOptions): Promise<ApiTokenResponse[]>;
|
|
271
472
|
declare function createApiKey(req: CreateApiTokenRequest): Promise<ApiTokenResponse & {
|
|
272
473
|
token?: string;
|
|
@@ -284,4 +485,4 @@ declare function exec(opts: ExecOptions): Promise<ExecDiskResult>;
|
|
|
284
485
|
*/
|
|
285
486
|
declare function workspace(mounts: Record<string, ExecMount>): Workspace;
|
|
286
487
|
//#endregion
|
|
287
|
-
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 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 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 S3CompatibleMount, type S3Mount, type S3Object, type ShareUrlOptions, type ShareUrlResult, type TokenUser, Tokens, USER_AGENT, type UploadPart, VERSION, Workspace, configure, createApiKey, createDisk, deleteApiKey, effectiveUploadPartSize, exec, getDisk, listApiKeys, listDisks, workspace };
|
|
488
|
+
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 S3CompatibleMount, type S3Mount, type S3Object, Sandbox, type SandboxConnectionInfo, type SandboxEndpoint, SandboxExec, type SandboxExecOptions, type SandboxExecResponse, type SandboxExecStatus, type SandboxForkOptions, SandboxPty, type SandboxPtyOptions, type SandboxPtyResult, type SandboxResponse, type SandboxStatus, 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 { _ as
|
|
2
|
-
export { Archil, ArchilApiError, ArchilError, ArchilS3Error, Disk, DiskMultipart, Disks, Tokens, USER_AGENT, VERSION, Workspace, configure, createApiKey, createDisk, deleteApiKey, effectiveUploadPartSize, exec, getDisk, listApiKeys, listDisks, workspace };
|
|
1
|
+
import { C as effectiveUploadPartSize, D as ArchilError, E as ArchilApiError, O as ArchilS3Error, S as DiskMultipart, T as VERSION, _ as Sandbox, a as deleteApiKey, b as Disks, c as getSandbox, d as listSandboxes, f as workspace, g as Sandboxes, h as Tokens, i as createSandbox, 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 USER_AGENT, x as Disk, y as SandboxPty } from "./src-CR3Ksi_s.mjs";
|
|
2
|
+
export { Archil, ArchilApiError, ArchilError, ArchilS3Error, Disk, DiskMultipart, Disks, Sandbox, SandboxExec, SandboxPty, Sandboxes, Tokens, USER_AGENT, VERSION, Workspace, configure, createApiKey, createDisk, createSandbox, deleteApiKey, effectiveUploadPartSize, exec, getDisk, getSandbox, listApiKeys, listDisks, listSandboxes, workspace };
|