@blaxel/core 0.2.69 → 0.2.70

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/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/client/sdk.gen.js +124 -3
  3. package/dist/cjs/common/settings.js +2 -2
  4. package/dist/cjs/drive/index.js +182 -0
  5. package/dist/cjs/index.js +1 -0
  6. package/dist/cjs/sandbox/drive/drive.js +70 -0
  7. package/dist/cjs/sandbox/drive/index.js +17 -0
  8. package/dist/cjs/sandbox/sandbox.js +9 -6
  9. package/dist/cjs/types/client/sdk.gen.d.ts +47 -1
  10. package/dist/cjs/types/client/types.gen.d.ts +237 -0
  11. package/dist/cjs/types/drive/index.d.ts +34 -0
  12. package/dist/cjs/types/index.d.ts +1 -0
  13. package/dist/cjs/types/sandbox/drive/drive.d.ts +42 -0
  14. package/dist/cjs/types/sandbox/drive/index.d.ts +1 -0
  15. package/dist/cjs/types/sandbox/sandbox.d.ts +2 -0
  16. package/dist/cjs-browser/.tsbuildinfo +1 -1
  17. package/dist/cjs-browser/client/sdk.gen.js +124 -3
  18. package/dist/cjs-browser/common/settings.js +2 -2
  19. package/dist/cjs-browser/drive/index.js +182 -0
  20. package/dist/cjs-browser/index.js +1 -0
  21. package/dist/cjs-browser/sandbox/drive/drive.js +70 -0
  22. package/dist/cjs-browser/sandbox/drive/index.js +17 -0
  23. package/dist/cjs-browser/sandbox/sandbox.js +9 -6
  24. package/dist/cjs-browser/types/client/sdk.gen.d.ts +47 -1
  25. package/dist/cjs-browser/types/client/types.gen.d.ts +237 -0
  26. package/dist/cjs-browser/types/drive/index.d.ts +34 -0
  27. package/dist/cjs-browser/types/index.d.ts +1 -0
  28. package/dist/cjs-browser/types/sandbox/drive/drive.d.ts +42 -0
  29. package/dist/cjs-browser/types/sandbox/drive/index.d.ts +1 -0
  30. package/dist/cjs-browser/types/sandbox/sandbox.d.ts +2 -0
  31. package/dist/esm/.tsbuildinfo +1 -1
  32. package/dist/esm/client/sdk.gen.js +114 -0
  33. package/dist/esm/common/settings.js +2 -2
  34. package/dist/esm/drive/index.js +178 -0
  35. package/dist/esm/index.js +1 -0
  36. package/dist/esm/sandbox/drive/drive.js +66 -0
  37. package/dist/esm/sandbox/drive/index.js +1 -0
  38. package/dist/esm/sandbox/sandbox.js +3 -0
  39. package/dist/esm-browser/.tsbuildinfo +1 -1
  40. package/dist/esm-browser/client/sdk.gen.js +114 -0
  41. package/dist/esm-browser/common/settings.js +2 -2
  42. package/dist/esm-browser/drive/index.js +178 -0
  43. package/dist/esm-browser/index.js +1 -0
  44. package/dist/esm-browser/sandbox/drive/drive.js +66 -0
  45. package/dist/esm-browser/sandbox/drive/index.js +1 -0
  46. package/dist/esm-browser/sandbox/sandbox.js +3 -0
  47. package/package.json +1 -1
@@ -414,6 +414,67 @@ export type CustomDomainSpecWritable = {
414
414
  [key: string]: string;
415
415
  };
416
416
  };
417
+ /**
418
+ * Drive providing persistent storage that can be attached to agents, functions, and sandboxes. Drives are backed by SeaweedFS buckets and can be mounted at runtime via the sbx API.
419
+ */
420
+ export type Drive = {
421
+ events?: CoreEvents;
422
+ metadata: Metadata;
423
+ spec: DriveSpec;
424
+ state?: DriveState;
425
+ /**
426
+ * Drive status computed from events
427
+ */
428
+ readonly status?: string;
429
+ };
430
+ /**
431
+ * Drive providing persistent storage that can be attached to agents, functions, and sandboxes. Drives are backed by SeaweedFS buckets and can be mounted at runtime via the sbx API.
432
+ */
433
+ export type DriveWritable = {
434
+ events?: CoreEventsWritable;
435
+ metadata: MetadataWritable;
436
+ spec: DriveSpecWritable;
437
+ state?: DriveState;
438
+ };
439
+ /**
440
+ * Immutable drive configuration set at creation time
441
+ */
442
+ export type DriveSpec = {
443
+ /**
444
+ * The internal infrastructure resource identifier for this drive (bucket name)
445
+ */
446
+ readonly infrastructureId?: string;
447
+ /**
448
+ * Deployment region for the drive (e.g., us-pdx-1, eu-lon-1). Must match the region of resources it attaches to.
449
+ */
450
+ region?: string;
451
+ /**
452
+ * Optional size limit for the drive in GB. If not specified, drive has no size limit.
453
+ */
454
+ size?: number;
455
+ };
456
+ /**
457
+ * Immutable drive configuration set at creation time
458
+ */
459
+ export type DriveSpecWritable = {
460
+ /**
461
+ * Deployment region for the drive (e.g., us-pdx-1, eu-lon-1). Must match the region of resources it attaches to.
462
+ */
463
+ region?: string;
464
+ /**
465
+ * Optional size limit for the drive in GB. If not specified, drive has no size limit.
466
+ */
467
+ size?: number;
468
+ };
469
+ /**
470
+ * Current runtime state of the drive
471
+ */
472
+ export type DriveState = {
473
+ /**
474
+ * S3-compatible endpoint URL for accessing drive contents
475
+ */
476
+ readonly s3Url?: string;
477
+ };
417
478
  /**
418
479
  * An egress gateway that manages outbound traffic routing within a VPC. Multiple egress IPs can be allocated from a single gateway.
419
480
  */
@@ -2233,6 +2294,12 @@ export type PublicIps = {
2233
2294
  * Region
2234
2295
  */
2235
2296
  export type Region = {
2297
+ /**
2298
+ * S3-compatible endpoint URL for drive storage in this region. Use {s3Endpoint}/{bucketName} to access drive contents.
2299
+ */
2300
+ agentDrivePublicUrl?: {
2301
+ [key: string]: unknown;
2302
+ };
2236
2303
  /**
2237
2304
  * Region display name
2238
2305
  */
@@ -2245,6 +2312,10 @@ export type Region = {
2245
2312
  * Region display name
2246
2313
  */
2247
2314
  country?: string;
2315
+ /**
2316
+ * Drives availability status - indicates if an S3 endpoint is configured for the region
2317
+ */
2318
+ drivesAvailable?: boolean;
2248
2319
  /**
2249
2320
  * Egress availability status - indicates if network plane URL is configured for the region
2250
2321
  */
@@ -3425,6 +3496,172 @@ export type VerifyCustomDomainResponses = {
3425
3496
  200: CustomDomain;
3426
3497
  };
3427
3498
  export type VerifyCustomDomainResponse = VerifyCustomDomainResponses[keyof VerifyCustomDomainResponses];
3499
+ export type ListDrivesData = {
3500
+ body?: never;
3501
+ path?: never;
3502
+ query?: never;
3503
+ url: '/drives';
3504
+ };
3505
+ export type ListDrivesErrors = {
3506
+ /**
3507
+ * Unauthorized
3508
+ */
3509
+ 401: unknown;
3510
+ };
3511
+ export type ListDrivesResponses = {
3512
+ /**
3513
+ * successful operation
3514
+ */
3515
+ 200: Array<Drive>;
3516
+ };
3517
+ export type ListDrivesResponse = ListDrivesResponses[keyof ListDrivesResponses];
3518
+ export type CreateDriveData = {
3519
+ body: DriveWritable;
3520
+ path?: never;
3521
+ query?: never;
3522
+ url: '/drives';
3523
+ };
3524
+ export type CreateDriveErrors = {
3525
+ /**
3526
+ * Unauthorized
3527
+ */
3528
+ 401: unknown;
3529
+ };
3530
+ export type CreateDriveResponses = {
3531
+ /**
3532
+ * successful operation
3533
+ */
3534
+ 200: Drive;
3535
+ };
3536
+ export type CreateDriveResponse = CreateDriveResponses[keyof CreateDriveResponses];
3537
+ export type DeleteDriveData = {
3538
+ body?: never;
3539
+ path: {
3540
+ driveName: string;
3541
+ };
3542
+ query?: never;
3543
+ url: '/drives/{driveName}';
3544
+ };
3545
+ export type DeleteDriveErrors = {
3546
+ /**
3547
+ * Unauthorized
3548
+ */
3549
+ 401: unknown;
3550
+ /**
3551
+ * Drive not found
3552
+ */
3553
+ 404: unknown;
3554
+ };
3555
+ export type DeleteDriveResponses = {
3556
+ /**
3557
+ * successful operation
3558
+ */
3559
+ 200: {
3560
+ message?: string;
3561
+ name?: string;
3562
+ };
3563
+ };
3564
+ export type DeleteDriveResponse = DeleteDriveResponses[keyof DeleteDriveResponses];
3565
+ export type GetDriveData = {
3566
+ body?: never;
3567
+ path: {
3568
+ driveName: string;
3569
+ };
3570
+ query?: never;
3571
+ url: '/drives/{driveName}';
3572
+ };
3573
+ export type GetDriveErrors = {
3574
+ /**
3575
+ * Unauthorized
3576
+ */
3577
+ 401: unknown;
3578
+ /**
3579
+ * Drive not found
3580
+ */
3581
+ 404: unknown;
3582
+ };
3583
+ export type GetDriveResponses = {
3584
+ /**
3585
+ * successful operation
3586
+ */
3587
+ 200: Drive;
3588
+ };
3589
+ export type GetDriveResponse = GetDriveResponses[keyof GetDriveResponses];
3590
+ export type UpdateDriveData = {
3591
+ body: DriveWritable;
3592
+ path: {
3593
+ driveName: string;
3594
+ };
3595
+ query?: never;
3596
+ url: '/drives/{driveName}';
3597
+ };
3598
+ export type UpdateDriveErrors = {
3599
+ /**
3600
+ * Unauthorized
3601
+ */
3602
+ 401: unknown;
3603
+ /**
3604
+ * Drive not found
3605
+ */
3606
+ 404: unknown;
3607
+ };
3608
+ export type UpdateDriveResponses = {
3609
+ /**
3610
+ * successful operation
3611
+ */
3612
+ 200: Drive;
3613
+ };
3614
+ export type UpdateDriveResponse = UpdateDriveResponses[keyof UpdateDriveResponses];
3615
+ export type CreateDriveAccessTokenData = {
3616
+ body?: never;
3617
+ path: {
3618
+ driveName: string;
3619
+ };
3620
+ query?: never;
3621
+ url: '/drives/{driveName}/access-token';
3622
+ };
3623
+ export type CreateDriveAccessTokenErrors = {
3624
+ /**
3625
+ * Unauthorized
3626
+ */
3627
+ 401: unknown;
3628
+ /**
3629
+ * Drives feature not enabled
3630
+ */
3631
+ 403: unknown;
3632
+ /**
3633
+ * Drive not found
3634
+ */
3635
+ 404: unknown;
3636
+ };
3637
+ export type CreateDriveAccessTokenResponses = {
3638
+ /**
3639
+ * successful operation
3640
+ */
3641
+ 200: {
3642
+ access_token?: string;
3643
+ expires_in?: number;
3644
+ token_type?: string;
3645
+ };
3646
+ };
3647
+ export type CreateDriveAccessTokenResponse = CreateDriveAccessTokenResponses[keyof CreateDriveAccessTokenResponses];
3648
+ export type GetDriveJwksData = {
3649
+ body?: never;
3650
+ path?: never;
3651
+ query?: never;
3652
+ url: '/drives/jwks.json';
3653
+ };
3654
+ export type GetDriveJwksResponses = {
3655
+ /**
3656
+ * successful operation
3657
+ */
3658
+ 200: {
3659
+ keys?: Array<{
3660
+ [key: string]: unknown;
3661
+ }>;
3662
+ };
3663
+ };
3664
+ export type GetDriveJwksResponse = GetDriveJwksResponses[keyof GetDriveJwksResponses];
3428
3665
  export type ListAllEgressGatewaysData = {
3429
3666
  body?: never;
3430
3667
  path?: never;
@@ -0,0 +1,34 @@
1
+ import { Drive } from "../client/index.js";
2
+ export interface DriveCreateConfiguration {
3
+ name?: string;
4
+ displayName?: string;
5
+ labels?: Record<string, string>;
6
+ size?: number;
7
+ region?: string;
8
+ }
9
+ export declare class DriveInstance {
10
+ private drive;
11
+ constructor(drive: Drive);
12
+ get metadata(): import("../client/types.gen.js").Metadata;
13
+ get spec(): import("../client/types.gen.js").DriveSpec;
14
+ get state(): import("../client/types.gen.js").DriveState | undefined;
15
+ get status(): string | undefined;
16
+ get name(): string;
17
+ get displayName(): string | undefined;
18
+ get size(): number | undefined;
19
+ get region(): string | undefined;
20
+ static create(config: DriveCreateConfiguration | Drive): Promise<DriveInstance>;
21
+ static get(driveName: string): Promise<DriveInstance>;
22
+ static list(): Promise<DriveInstance[]>;
23
+ static delete(driveName: string): Promise<{
24
+ message?: string;
25
+ name?: string;
26
+ }>;
27
+ delete(): Promise<{
28
+ message?: string;
29
+ name?: string;
30
+ }>;
31
+ static update(driveName: string, updates: DriveCreateConfiguration | Drive): Promise<DriveInstance>;
32
+ update(updates: DriveCreateConfiguration | Drive): Promise<DriveInstance>;
33
+ static createIfNotExists(config: DriveCreateConfiguration | Drive): Promise<DriveInstance>;
34
+ }
@@ -9,6 +9,7 @@ export * from "./common/internal.js";
9
9
  export * from "./common/logger.js";
10
10
  export * from "./common/settings.js";
11
11
  export * from "./common/webhook.js";
12
+ export * from "./drive/index.js";
12
13
  export * from "./image/index.js";
13
14
  export * from "./jobs/index.js";
14
15
  export * from "./mcp/index.js";
@@ -0,0 +1,42 @@
1
+ import { Sandbox } from "../../client/types.gen.js";
2
+ import { SandboxAction } from "../action.js";
3
+ export interface DriveMountRequest {
4
+ driveName: string;
5
+ mountPath: string;
6
+ drivePath?: string;
7
+ }
8
+ export interface DriveMountResponse {
9
+ success: boolean;
10
+ message: string;
11
+ driveName: string;
12
+ mountPath: string;
13
+ drivePath: string;
14
+ }
15
+ export interface DriveMountInfo {
16
+ driveName: string;
17
+ mountPath: string;
18
+ drivePath: string;
19
+ }
20
+ export interface DriveListResponse {
21
+ mounts: DriveMountInfo[];
22
+ }
23
+ export interface DriveUnmountResponse {
24
+ success: boolean;
25
+ message: string;
26
+ mountPath: string;
27
+ }
28
+ export declare class SandboxDrive extends SandboxAction {
29
+ constructor(sandbox: Sandbox);
30
+ /**
31
+ * Mount a drive to the sandbox at a specific mount path
32
+ */
33
+ mount(request: DriveMountRequest): Promise<DriveMountResponse>;
34
+ /**
35
+ * Unmount a drive from the sandbox by mount path
36
+ */
37
+ unmount(mountPath: string): Promise<DriveUnmountResponse>;
38
+ /**
39
+ * List all mounted drives in the sandbox
40
+ */
41
+ list(): Promise<DriveMountInfo[]>;
42
+ }
@@ -0,0 +1 @@
1
+ export * from "./drive.js";
@@ -1,5 +1,6 @@
1
1
  import { SandboxLifecycle, Sandbox as SandboxModel } from "../client/index.js";
2
2
  import { SandboxCodegen } from "./codegen/index.js";
3
+ import { SandboxDrive } from "./drive/index.js";
3
4
  import { SandboxFileSystem } from "./filesystem/index.js";
4
5
  import { SandboxNetwork } from "./network/index.js";
5
6
  import { SandboxPreviews } from "./preview.js";
@@ -16,6 +17,7 @@ export declare class SandboxInstance {
16
17
  sessions: SandboxSessions;
17
18
  codegen: SandboxCodegen;
18
19
  system: SandboxSystem;
20
+ drives: SandboxDrive;
19
21
  constructor(sandbox: SandboxConfiguration);
20
22
  get metadata(): import("../client/types.gen.js").Metadata;
21
23
  get status(): import("../client/types.gen.js").Status | undefined;