disk 0.8.23 → 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 +64 -6
- 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 +147 -109
- package/dist/index.d.cts +99 -60
- package/dist/index.d.mts +99 -60
- 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-DgL0HTS-.mjs → src-CR3Ksi_s.mjs} +147 -108
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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
2
|
import { components } from "@archildata/api-types";
|
|
3
3
|
|
|
4
4
|
//#region src/disks.d.ts
|
|
@@ -54,45 +54,6 @@ declare class Disks {
|
|
|
54
54
|
create(req: CreateDiskRequest): Promise<CreateDiskResult>;
|
|
55
55
|
}
|
|
56
56
|
//#endregion
|
|
57
|
-
//#region src/errors.d.ts
|
|
58
|
-
/**
|
|
59
|
-
* Base class for every error the SDK throws. Catch with `instanceof ArchilError`
|
|
60
|
-
* to handle control-plane and S3 failures uniformly; `status` is the HTTP status
|
|
61
|
-
* code and `code` a machine-readable error code when the server provided one.
|
|
62
|
-
*/
|
|
63
|
-
declare class ArchilError extends Error {
|
|
64
|
-
/** HTTP status code associated with the failure. */
|
|
65
|
-
readonly status: number;
|
|
66
|
-
/** Machine-readable error code (e.g. an S3 code like "NoSuchKey"), if known. */
|
|
67
|
-
readonly code?: string;
|
|
68
|
-
constructor(message: string, status: number, code?: string);
|
|
69
|
-
}
|
|
70
|
-
/** Error from the control-plane REST API. */
|
|
71
|
-
declare class ArchilApiError extends ArchilError {
|
|
72
|
-
constructor(message: string, status: number, code?: string);
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Error from the S3-compatible object API (getObject/putObject/deleteObject/
|
|
76
|
-
* headObject/listObjects). The gateway returns an S3-style XML `<Error>` body;
|
|
77
|
-
* this surfaces its parts as structured fields (`status`, `code`, `requestId`)
|
|
78
|
-
* rather than a raw blob, while keeping the full body on `raw` for debugging.
|
|
79
|
-
*/
|
|
80
|
-
declare class ArchilS3Error extends ArchilError {
|
|
81
|
-
/** S3 request id, if the gateway returned one. */
|
|
82
|
-
readonly requestId?: string;
|
|
83
|
-
/** Raw response body (the XML document), for debugging. */
|
|
84
|
-
readonly raw: string;
|
|
85
|
-
constructor(opts: {
|
|
86
|
-
operation: string;
|
|
87
|
-
statusCode: number;
|
|
88
|
-
statusText?: string;
|
|
89
|
-
code?: string;
|
|
90
|
-
message?: string;
|
|
91
|
-
requestId?: string;
|
|
92
|
-
raw: string;
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
//#endregion
|
|
96
57
|
//#region src/sandbox.d.ts
|
|
97
58
|
/** @internal */
|
|
98
59
|
type SandboxWire = components["schemas"]["Sandbox"];
|
|
@@ -106,9 +67,12 @@ interface SandboxEndpoint {
|
|
|
106
67
|
}
|
|
107
68
|
interface SandboxResponse {
|
|
108
69
|
id: string;
|
|
70
|
+
name: string;
|
|
109
71
|
status: SandboxStatus;
|
|
110
72
|
vcpuCount: number;
|
|
111
73
|
memSizeMiB: number;
|
|
74
|
+
baseImage: string;
|
|
75
|
+
platform?: "arm64" | "amd64";
|
|
112
76
|
maxTtlSeconds: number;
|
|
113
77
|
maxConcurrentExecs: number;
|
|
114
78
|
endpoints?: SandboxEndpoint[];
|
|
@@ -133,28 +97,34 @@ interface SandboxExecResponse {
|
|
|
133
97
|
finishedAt?: Date;
|
|
134
98
|
}
|
|
135
99
|
interface SandboxWaitOptions {
|
|
136
|
-
|
|
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;
|
|
137
113
|
}
|
|
138
114
|
type SandboxExecOptions = {
|
|
139
115
|
commandTty?: boolean;
|
|
140
116
|
env?: Record<string, string>;
|
|
141
117
|
timeoutSeconds?: number;
|
|
142
118
|
} & SandboxWaitOptions;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
declare class SandboxWaitTimeoutError extends ArchilError {
|
|
149
|
-
readonly operation: "start" | "stop" | "pause" | "resume" | "exec";
|
|
150
|
-
readonly timeoutMs: number;
|
|
151
|
-
readonly latest: Sandbox | SandboxExec;
|
|
152
|
-
constructor(operation: "start" | "stop" | "pause" | "resume" | "exec", timeoutMs: number, latest: Sandbox | SandboxExec);
|
|
119
|
+
interface SandboxPtyOptions {
|
|
120
|
+
pty: true;
|
|
121
|
+
cols?: number;
|
|
122
|
+
rows?: number;
|
|
123
|
+
onData?: (data: string) => void;
|
|
153
124
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
constructor(sandbox: Sandbox);
|
|
125
|
+
interface SandboxPtyResult {
|
|
126
|
+
/** Unavailable when a runtime closes without reporting the process status. */
|
|
127
|
+
exitCode?: number;
|
|
158
128
|
}
|
|
159
129
|
declare class SandboxExec {
|
|
160
130
|
sandboxId: string;
|
|
@@ -180,11 +150,30 @@ declare class SandboxExec {
|
|
|
180
150
|
/** Cancel this exec and update it in place, returning the same object. */
|
|
181
151
|
cancel(): Promise<SandboxExec>;
|
|
182
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
|
+
}
|
|
183
169
|
declare class Sandbox {
|
|
184
170
|
id: string;
|
|
171
|
+
name: string;
|
|
185
172
|
status: SandboxStatus;
|
|
186
173
|
vcpuCount: number;
|
|
187
174
|
memSizeMiB: number;
|
|
175
|
+
baseImage: string;
|
|
176
|
+
platform?: "arm64" | "amd64";
|
|
188
177
|
maxTtlSeconds: number;
|
|
189
178
|
maxConcurrentExecs: number;
|
|
190
179
|
endpoints?: SandboxEndpoint[];
|
|
@@ -204,13 +193,20 @@ declare class Sandbox {
|
|
|
204
193
|
/** Re-fetch this sandbox. */
|
|
205
194
|
refresh(): Promise<this>;
|
|
206
195
|
/** Start this sandbox. */
|
|
207
|
-
start(options?: SandboxWaitOptions): Promise<Sandbox>;
|
|
196
|
+
start(options?: SandboxWaitOptions): Promise<Sandbox | this>;
|
|
208
197
|
/** Stop this sandbox. */
|
|
209
|
-
stop(options?: SandboxWaitOptions): Promise<this>;
|
|
198
|
+
stop(options?: SandboxWaitOptions): Promise<Sandbox | this>;
|
|
210
199
|
/** Pause this sandbox, preserving its CPU and memory state. */
|
|
211
|
-
pause(options?: SandboxWaitOptions): Promise<this>;
|
|
200
|
+
pause(options?: SandboxWaitOptions): Promise<Sandbox | this>;
|
|
212
201
|
/** Resume this sandbox from its preserved CPU and memory state. */
|
|
213
|
-
resume(options?: SandboxWaitOptions): Promise<this>;
|
|
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>;
|
|
214
210
|
exec(command: string, options?: SandboxExecOptions): Promise<SandboxExec>;
|
|
215
211
|
listExecs(): Promise<SandboxExec[]>;
|
|
216
212
|
getExec(execId: string): Promise<SandboxExec>;
|
|
@@ -219,7 +215,11 @@ declare class Sandbox {
|
|
|
219
215
|
//#endregion
|
|
220
216
|
//#region src/sandboxes.d.ts
|
|
221
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. */
|
|
222
221
|
vcpuCount?: number;
|
|
222
|
+
/** Memory allocated to the sandbox in MiB, from 256 to 65536. Defaults to 2048. */
|
|
223
223
|
memSizeMiB?: number;
|
|
224
224
|
/**
|
|
225
225
|
* Public Linux OCI image reference for the sandbox's root filesystem.
|
|
@@ -417,6 +417,45 @@ declare class Archil {
|
|
|
417
417
|
workspace(mounts: Record<string, ExecMount>): Workspace;
|
|
418
418
|
}
|
|
419
419
|
//#endregion
|
|
420
|
+
//#region src/errors.d.ts
|
|
421
|
+
/**
|
|
422
|
+
* Base class for every error the SDK throws. Catch with `instanceof ArchilError`
|
|
423
|
+
* to handle control-plane and S3 failures uniformly; `status` is the HTTP status
|
|
424
|
+
* code and `code` a machine-readable error code when the server provided one.
|
|
425
|
+
*/
|
|
426
|
+
declare class ArchilError extends Error {
|
|
427
|
+
/** HTTP status code associated with the failure. */
|
|
428
|
+
readonly status: number;
|
|
429
|
+
/** Machine-readable error code (e.g. an S3 code like "NoSuchKey"), if known. */
|
|
430
|
+
readonly code?: string;
|
|
431
|
+
constructor(message: string, status: number, code?: string);
|
|
432
|
+
}
|
|
433
|
+
/** Error from the control-plane REST API. */
|
|
434
|
+
declare class ArchilApiError extends ArchilError {
|
|
435
|
+
constructor(message: string, status: number, code?: string);
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Error from the S3-compatible object API (getObject/putObject/deleteObject/
|
|
439
|
+
* headObject/listObjects). The gateway returns an S3-style XML `<Error>` body;
|
|
440
|
+
* this surfaces its parts as structured fields (`status`, `code`, `requestId`)
|
|
441
|
+
* rather than a raw blob, while keeping the full body on `raw` for debugging.
|
|
442
|
+
*/
|
|
443
|
+
declare class ArchilS3Error extends ArchilError {
|
|
444
|
+
/** S3 request id, if the gateway returned one. */
|
|
445
|
+
readonly requestId?: string;
|
|
446
|
+
/** Raw response body (the XML document), for debugging. */
|
|
447
|
+
readonly raw: string;
|
|
448
|
+
constructor(opts: {
|
|
449
|
+
operation: string;
|
|
450
|
+
statusCode: number;
|
|
451
|
+
statusText?: string;
|
|
452
|
+
code?: string;
|
|
453
|
+
message?: string;
|
|
454
|
+
requestId?: string;
|
|
455
|
+
raw: string;
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
//#endregion
|
|
420
459
|
//#region src/version.d.ts
|
|
421
460
|
declare const VERSION: string;
|
|
422
461
|
declare const USER_AGENT: string;
|
|
@@ -446,4 +485,4 @@ declare function exec(opts: ExecOptions): Promise<ExecDiskResult>;
|
|
|
446
485
|
*/
|
|
447
486
|
declare function workspace(mounts: Record<string, ExecMount>): Workspace;
|
|
448
487
|
//#endregion
|
|
449
|
-
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 SandboxEndpoint, SandboxExec, type SandboxExecOptions, type SandboxExecResponse, type SandboxExecStatus, type
|
|
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,4 @@
|
|
|
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
2
|
import { components } from "@archildata/api-types";
|
|
3
3
|
|
|
4
4
|
//#region src/disks.d.ts
|
|
@@ -54,45 +54,6 @@ declare class Disks {
|
|
|
54
54
|
create(req: CreateDiskRequest): Promise<CreateDiskResult>;
|
|
55
55
|
}
|
|
56
56
|
//#endregion
|
|
57
|
-
//#region src/errors.d.ts
|
|
58
|
-
/**
|
|
59
|
-
* Base class for every error the SDK throws. Catch with `instanceof ArchilError`
|
|
60
|
-
* to handle control-plane and S3 failures uniformly; `status` is the HTTP status
|
|
61
|
-
* code and `code` a machine-readable error code when the server provided one.
|
|
62
|
-
*/
|
|
63
|
-
declare class ArchilError extends Error {
|
|
64
|
-
/** HTTP status code associated with the failure. */
|
|
65
|
-
readonly status: number;
|
|
66
|
-
/** Machine-readable error code (e.g. an S3 code like "NoSuchKey"), if known. */
|
|
67
|
-
readonly code?: string;
|
|
68
|
-
constructor(message: string, status: number, code?: string);
|
|
69
|
-
}
|
|
70
|
-
/** Error from the control-plane REST API. */
|
|
71
|
-
declare class ArchilApiError extends ArchilError {
|
|
72
|
-
constructor(message: string, status: number, code?: string);
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Error from the S3-compatible object API (getObject/putObject/deleteObject/
|
|
76
|
-
* headObject/listObjects). The gateway returns an S3-style XML `<Error>` body;
|
|
77
|
-
* this surfaces its parts as structured fields (`status`, `code`, `requestId`)
|
|
78
|
-
* rather than a raw blob, while keeping the full body on `raw` for debugging.
|
|
79
|
-
*/
|
|
80
|
-
declare class ArchilS3Error extends ArchilError {
|
|
81
|
-
/** S3 request id, if the gateway returned one. */
|
|
82
|
-
readonly requestId?: string;
|
|
83
|
-
/** Raw response body (the XML document), for debugging. */
|
|
84
|
-
readonly raw: string;
|
|
85
|
-
constructor(opts: {
|
|
86
|
-
operation: string;
|
|
87
|
-
statusCode: number;
|
|
88
|
-
statusText?: string;
|
|
89
|
-
code?: string;
|
|
90
|
-
message?: string;
|
|
91
|
-
requestId?: string;
|
|
92
|
-
raw: string;
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
//#endregion
|
|
96
57
|
//#region src/sandbox.d.ts
|
|
97
58
|
/** @internal */
|
|
98
59
|
type SandboxWire = components["schemas"]["Sandbox"];
|
|
@@ -106,9 +67,12 @@ interface SandboxEndpoint {
|
|
|
106
67
|
}
|
|
107
68
|
interface SandboxResponse {
|
|
108
69
|
id: string;
|
|
70
|
+
name: string;
|
|
109
71
|
status: SandboxStatus;
|
|
110
72
|
vcpuCount: number;
|
|
111
73
|
memSizeMiB: number;
|
|
74
|
+
baseImage: string;
|
|
75
|
+
platform?: "arm64" | "amd64";
|
|
112
76
|
maxTtlSeconds: number;
|
|
113
77
|
maxConcurrentExecs: number;
|
|
114
78
|
endpoints?: SandboxEndpoint[];
|
|
@@ -133,28 +97,34 @@ interface SandboxExecResponse {
|
|
|
133
97
|
finishedAt?: Date;
|
|
134
98
|
}
|
|
135
99
|
interface SandboxWaitOptions {
|
|
136
|
-
|
|
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;
|
|
137
113
|
}
|
|
138
114
|
type SandboxExecOptions = {
|
|
139
115
|
commandTty?: boolean;
|
|
140
116
|
env?: Record<string, string>;
|
|
141
117
|
timeoutSeconds?: number;
|
|
142
118
|
} & SandboxWaitOptions;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
declare class SandboxWaitTimeoutError extends ArchilError {
|
|
149
|
-
readonly operation: "start" | "stop" | "pause" | "resume" | "exec";
|
|
150
|
-
readonly timeoutMs: number;
|
|
151
|
-
readonly latest: Sandbox | SandboxExec;
|
|
152
|
-
constructor(operation: "start" | "stop" | "pause" | "resume" | "exec", timeoutMs: number, latest: Sandbox | SandboxExec);
|
|
119
|
+
interface SandboxPtyOptions {
|
|
120
|
+
pty: true;
|
|
121
|
+
cols?: number;
|
|
122
|
+
rows?: number;
|
|
123
|
+
onData?: (data: string) => void;
|
|
153
124
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
constructor(sandbox: Sandbox);
|
|
125
|
+
interface SandboxPtyResult {
|
|
126
|
+
/** Unavailable when a runtime closes without reporting the process status. */
|
|
127
|
+
exitCode?: number;
|
|
158
128
|
}
|
|
159
129
|
declare class SandboxExec {
|
|
160
130
|
sandboxId: string;
|
|
@@ -180,11 +150,30 @@ declare class SandboxExec {
|
|
|
180
150
|
/** Cancel this exec and update it in place, returning the same object. */
|
|
181
151
|
cancel(): Promise<SandboxExec>;
|
|
182
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
|
+
}
|
|
183
169
|
declare class Sandbox {
|
|
184
170
|
id: string;
|
|
171
|
+
name: string;
|
|
185
172
|
status: SandboxStatus;
|
|
186
173
|
vcpuCount: number;
|
|
187
174
|
memSizeMiB: number;
|
|
175
|
+
baseImage: string;
|
|
176
|
+
platform?: "arm64" | "amd64";
|
|
188
177
|
maxTtlSeconds: number;
|
|
189
178
|
maxConcurrentExecs: number;
|
|
190
179
|
endpoints?: SandboxEndpoint[];
|
|
@@ -204,13 +193,20 @@ declare class Sandbox {
|
|
|
204
193
|
/** Re-fetch this sandbox. */
|
|
205
194
|
refresh(): Promise<this>;
|
|
206
195
|
/** Start this sandbox. */
|
|
207
|
-
start(options?: SandboxWaitOptions): Promise<Sandbox>;
|
|
196
|
+
start(options?: SandboxWaitOptions): Promise<Sandbox | this>;
|
|
208
197
|
/** Stop this sandbox. */
|
|
209
|
-
stop(options?: SandboxWaitOptions): Promise<this>;
|
|
198
|
+
stop(options?: SandboxWaitOptions): Promise<Sandbox | this>;
|
|
210
199
|
/** Pause this sandbox, preserving its CPU and memory state. */
|
|
211
|
-
pause(options?: SandboxWaitOptions): Promise<this>;
|
|
200
|
+
pause(options?: SandboxWaitOptions): Promise<Sandbox | this>;
|
|
212
201
|
/** Resume this sandbox from its preserved CPU and memory state. */
|
|
213
|
-
resume(options?: SandboxWaitOptions): Promise<this>;
|
|
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>;
|
|
214
210
|
exec(command: string, options?: SandboxExecOptions): Promise<SandboxExec>;
|
|
215
211
|
listExecs(): Promise<SandboxExec[]>;
|
|
216
212
|
getExec(execId: string): Promise<SandboxExec>;
|
|
@@ -219,7 +215,11 @@ declare class Sandbox {
|
|
|
219
215
|
//#endregion
|
|
220
216
|
//#region src/sandboxes.d.ts
|
|
221
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. */
|
|
222
221
|
vcpuCount?: number;
|
|
222
|
+
/** Memory allocated to the sandbox in MiB, from 256 to 65536. Defaults to 2048. */
|
|
223
223
|
memSizeMiB?: number;
|
|
224
224
|
/**
|
|
225
225
|
* Public Linux OCI image reference for the sandbox's root filesystem.
|
|
@@ -417,6 +417,45 @@ declare class Archil {
|
|
|
417
417
|
workspace(mounts: Record<string, ExecMount>): Workspace;
|
|
418
418
|
}
|
|
419
419
|
//#endregion
|
|
420
|
+
//#region src/errors.d.ts
|
|
421
|
+
/**
|
|
422
|
+
* Base class for every error the SDK throws. Catch with `instanceof ArchilError`
|
|
423
|
+
* to handle control-plane and S3 failures uniformly; `status` is the HTTP status
|
|
424
|
+
* code and `code` a machine-readable error code when the server provided one.
|
|
425
|
+
*/
|
|
426
|
+
declare class ArchilError extends Error {
|
|
427
|
+
/** HTTP status code associated with the failure. */
|
|
428
|
+
readonly status: number;
|
|
429
|
+
/** Machine-readable error code (e.g. an S3 code like "NoSuchKey"), if known. */
|
|
430
|
+
readonly code?: string;
|
|
431
|
+
constructor(message: string, status: number, code?: string);
|
|
432
|
+
}
|
|
433
|
+
/** Error from the control-plane REST API. */
|
|
434
|
+
declare class ArchilApiError extends ArchilError {
|
|
435
|
+
constructor(message: string, status: number, code?: string);
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Error from the S3-compatible object API (getObject/putObject/deleteObject/
|
|
439
|
+
* headObject/listObjects). The gateway returns an S3-style XML `<Error>` body;
|
|
440
|
+
* this surfaces its parts as structured fields (`status`, `code`, `requestId`)
|
|
441
|
+
* rather than a raw blob, while keeping the full body on `raw` for debugging.
|
|
442
|
+
*/
|
|
443
|
+
declare class ArchilS3Error extends ArchilError {
|
|
444
|
+
/** S3 request id, if the gateway returned one. */
|
|
445
|
+
readonly requestId?: string;
|
|
446
|
+
/** Raw response body (the XML document), for debugging. */
|
|
447
|
+
readonly raw: string;
|
|
448
|
+
constructor(opts: {
|
|
449
|
+
operation: string;
|
|
450
|
+
statusCode: number;
|
|
451
|
+
statusText?: string;
|
|
452
|
+
code?: string;
|
|
453
|
+
message?: string;
|
|
454
|
+
requestId?: string;
|
|
455
|
+
raw: string;
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
//#endregion
|
|
420
459
|
//#region src/version.d.ts
|
|
421
460
|
declare const VERSION: string;
|
|
422
461
|
declare const USER_AGENT: string;
|
|
@@ -446,4 +485,4 @@ declare function exec(opts: ExecOptions): Promise<ExecDiskResult>;
|
|
|
446
485
|
*/
|
|
447
486
|
declare function workspace(mounts: Record<string, ExecMount>): Workspace;
|
|
448
487
|
//#endregion
|
|
449
|
-
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 SandboxEndpoint, SandboxExec, type SandboxExecOptions, type SandboxExecResponse, type SandboxExecStatus, type
|
|
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 { C as
|
|
2
|
-
export { Archil, ArchilApiError, ArchilError, ArchilS3Error, Disk, DiskMultipart, Disks, Sandbox, SandboxExec,
|
|
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 };
|