@distilled.cloud/archil 0.0.0 → 1.0.0-rc.10

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.
Files changed (47) hide show
  1. package/LICENSE +201 -0
  2. package/lib/credentials.d.ts +29 -0
  3. package/lib/credentials.d.ts.map +1 -0
  4. package/lib/credentials.js +35 -0
  5. package/lib/credentials.js.map +1 -0
  6. package/lib/errors.d.ts +36 -0
  7. package/lib/errors.d.ts.map +1 -0
  8. package/lib/errors.js +26 -0
  9. package/lib/errors.js.map +1 -0
  10. package/lib/index.d.ts +24 -0
  11. package/lib/index.d.ts.map +1 -0
  12. package/lib/index.js +28 -0
  13. package/lib/index.js.map +1 -0
  14. package/lib/pagination.d.ts +9 -0
  15. package/lib/pagination.d.ts.map +1 -0
  16. package/lib/pagination.js +9 -0
  17. package/lib/pagination.js.map +1 -0
  18. package/lib/protocol.d.ts +18 -0
  19. package/lib/protocol.d.ts.map +1 -0
  20. package/lib/protocol.js +51 -0
  21. package/lib/protocol.js.map +1 -0
  22. package/lib/retry.d.ts +32 -0
  23. package/lib/retry.d.ts.map +1 -0
  24. package/lib/retry.js +32 -0
  25. package/lib/retry.js.map +1 -0
  26. package/lib/services/archil.d.ts +783 -0
  27. package/lib/services/archil.d.ts.map +1 -0
  28. package/lib/services/archil.js +719 -0
  29. package/lib/services/archil.js.map +1 -0
  30. package/lib/services/index.d.ts +2 -0
  31. package/lib/services/index.d.ts.map +1 -0
  32. package/lib/services/index.js +3 -0
  33. package/lib/services/index.js.map +1 -0
  34. package/lib/traits.d.ts +11 -0
  35. package/lib/traits.d.ts.map +1 -0
  36. package/lib/traits.js +11 -0
  37. package/lib/traits.js.map +1 -0
  38. package/package.json +77 -6
  39. package/src/credentials.ts +58 -0
  40. package/src/errors.ts +50 -0
  41. package/src/index.ts +36 -0
  42. package/src/pagination.ts +8 -0
  43. package/src/protocol.ts +75 -0
  44. package/src/retry.ts +54 -0
  45. package/src/services/archil.ts +1784 -0
  46. package/src/services/index.ts +2 -0
  47. package/src/traits.ts +44 -0
@@ -0,0 +1,1784 @@
1
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-archil). Do not edit.
2
+ import * as S from "@distilled.cloud/core/schema";
3
+ import * as Redacted from "effect/Redacted";
4
+ import * as API from "@distilled.cloud/core/api";
5
+ import * as C from "@distilled.cloud/core/category";
6
+ import * as T from "../traits.ts";
7
+ import {
8
+ ArchilProtocol,
9
+ type ArchilOpError,
10
+ type ArchilOpContext,
11
+ } from "../protocol.ts";
12
+ import { UnknownArchilError } from "../errors.ts";
13
+ import * as Retry from "../retry.ts";
14
+
15
+ export type { ArchilOpError, ArchilOpContext };
16
+
17
+ export class BadRequest
18
+ extends /*@__PURE__*/ T.applyErrorMatchers(
19
+ /*@__PURE__*/ S.TaggedError<BadRequest>()("BadRequest", {
20
+ code: S.Number,
21
+ message: S.String,
22
+ }).pipe(C.withBadRequestError),
23
+ [{ status: 400 }],
24
+ ) {}
25
+
26
+ export class Conflict
27
+ extends /*@__PURE__*/ T.applyErrorMatchers(
28
+ /*@__PURE__*/ S.TaggedError<Conflict>()("Conflict", {
29
+ code: S.Number,
30
+ message: S.String,
31
+ }).pipe(C.withConflictError),
32
+ [{ status: 409 }],
33
+ ) {}
34
+
35
+ export class Forbidden
36
+ extends /*@__PURE__*/ T.applyErrorMatchers(
37
+ /*@__PURE__*/ S.TaggedError<Forbidden>()("Forbidden", {
38
+ code: S.Number,
39
+ message: S.String,
40
+ }).pipe(C.withAuthError),
41
+ [{ status: 403 }],
42
+ ) {}
43
+
44
+ export class NotFound
45
+ extends /*@__PURE__*/ T.applyErrorMatchers(
46
+ /*@__PURE__*/ S.TaggedError<NotFound>()("NotFound", {
47
+ code: S.Number,
48
+ message: S.String,
49
+ }).pipe(C.withBadRequestError),
50
+ [{ status: 404 }],
51
+ ) {}
52
+
53
+ export type TokenUserType = "token";
54
+ export const TokenUserType = S.String;
55
+
56
+ export interface TokenUser {
57
+ type: TokenUserType;
58
+ /** Deprecated. Client-provided token. If omitted, the server generates a cryptographically secure token and returns it in the response. */
59
+ principal?: string;
60
+ nickname: string;
61
+ /** Deprecated. Last 4 characters of the token. Required when principal is provided; ignored when the server generates the token. */
62
+ tokenSuffix?: string;
63
+ }
64
+ export const TokenUser = /*@__PURE__*/ S.suspend(() =>
65
+ S.Struct({
66
+ type: TokenUserType,
67
+ principal: S.optional(S.String),
68
+ nickname: S.String,
69
+ tokenSuffix: S.optional(S.String),
70
+ }),
71
+ ).annotate({ identifier: "TokenUser" }) as any as S.Schema<TokenUser>;
72
+
73
+ export type AwsStsUserType = "awssts";
74
+ export const AwsStsUserType = S.String;
75
+
76
+ export interface AwsStsUser {
77
+ type: AwsStsUserType;
78
+ /** IAM principal ARN */
79
+ principal: string;
80
+ }
81
+ export const AwsStsUser = /*@__PURE__*/ S.suspend(() =>
82
+ S.Struct({
83
+ type: AwsStsUserType,
84
+ principal: S.String,
85
+ }),
86
+ ).annotate({ identifier: "AwsStsUser" }) as any as S.Schema<AwsStsUser>;
87
+
88
+ export type DiskUser = TokenUser | AwsStsUser;
89
+ export const DiskUser = S.Unknown as any as S.Schema<DiskUser>;
90
+
91
+ export interface AddDiskUserRequest {
92
+ /** Disk ID (format `dsk-{16 hex chars}`) */
93
+ id: string;
94
+ body: DiskUser;
95
+ }
96
+ export const AddDiskUserRequest = /*@__PURE__*/ S.suspend(() =>
97
+ S.Struct({
98
+ id: S.String.pipe(T.Label()),
99
+ body: DiskUser.pipe(T.HttpBody()),
100
+ }).pipe(T.Http({ method: "POST", uri: "/api/disks/{id}/users", code: 200 })),
101
+ ).annotate({
102
+ identifier: "AddDiskUserRequest",
103
+ }) as any as S.Schema<AddDiskUserRequest>;
104
+
105
+ export type AuthorizedUserType = "token" | "awssts";
106
+ export const AuthorizedUserType = S.String;
107
+
108
+ export interface AuthorizedUser {
109
+ type?: AuthorizedUserType;
110
+ /** Use identifier instead. Only populated for awssts type (the IAM ARN). */
111
+ principal?: string;
112
+ nickname?: string;
113
+ tokenSuffix?: string;
114
+ /** The generated disk token (used by clients when mounting the disk). Only present in the response when the server generates the token (i.e. principal was not provided). This value is shown exactly once and cannot be retrieved again. */
115
+ token?: string;
116
+ /** Stable identifier for this user, returned in creation and list responses. Use this value with DELETE /api/disks/{id}/users/{type}?identifier={identifier} to remove the user. For awssts users, this is the IAM ARN. */
117
+ identifier?: string;
118
+ createdAt?: string;
119
+ }
120
+ export const AuthorizedUser = /*@__PURE__*/ S.suspend(() =>
121
+ S.Struct({
122
+ type: S.optional(AuthorizedUserType),
123
+ principal: S.optional(S.String),
124
+ nickname: S.optional(S.String),
125
+ tokenSuffix: S.optional(S.String),
126
+ token: S.optional(S.String),
127
+ identifier: S.optional(S.String),
128
+ createdAt: S.optional(S.String),
129
+ }),
130
+ ).annotate({ identifier: "AuthorizedUser" }) as any as S.Schema<AuthorizedUser>;
131
+
132
+ export interface ApiResponseAuthorizedUser {
133
+ success: boolean;
134
+ data: AuthorizedUser;
135
+ }
136
+ export const ApiResponseAuthorizedUser = /*@__PURE__*/ S.suspend(() =>
137
+ S.Struct({
138
+ success: S.Boolean,
139
+ data: AuthorizedUser,
140
+ }),
141
+ ).annotate({
142
+ identifier: "ApiResponseAuthorizedUser",
143
+ }) as any as S.Schema<ApiResponseAuthorizedUser>;
144
+
145
+ export interface CreateApiTokenRequest {
146
+ /** Token name */
147
+ name: string;
148
+ /** Token description */
149
+ description?: string;
150
+ }
151
+ export const CreateApiTokenRequest = /*@__PURE__*/ S.suspend(() =>
152
+ S.Struct({
153
+ name: S.String,
154
+ description: S.optional(S.String),
155
+ }).pipe(T.Http({ method: "POST", uri: "/api/tokens", code: 200 })),
156
+ ).annotate({
157
+ identifier: "CreateApiTokenRequest",
158
+ }) as any as S.Schema<CreateApiTokenRequest>;
159
+
160
+ export interface ApiResponseTokenCreatedData {
161
+ /** Token hash/ID */
162
+ id?: string;
163
+ name?: string;
164
+ description?: string;
165
+ /** Last 4 characters of the token */
166
+ tokenSuffix?: string;
167
+ createdAt?: string;
168
+ lastUsedAt?: string;
169
+ /** Full token value (only shown at creation) */
170
+ token?: string;
171
+ }
172
+ export const ApiResponseTokenCreatedData = /*@__PURE__*/ S.suspend(() =>
173
+ S.Struct({
174
+ id: S.optional(S.String),
175
+ name: S.optional(S.String),
176
+ description: S.optional(S.String),
177
+ tokenSuffix: S.optional(S.String),
178
+ createdAt: S.optional(S.String),
179
+ lastUsedAt: S.optional(S.String),
180
+ token: S.optional(S.String),
181
+ }),
182
+ ).annotate({
183
+ identifier: "ApiResponseTokenCreatedData",
184
+ }) as any as S.Schema<ApiResponseTokenCreatedData>;
185
+
186
+ export interface ApiResponseTokenCreated {
187
+ success: boolean;
188
+ data: ApiResponseTokenCreatedData;
189
+ }
190
+ export const ApiResponseTokenCreated = /*@__PURE__*/ S.suspend(() =>
191
+ S.Struct({
192
+ success: S.Boolean,
193
+ data: ApiResponseTokenCreatedData,
194
+ }),
195
+ ).annotate({
196
+ identifier: "ApiResponseTokenCreated",
197
+ }) as any as S.Schema<ApiResponseTokenCreated>;
198
+
199
+ /** Mount type identifier */
200
+ export type S3MountType = "s3";
201
+ export const S3MountType = S.String;
202
+
203
+ /** Mount configuration for Amazon S3 buckets */
204
+ export interface S3Mount {
205
+ /** Mount type identifier */
206
+ type: S3MountType;
207
+ /** S3 bucket name */
208
+ bucketName: string;
209
+ /** AWS access key ID (optional for public buckets or IAM role auth) */
210
+ accessKeyId?: string | Redacted.Redacted<string>;
211
+ /** AWS secret access key */
212
+ secretAccessKey?: string | Redacted.Redacted<string>;
213
+ /** Session token for temporary credentials */
214
+ sessionToken?: string | Redacted.Redacted<string>;
215
+ /** Prefix within the bucket */
216
+ bucketPrefix?: string;
217
+ }
218
+ export const S3Mount = /*@__PURE__*/ S.suspend(() =>
219
+ S.Struct({
220
+ type: S3MountType,
221
+ bucketName: S.String,
222
+ accessKeyId: S.optional(S.String.pipe(T.SensitiveValue({}))),
223
+ secretAccessKey: S.optional(S.String.pipe(T.SensitiveValue({}))),
224
+ sessionToken: S.optional(S.String.pipe(T.SensitiveValue({}))),
225
+ bucketPrefix: S.optional(S.String),
226
+ }),
227
+ ).annotate({ identifier: "S3Mount" }) as any as S.Schema<S3Mount>;
228
+
229
+ /** Mount type identifier */
230
+ export type GCSMountType = "gcs";
231
+ export const GCSMountType = S.String;
232
+
233
+ /** Mount configuration for Google Cloud Storage buckets */
234
+ export interface GCSMount {
235
+ /** Mount type identifier */
236
+ type: GCSMountType;
237
+ /** GCS bucket name */
238
+ bucketName: string;
239
+ /** HMAC access key ID */
240
+ accessKeyId: string | Redacted.Redacted<string>;
241
+ /** HMAC secret access key */
242
+ secretAccessKey: string | Redacted.Redacted<string>;
243
+ /** Prefix within the bucket (optional) */
244
+ bucketPrefix?: string;
245
+ }
246
+ export const GCSMount = /*@__PURE__*/ S.suspend(() =>
247
+ S.Struct({
248
+ type: GCSMountType,
249
+ bucketName: S.String,
250
+ accessKeyId: S.String.pipe(T.SensitiveValue({})),
251
+ secretAccessKey: S.String.pipe(T.SensitiveValue({})),
252
+ bucketPrefix: S.optional(S.String),
253
+ }),
254
+ ).annotate({ identifier: "GCSMount" }) as any as S.Schema<GCSMount>;
255
+
256
+ /** Mount type identifier */
257
+ export type R2MountType = "r2";
258
+ export const R2MountType = S.String;
259
+
260
+ /** Mount configuration for Cloudflare R2 buckets */
261
+ export interface R2Mount {
262
+ /** Mount type identifier */
263
+ type: R2MountType;
264
+ /** R2 bucket name */
265
+ bucketName: string;
266
+ /** R2 endpoint URL */
267
+ bucketEndpoint: string;
268
+ /** R2 access key ID */
269
+ accessKeyId: string | Redacted.Redacted<string>;
270
+ /** R2 secret access key */
271
+ secretAccessKey: string | Redacted.Redacted<string>;
272
+ /** Prefix within the bucket (optional) */
273
+ bucketPrefix?: string;
274
+ }
275
+ export const R2Mount = /*@__PURE__*/ S.suspend(() =>
276
+ S.Struct({
277
+ type: R2MountType,
278
+ bucketName: S.String,
279
+ bucketEndpoint: S.String,
280
+ accessKeyId: S.String.pipe(T.SensitiveValue({})),
281
+ secretAccessKey: S.String.pipe(T.SensitiveValue({})),
282
+ bucketPrefix: S.optional(S.String),
283
+ }),
284
+ ).annotate({ identifier: "R2Mount" }) as any as S.Schema<R2Mount>;
285
+
286
+ /** Mount type identifier */
287
+ export type S3CompatibleMountType = "s3-compatible";
288
+ export const S3CompatibleMountType = S.String;
289
+
290
+ /** Mount configuration for S3-compatible storage (MinIO, Backblaze B2, etc.) */
291
+ export interface S3CompatibleMount {
292
+ /** Mount type identifier */
293
+ type: S3CompatibleMountType;
294
+ /** Bucket name */
295
+ bucketName: string;
296
+ /** S3-compatible endpoint URL */
297
+ bucketEndpoint: string;
298
+ /** Access key ID */
299
+ accessKeyId: string | Redacted.Redacted<string>;
300
+ /** Secret access key */
301
+ secretAccessKey: string | Redacted.Redacted<string>;
302
+ /** Prefix within the bucket (optional) */
303
+ bucketPrefix?: string;
304
+ }
305
+ export const S3CompatibleMount = /*@__PURE__*/ S.suspend(() =>
306
+ S.Struct({
307
+ type: S3CompatibleMountType,
308
+ bucketName: S.String,
309
+ bucketEndpoint: S.String,
310
+ accessKeyId: S.String.pipe(T.SensitiveValue({})),
311
+ secretAccessKey: S.String.pipe(T.SensitiveValue({})),
312
+ bucketPrefix: S.optional(S.String),
313
+ }),
314
+ ).annotate({
315
+ identifier: "S3CompatibleMount",
316
+ }) as any as S.Schema<S3CompatibleMount>;
317
+
318
+ /** Mount type identifier */
319
+ export type AzureBlobMountType = "azure-blob";
320
+ export const AzureBlobMountType = S.String;
321
+
322
+ /** Mount configuration for Azure Blob Storage containers */
323
+ export interface AzureBlobMount {
324
+ /** Mount type identifier */
325
+ type: AzureBlobMountType;
326
+ /** Azure blob container name */
327
+ containerName: string;
328
+ /** Azure blob endpoint URL (optional if storageAccountName provided) */
329
+ endpoint?: string;
330
+ /** Azure storage account name (used to derive endpoint if not provided) */
331
+ storageAccountName?: string;
332
+ /** Azure AD tenant ID */
333
+ tenantId: string;
334
+ /** Azure AD application client ID */
335
+ clientId: string;
336
+ /** Azure AD application client secret */
337
+ clientSecret: string | Redacted.Redacted<string>;
338
+ /** Prefix within the container */
339
+ bucketPrefix?: string;
340
+ }
341
+ export const AzureBlobMount = /*@__PURE__*/ S.suspend(() =>
342
+ S.Struct({
343
+ type: AzureBlobMountType,
344
+ containerName: S.String,
345
+ endpoint: S.optional(S.String),
346
+ storageAccountName: S.optional(S.String),
347
+ tenantId: S.String,
348
+ clientId: S.String,
349
+ clientSecret: S.String.pipe(T.SensitiveValue({})),
350
+ bucketPrefix: S.optional(S.String),
351
+ }),
352
+ ).annotate({ identifier: "AzureBlobMount" }) as any as S.Schema<AzureBlobMount>;
353
+
354
+ export type MountConfig =
355
+ | S3Mount
356
+ | GCSMount
357
+ | R2Mount
358
+ | S3CompatibleMount
359
+ | AzureBlobMount;
360
+ export const MountConfig = S.Unknown as any as S.Schema<MountConfig>;
361
+
362
+ /** Storage mount to attach. Omit for archil-managed storage. */
363
+ export type CreateDiskRequestMountsList = Array<MountConfig>;
364
+ export const CreateDiskRequestMountsList = /*@__PURE__*/ S.Array(
365
+ MountConfig,
366
+ ) as any as S.Schema<CreateDiskRequestMountsList>;
367
+
368
+ /** Deprecated. Use AddDiskUser after creation instead. When provided, suppresses the default auto-generated token user. */
369
+ export type CreateDiskRequestAuthMethodsList = Array<DiskUser>;
370
+ export const CreateDiskRequestAuthMethodsList = /*@__PURE__*/ S.Array(
371
+ DiskUser,
372
+ ) as any as S.Schema<CreateDiskRequestAuthMethodsList>;
373
+
374
+ export interface CreateDiskRequest {
375
+ /** Disk name (alphanumeric, dashes, underscores) */
376
+ name: string;
377
+ /** Storage mount to attach. Omit for archil-managed storage. */
378
+ mounts?: CreateDiskRequestMountsList;
379
+ /** Deprecated. Use AddDiskUser after creation instead. When provided, suppresses the default auto-generated token user. */
380
+ authMethods?: CreateDiskRequestAuthMethodsList;
381
+ }
382
+ export const CreateDiskRequest = /*@__PURE__*/ S.suspend(() =>
383
+ S.Struct({
384
+ name: S.String,
385
+ mounts: S.optional(CreateDiskRequestMountsList),
386
+ authMethods: S.optional(CreateDiskRequestAuthMethodsList),
387
+ }).pipe(T.Http({ method: "POST", uri: "/api/disks", code: 200 })),
388
+ ).annotate({
389
+ identifier: "CreateDiskRequest",
390
+ }) as any as S.Schema<CreateDiskRequest>;
391
+
392
+ export type ApiResponseCreateDiskDataAuthorizedUsersList =
393
+ Array<AuthorizedUser>;
394
+ export const ApiResponseCreateDiskDataAuthorizedUsersList =
395
+ /*@__PURE__*/ S.Array(
396
+ AuthorizedUser,
397
+ ) as any as S.Schema<ApiResponseCreateDiskDataAuthorizedUsersList>;
398
+
399
+ export interface ApiResponseCreateDiskData {
400
+ diskId?: string;
401
+ authorizedUsers?: ApiResponseCreateDiskDataAuthorizedUsersList;
402
+ }
403
+ export const ApiResponseCreateDiskData = /*@__PURE__*/ S.suspend(() =>
404
+ S.Struct({
405
+ diskId: S.optional(S.String),
406
+ authorizedUsers: S.optional(ApiResponseCreateDiskDataAuthorizedUsersList),
407
+ }),
408
+ ).annotate({
409
+ identifier: "ApiResponseCreateDiskData",
410
+ }) as any as S.Schema<ApiResponseCreateDiskData>;
411
+
412
+ export interface ApiResponseCreateDisk {
413
+ success: boolean;
414
+ data: ApiResponseCreateDiskData;
415
+ }
416
+ export const ApiResponseCreateDisk = /*@__PURE__*/ S.suspend(() =>
417
+ S.Struct({
418
+ success: S.Boolean,
419
+ data: ApiResponseCreateDiskData,
420
+ }),
421
+ ).annotate({
422
+ identifier: "ApiResponseCreateDisk",
423
+ }) as any as S.Schema<ApiResponseCreateDisk>;
424
+
425
+ /** Environment variables applied to every process */
426
+ export type CreateSandboxRequestEnvMap = { [key: string]: string | undefined };
427
+ export const CreateSandboxRequestEnvMap = /*@__PURE__*/ S.Record(
428
+ S.String,
429
+ S.String,
430
+ ) as any as S.Schema<CreateSandboxRequestEnvMap>;
431
+
432
+ export interface CreateSandboxRequest {
433
+ /** Hold the request for a completed sandbox lifecycle transition */
434
+ wait?: boolean;
435
+ /** Sandbox name, unique within the account. A random word-list name is generated when omitted. */
436
+ name?: string;
437
+ vcpu_count?: number;
438
+ mem_size_mib?: number;
439
+ /** Public Linux OCI image reference. Docker shorthand and tags are accepted. */
440
+ base_image?: string;
441
+ /** Environment variables applied to every process */
442
+ env?: CreateSandboxRequestEnvMap;
443
+ /** Lifetime budget for each powered-on session. Activity does not extend the deadline; starting or resuming the sandbox begins a fresh session. */
444
+ max_ttl_seconds?: number;
445
+ /** Maximum concurrently attached process sessions */
446
+ max_concurrent_execs?: number;
447
+ }
448
+ export const CreateSandboxRequest = /*@__PURE__*/ S.suspend(() =>
449
+ S.Struct({
450
+ wait: S.optional(S.Boolean.pipe(T.Query())),
451
+ name: S.optional(S.String),
452
+ vcpu_count: S.optional(S.Number),
453
+ mem_size_mib: S.optional(S.Number),
454
+ base_image: S.optional(S.String),
455
+ env: S.optional(CreateSandboxRequestEnvMap),
456
+ max_ttl_seconds: S.optional(S.Number),
457
+ max_concurrent_execs: S.optional(S.Number),
458
+ }).pipe(T.Http({ method: "POST", uri: "/api/sandboxes", code: 200 })),
459
+ ).annotate({
460
+ identifier: "CreateSandboxRequest",
461
+ }) as any as S.Schema<CreateSandboxRequest>;
462
+
463
+ export interface CreateSandboxResponse {}
464
+ export const CreateSandboxResponse = /*@__PURE__*/ S.suspend(() =>
465
+ S.Struct({}),
466
+ ).annotate({
467
+ identifier: "CreateSandboxResponse",
468
+ }) as any as S.Schema<CreateSandboxResponse>;
469
+
470
+ export interface CreateSandboxConnectionRequest {
471
+ /** Sandbox UUID */
472
+ sid: string;
473
+ }
474
+ export const CreateSandboxConnectionRequest = /*@__PURE__*/ S.suspend(() =>
475
+ S.Struct({
476
+ sid: S.String.pipe(T.Label()),
477
+ }).pipe(
478
+ T.Http({
479
+ method: "POST",
480
+ uri: "/api/sandboxes/{sid}/connections",
481
+ code: 200,
482
+ }),
483
+ ),
484
+ ).annotate({
485
+ identifier: "CreateSandboxConnectionRequest",
486
+ }) as any as S.Schema<CreateSandboxConnectionRequest>;
487
+
488
+ export interface SandboxConnection {
489
+ url: string;
490
+ expires_at: string;
491
+ }
492
+ export const SandboxConnection = /*@__PURE__*/ S.suspend(() =>
493
+ S.Struct({
494
+ url: S.String,
495
+ expires_at: S.String,
496
+ }),
497
+ ).annotate({
498
+ identifier: "SandboxConnection",
499
+ }) as any as S.Schema<SandboxConnection>;
500
+
501
+ export interface ApiResponseSandboxConnection {
502
+ success: boolean;
503
+ data: SandboxConnection;
504
+ }
505
+ export const ApiResponseSandboxConnection = /*@__PURE__*/ S.suspend(() =>
506
+ S.Struct({
507
+ success: S.Boolean,
508
+ data: SandboxConnection,
509
+ }),
510
+ ).annotate({
511
+ identifier: "ApiResponseSandboxConnection",
512
+ }) as any as S.Schema<ApiResponseSandboxConnection>;
513
+
514
+ export interface CreateShareUrlRequest {
515
+ /** Disk ID (format `dsk-{16 hex chars}`) */
516
+ id: string;
517
+ /** File key (path) within the disk. */
518
+ key: string;
519
+ /** URL lifetime in seconds. Any integer from 1 to 604800 (7 days). Defaults to 86400 (24 hours). */
520
+ expiresIn?: number;
521
+ }
522
+ export const CreateShareUrlRequest = /*@__PURE__*/ S.suspend(() =>
523
+ S.Struct({
524
+ id: S.String.pipe(T.Label()),
525
+ key: S.String,
526
+ expiresIn: S.optional(S.Number),
527
+ }).pipe(T.Http({ method: "POST", uri: "/api/disks/{id}/share", code: 200 })),
528
+ ).annotate({
529
+ identifier: "CreateShareUrlRequest",
530
+ }) as any as S.Schema<CreateShareUrlRequest>;
531
+
532
+ export interface ApiResponseShareUrlData {
533
+ /** The signed, public download URL. */
534
+ url: string;
535
+ /** URL lifetime in seconds. */
536
+ expiresIn: number;
537
+ }
538
+ export const ApiResponseShareUrlData = /*@__PURE__*/ S.suspend(() =>
539
+ S.Struct({
540
+ url: S.String,
541
+ expiresIn: S.Number,
542
+ }),
543
+ ).annotate({
544
+ identifier: "ApiResponseShareUrlData",
545
+ }) as any as S.Schema<ApiResponseShareUrlData>;
546
+
547
+ export interface ApiResponseShareUrl {
548
+ success: boolean;
549
+ data: ApiResponseShareUrlData;
550
+ }
551
+ export const ApiResponseShareUrl = /*@__PURE__*/ S.suspend(() =>
552
+ S.Struct({
553
+ success: S.Boolean,
554
+ data: ApiResponseShareUrlData,
555
+ }),
556
+ ).annotate({
557
+ identifier: "ApiResponseShareUrl",
558
+ }) as any as S.Schema<ApiResponseShareUrl>;
559
+
560
+ export interface DeleteDiskRequest {
561
+ /** Disk ID (format `dsk-{16 hex chars}`) */
562
+ id: string;
563
+ }
564
+ export const DeleteDiskRequest = /*@__PURE__*/ S.suspend(() =>
565
+ S.Struct({
566
+ id: S.String.pipe(T.Label()),
567
+ }).pipe(T.Http({ method: "DELETE", uri: "/api/disks/{id}", code: 200 })),
568
+ ).annotate({
569
+ identifier: "DeleteDiskRequest",
570
+ }) as any as S.Schema<DeleteDiskRequest>;
571
+
572
+ export interface ApiResponseEmpty {
573
+ success: boolean;
574
+ }
575
+ export const ApiResponseEmpty = /*@__PURE__*/ S.suspend(() =>
576
+ S.Struct({
577
+ success: S.Boolean,
578
+ }),
579
+ ).annotate({
580
+ identifier: "ApiResponseEmpty",
581
+ }) as any as S.Schema<ApiResponseEmpty>;
582
+
583
+ export interface DeleteSandboxRequest {
584
+ /** Sandbox UUID */
585
+ sid: string;
586
+ }
587
+ export const DeleteSandboxRequest = /*@__PURE__*/ S.suspend(() =>
588
+ S.Struct({
589
+ sid: S.String.pipe(T.Label()),
590
+ }).pipe(T.Http({ method: "DELETE", uri: "/api/sandboxes/{sid}", code: 200 })),
591
+ ).annotate({
592
+ identifier: "DeleteSandboxRequest",
593
+ }) as any as S.Schema<DeleteSandboxRequest>;
594
+
595
+ export interface DeleteSandboxResponse {}
596
+ export const DeleteSandboxResponse = /*@__PURE__*/ S.suspend(() =>
597
+ S.Struct({}),
598
+ ).annotate({
599
+ identifier: "DeleteSandboxResponse",
600
+ }) as any as S.Schema<DeleteSandboxResponse>;
601
+
602
+ export interface DeleteTokenRequest {
603
+ /** The token ID (hash) */
604
+ id: string;
605
+ }
606
+ export const DeleteTokenRequest = /*@__PURE__*/ S.suspend(() =>
607
+ S.Struct({
608
+ id: S.String.pipe(T.Label()),
609
+ }).pipe(T.Http({ method: "DELETE", uri: "/api/tokens/{id}", code: 200 })),
610
+ ).annotate({
611
+ identifier: "DeleteTokenRequest",
612
+ }) as any as S.Schema<DeleteTokenRequest>;
613
+
614
+ export interface ApiResponseMessageData {
615
+ message?: string;
616
+ }
617
+ export const ApiResponseMessageData = /*@__PURE__*/ S.suspend(() =>
618
+ S.Struct({
619
+ message: S.optional(S.String),
620
+ }),
621
+ ).annotate({
622
+ identifier: "ApiResponseMessageData",
623
+ }) as any as S.Schema<ApiResponseMessageData>;
624
+
625
+ export interface ApiResponseMessage {
626
+ success: boolean;
627
+ data: ApiResponseMessageData;
628
+ }
629
+ export const ApiResponseMessage = /*@__PURE__*/ S.suspend(() =>
630
+ S.Struct({
631
+ success: S.Boolean,
632
+ data: ApiResponseMessageData,
633
+ }),
634
+ ).annotate({
635
+ identifier: "ApiResponseMessage",
636
+ }) as any as S.Schema<ApiResponseMessage>;
637
+
638
+ export interface ExecMount {
639
+ /** Disk ID to mount at this relative path */
640
+ disk: string;
641
+ /** Subdirectory of the disk to expose at the mountpoint. Must be a relative path with no `.` or `..` segments. When omitted, the disk's root is exposed. */
642
+ subdirectory?: string;
643
+ /** When true, the disk is mounted read-only inside the container. Writes against the mount fail with EROFS. */
644
+ readOnly?: boolean;
645
+ }
646
+ export const ExecMount = /*@__PURE__*/ S.suspend(() =>
647
+ S.Struct({
648
+ disk: S.String,
649
+ subdirectory: S.optional(S.String),
650
+ readOnly: S.optional(S.Boolean),
651
+ }),
652
+ ).annotate({ identifier: "ExecMount" }) as any as S.Schema<ExecMount>;
653
+
654
+ export type ExecRequestDisksValue = string | ExecMount;
655
+ export const ExecRequestDisksValue =
656
+ S.Unknown as any as S.Schema<ExecRequestDisksValue>;
657
+
658
+ /** Map of relative path under `/mnt/archil` to the disk to mount there. At least one entry is required. Relative paths must be non-empty, non-absolute, and contain no `.` or `..` segments. Each value is either a plain disk ID string (mounts the disk's root, read-write) or an object that additionally selects a subdirectory of the disk and/or marks the mount as read-only. */
659
+ export type ExecRequestDisksMap = {
660
+ [key: string]: ExecRequestDisksValue | undefined;
661
+ };
662
+ export const ExecRequestDisksMap = /*@__PURE__*/ S.Record(
663
+ S.String,
664
+ ExecRequestDisksValue,
665
+ ) as any as S.Schema<ExecRequestDisksMap>;
666
+
667
+ export interface ExecRequest {
668
+ /** Map of relative path under `/mnt/archil` to the disk to mount there. At least one entry is required. Relative paths must be non-empty, non-absolute, and contain no `.` or `..` segments. Each value is either a plain disk ID string (mounts the disk's root, read-write) or an object that additionally selects a subdirectory of the disk and/or marks the mount as read-only. */
669
+ disks: ExecRequestDisksMap;
670
+ /** Shell command to execute inside the container */
671
+ command: string;
672
+ }
673
+ export const ExecRequest = /*@__PURE__*/ S.suspend(() =>
674
+ S.Struct({
675
+ disks: ExecRequestDisksMap,
676
+ command: S.String,
677
+ }).pipe(T.Http({ method: "POST", uri: "/api/exec", code: 200 })),
678
+ ).annotate({ identifier: "ExecRequest" }) as any as S.Schema<ExecRequest>;
679
+
680
+ /** Server-measured timings for an exec request. */
681
+ export interface ExecTiming {
682
+ /** End-to-end wall clock measured on the server, from request arrival to response. */
683
+ totalMs: number;
684
+ /** Time spent queueing, scheduling, booting/claiming a VM, and mounting the filesystem before the command started running. */
685
+ queueMs: number;
686
+ /** Time the user's command itself ran, measured by the runtime. */
687
+ executeMs: number;
688
+ }
689
+ export const ExecTiming = /*@__PURE__*/ S.suspend(() =>
690
+ S.Struct({
691
+ totalMs: S.Number,
692
+ queueMs: S.Number,
693
+ executeMs: S.Number,
694
+ }),
695
+ ).annotate({ identifier: "ExecTiming" }) as any as S.Schema<ExecTiming>;
696
+
697
+ export interface ExecDiskResult {
698
+ /** Exit code of the command (0 = success) */
699
+ exitCode: number;
700
+ /** Standard output from the command */
701
+ stdout: string;
702
+ /** Standard error from the command */
703
+ stderr: string;
704
+ timing: ExecTiming;
705
+ }
706
+ export const ExecDiskResult = /*@__PURE__*/ S.suspend(() =>
707
+ S.Struct({
708
+ exitCode: S.Number,
709
+ stdout: S.String,
710
+ stderr: S.String,
711
+ timing: ExecTiming,
712
+ }),
713
+ ).annotate({ identifier: "ExecDiskResult" }) as any as S.Schema<ExecDiskResult>;
714
+
715
+ export interface ApiResponseExec {
716
+ success: boolean;
717
+ data: ExecDiskResult;
718
+ }
719
+ export const ApiResponseExec = /*@__PURE__*/ S.suspend(() =>
720
+ S.Struct({
721
+ success: S.Boolean,
722
+ data: ExecDiskResult,
723
+ }),
724
+ ).annotate({
725
+ identifier: "ApiResponseExec",
726
+ }) as any as S.Schema<ApiResponseExec>;
727
+
728
+ export interface ExecDiskRequest {
729
+ /** Disk ID (format `dsk-{16 hex chars}`) */
730
+ id: string;
731
+ /** Shell command to execute inside the container */
732
+ command: string;
733
+ }
734
+ export const ExecDiskRequest = /*@__PURE__*/ S.suspend(() =>
735
+ S.Struct({
736
+ id: S.String.pipe(T.Label()),
737
+ command: S.String,
738
+ }).pipe(T.Http({ method: "POST", uri: "/api/disks/{id}/exec", code: 200 })),
739
+ ).annotate({
740
+ identifier: "ExecDiskRequest",
741
+ }) as any as S.Schema<ExecDiskRequest>;
742
+
743
+ export interface ApiResponseExecDisk {
744
+ success: boolean;
745
+ data: ExecDiskResult;
746
+ }
747
+ export const ApiResponseExecDisk = /*@__PURE__*/ S.suspend(() =>
748
+ S.Struct({
749
+ success: S.Boolean,
750
+ data: ExecDiskResult,
751
+ }),
752
+ ).annotate({
753
+ identifier: "ApiResponseExecDisk",
754
+ }) as any as S.Schema<ApiResponseExecDisk>;
755
+
756
+ export interface ForkSandboxRequest {
757
+ /** Sandbox UUID */
758
+ sid: string;
759
+ /** Hold the request for a completed sandbox lifecycle transition */
760
+ wait?: boolean;
761
+ /** Name for the fork. A random word-list name is generated when omitted. */
762
+ name?: string;
763
+ }
764
+ export const ForkSandboxRequest = /*@__PURE__*/ S.suspend(() =>
765
+ S.Struct({
766
+ sid: S.String.pipe(T.Label()),
767
+ wait: S.optional(S.Boolean.pipe(T.Query())),
768
+ name: S.optional(S.String),
769
+ }).pipe(
770
+ T.Http({ method: "POST", uri: "/api/sandboxes/{sid}/fork", code: 200 }),
771
+ ),
772
+ ).annotate({
773
+ identifier: "ForkSandboxRequest",
774
+ }) as any as S.Schema<ForkSandboxRequest>;
775
+
776
+ export interface ForkSandboxResponse {}
777
+ export const ForkSandboxResponse = /*@__PURE__*/ S.suspend(() =>
778
+ S.Struct({}),
779
+ ).annotate({
780
+ identifier: "ForkSandboxResponse",
781
+ }) as any as S.Schema<ForkSandboxResponse>;
782
+
783
+ export interface GetDiskRequest {
784
+ /** Disk ID (format `dsk-{16 hex chars}`) */
785
+ id: string;
786
+ }
787
+ export const GetDiskRequest = /*@__PURE__*/ S.suspend(() =>
788
+ S.Struct({
789
+ id: S.String.pipe(T.Label()),
790
+ }).pipe(T.Http({ method: "GET", uri: "/api/disks/{id}", code: 200 })),
791
+ ).annotate({ identifier: "GetDiskRequest" }) as any as S.Schema<GetDiskRequest>;
792
+
793
+ /** Disk status */
794
+ export type DiskResponseStatus =
795
+ | "available"
796
+ | "creating"
797
+ | "deleting"
798
+ | "deleted"
799
+ | "failed";
800
+ export const DiskResponseStatus = S.String;
801
+
802
+ /** Storage backend type */
803
+ export type MountResponseType =
804
+ | "s3"
805
+ | "gcs"
806
+ | "r2"
807
+ | "s3-compatible"
808
+ | "azure-blob";
809
+ export const MountResponseType = S.String;
810
+
811
+ /** Access mode */
812
+ export type MountResponseAccessMode = "rw" | "ro";
813
+ export const MountResponseAccessMode = S.String;
814
+
815
+ /** Mount configuration details (secrets omitted) */
816
+ export interface MountConfigResponse {
817
+ /** Bucket name */
818
+ bucketName?: string;
819
+ /** Storage endpoint URL */
820
+ bucketEndpoint?: string;
821
+ /** Prefix within the bucket */
822
+ bucketPrefix?: string;
823
+ /** Session identifier for IAM-authorized mounts */
824
+ sessionId?: string;
825
+ }
826
+ export const MountConfigResponse = /*@__PURE__*/ S.suspend(() =>
827
+ S.Struct({
828
+ bucketName: S.optional(S.String),
829
+ bucketEndpoint: S.optional(S.String),
830
+ bucketPrefix: S.optional(S.String),
831
+ sessionId: S.optional(S.String),
832
+ }),
833
+ ).annotate({
834
+ identifier: "MountConfigResponse",
835
+ }) as any as S.Schema<MountConfigResponse>;
836
+
837
+ /** Current connection status */
838
+ export type MountResponseConnectionStatus = "connected" | "disconnected";
839
+ export const MountResponseConnectionStatus = S.String;
840
+
841
+ /** How the mount authenticates to the storage backend */
842
+ export type MountResponseAuthorizationType = "iam" | "accessKeys" | "oauth";
843
+ export const MountResponseAuthorizationType = S.String;
844
+
845
+ export interface MountResponse {
846
+ /** Mount identifier */
847
+ id?: string;
848
+ /** Storage backend type */
849
+ type?: MountResponseType;
850
+ /** Mount path */
851
+ path?: string;
852
+ /** Bucket/container name */
853
+ name?: string;
854
+ /** Access mode */
855
+ accessMode?: MountResponseAccessMode;
856
+ config?: MountConfigResponse;
857
+ /** Current connection status */
858
+ connectionStatus?: MountResponseConnectionStatus;
859
+ /** Authentication error message (if disconnected) */
860
+ authError?: string;
861
+ /** How the mount authenticates to the storage backend */
862
+ authorizationType?: MountResponseAuthorizationType;
863
+ }
864
+ export const MountResponse = /*@__PURE__*/ S.suspend(() =>
865
+ S.Struct({
866
+ id: S.optional(S.String),
867
+ type: S.optional(MountResponseType),
868
+ path: S.optional(S.String),
869
+ name: S.optional(S.String),
870
+ accessMode: S.optional(MountResponseAccessMode),
871
+ config: S.optional(MountConfigResponse),
872
+ connectionStatus: S.optional(MountResponseConnectionStatus),
873
+ authError: S.optional(S.String),
874
+ authorizationType: S.optional(MountResponseAuthorizationType),
875
+ }),
876
+ ).annotate({ identifier: "MountResponse" }) as any as S.Schema<MountResponse>;
877
+
878
+ export type DiskResponseMountsList = Array<MountResponse>;
879
+ export const DiskResponseMountsList = /*@__PURE__*/ S.Array(
880
+ MountResponse,
881
+ ) as any as S.Schema<DiskResponseMountsList>;
882
+
883
+ export interface DiskMetrics {
884
+ /** Data transfer amount with unit (e.g., "1.5 GB") */
885
+ dataTransfer?: string;
886
+ /** Total request count as a formatted string (e.g., "1,234") */
887
+ requests?: string;
888
+ /** Average response time with unit (e.g., "45ms") */
889
+ avgResponseTime?: string;
890
+ }
891
+ export const DiskMetrics = /*@__PURE__*/ S.suspend(() =>
892
+ S.Struct({
893
+ dataTransfer: S.optional(S.String),
894
+ requests: S.optional(S.String),
895
+ avgResponseTime: S.optional(S.String),
896
+ }),
897
+ ).annotate({ identifier: "DiskMetrics" }) as any as S.Schema<DiskMetrics>;
898
+
899
+ export interface ConnectedClient {
900
+ id?: string;
901
+ ipAddress?: string;
902
+ connectedAt?: string;
903
+ }
904
+ export const ConnectedClient = /*@__PURE__*/ S.suspend(() =>
905
+ S.Struct({
906
+ id: S.optional(S.String),
907
+ ipAddress: S.optional(S.String),
908
+ connectedAt: S.optional(S.String),
909
+ }),
910
+ ).annotate({
911
+ identifier: "ConnectedClient",
912
+ }) as any as S.Schema<ConnectedClient>;
913
+
914
+ export type DiskResponseConnectedClientsList = Array<ConnectedClient>;
915
+ export const DiskResponseConnectedClientsList = /*@__PURE__*/ S.Array(
916
+ ConnectedClient,
917
+ ) as any as S.Schema<DiskResponseConnectedClientsList>;
918
+
919
+ export type DiskResponseAuthorizedUsersList = Array<AuthorizedUser>;
920
+ export const DiskResponseAuthorizedUsersList = /*@__PURE__*/ S.Array(
921
+ AuthorizedUser,
922
+ ) as any as S.Schema<DiskResponseAuthorizedUsersList>;
923
+
924
+ export interface DiskResponse {
925
+ /** Disk ID */
926
+ id: string;
927
+ /** Disk name */
928
+ name: string;
929
+ /** Owning organization ID */
930
+ organization: string;
931
+ /** Disk status */
932
+ status: DiskResponseStatus;
933
+ /** Filesystem handler status */
934
+ fsHandlerStatus?: string;
935
+ /** Cloud provider */
936
+ provider: string;
937
+ /** Disk region (e.g., aws-us-east-1, gcp-us-central1) */
938
+ region: string;
939
+ /** Creation timestamp */
940
+ createdAt: string;
941
+ /** Last access timestamp */
942
+ lastAccessed?: string;
943
+ /** Total data size in bytes */
944
+ dataSize?: number;
945
+ /** Monthly usage amount formatted as a currency string (e.g., "$1.23") */
946
+ monthlyUsage?: string;
947
+ mounts?: DiskResponseMountsList;
948
+ metrics?: DiskMetrics;
949
+ connectedClients?: DiskResponseConnectedClientsList;
950
+ authorizedUsers?: DiskResponseAuthorizedUsersList;
951
+ }
952
+ export const DiskResponse = /*@__PURE__*/ S.suspend(() =>
953
+ S.Struct({
954
+ id: S.String,
955
+ name: S.String,
956
+ organization: S.String,
957
+ status: DiskResponseStatus,
958
+ fsHandlerStatus: S.optional(S.String),
959
+ provider: S.String,
960
+ region: S.String,
961
+ createdAt: S.String,
962
+ lastAccessed: S.optional(S.String),
963
+ dataSize: S.optional(S.Number),
964
+ monthlyUsage: S.optional(S.String),
965
+ mounts: S.optional(DiskResponseMountsList),
966
+ metrics: S.optional(DiskMetrics),
967
+ connectedClients: S.optional(DiskResponseConnectedClientsList),
968
+ authorizedUsers: S.optional(DiskResponseAuthorizedUsersList),
969
+ }),
970
+ ).annotate({ identifier: "DiskResponse" }) as any as S.Schema<DiskResponse>;
971
+
972
+ export interface ApiResponseDisk {
973
+ success: boolean;
974
+ data: DiskResponse;
975
+ }
976
+ export const ApiResponseDisk = /*@__PURE__*/ S.suspend(() =>
977
+ S.Struct({
978
+ success: S.Boolean,
979
+ data: DiskResponse,
980
+ }),
981
+ ).annotate({
982
+ identifier: "ApiResponseDisk",
983
+ }) as any as S.Schema<ApiResponseDisk>;
984
+
985
+ export interface GetSandboxRequest {
986
+ /** Sandbox UUID */
987
+ sid: string;
988
+ }
989
+ export const GetSandboxRequest = /*@__PURE__*/ S.suspend(() =>
990
+ S.Struct({
991
+ sid: S.String.pipe(T.Label()),
992
+ }).pipe(T.Http({ method: "GET", uri: "/api/sandboxes/{sid}", code: 200 })),
993
+ ).annotate({
994
+ identifier: "GetSandboxRequest",
995
+ }) as any as S.Schema<GetSandboxRequest>;
996
+
997
+ export type SandboxState =
998
+ | "pending"
999
+ | "running"
1000
+ | "pausing"
1001
+ | "paused"
1002
+ | "stopping"
1003
+ | "stopped"
1004
+ | "exited"
1005
+ | "failed"
1006
+ | "deleting"
1007
+ | "deleted";
1008
+ export const SandboxState = S.String;
1009
+
1010
+ /** Sandbox CPU architecture. */
1011
+ export type SandboxPlatform = "arm64" | "amd64";
1012
+ export const SandboxPlatform = S.String;
1013
+
1014
+ export interface SandboxEndpoint {
1015
+ port: number;
1016
+ hostname: string;
1017
+ }
1018
+ export const SandboxEndpoint = /*@__PURE__*/ S.suspend(() =>
1019
+ S.Struct({
1020
+ port: S.Number,
1021
+ hostname: S.String,
1022
+ }),
1023
+ ).annotate({
1024
+ identifier: "SandboxEndpoint",
1025
+ }) as any as S.Schema<SandboxEndpoint>;
1026
+
1027
+ export type SandboxEndpointsList = Array<SandboxEndpoint>;
1028
+ export const SandboxEndpointsList = /*@__PURE__*/ S.Array(
1029
+ SandboxEndpoint,
1030
+ ) as any as S.Schema<SandboxEndpointsList>;
1031
+
1032
+ export interface Sandbox {
1033
+ sandbox_id: string;
1034
+ /** Sandbox name. */
1035
+ name: string;
1036
+ status: SandboxState;
1037
+ vcpu_count: number;
1038
+ mem_size_mib: number;
1039
+ /** Lifetime budget for each powered-on session. Activity does not extend the deadline; starting or resuming the sandbox begins a fresh session. */
1040
+ max_ttl_seconds: number;
1041
+ /** Maximum concurrently attached process sessions */
1042
+ max_concurrent_execs: number;
1043
+ /** OCI reference requested when the sandbox was created. */
1044
+ base_image: string;
1045
+ /** Sandbox CPU architecture. */
1046
+ platform?: SandboxPlatform;
1047
+ endpoints?: SandboxEndpointsList;
1048
+ created_at: string;
1049
+ running_at?: string;
1050
+ finished_at?: string;
1051
+ last_active_at: string;
1052
+ /** Current powered-on session deadline; absent while inactive. */
1053
+ expires_at?: string;
1054
+ exit_reason?: string;
1055
+ }
1056
+ export const Sandbox = /*@__PURE__*/ S.suspend(() =>
1057
+ S.Struct({
1058
+ sandbox_id: S.String,
1059
+ name: S.String,
1060
+ status: SandboxState,
1061
+ vcpu_count: S.Number,
1062
+ mem_size_mib: S.Number,
1063
+ max_ttl_seconds: S.Number,
1064
+ max_concurrent_execs: S.Number,
1065
+ base_image: S.String,
1066
+ platform: S.optional(SandboxPlatform),
1067
+ endpoints: S.optional(SandboxEndpointsList),
1068
+ created_at: S.String,
1069
+ running_at: S.optional(S.String),
1070
+ finished_at: S.optional(S.String),
1071
+ last_active_at: S.String,
1072
+ expires_at: S.optional(S.String),
1073
+ exit_reason: S.optional(S.String),
1074
+ }),
1075
+ ).annotate({ identifier: "Sandbox" }) as any as S.Schema<Sandbox>;
1076
+
1077
+ export interface ApiResponseSandbox {
1078
+ success: boolean;
1079
+ data: Sandbox;
1080
+ }
1081
+ export const ApiResponseSandbox = /*@__PURE__*/ S.suspend(() =>
1082
+ S.Struct({
1083
+ success: S.Boolean,
1084
+ data: Sandbox,
1085
+ }),
1086
+ ).annotate({
1087
+ identifier: "ApiResponseSandbox",
1088
+ }) as any as S.Schema<ApiResponseSandbox>;
1089
+
1090
+ export interface GrepDiskRequest {
1091
+ /** Disk ID (format `dsk-{16 hex chars}`) */
1092
+ id: string;
1093
+ /** Directory on the disk to search, relative to the disk root. An empty string or "/" means the disk root. */
1094
+ directory: string;
1095
+ /** Extended regular expression (passed to `grep -E`) */
1096
+ pattern: string;
1097
+ /** When true, walks subdirectories breadth-first. */
1098
+ recursive?: boolean;
1099
+ /** Wall-clock deadline for the entire request. Capped at 30 seconds because the runtime exec container itself is bounded at ~30s; longer requests would have their workers killed mid-scan. */
1100
+ maxDurationSeconds?: number;
1101
+ /** Maximum number of parallel grep workers. Higher values finish larger datasets within the deadline but consume proportionally more runtime capacity. */
1102
+ concurrency?: number;
1103
+ /** Stop scanning once the aggregator has this many matches. Returned matches are a sample of whichever workers reported first, not the lexicographically first N. */
1104
+ maxResults?: number;
1105
+ }
1106
+ export const GrepDiskRequest = /*@__PURE__*/ S.suspend(() =>
1107
+ S.Struct({
1108
+ id: S.String.pipe(T.Label()),
1109
+ directory: S.String,
1110
+ pattern: S.String,
1111
+ recursive: S.optional(S.Boolean),
1112
+ maxDurationSeconds: S.optional(S.Number),
1113
+ concurrency: S.optional(S.Number),
1114
+ maxResults: S.optional(S.Number),
1115
+ }).pipe(T.Http({ method: "POST", uri: "/api/disks/{id}/grep", code: 200 })),
1116
+ ).annotate({
1117
+ identifier: "GrepDiskRequest",
1118
+ }) as any as S.Schema<GrepDiskRequest>;
1119
+
1120
+ export interface GrepMatch {
1121
+ /** Path to the file (relative to the disk root). */
1122
+ file: string;
1123
+ /** 1-based line number where the match occurred. */
1124
+ line: number;
1125
+ /** The matching line. */
1126
+ text: string;
1127
+ }
1128
+ export const GrepMatch = /*@__PURE__*/ S.suspend(() =>
1129
+ S.Struct({
1130
+ file: S.String,
1131
+ line: S.Number,
1132
+ text: S.String,
1133
+ }),
1134
+ ).annotate({ identifier: "GrepMatch" }) as any as S.Schema<GrepMatch>;
1135
+
1136
+ export type GrepDiskResultMatchesList = Array<GrepMatch>;
1137
+ export const GrepDiskResultMatchesList = /*@__PURE__*/ S.Array(
1138
+ GrepMatch,
1139
+ ) as any as S.Schema<GrepDiskResultMatchesList>;
1140
+
1141
+ /** Why the search stopped. - `completed`: every file under the directory was scanned successfully. - `incomplete`: pipeline ran to its natural end but one or more batches errored (invalid regex, unreadable file, runtime issue). Results may be partial or wrong; do not rely on completeness. - `max_results`: hit `maxResults` before scanning everything. - `deadline`: hit `maxDurationSeconds`. - `list_failed`: directory listing failed; partial results may be present. */
1142
+ export type GrepStoppedReason =
1143
+ | "completed"
1144
+ | "incomplete"
1145
+ | "max_results"
1146
+ | "deadline"
1147
+ | "list_failed";
1148
+ export const GrepStoppedReason = S.String;
1149
+
1150
+ export interface GrepDiskResult {
1151
+ matches: GrepDiskResultMatchesList;
1152
+ stoppedReason: GrepStoppedReason;
1153
+ /** Files actually fed to a grep container. */
1154
+ filesScanned: number;
1155
+ /** Number of grep containers started for this request. */
1156
+ containersDispatched: number;
1157
+ /** Sum of per-container execution time in seconds, measured by the runtime. Approximates billable container-seconds. */
1158
+ computeSecondsUsed: number;
1159
+ /** End-to-end wall clock measured by the server. */
1160
+ durationMs: number;
1161
+ /** Wall-clock time spent enumerating files via listObjects, from the request's start to the moment listing fully drained (or was canceled). Listing and matching overlap, so listingMs + grepMs typically exceeds durationMs. */
1162
+ listingMs: number;
1163
+ /** Wall-clock time spent matching, from the first grep container being dispatched to the last container reporting results. 0 if no batches ran. */
1164
+ grepMs: number;
1165
+ }
1166
+ export const GrepDiskResult = /*@__PURE__*/ S.suspend(() =>
1167
+ S.Struct({
1168
+ matches: GrepDiskResultMatchesList,
1169
+ stoppedReason: GrepStoppedReason,
1170
+ filesScanned: S.Number,
1171
+ containersDispatched: S.Number,
1172
+ computeSecondsUsed: S.Number,
1173
+ durationMs: S.Number,
1174
+ listingMs: S.Number,
1175
+ grepMs: S.Number,
1176
+ }),
1177
+ ).annotate({ identifier: "GrepDiskResult" }) as any as S.Schema<GrepDiskResult>;
1178
+
1179
+ export interface ApiResponseGrepDisk {
1180
+ success: boolean;
1181
+ data: GrepDiskResult;
1182
+ }
1183
+ export const ApiResponseGrepDisk = /*@__PURE__*/ S.suspend(() =>
1184
+ S.Struct({
1185
+ success: S.Boolean,
1186
+ data: GrepDiskResult,
1187
+ }),
1188
+ ).annotate({
1189
+ identifier: "ApiResponseGrepDisk",
1190
+ }) as any as S.Schema<ApiResponseGrepDisk>;
1191
+
1192
+ export interface ListApiTokensRequest {
1193
+ /** Maximum number of items to return */
1194
+ limit?: number;
1195
+ /** Pagination cursor from a previous response */
1196
+ cursor?: string;
1197
+ }
1198
+ export const ListApiTokensRequest = /*@__PURE__*/ S.suspend(() =>
1199
+ S.Struct({
1200
+ limit: S.optional(S.Number.pipe(T.Query())),
1201
+ cursor: S.optional(S.String.pipe(T.Query())),
1202
+ }).pipe(T.Http({ method: "GET", uri: "/api/tokens", code: 200 })),
1203
+ ).annotate({
1204
+ identifier: "ListApiTokensRequest",
1205
+ }) as any as S.Schema<ListApiTokensRequest>;
1206
+
1207
+ export interface ApiTokenResponse {
1208
+ /** Token hash/ID */
1209
+ id?: string;
1210
+ name?: string;
1211
+ description?: string;
1212
+ /** Last 4 characters of the token */
1213
+ tokenSuffix?: string;
1214
+ createdAt?: string;
1215
+ lastUsedAt?: string;
1216
+ }
1217
+ export const ApiTokenResponse = /*@__PURE__*/ S.suspend(() =>
1218
+ S.Struct({
1219
+ id: S.optional(S.String),
1220
+ name: S.optional(S.String),
1221
+ description: S.optional(S.String),
1222
+ tokenSuffix: S.optional(S.String),
1223
+ createdAt: S.optional(S.String),
1224
+ lastUsedAt: S.optional(S.String),
1225
+ }),
1226
+ ).annotate({
1227
+ identifier: "ApiTokenResponse",
1228
+ }) as any as S.Schema<ApiTokenResponse>;
1229
+
1230
+ export type ApiResponseTokenListDataTokensList = Array<ApiTokenResponse>;
1231
+ export const ApiResponseTokenListDataTokensList = /*@__PURE__*/ S.Array(
1232
+ ApiTokenResponse,
1233
+ ) as any as S.Schema<ApiResponseTokenListDataTokensList>;
1234
+
1235
+ export interface ApiResponseTokenListData {
1236
+ tokens?: ApiResponseTokenListDataTokensList;
1237
+ }
1238
+ export const ApiResponseTokenListData = /*@__PURE__*/ S.suspend(() =>
1239
+ S.Struct({
1240
+ tokens: S.optional(ApiResponseTokenListDataTokensList),
1241
+ }),
1242
+ ).annotate({
1243
+ identifier: "ApiResponseTokenListData",
1244
+ }) as any as S.Schema<ApiResponseTokenListData>;
1245
+
1246
+ export interface ApiResponseTokenList {
1247
+ success: boolean;
1248
+ data: ApiResponseTokenListData;
1249
+ }
1250
+ export const ApiResponseTokenList = /*@__PURE__*/ S.suspend(() =>
1251
+ S.Struct({
1252
+ success: S.Boolean,
1253
+ data: ApiResponseTokenListData,
1254
+ }),
1255
+ ).annotate({
1256
+ identifier: "ApiResponseTokenList",
1257
+ }) as any as S.Schema<ApiResponseTokenList>;
1258
+
1259
+ export interface ListDisksRequest {
1260
+ /** Maximum number of items to return */
1261
+ limit?: number;
1262
+ /** Pagination cursor from a previous response */
1263
+ cursor?: string;
1264
+ /** Filter disks by exact name match. */
1265
+ name?: string;
1266
+ }
1267
+ export const ListDisksRequest = /*@__PURE__*/ S.suspend(() =>
1268
+ S.Struct({
1269
+ limit: S.optional(S.Number.pipe(T.Query())),
1270
+ cursor: S.optional(S.String.pipe(T.Query())),
1271
+ name: S.optional(S.String.pipe(T.Query())),
1272
+ }).pipe(T.Http({ method: "GET", uri: "/api/disks", code: 200 })),
1273
+ ).annotate({
1274
+ identifier: "ListDisksRequest",
1275
+ }) as any as S.Schema<ListDisksRequest>;
1276
+
1277
+ export type ApiResponseDiskListDataList = Array<DiskResponse>;
1278
+ export const ApiResponseDiskListDataList = /*@__PURE__*/ S.Array(
1279
+ DiskResponse,
1280
+ ) as any as S.Schema<ApiResponseDiskListDataList>;
1281
+
1282
+ /** All API responses use a standard envelope with `success: boolean` and `data` (on success) or `error: string` (on failure). The ApiResponse_* schemas each define the specific `data` shape for their endpoint. */
1283
+ export interface ApiResponseDiskList {
1284
+ success: boolean;
1285
+ data: ApiResponseDiskListDataList;
1286
+ }
1287
+ export const ApiResponseDiskList = /*@__PURE__*/ S.suspend(() =>
1288
+ S.Struct({
1289
+ success: S.Boolean,
1290
+ data: ApiResponseDiskListDataList,
1291
+ }),
1292
+ ).annotate({
1293
+ identifier: "ApiResponseDiskList",
1294
+ }) as any as S.Schema<ApiResponseDiskList>;
1295
+
1296
+ export interface ListSandboxesRequest {
1297
+ /** Only sandboxes that mount this disk */
1298
+ filesystem?: string;
1299
+ }
1300
+ export const ListSandboxesRequest = /*@__PURE__*/ S.suspend(() =>
1301
+ S.Struct({
1302
+ filesystem: S.optional(S.String.pipe(T.Query())),
1303
+ }).pipe(T.Http({ method: "GET", uri: "/api/sandboxes", code: 200 })),
1304
+ ).annotate({
1305
+ identifier: "ListSandboxesRequest",
1306
+ }) as any as S.Schema<ListSandboxesRequest>;
1307
+
1308
+ export type ApiResponseSandboxListDataSandboxesList = Array<Sandbox>;
1309
+ export const ApiResponseSandboxListDataSandboxesList = /*@__PURE__*/ S.Array(
1310
+ Sandbox,
1311
+ ) as any as S.Schema<ApiResponseSandboxListDataSandboxesList>;
1312
+
1313
+ export interface ApiResponseSandboxListData {
1314
+ sandboxes?: ApiResponseSandboxListDataSandboxesList;
1315
+ }
1316
+ export const ApiResponseSandboxListData = /*@__PURE__*/ S.suspend(() =>
1317
+ S.Struct({
1318
+ sandboxes: S.optional(ApiResponseSandboxListDataSandboxesList),
1319
+ }),
1320
+ ).annotate({
1321
+ identifier: "ApiResponseSandboxListData",
1322
+ }) as any as S.Schema<ApiResponseSandboxListData>;
1323
+
1324
+ export interface ApiResponseSandboxList {
1325
+ success: boolean;
1326
+ data: ApiResponseSandboxListData;
1327
+ }
1328
+ export const ApiResponseSandboxList = /*@__PURE__*/ S.suspend(() =>
1329
+ S.Struct({
1330
+ success: S.Boolean,
1331
+ data: ApiResponseSandboxListData,
1332
+ }),
1333
+ ).annotate({
1334
+ identifier: "ApiResponseSandboxList",
1335
+ }) as any as S.Schema<ApiResponseSandboxList>;
1336
+
1337
+ export interface PauseSandboxRequest {
1338
+ /** Sandbox UUID */
1339
+ sid: string;
1340
+ }
1341
+ export const PauseSandboxRequest = /*@__PURE__*/ S.suspend(() =>
1342
+ S.Struct({
1343
+ sid: S.String.pipe(T.Label()),
1344
+ }).pipe(
1345
+ T.Http({ method: "POST", uri: "/api/sandboxes/{sid}/pause", code: 200 }),
1346
+ ),
1347
+ ).annotate({
1348
+ identifier: "PauseSandboxRequest",
1349
+ }) as any as S.Schema<PauseSandboxRequest>;
1350
+
1351
+ export type RemoveDiskUserRequestUserType = "token" | "awssts";
1352
+ export const RemoveDiskUserRequestUserType = S.String;
1353
+
1354
+ export interface RemoveDiskUserRequest {
1355
+ /** Disk ID (format `dsk-{16 hex chars}`) */
1356
+ id: string;
1357
+ /** The type of user authentication */
1358
+ userType: RemoveDiskUserRequestUserType | (string & {});
1359
+ /** Identifier of the user to remove, as returned in the creation or list response. For awssts users, this is the IAM ARN. */
1360
+ identifier?: string;
1361
+ /** Use identifier instead. */
1362
+ principal?: string;
1363
+ }
1364
+ export const RemoveDiskUserRequest = /*@__PURE__*/ S.suspend(() =>
1365
+ S.Struct({
1366
+ id: S.String.pipe(T.Label()),
1367
+ userType: RemoveDiskUserRequestUserType.pipe(T.Label()),
1368
+ identifier: S.optional(S.String.pipe(T.Query())),
1369
+ principal: S.optional(S.String.pipe(T.Query())),
1370
+ }).pipe(
1371
+ T.Http({
1372
+ method: "DELETE",
1373
+ uri: "/api/disks/{id}/users/{userType}",
1374
+ code: 200,
1375
+ }),
1376
+ ),
1377
+ ).annotate({
1378
+ identifier: "RemoveDiskUserRequest",
1379
+ }) as any as S.Schema<RemoveDiskUserRequest>;
1380
+
1381
+ export interface ResumeSandboxRequest {
1382
+ /** Sandbox UUID */
1383
+ sid: string;
1384
+ /** Hold the request for a completed sandbox lifecycle transition */
1385
+ wait?: boolean;
1386
+ }
1387
+ export const ResumeSandboxRequest = /*@__PURE__*/ S.suspend(() =>
1388
+ S.Struct({
1389
+ sid: S.String.pipe(T.Label()),
1390
+ wait: S.optional(S.Boolean.pipe(T.Query())),
1391
+ }).pipe(
1392
+ T.Http({ method: "POST", uri: "/api/sandboxes/{sid}/resume", code: 200 }),
1393
+ ),
1394
+ ).annotate({
1395
+ identifier: "ResumeSandboxRequest",
1396
+ }) as any as S.Schema<ResumeSandboxRequest>;
1397
+
1398
+ export interface StartSandboxRequest {
1399
+ /** Sandbox UUID */
1400
+ sid: string;
1401
+ /** Hold the request for a completed sandbox lifecycle transition */
1402
+ wait?: boolean;
1403
+ }
1404
+ export const StartSandboxRequest = /*@__PURE__*/ S.suspend(() =>
1405
+ S.Struct({
1406
+ sid: S.String.pipe(T.Label()),
1407
+ wait: S.optional(S.Boolean.pipe(T.Query())),
1408
+ }).pipe(
1409
+ T.Http({ method: "POST", uri: "/api/sandboxes/{sid}/start", code: 200 }),
1410
+ ),
1411
+ ).annotate({
1412
+ identifier: "StartSandboxRequest",
1413
+ }) as any as S.Schema<StartSandboxRequest>;
1414
+
1415
+ export interface StopSandboxRequest {
1416
+ /** Sandbox UUID */
1417
+ sid: string;
1418
+ }
1419
+ export const StopSandboxRequest = /*@__PURE__*/ S.suspend(() =>
1420
+ S.Struct({
1421
+ sid: S.String.pipe(T.Label()),
1422
+ }).pipe(
1423
+ T.Http({ method: "POST", uri: "/api/sandboxes/{sid}/stop", code: 200 }),
1424
+ ),
1425
+ ).annotate({
1426
+ identifier: "StopSandboxRequest",
1427
+ }) as any as S.Schema<StopSandboxRequest>;
1428
+
1429
+ export type AddDiskUserError = BadRequest | ArchilOpError;
1430
+ /** Add user to disk Adds an authorized user to a disk. Users can authenticate via: - **token**: A shared token with a nickname and 4-character suffix - **awssts**: AWS STS role assumption with an IAM principal ARN */
1431
+ export const addDiskUser: API.OperationMethod<
1432
+ AddDiskUserRequest,
1433
+ ApiResponseAuthorizedUser,
1434
+ AddDiskUserError,
1435
+ ArchilOpContext
1436
+ > = /*@__PURE__*/ API.make(() => ({
1437
+ input: AddDiskUserRequest,
1438
+ output: ApiResponseAuthorizedUser,
1439
+ errors: [BadRequest, UnknownArchilError],
1440
+ protocol: ArchilProtocol,
1441
+ retry: Retry.Retry,
1442
+ }));
1443
+
1444
+ export type CreateApiTokenError = BadRequest | ArchilOpError;
1445
+ /** Create API token Creates a new API token for programmatic access. The full token value is only returned once at creation time. */
1446
+ export const createApiToken: API.OperationMethod<
1447
+ CreateApiTokenRequest,
1448
+ ApiResponseTokenCreated,
1449
+ CreateApiTokenError,
1450
+ ArchilOpContext
1451
+ > = /*@__PURE__*/ API.make(() => ({
1452
+ input: CreateApiTokenRequest,
1453
+ output: ApiResponseTokenCreated,
1454
+ errors: [BadRequest, UnknownArchilError],
1455
+ protocol: ArchilProtocol,
1456
+ retry: Retry.Retry,
1457
+ }));
1458
+
1459
+ export type CreateDiskError = BadRequest | Forbidden | Conflict | ArchilOpError;
1460
+ /** Create a new disk Creates a new disk with the specified configuration. A default disk token user is automatically generated and returned in the response, so the disk is immediately mountable. The one-time disk token appears in `authorizedUsers[].token` and cannot be retrieved again. (This disk token is scoped to the new disk and is separate from the API key you used to make this request.) To provide your own users instead, pass the deprecated `authMethods` field or call AddDiskUser after creation. */
1461
+ export const createDisk: API.OperationMethod<
1462
+ CreateDiskRequest,
1463
+ ApiResponseCreateDisk,
1464
+ CreateDiskError,
1465
+ ArchilOpContext
1466
+ > = /*@__PURE__*/ API.make(() => ({
1467
+ input: CreateDiskRequest,
1468
+ output: ApiResponseCreateDisk,
1469
+ errors: [BadRequest, Forbidden, Conflict, UnknownArchilError],
1470
+ protocol: ArchilProtocol,
1471
+ retry: Retry.Retry,
1472
+ }));
1473
+
1474
+ export type CreateSandboxError = BadRequest | Conflict | ArchilOpError;
1475
+ /** Create a sandbox Provisions a sandbox VM with the requested shape and a dedicated, persistent Archil disk. By default the response reports `pending` after the runtime accepts the start. Set `wait=true` to hold for `running`; if the wait budget expires, the response remains `pending` and startup continues. */
1476
+ export const createSandbox: API.OperationMethod<
1477
+ CreateSandboxRequest,
1478
+ CreateSandboxResponse,
1479
+ CreateSandboxError,
1480
+ ArchilOpContext
1481
+ > = /*@__PURE__*/ API.make(() => ({
1482
+ input: CreateSandboxRequest,
1483
+ output: CreateSandboxResponse,
1484
+ errors: [BadRequest, Conflict, UnknownArchilError],
1485
+ protocol: ArchilProtocol,
1486
+ retry: Retry.Retry,
1487
+ }));
1488
+
1489
+ export type CreateSandboxConnectionError = NotFound | Conflict | ArchilOpError;
1490
+ /** Create a sandbox process connection Returns a short-lived WebSocket URL for the process API in a running sandbox. The URL contains a signed token that expires at `expires_at`. */
1491
+ export const createSandboxConnection: API.OperationMethod<
1492
+ CreateSandboxConnectionRequest,
1493
+ ApiResponseSandboxConnection,
1494
+ CreateSandboxConnectionError,
1495
+ ArchilOpContext
1496
+ > = /*@__PURE__*/ API.make(() => ({
1497
+ input: CreateSandboxConnectionRequest,
1498
+ output: ApiResponseSandboxConnection,
1499
+ errors: [NotFound, Conflict, UnknownArchilError],
1500
+ protocol: ArchilProtocol,
1501
+ retry: Retry.Retry,
1502
+ }));
1503
+
1504
+ export type CreateShareUrlError = BadRequest | NotFound | ArchilOpError;
1505
+ /** Create a share URL for a file Creates a signed, time-limited URL for downloading a file without authentication. The URL expires after 24 hours by default; pass `expiresIn` to set a custom lifetime up to 7 days. The returned URL points to a public endpoint (`GET /api/shared/{token}`) that verifies the signature, checks expiry, and streams the file with a sensible `Content-Type` and `Content-Disposition`. Range requests are supported. No credentials are needed to open the URL. */
1506
+ export const createShareUrl: API.OperationMethod<
1507
+ CreateShareUrlRequest,
1508
+ ApiResponseShareUrl,
1509
+ CreateShareUrlError,
1510
+ ArchilOpContext
1511
+ > = /*@__PURE__*/ API.make(() => ({
1512
+ input: CreateShareUrlRequest,
1513
+ output: ApiResponseShareUrl,
1514
+ errors: [BadRequest, NotFound, UnknownArchilError],
1515
+ protocol: ArchilProtocol,
1516
+ retry: Retry.Retry,
1517
+ }));
1518
+
1519
+ export type DeleteDiskError = BadRequest | NotFound | ArchilOpError;
1520
+ /** Delete a disk Deletes a disk and all associated resources. */
1521
+ export const deleteDisk: API.OperationMethod<
1522
+ DeleteDiskRequest,
1523
+ ApiResponseEmpty,
1524
+ DeleteDiskError,
1525
+ ArchilOpContext
1526
+ > = /*@__PURE__*/ API.make(() => ({
1527
+ input: DeleteDiskRequest,
1528
+ output: ApiResponseEmpty,
1529
+ errors: [BadRequest, NotFound, UnknownArchilError],
1530
+ protocol: ArchilProtocol,
1531
+ retry: Retry.Retry,
1532
+ }));
1533
+
1534
+ export type DeleteSandboxError = NotFound | Conflict | ArchilOpError;
1535
+ /** Delete a sandbox Permanently deletes a stopped, exited, or failed sandbox and its backing disk. A sandbox with child forks cannot be deleted until those children are deleted, starting with the deepest ones. */
1536
+ export const deleteSandbox: API.OperationMethod<
1537
+ DeleteSandboxRequest,
1538
+ DeleteSandboxResponse,
1539
+ DeleteSandboxError,
1540
+ ArchilOpContext
1541
+ > = /*@__PURE__*/ API.make(() => ({
1542
+ input: DeleteSandboxRequest,
1543
+ output: DeleteSandboxResponse,
1544
+ errors: [NotFound, Conflict, UnknownArchilError],
1545
+ protocol: ArchilProtocol,
1546
+ retry: Retry.Retry,
1547
+ }));
1548
+
1549
+ export type DeleteTokenError = NotFound | ArchilOpError;
1550
+ /** Delete API token Revokes and deletes an API token. */
1551
+ export const deleteToken: API.OperationMethod<
1552
+ DeleteTokenRequest,
1553
+ ApiResponseMessage,
1554
+ DeleteTokenError,
1555
+ ArchilOpContext
1556
+ > = /*@__PURE__*/ API.make(() => ({
1557
+ input: DeleteTokenRequest,
1558
+ output: ApiResponseMessage,
1559
+ errors: [NotFound, UnknownArchilError],
1560
+ protocol: ArchilProtocol,
1561
+ retry: Retry.Retry,
1562
+ }));
1563
+
1564
+ export type ExecError = BadRequest | NotFound | ArchilOpError;
1565
+ /** Execute a command with multiple disks mounted Launches a container with the supplied set of disks each mounted at its own relative path under `/mnt/archil`, runs the command to completion, and shuts down the container. Activation is atomic: every disk mounts or none of them do. Relative paths must be non-empty, non-absolute, and contain no `.` / `..` segments. Mounting two disks at the same relative path is an error. */
1566
+ export const exec: API.OperationMethod<
1567
+ ExecRequest,
1568
+ ApiResponseExec,
1569
+ ExecError,
1570
+ ArchilOpContext
1571
+ > = /*@__PURE__*/ API.make(() => ({
1572
+ input: ExecRequest,
1573
+ output: ApiResponseExec,
1574
+ errors: [BadRequest, NotFound, UnknownArchilError],
1575
+ protocol: ArchilProtocol,
1576
+ retry: Retry.Retry,
1577
+ }));
1578
+
1579
+ export type ExecDiskError = BadRequest | NotFound | ArchilOpError;
1580
+ /** Execute a command on a disk Launches a container with the specified disk mounted, runs the given command to completion, shuts down the container, and returns the command result. */
1581
+ export const execDisk: API.OperationMethod<
1582
+ ExecDiskRequest,
1583
+ ApiResponseExecDisk,
1584
+ ExecDiskError,
1585
+ ArchilOpContext
1586
+ > = /*@__PURE__*/ API.make(() => ({
1587
+ input: ExecDiskRequest,
1588
+ output: ApiResponseExecDisk,
1589
+ errors: [BadRequest, NotFound, UnknownArchilError],
1590
+ protocol: ArchilProtocol,
1591
+ retry: Retry.Retry,
1592
+ }));
1593
+
1594
+ export type ForkSandboxError = BadRequest | NotFound | Conflict | ArchilOpError;
1595
+ /** Fork a sandbox Checkpoints a running source sandbox and creates an isolated writable disk branch. Forks from running or paused sources resume from the source's CPU, memory, and disk state. Forks from stopped sources cold-boot from the saved disk checkpoint. A running source is resumed after its checkpoint; paused and stopped sources remain inactive. Forked sandboxes may themselves be forked. */
1596
+ export const forkSandbox: API.OperationMethod<
1597
+ ForkSandboxRequest,
1598
+ ForkSandboxResponse,
1599
+ ForkSandboxError,
1600
+ ArchilOpContext
1601
+ > = /*@__PURE__*/ API.make(() => ({
1602
+ input: ForkSandboxRequest,
1603
+ output: ForkSandboxResponse,
1604
+ errors: [BadRequest, NotFound, Conflict, UnknownArchilError],
1605
+ protocol: ArchilProtocol,
1606
+ retry: Retry.Retry,
1607
+ }));
1608
+
1609
+ export type GetDiskError = BadRequest | NotFound | ArchilOpError;
1610
+ /** Get disk details Returns detailed information about a specific disk. */
1611
+ export const getDisk: API.OperationMethod<
1612
+ GetDiskRequest,
1613
+ ApiResponseDisk,
1614
+ GetDiskError,
1615
+ ArchilOpContext
1616
+ > = /*@__PURE__*/ API.make(() => ({
1617
+ input: GetDiskRequest,
1618
+ output: ApiResponseDisk,
1619
+ errors: [BadRequest, NotFound, UnknownArchilError],
1620
+ protocol: ArchilProtocol,
1621
+ retry: Retry.Retry,
1622
+ }));
1623
+
1624
+ export type GetSandboxError = NotFound | ArchilOpError;
1625
+ /** Get a sandbox */
1626
+ export const getSandbox: API.OperationMethod<
1627
+ GetSandboxRequest,
1628
+ ApiResponseSandbox,
1629
+ GetSandboxError,
1630
+ ArchilOpContext
1631
+ > = /*@__PURE__*/ API.make(() => ({
1632
+ input: GetSandboxRequest,
1633
+ output: ApiResponseSandbox,
1634
+ errors: [NotFound, UnknownArchilError],
1635
+ protocol: ArchilProtocol,
1636
+ retry: Retry.Retry,
1637
+ }));
1638
+
1639
+ export type GrepDiskError = BadRequest | NotFound | ArchilOpError;
1640
+ /** Parallel grep over a directory on a disk Searches files under a directory on the disk for lines matching a regular expression. Listing and matching are fanned out across ephemeral exec containers, so the request finishes within the user's time budget regardless of the size of the directory. The user controls cost and latency with three knobs: - `maxDurationSeconds` is the wall-clock deadline (capped at 30s). - `concurrency` is the maximum number of parallel grep workers. Higher concurrency finishes larger datasets within the deadline, at proportionally more compute. - `maxResults` causes the search to short-circuit after the aggregator has collected this many matches. With `recursive: false` only files directly under `directory` are searched. With `recursive: true` subdirectories are walked breadth-first and grep workers are dispatched as soon as each level finishes listing — listing and matching overlap. The matches returned when stopping early on `maxResults` are a sample of whichever workers reported first, not the lexicographically first N. The response surfaces `stoppedReason` so callers can distinguish completion from early termination. */
1641
+ export const grepDisk: API.OperationMethod<
1642
+ GrepDiskRequest,
1643
+ ApiResponseGrepDisk,
1644
+ GrepDiskError,
1645
+ ArchilOpContext
1646
+ > = /*@__PURE__*/ API.make(() => ({
1647
+ input: GrepDiskRequest,
1648
+ output: ApiResponseGrepDisk,
1649
+ errors: [BadRequest, NotFound, UnknownArchilError],
1650
+ protocol: ArchilProtocol,
1651
+ retry: Retry.Retry,
1652
+ }));
1653
+
1654
+ export type ListApiTokensError = ArchilOpError;
1655
+ /** List API tokens Returns all API tokens for the authenticated account. */
1656
+ export const listApiTokens: API.OperationMethod<
1657
+ ListApiTokensRequest,
1658
+ ApiResponseTokenList,
1659
+ ListApiTokensError,
1660
+ ArchilOpContext
1661
+ > = /*@__PURE__*/ API.make(() => ({
1662
+ input: ListApiTokensRequest,
1663
+ output: ApiResponseTokenList,
1664
+ errors: [UnknownArchilError],
1665
+ protocol: ArchilProtocol,
1666
+ retry: Retry.Retry,
1667
+ }));
1668
+
1669
+ export type ListDisksError = ArchilOpError;
1670
+ /** List all disks Returns all disks owned by the authenticated account. */
1671
+ export const listDisks: API.OperationMethod<
1672
+ ListDisksRequest,
1673
+ ApiResponseDiskList,
1674
+ ListDisksError,
1675
+ ArchilOpContext
1676
+ > = /*@__PURE__*/ API.make(() => ({
1677
+ input: ListDisksRequest,
1678
+ output: ApiResponseDiskList,
1679
+ errors: [UnknownArchilError],
1680
+ protocol: ArchilProtocol,
1681
+ retry: Retry.Retry,
1682
+ }));
1683
+
1684
+ export type ListSandboxesError = BadRequest | ArchilOpError;
1685
+ /** List sandboxes All the account's sandboxes, oldest first. */
1686
+ export const listSandboxes: API.OperationMethod<
1687
+ ListSandboxesRequest,
1688
+ ApiResponseSandboxList,
1689
+ ListSandboxesError,
1690
+ ArchilOpContext
1691
+ > = /*@__PURE__*/ API.make(() => ({
1692
+ input: ListSandboxesRequest,
1693
+ output: ApiResponseSandboxList,
1694
+ errors: [BadRequest, UnknownArchilError],
1695
+ protocol: ArchilProtocol,
1696
+ retry: Retry.Retry,
1697
+ }));
1698
+
1699
+ export type PauseSandboxError =
1700
+ | BadRequest
1701
+ | NotFound
1702
+ | Conflict
1703
+ | ArchilOpError;
1704
+ /** Pause a sandbox Snapshot the CPU & memory state, then stop the VM. The sandbox reports `pausing` until the snapshot commit marker is durable and the VM exits, then reports `paused`. Attached process connections close, while agent-owned processes remain available for reattachment after resume. A sandbox that is still `pending` must reach `running` before it can be paused. To restore the snapshot, call `/resume`. */
1705
+ export const pauseSandbox: API.OperationMethod<
1706
+ PauseSandboxRequest,
1707
+ ApiResponseSandbox,
1708
+ PauseSandboxError,
1709
+ ArchilOpContext
1710
+ > = /*@__PURE__*/ API.make(() => ({
1711
+ input: PauseSandboxRequest,
1712
+ output: ApiResponseSandbox,
1713
+ errors: [BadRequest, NotFound, Conflict, UnknownArchilError],
1714
+ protocol: ArchilProtocol,
1715
+ retry: Retry.Retry,
1716
+ }));
1717
+
1718
+ export type RemoveDiskUserError = BadRequest | ArchilOpError;
1719
+ /** Remove user from disk Removes an authorized user from a disk. */
1720
+ export const removeDiskUser: API.OperationMethod<
1721
+ RemoveDiskUserRequest,
1722
+ ApiResponseMessage,
1723
+ RemoveDiskUserError,
1724
+ ArchilOpContext
1725
+ > = /*@__PURE__*/ API.make(() => ({
1726
+ input: RemoveDiskUserRequest,
1727
+ output: ApiResponseMessage,
1728
+ errors: [BadRequest, UnknownArchilError],
1729
+ protocol: ArchilProtocol,
1730
+ retry: Retry.Retry,
1731
+ }));
1732
+
1733
+ export type ResumeSandboxError =
1734
+ | BadRequest
1735
+ | NotFound
1736
+ | Conflict
1737
+ | ArchilOpError;
1738
+ /** Resume a sandbox Restores a paused sandbox's committed CPU and memory snapshot. Resuming a running sandbox or a pending resume is idempotent. Only a `paused` sandbox can begin a new resume; `stopped`, `exited`, `failed`, `stopping`, `pausing`, or a pending cold start returns 409. */
1739
+ export const resumeSandbox: API.OperationMethod<
1740
+ ResumeSandboxRequest,
1741
+ ApiResponseSandbox,
1742
+ ResumeSandboxError,
1743
+ ArchilOpContext
1744
+ > = /*@__PURE__*/ API.make(() => ({
1745
+ input: ResumeSandboxRequest,
1746
+ output: ApiResponseSandbox,
1747
+ errors: [BadRequest, NotFound, Conflict, UnknownArchilError],
1748
+ protocol: ArchilProtocol,
1749
+ retry: Retry.Retry,
1750
+ }));
1751
+
1752
+ export type StartSandboxError =
1753
+ | BadRequest
1754
+ | NotFound
1755
+ | Conflict
1756
+ | ArchilOpError;
1757
+ /** Cold-start a sandbox Cold-boots from the persisted configuration and disks. If the sandbox was paused, its memory snapshot is consumed and discarded before the new VM runs; disk state remains. Starting a running sandbox or a pending cold start is idempotent. A sandbox that is stopping, pausing, or pending a resume returns 409. */
1758
+ export const startSandbox: API.OperationMethod<
1759
+ StartSandboxRequest,
1760
+ ApiResponseSandbox,
1761
+ StartSandboxError,
1762
+ ArchilOpContext
1763
+ > = /*@__PURE__*/ API.make(() => ({
1764
+ input: StartSandboxRequest,
1765
+ output: ApiResponseSandbox,
1766
+ errors: [BadRequest, NotFound, Conflict, UnknownArchilError],
1767
+ protocol: ArchilProtocol,
1768
+ retry: Retry.Retry,
1769
+ }));
1770
+
1771
+ export type StopSandboxError = BadRequest | NotFound | Conflict | ArchilOpError;
1772
+ /** Stop a sandbox Gracefully shuts down the guest, then checkpoints its disk before entering `stopped`. The sandbox and any forks from it cold-boot from disk state. Stopping a paused sandbox reuses its existing disk checkpoint. In-flight processes receive the guest shutdown signal. */
1773
+ export const stopSandbox: API.OperationMethod<
1774
+ StopSandboxRequest,
1775
+ ApiResponseSandbox,
1776
+ StopSandboxError,
1777
+ ArchilOpContext
1778
+ > = /*@__PURE__*/ API.make(() => ({
1779
+ input: StopSandboxRequest,
1780
+ output: ApiResponseSandbox,
1781
+ errors: [BadRequest, NotFound, Conflict, UnknownArchilError],
1782
+ protocol: ArchilProtocol,
1783
+ retry: Retry.Retry,
1784
+ }));