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

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 +721 -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 +1785 -0
  46. package/src/services/index.ts +2 -0
  47. package/src/traits.ts +44 -0
@@ -0,0 +1,721 @@
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.js";
7
+ import { ArchilProtocol, } from "../protocol.js";
8
+ import { UnknownArchilError } from "../errors.js";
9
+ import * as Retry from "../retry.js";
10
+ export class BadRequest extends /*@__PURE__*/ /*@__PURE__*/ T.applyErrorMatchers(
11
+ /*@__PURE__*/ S.TaggedError()("BadRequest", {
12
+ code: S.Number,
13
+ message: S.String,
14
+ }).pipe(C.withBadRequestError), [{ status: 400 }]) {
15
+ }
16
+ export class Conflict extends /*@__PURE__*/ /*@__PURE__*/ T.applyErrorMatchers(
17
+ /*@__PURE__*/ S.TaggedError()("Conflict", {
18
+ code: S.Number,
19
+ message: S.String,
20
+ }).pipe(C.withConflictError), [{ status: 409 }]) {
21
+ }
22
+ export class Forbidden extends /*@__PURE__*/ /*@__PURE__*/ T.applyErrorMatchers(
23
+ /*@__PURE__*/ S.TaggedError()("Forbidden", {
24
+ code: S.Number,
25
+ message: S.String,
26
+ }).pipe(C.withAuthError), [{ status: 403 }]) {
27
+ }
28
+ export class NotFound extends /*@__PURE__*/ /*@__PURE__*/ T.applyErrorMatchers(
29
+ /*@__PURE__*/ S.TaggedError()("NotFound", {
30
+ code: S.Number,
31
+ message: S.String,
32
+ }).pipe(C.withBadRequestError), [{ status: 404 }]) {
33
+ }
34
+ export const TokenUserType = /*@__PURE__*/ S.String;
35
+ export const TokenUser = /*@__PURE__*/ S.suspend(() => S.Struct({
36
+ type: TokenUserType,
37
+ principal: S.optional(S.String),
38
+ nickname: S.String,
39
+ tokenSuffix: S.optional(S.String),
40
+ })).annotate({ identifier: "TokenUser" });
41
+ export const AwsStsUserType = /*@__PURE__*/ S.String;
42
+ export const AwsStsUser = /*@__PURE__*/ S.suspend(() => S.Struct({
43
+ type: AwsStsUserType,
44
+ principal: S.String,
45
+ })).annotate({ identifier: "AwsStsUser" });
46
+ export const DiskUser = /*@__PURE__*/ S.Unknown;
47
+ export const AddDiskUserRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
48
+ id: S.String.pipe(T.Label()),
49
+ body: DiskUser.pipe(T.HttpBody()),
50
+ }).pipe(T.Http({ method: "POST", uri: "/api/disks/{id}/users", code: 200 }))).annotate({
51
+ identifier: "AddDiskUserRequest",
52
+ });
53
+ export const AuthorizedUserType = /*@__PURE__*/ S.String;
54
+ export const AuthorizedUser = /*@__PURE__*/ S.suspend(() => S.Struct({
55
+ type: S.optional(AuthorizedUserType),
56
+ principal: S.optional(S.String),
57
+ nickname: S.optional(S.String),
58
+ tokenSuffix: S.optional(S.String),
59
+ token: S.optional(S.String),
60
+ identifier: S.optional(S.String),
61
+ createdAt: S.optional(S.String),
62
+ })).annotate({ identifier: "AuthorizedUser" });
63
+ export const ApiResponseAuthorizedUser = /*@__PURE__*/ S.suspend(() => S.Struct({
64
+ success: S.Boolean,
65
+ data: AuthorizedUser,
66
+ })).annotate({
67
+ identifier: "ApiResponseAuthorizedUser",
68
+ });
69
+ export const CreateApiTokenRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
70
+ name: S.String,
71
+ description: S.optional(S.String),
72
+ }).pipe(T.Http({ method: "POST", uri: "/api/tokens", code: 200 }))).annotate({
73
+ identifier: "CreateApiTokenRequest",
74
+ });
75
+ export const ApiResponseTokenCreatedData = /*@__PURE__*/ S.suspend(() => S.Struct({
76
+ id: S.optional(S.String),
77
+ name: S.optional(S.String),
78
+ description: S.optional(S.String),
79
+ tokenSuffix: S.optional(S.String),
80
+ createdAt: S.optional(S.String),
81
+ lastUsedAt: S.optional(S.String),
82
+ token: S.optional(S.String),
83
+ })).annotate({
84
+ identifier: "ApiResponseTokenCreatedData",
85
+ });
86
+ export const ApiResponseTokenCreated = /*@__PURE__*/ S.suspend(() => S.Struct({
87
+ success: S.Boolean,
88
+ data: ApiResponseTokenCreatedData,
89
+ })).annotate({
90
+ identifier: "ApiResponseTokenCreated",
91
+ });
92
+ export const S3MountType = /*@__PURE__*/ S.String;
93
+ export const S3Mount = /*@__PURE__*/ S.suspend(() => S.Struct({
94
+ type: S3MountType,
95
+ bucketName: S.String,
96
+ accessKeyId: S.optional(S.String.pipe(T.SensitiveValue({}))),
97
+ secretAccessKey: S.optional(S.String.pipe(T.SensitiveValue({}))),
98
+ sessionToken: S.optional(S.String.pipe(T.SensitiveValue({}))),
99
+ bucketPrefix: S.optional(S.String),
100
+ })).annotate({ identifier: "S3Mount" });
101
+ export const GCSMountType = /*@__PURE__*/ S.String;
102
+ export const GCSMount = /*@__PURE__*/ S.suspend(() => S.Struct({
103
+ type: GCSMountType,
104
+ bucketName: S.String,
105
+ accessKeyId: S.String.pipe(T.SensitiveValue({})),
106
+ secretAccessKey: S.String.pipe(T.SensitiveValue({})),
107
+ bucketPrefix: S.optional(S.String),
108
+ })).annotate({ identifier: "GCSMount" });
109
+ export const R2MountType = /*@__PURE__*/ S.String;
110
+ export const R2Mount = /*@__PURE__*/ S.suspend(() => S.Struct({
111
+ type: R2MountType,
112
+ bucketName: S.String,
113
+ bucketEndpoint: S.String,
114
+ accessKeyId: S.String.pipe(T.SensitiveValue({})),
115
+ secretAccessKey: S.String.pipe(T.SensitiveValue({})),
116
+ bucketPrefix: S.optional(S.String),
117
+ })).annotate({ identifier: "R2Mount" });
118
+ export const S3CompatibleMountType = /*@__PURE__*/ S.String;
119
+ export const S3CompatibleMount = /*@__PURE__*/ S.suspend(() => S.Struct({
120
+ type: S3CompatibleMountType,
121
+ bucketName: S.String,
122
+ bucketEndpoint: S.String,
123
+ accessKeyId: S.String.pipe(T.SensitiveValue({})),
124
+ secretAccessKey: S.String.pipe(T.SensitiveValue({})),
125
+ bucketPrefix: S.optional(S.String),
126
+ })).annotate({
127
+ identifier: "S3CompatibleMount",
128
+ });
129
+ export const AzureBlobMountType = /*@__PURE__*/ S.String;
130
+ export const AzureBlobMount = /*@__PURE__*/ S.suspend(() => S.Struct({
131
+ type: AzureBlobMountType,
132
+ containerName: S.String,
133
+ endpoint: S.optional(S.String),
134
+ storageAccountName: S.optional(S.String),
135
+ tenantId: S.String,
136
+ clientId: S.String,
137
+ clientSecret: S.String.pipe(T.SensitiveValue({})),
138
+ bucketPrefix: S.optional(S.String),
139
+ })).annotate({ identifier: "AzureBlobMount" });
140
+ export const MountConfig =
141
+ /*@__PURE__*/ S.Unknown;
142
+ export const CreateDiskRequestMountsList = /*@__PURE__*/ S.Array(MountConfig);
143
+ export const CreateDiskRequestAuthMethodsList = /*@__PURE__*/ S.Array(DiskUser);
144
+ export const CreateDiskRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
145
+ name: S.String,
146
+ mounts: S.optional(CreateDiskRequestMountsList),
147
+ authMethods: S.optional(CreateDiskRequestAuthMethodsList),
148
+ }).pipe(T.Http({ method: "POST", uri: "/api/disks", code: 200 }))).annotate({
149
+ identifier: "CreateDiskRequest",
150
+ });
151
+ export const ApiResponseCreateDiskDataAuthorizedUsersList =
152
+ /*@__PURE__*/ S.Array(AuthorizedUser);
153
+ export const ApiResponseCreateDiskData = /*@__PURE__*/ S.suspend(() => S.Struct({
154
+ diskId: S.optional(S.String),
155
+ authorizedUsers: S.optional(ApiResponseCreateDiskDataAuthorizedUsersList),
156
+ })).annotate({
157
+ identifier: "ApiResponseCreateDiskData",
158
+ });
159
+ export const ApiResponseCreateDisk = /*@__PURE__*/ S.suspend(() => S.Struct({
160
+ success: S.Boolean,
161
+ data: ApiResponseCreateDiskData,
162
+ })).annotate({
163
+ identifier: "ApiResponseCreateDisk",
164
+ });
165
+ export const CreateSandboxRequestEnvMap = /*@__PURE__*/ S.Record(S.String, S.String);
166
+ export const CreateSandboxRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
167
+ wait: S.optional(S.Boolean.pipe(T.Query())),
168
+ name: S.optional(S.String),
169
+ vcpu_count: S.optional(S.Number),
170
+ mem_size_mib: S.optional(S.Number),
171
+ base_image: S.optional(S.String),
172
+ env: S.optional(CreateSandboxRequestEnvMap),
173
+ max_ttl_seconds: S.optional(S.Number),
174
+ max_concurrent_execs: S.optional(S.Number),
175
+ }).pipe(T.Http({ method: "POST", uri: "/api/sandboxes", code: 200 }))).annotate({
176
+ identifier: "CreateSandboxRequest",
177
+ });
178
+ export const CreateSandboxResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
179
+ identifier: "CreateSandboxResponse",
180
+ });
181
+ export const CreateSandboxConnectionRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
182
+ sid: S.String.pipe(T.Label()),
183
+ }).pipe(T.Http({
184
+ method: "POST",
185
+ uri: "/api/sandboxes/{sid}/connections",
186
+ code: 200,
187
+ }))).annotate({
188
+ identifier: "CreateSandboxConnectionRequest",
189
+ });
190
+ export const SandboxConnection = /*@__PURE__*/ S.suspend(() => S.Struct({
191
+ url: S.String,
192
+ expires_at: S.String,
193
+ })).annotate({
194
+ identifier: "SandboxConnection",
195
+ });
196
+ export const ApiResponseSandboxConnection = /*@__PURE__*/ S.suspend(() => S.Struct({
197
+ success: S.Boolean,
198
+ data: SandboxConnection,
199
+ })).annotate({
200
+ identifier: "ApiResponseSandboxConnection",
201
+ });
202
+ export const CreateShareUrlRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
203
+ id: S.String.pipe(T.Label()),
204
+ key: S.String,
205
+ expiresIn: S.optional(S.Number),
206
+ }).pipe(T.Http({ method: "POST", uri: "/api/disks/{id}/share", code: 200 }))).annotate({
207
+ identifier: "CreateShareUrlRequest",
208
+ });
209
+ export const ApiResponseShareUrlData = /*@__PURE__*/ S.suspend(() => S.Struct({
210
+ url: S.String,
211
+ expiresIn: S.Number,
212
+ })).annotate({
213
+ identifier: "ApiResponseShareUrlData",
214
+ });
215
+ export const ApiResponseShareUrl = /*@__PURE__*/ S.suspend(() => S.Struct({
216
+ success: S.Boolean,
217
+ data: ApiResponseShareUrlData,
218
+ })).annotate({
219
+ identifier: "ApiResponseShareUrl",
220
+ });
221
+ export const DeleteDiskRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
222
+ id: S.String.pipe(T.Label()),
223
+ }).pipe(T.Http({ method: "DELETE", uri: "/api/disks/{id}", code: 200 }))).annotate({
224
+ identifier: "DeleteDiskRequest",
225
+ });
226
+ export const ApiResponseEmpty = /*@__PURE__*/ S.suspend(() => S.Struct({
227
+ success: S.Boolean,
228
+ })).annotate({
229
+ identifier: "ApiResponseEmpty",
230
+ });
231
+ export const DeleteSandboxRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
232
+ sid: S.String.pipe(T.Label()),
233
+ }).pipe(T.Http({ method: "DELETE", uri: "/api/sandboxes/{sid}", code: 200 }))).annotate({
234
+ identifier: "DeleteSandboxRequest",
235
+ });
236
+ export const DeleteSandboxResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
237
+ identifier: "DeleteSandboxResponse",
238
+ });
239
+ export const DeleteTokenRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
240
+ id: S.String.pipe(T.Label()),
241
+ }).pipe(T.Http({ method: "DELETE", uri: "/api/tokens/{id}", code: 200 }))).annotate({
242
+ identifier: "DeleteTokenRequest",
243
+ });
244
+ export const ApiResponseMessageData = /*@__PURE__*/ S.suspend(() => S.Struct({
245
+ message: S.optional(S.String),
246
+ })).annotate({
247
+ identifier: "ApiResponseMessageData",
248
+ });
249
+ export const ApiResponseMessage = /*@__PURE__*/ S.suspend(() => S.Struct({
250
+ success: S.Boolean,
251
+ data: ApiResponseMessageData,
252
+ })).annotate({
253
+ identifier: "ApiResponseMessage",
254
+ });
255
+ export const ExecMount = /*@__PURE__*/ S.suspend(() => S.Struct({
256
+ disk: S.String,
257
+ subdirectory: S.optional(S.String),
258
+ readOnly: S.optional(S.Boolean),
259
+ })).annotate({ identifier: "ExecMount" });
260
+ export const ExecRequestDisksValue =
261
+ /*@__PURE__*/ S.Unknown;
262
+ export const ExecRequestDisksMap = /*@__PURE__*/ S.Record(S.String, ExecRequestDisksValue);
263
+ export const ExecRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
264
+ disks: ExecRequestDisksMap,
265
+ command: S.String,
266
+ }).pipe(T.Http({ method: "POST", uri: "/api/exec", code: 200 }))).annotate({ identifier: "ExecRequest" });
267
+ export const ExecTiming = /*@__PURE__*/ S.suspend(() => S.Struct({
268
+ totalMs: S.Number,
269
+ queueMs: S.Number,
270
+ executeMs: S.Number,
271
+ })).annotate({ identifier: "ExecTiming" });
272
+ export const ExecDiskResult = /*@__PURE__*/ S.suspend(() => S.Struct({
273
+ exitCode: S.Number,
274
+ stdout: S.String,
275
+ stderr: S.String,
276
+ timing: ExecTiming,
277
+ })).annotate({ identifier: "ExecDiskResult" });
278
+ export const ApiResponseExec = /*@__PURE__*/ S.suspend(() => S.Struct({
279
+ success: S.Boolean,
280
+ data: ExecDiskResult,
281
+ })).annotate({
282
+ identifier: "ApiResponseExec",
283
+ });
284
+ export const ExecDiskRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
285
+ id: S.String.pipe(T.Label()),
286
+ command: S.String,
287
+ }).pipe(T.Http({ method: "POST", uri: "/api/disks/{id}/exec", code: 200 }))).annotate({
288
+ identifier: "ExecDiskRequest",
289
+ });
290
+ export const ApiResponseExecDisk = /*@__PURE__*/ S.suspend(() => S.Struct({
291
+ success: S.Boolean,
292
+ data: ExecDiskResult,
293
+ })).annotate({
294
+ identifier: "ApiResponseExecDisk",
295
+ });
296
+ export const ForkSandboxRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
297
+ sid: S.String.pipe(T.Label()),
298
+ wait: S.optional(S.Boolean.pipe(T.Query())),
299
+ name: S.optional(S.String),
300
+ }).pipe(T.Http({ method: "POST", uri: "/api/sandboxes/{sid}/fork", code: 200 }))).annotate({
301
+ identifier: "ForkSandboxRequest",
302
+ });
303
+ export const ForkSandboxResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
304
+ identifier: "ForkSandboxResponse",
305
+ });
306
+ export const GetDiskRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
307
+ id: S.String.pipe(T.Label()),
308
+ }).pipe(T.Http({ method: "GET", uri: "/api/disks/{id}", code: 200 }))).annotate({ identifier: "GetDiskRequest" });
309
+ export const DiskResponseStatus = /*@__PURE__*/ S.String;
310
+ export const MountResponseType = /*@__PURE__*/ S.String;
311
+ export const MountResponseAccessMode = /*@__PURE__*/ S.String;
312
+ export const MountConfigResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
313
+ bucketName: S.optional(S.String),
314
+ bucketEndpoint: S.optional(S.String),
315
+ bucketPrefix: S.optional(S.String),
316
+ sessionId: S.optional(S.String),
317
+ })).annotate({
318
+ identifier: "MountConfigResponse",
319
+ });
320
+ export const MountResponseConnectionStatus = /*@__PURE__*/ S.String;
321
+ export const MountResponseAuthorizationType = /*@__PURE__*/ S.String;
322
+ export const MountResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
323
+ id: S.optional(S.String),
324
+ type: S.optional(MountResponseType),
325
+ path: S.optional(S.String),
326
+ name: S.optional(S.String),
327
+ accessMode: S.optional(MountResponseAccessMode),
328
+ config: S.optional(MountConfigResponse),
329
+ connectionStatus: S.optional(MountResponseConnectionStatus),
330
+ authError: S.optional(S.String),
331
+ authorizationType: S.optional(MountResponseAuthorizationType),
332
+ })).annotate({ identifier: "MountResponse" });
333
+ export const DiskResponseMountsList = /*@__PURE__*/ S.Array(MountResponse);
334
+ export const DiskMetrics = /*@__PURE__*/ S.suspend(() => S.Struct({
335
+ dataTransfer: S.optional(S.String),
336
+ requests: S.optional(S.String),
337
+ avgResponseTime: S.optional(S.String),
338
+ })).annotate({ identifier: "DiskMetrics" });
339
+ export const ConnectedClient = /*@__PURE__*/ S.suspend(() => S.Struct({
340
+ id: S.optional(S.String),
341
+ ipAddress: S.optional(S.String),
342
+ connectedAt: S.optional(S.String),
343
+ })).annotate({
344
+ identifier: "ConnectedClient",
345
+ });
346
+ export const DiskResponseConnectedClientsList = /*@__PURE__*/ S.Array(ConnectedClient);
347
+ export const DiskResponseAuthorizedUsersList = /*@__PURE__*/ S.Array(AuthorizedUser);
348
+ export const DiskResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
349
+ id: S.String,
350
+ name: S.String,
351
+ organization: S.String,
352
+ status: DiskResponseStatus,
353
+ fsHandlerStatus: S.optional(S.String),
354
+ provider: S.String,
355
+ region: S.String,
356
+ createdAt: S.String,
357
+ lastAccessed: S.optional(S.String),
358
+ dataSize: S.optional(S.Number),
359
+ monthlyUsage: S.optional(S.String),
360
+ mounts: S.optional(DiskResponseMountsList),
361
+ metrics: S.optional(DiskMetrics),
362
+ connectedClients: S.optional(DiskResponseConnectedClientsList),
363
+ authorizedUsers: S.optional(DiskResponseAuthorizedUsersList),
364
+ })).annotate({ identifier: "DiskResponse" });
365
+ export const ApiResponseDisk = /*@__PURE__*/ S.suspend(() => S.Struct({
366
+ success: S.Boolean,
367
+ data: DiskResponse,
368
+ })).annotate({
369
+ identifier: "ApiResponseDisk",
370
+ });
371
+ export const GetSandboxRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
372
+ sid: S.String.pipe(T.Label()),
373
+ }).pipe(T.Http({ method: "GET", uri: "/api/sandboxes/{sid}", code: 200 }))).annotate({
374
+ identifier: "GetSandboxRequest",
375
+ });
376
+ export const SandboxState = /*@__PURE__*/ S.String;
377
+ export const SandboxPlatform = /*@__PURE__*/ S.String;
378
+ export const SandboxEndpoint = /*@__PURE__*/ S.suspend(() => S.Struct({
379
+ port: S.Number,
380
+ hostname: S.String,
381
+ })).annotate({
382
+ identifier: "SandboxEndpoint",
383
+ });
384
+ export const SandboxEndpointsList = /*@__PURE__*/ S.Array(SandboxEndpoint);
385
+ export const Sandbox = /*@__PURE__*/ S.suspend(() => S.Struct({
386
+ sandbox_id: S.String,
387
+ name: S.String,
388
+ status: SandboxState,
389
+ vcpu_count: S.Number,
390
+ mem_size_mib: S.Number,
391
+ max_ttl_seconds: S.Number,
392
+ max_concurrent_execs: S.Number,
393
+ base_image: S.String,
394
+ platform: S.optional(SandboxPlatform),
395
+ endpoints: S.optional(SandboxEndpointsList),
396
+ created_at: S.String,
397
+ running_at: S.optional(S.String),
398
+ finished_at: S.optional(S.String),
399
+ last_active_at: S.String,
400
+ expires_at: S.optional(S.String),
401
+ exit_reason: S.optional(S.String),
402
+ })).annotate({ identifier: "Sandbox" });
403
+ export const ApiResponseSandbox = /*@__PURE__*/ S.suspend(() => S.Struct({
404
+ success: S.Boolean,
405
+ data: Sandbox,
406
+ })).annotate({
407
+ identifier: "ApiResponseSandbox",
408
+ });
409
+ export const GrepDiskRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
410
+ id: S.String.pipe(T.Label()),
411
+ directory: S.String,
412
+ pattern: S.String,
413
+ recursive: S.optional(S.Boolean),
414
+ maxDurationSeconds: S.optional(S.Number),
415
+ concurrency: S.optional(S.Number),
416
+ maxResults: S.optional(S.Number),
417
+ }).pipe(T.Http({ method: "POST", uri: "/api/disks/{id}/grep", code: 200 }))).annotate({
418
+ identifier: "GrepDiskRequest",
419
+ });
420
+ export const GrepMatch = /*@__PURE__*/ S.suspend(() => S.Struct({
421
+ file: S.String,
422
+ line: S.Number,
423
+ text: S.String,
424
+ })).annotate({ identifier: "GrepMatch" });
425
+ export const GrepDiskResultMatchesList = /*@__PURE__*/ S.Array(GrepMatch);
426
+ export const GrepStoppedReason = /*@__PURE__*/ S.String;
427
+ export const GrepDiskResult = /*@__PURE__*/ S.suspend(() => S.Struct({
428
+ matches: GrepDiskResultMatchesList,
429
+ stoppedReason: GrepStoppedReason,
430
+ filesScanned: S.Number,
431
+ containersDispatched: S.Number,
432
+ computeSecondsUsed: S.Number,
433
+ durationMs: S.Number,
434
+ listingMs: S.Number,
435
+ grepMs: S.Number,
436
+ })).annotate({ identifier: "GrepDiskResult" });
437
+ export const ApiResponseGrepDisk = /*@__PURE__*/ S.suspend(() => S.Struct({
438
+ success: S.Boolean,
439
+ data: GrepDiskResult,
440
+ })).annotate({
441
+ identifier: "ApiResponseGrepDisk",
442
+ });
443
+ export const ListApiTokensRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
444
+ limit: S.optional(S.Number.pipe(T.Query())),
445
+ cursor: S.optional(S.String.pipe(T.Query())),
446
+ }).pipe(T.Http({ method: "GET", uri: "/api/tokens", code: 200 }))).annotate({
447
+ identifier: "ListApiTokensRequest",
448
+ });
449
+ export const ApiTokenResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
450
+ id: S.optional(S.String),
451
+ name: S.optional(S.String),
452
+ description: S.optional(S.String),
453
+ tokenSuffix: S.optional(S.String),
454
+ createdAt: S.optional(S.String),
455
+ lastUsedAt: S.optional(S.String),
456
+ })).annotate({
457
+ identifier: "ApiTokenResponse",
458
+ });
459
+ export const ApiResponseTokenListDataTokensList = /*@__PURE__*/ S.Array(ApiTokenResponse);
460
+ export const ApiResponseTokenListData = /*@__PURE__*/ S.suspend(() => S.Struct({
461
+ tokens: S.optional(ApiResponseTokenListDataTokensList),
462
+ })).annotate({
463
+ identifier: "ApiResponseTokenListData",
464
+ });
465
+ export const ApiResponseTokenList = /*@__PURE__*/ S.suspend(() => S.Struct({
466
+ success: S.Boolean,
467
+ data: ApiResponseTokenListData,
468
+ })).annotate({
469
+ identifier: "ApiResponseTokenList",
470
+ });
471
+ export const ListDisksRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
472
+ limit: S.optional(S.Number.pipe(T.Query())),
473
+ cursor: S.optional(S.String.pipe(T.Query())),
474
+ name: S.optional(S.String.pipe(T.Query())),
475
+ }).pipe(T.Http({ method: "GET", uri: "/api/disks", code: 200 }))).annotate({
476
+ identifier: "ListDisksRequest",
477
+ });
478
+ export const ApiResponseDiskListDataList = /*@__PURE__*/ S.Array(DiskResponse);
479
+ export const ApiResponseDiskList = /*@__PURE__*/ S.suspend(() => S.Struct({
480
+ success: S.Boolean,
481
+ data: ApiResponseDiskListDataList,
482
+ })).annotate({
483
+ identifier: "ApiResponseDiskList",
484
+ });
485
+ export const ListSandboxesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
486
+ filesystem: S.optional(S.String.pipe(T.Query())),
487
+ }).pipe(T.Http({ method: "GET", uri: "/api/sandboxes", code: 200 }))).annotate({
488
+ identifier: "ListSandboxesRequest",
489
+ });
490
+ export const ApiResponseSandboxListDataSandboxesList = /*@__PURE__*/ S.Array(Sandbox);
491
+ export const ApiResponseSandboxListData = /*@__PURE__*/ S.suspend(() => S.Struct({
492
+ sandboxes: S.optional(ApiResponseSandboxListDataSandboxesList),
493
+ })).annotate({
494
+ identifier: "ApiResponseSandboxListData",
495
+ });
496
+ export const ApiResponseSandboxList = /*@__PURE__*/ S.suspend(() => S.Struct({
497
+ success: S.Boolean,
498
+ data: ApiResponseSandboxListData,
499
+ })).annotate({
500
+ identifier: "ApiResponseSandboxList",
501
+ });
502
+ export const PauseSandboxRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
503
+ sid: S.String.pipe(T.Label()),
504
+ }).pipe(T.Http({ method: "POST", uri: "/api/sandboxes/{sid}/pause", code: 200 }))).annotate({
505
+ identifier: "PauseSandboxRequest",
506
+ });
507
+ export const RemoveDiskUserRequestUserType = /*@__PURE__*/ S.String;
508
+ export const RemoveDiskUserRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
509
+ id: S.String.pipe(T.Label()),
510
+ userType: RemoveDiskUserRequestUserType.pipe(T.Label()),
511
+ identifier: S.optional(S.String.pipe(T.Query())),
512
+ principal: S.optional(S.String.pipe(T.Query())),
513
+ }).pipe(T.Http({
514
+ method: "DELETE",
515
+ uri: "/api/disks/{id}/users/{userType}",
516
+ code: 200,
517
+ }))).annotate({
518
+ identifier: "RemoveDiskUserRequest",
519
+ });
520
+ export const ResumeSandboxRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
521
+ sid: S.String.pipe(T.Label()),
522
+ wait: S.optional(S.Boolean.pipe(T.Query())),
523
+ }).pipe(T.Http({ method: "POST", uri: "/api/sandboxes/{sid}/resume", code: 200 }))).annotate({
524
+ identifier: "ResumeSandboxRequest",
525
+ });
526
+ export const StartSandboxRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
527
+ sid: S.String.pipe(T.Label()),
528
+ wait: S.optional(S.Boolean.pipe(T.Query())),
529
+ }).pipe(T.Http({ method: "POST", uri: "/api/sandboxes/{sid}/start", code: 200 }))).annotate({
530
+ identifier: "StartSandboxRequest",
531
+ });
532
+ export const StopSandboxRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
533
+ sid: S.String.pipe(T.Label()),
534
+ }).pipe(T.Http({ method: "POST", uri: "/api/sandboxes/{sid}/stop", code: 200 }))).annotate({
535
+ identifier: "StopSandboxRequest",
536
+ });
537
+ /** 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 */
538
+ export const addDiskUser = /*@__PURE__*/ API.make(() => ({
539
+ input: AddDiskUserRequest,
540
+ output: ApiResponseAuthorizedUser,
541
+ errors: [BadRequest, UnknownArchilError],
542
+ protocol: ArchilProtocol,
543
+ retry: Retry.Retry,
544
+ }));
545
+ /** Create API token Creates a new API token for programmatic access. The full token value is only returned once at creation time. */
546
+ export const createApiToken = /*@__PURE__*/ API.make(() => ({
547
+ input: CreateApiTokenRequest,
548
+ output: ApiResponseTokenCreated,
549
+ errors: [BadRequest, UnknownArchilError],
550
+ protocol: ArchilProtocol,
551
+ retry: Retry.Retry,
552
+ }));
553
+ /** 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. */
554
+ export const createDisk = /*@__PURE__*/ API.make(() => ({
555
+ input: CreateDiskRequest,
556
+ output: ApiResponseCreateDisk,
557
+ errors: [BadRequest, Forbidden, Conflict, UnknownArchilError],
558
+ protocol: ArchilProtocol,
559
+ retry: Retry.Retry,
560
+ }));
561
+ /** 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. */
562
+ export const createSandbox = /*@__PURE__*/ API.make(() => ({
563
+ input: CreateSandboxRequest,
564
+ output: CreateSandboxResponse,
565
+ errors: [BadRequest, Conflict, UnknownArchilError],
566
+ protocol: ArchilProtocol,
567
+ retry: Retry.Retry,
568
+ }));
569
+ /** 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`. */
570
+ export const createSandboxConnection = /*@__PURE__*/ API.make(() => ({
571
+ input: CreateSandboxConnectionRequest,
572
+ output: ApiResponseSandboxConnection,
573
+ errors: [NotFound, Conflict, UnknownArchilError],
574
+ protocol: ArchilProtocol,
575
+ retry: Retry.Retry,
576
+ }));
577
+ /** 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. */
578
+ export const createShareUrl = /*@__PURE__*/ API.make(() => ({
579
+ input: CreateShareUrlRequest,
580
+ output: ApiResponseShareUrl,
581
+ errors: [BadRequest, NotFound, UnknownArchilError],
582
+ protocol: ArchilProtocol,
583
+ retry: Retry.Retry,
584
+ }));
585
+ /** Delete a disk Deletes a disk and all associated resources. */
586
+ export const deleteDisk = /*@__PURE__*/ API.make(() => ({
587
+ input: DeleteDiskRequest,
588
+ output: ApiResponseEmpty,
589
+ errors: [BadRequest, NotFound, UnknownArchilError],
590
+ protocol: ArchilProtocol,
591
+ retry: Retry.Retry,
592
+ }));
593
+ /** 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. */
594
+ export const deleteSandbox = /*@__PURE__*/ API.make(() => ({
595
+ input: DeleteSandboxRequest,
596
+ output: DeleteSandboxResponse,
597
+ errors: [NotFound, Conflict, UnknownArchilError],
598
+ protocol: ArchilProtocol,
599
+ retry: Retry.Retry,
600
+ }));
601
+ /** Delete API token Revokes and deletes an API token. */
602
+ export const deleteToken = /*@__PURE__*/ API.make(() => ({
603
+ input: DeleteTokenRequest,
604
+ output: ApiResponseMessage,
605
+ errors: [NotFound, UnknownArchilError],
606
+ protocol: ArchilProtocol,
607
+ retry: Retry.Retry,
608
+ }));
609
+ /** 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. */
610
+ export const exec = /*@__PURE__*/ API.make(() => ({
611
+ input: ExecRequest,
612
+ output: ApiResponseExec,
613
+ errors: [BadRequest, NotFound, UnknownArchilError],
614
+ protocol: ArchilProtocol,
615
+ retry: Retry.Retry,
616
+ }));
617
+ /** 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. */
618
+ export const execDisk = /*@__PURE__*/ API.make(() => ({
619
+ input: ExecDiskRequest,
620
+ output: ApiResponseExecDisk,
621
+ errors: [BadRequest, NotFound, UnknownArchilError],
622
+ protocol: ArchilProtocol,
623
+ retry: Retry.Retry,
624
+ }));
625
+ /** 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. */
626
+ export const forkSandbox = /*@__PURE__*/ API.make(() => ({
627
+ input: ForkSandboxRequest,
628
+ output: ForkSandboxResponse,
629
+ errors: [BadRequest, NotFound, Conflict, UnknownArchilError],
630
+ protocol: ArchilProtocol,
631
+ retry: Retry.Retry,
632
+ }));
633
+ /** Get disk details Returns detailed information about a specific disk. */
634
+ export const getDisk = /*@__PURE__*/ API.make(() => ({
635
+ input: GetDiskRequest,
636
+ output: ApiResponseDisk,
637
+ errors: [BadRequest, NotFound, UnknownArchilError],
638
+ protocol: ArchilProtocol,
639
+ retry: Retry.Retry,
640
+ }));
641
+ /** Get a sandbox */
642
+ export const getSandbox = /*@__PURE__*/ API.make(() => ({
643
+ input: GetSandboxRequest,
644
+ output: ApiResponseSandbox,
645
+ errors: [NotFound, UnknownArchilError],
646
+ protocol: ArchilProtocol,
647
+ retry: Retry.Retry,
648
+ }));
649
+ /** 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. */
650
+ export const grepDisk = /*@__PURE__*/ API.make(() => ({
651
+ input: GrepDiskRequest,
652
+ output: ApiResponseGrepDisk,
653
+ errors: [BadRequest, NotFound, UnknownArchilError],
654
+ protocol: ArchilProtocol,
655
+ retry: Retry.Retry,
656
+ }));
657
+ /** List API tokens Returns all API tokens for the authenticated account. */
658
+ export const listApiTokens = /*@__PURE__*/ API.make(() => ({
659
+ input: ListApiTokensRequest,
660
+ output: ApiResponseTokenList,
661
+ errors: [UnknownArchilError],
662
+ protocol: ArchilProtocol,
663
+ retry: Retry.Retry,
664
+ }));
665
+ /** List all disks Returns all disks owned by the authenticated account. */
666
+ export const listDisks = /*@__PURE__*/ API.make(() => ({
667
+ input: ListDisksRequest,
668
+ output: ApiResponseDiskList,
669
+ errors: [UnknownArchilError],
670
+ protocol: ArchilProtocol,
671
+ retry: Retry.Retry,
672
+ }));
673
+ /** List sandboxes All the account's sandboxes, oldest first. */
674
+ export const listSandboxes = /*@__PURE__*/ API.make(() => ({
675
+ input: ListSandboxesRequest,
676
+ output: ApiResponseSandboxList,
677
+ errors: [BadRequest, UnknownArchilError],
678
+ protocol: ArchilProtocol,
679
+ retry: Retry.Retry,
680
+ }));
681
+ /** 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`. */
682
+ export const pauseSandbox = /*@__PURE__*/ API.make(() => ({
683
+ input: PauseSandboxRequest,
684
+ output: ApiResponseSandbox,
685
+ errors: [BadRequest, NotFound, Conflict, UnknownArchilError],
686
+ protocol: ArchilProtocol,
687
+ retry: Retry.Retry,
688
+ }));
689
+ /** Remove user from disk Removes an authorized user from a disk. */
690
+ export const removeDiskUser = /*@__PURE__*/ API.make(() => ({
691
+ input: RemoveDiskUserRequest,
692
+ output: ApiResponseMessage,
693
+ errors: [BadRequest, UnknownArchilError],
694
+ protocol: ArchilProtocol,
695
+ retry: Retry.Retry,
696
+ }));
697
+ /** 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. */
698
+ export const resumeSandbox = /*@__PURE__*/ API.make(() => ({
699
+ input: ResumeSandboxRequest,
700
+ output: ApiResponseSandbox,
701
+ errors: [BadRequest, NotFound, Conflict, UnknownArchilError],
702
+ protocol: ArchilProtocol,
703
+ retry: Retry.Retry,
704
+ }));
705
+ /** 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. */
706
+ export const startSandbox = /*@__PURE__*/ API.make(() => ({
707
+ input: StartSandboxRequest,
708
+ output: ApiResponseSandbox,
709
+ errors: [BadRequest, NotFound, Conflict, UnknownArchilError],
710
+ protocol: ArchilProtocol,
711
+ retry: Retry.Retry,
712
+ }));
713
+ /** 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. */
714
+ export const stopSandbox = /*@__PURE__*/ API.make(() => ({
715
+ input: StopSandboxRequest,
716
+ output: ApiResponseSandbox,
717
+ errors: [BadRequest, NotFound, Conflict, UnknownArchilError],
718
+ protocol: ArchilProtocol,
719
+ retry: Retry.Retry,
720
+ }));
721
+ //# sourceMappingURL=archil.js.map