@blaxel/core 0.2.96-preview.202 → 0.2.96-preview.204

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 (35) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/client/sdk.gen.js +113 -2
  3. package/dist/cjs/common/settings.js +2 -2
  4. package/dist/cjs/sandbox/index.js +1 -0
  5. package/dist/cjs/sandbox/sandbox.js +3 -0
  6. package/dist/cjs/sandbox/schedule.js +91 -0
  7. package/dist/cjs/types/client/sdk.gen.d.ts +31 -1
  8. package/dist/cjs/types/client/types.gen.d.ts +347 -0
  9. package/dist/cjs/types/sandbox/index.d.ts +1 -0
  10. package/dist/cjs/types/sandbox/sandbox.d.ts +2 -0
  11. package/dist/cjs/types/sandbox/schedule.d.ts +16 -0
  12. package/dist/cjs-browser/.tsbuildinfo +1 -1
  13. package/dist/cjs-browser/client/sdk.gen.js +113 -2
  14. package/dist/cjs-browser/common/settings.js +2 -2
  15. package/dist/cjs-browser/sandbox/index.js +1 -0
  16. package/dist/cjs-browser/sandbox/sandbox.js +3 -0
  17. package/dist/cjs-browser/sandbox/schedule.js +91 -0
  18. package/dist/cjs-browser/types/client/sdk.gen.d.ts +31 -1
  19. package/dist/cjs-browser/types/client/types.gen.d.ts +347 -0
  20. package/dist/cjs-browser/types/sandbox/index.d.ts +1 -0
  21. package/dist/cjs-browser/types/sandbox/sandbox.d.ts +2 -0
  22. package/dist/cjs-browser/types/sandbox/schedule.d.ts +16 -0
  23. package/dist/esm/.tsbuildinfo +1 -1
  24. package/dist/esm/client/sdk.gen.js +104 -0
  25. package/dist/esm/common/settings.js +2 -2
  26. package/dist/esm/sandbox/index.js +1 -0
  27. package/dist/esm/sandbox/sandbox.js +3 -0
  28. package/dist/esm/sandbox/schedule.js +87 -0
  29. package/dist/esm-browser/.tsbuildinfo +1 -1
  30. package/dist/esm-browser/client/sdk.gen.js +104 -0
  31. package/dist/esm-browser/common/settings.js +2 -2
  32. package/dist/esm-browser/sandbox/index.js +1 -0
  33. package/dist/esm-browser/sandbox/sandbox.js +3 -0
  34. package/dist/esm-browser/sandbox/schedule.js +87 -0
  35. package/package.json +1 -1
@@ -3626,6 +3626,195 @@ export type SandboxRuntime = {
3626
3626
  */
3627
3627
  ttl?: string;
3628
3628
  };
3629
+ /**
3630
+ * List of scheduled tasks for automated process execution inside the sandbox. Supports recurring cron expressions, one-off datetime targets, and sleep durations.
3631
+ */
3632
+ export type SandboxSchedule = Array<SandboxScheduleEntry>;
3633
+ /**
3634
+ * List of scheduled tasks for automated process execution inside the sandbox. Supports recurring cron expressions, one-off datetime targets, and sleep durations.
3635
+ */
3636
+ export type SandboxScheduleWritable = Array<SandboxScheduleEntryWritable>;
3637
+ /**
3638
+ * A scheduled task that executes a process inside the sandbox at specified times. Stored in the dedicated schedules table (no longer embedded in the sandbox spec).
3639
+ */
3640
+ export type SandboxScheduleEntry = {
3641
+ /**
3642
+ * Creation timestamp (read-only).
3643
+ */
3644
+ readonly createdAt?: string;
3645
+ /**
3646
+ * Unique identifier for this schedule within its sandbox. Auto-generated if not provided.
3647
+ */
3648
+ id?: string;
3649
+ input?: SandboxScheduleInput;
3650
+ /**
3651
+ * Maximum number of execution records kept for this schedule. Once reached, recording a new execution deletes the oldest. Defaults to 100.
3652
+ */
3653
+ maxExecutions?: number;
3654
+ /**
3655
+ * Type of schedule timing. 'cron' for recurring (5-field expression), 'at' for a specific RFC 3339 datetime, 'sleep' for a duration from now (resolved to 'at' on creation).
3656
+ */
3657
+ type?: 'cron' | 'at' | 'sleep';
3658
+ /**
3659
+ * Timing value. For 'cron': a 5-field cron expression (e.g. '0 8 * * 1-5'). For 'at': an RFC 3339 datetime (e.g. '2026-07-01T09:00:00Z'). For 'sleep': a duration (e.g. '2h', '30m', '7d').
3660
+ */
3661
+ value?: string;
3662
+ };
3663
+ /**
3664
+ * A scheduled task that executes a process inside the sandbox at specified times. Stored in the dedicated schedules table (no longer embedded in the sandbox spec).
3665
+ */
3666
+ export type SandboxScheduleEntryWritable = {
3667
+ /**
3668
+ * Unique identifier for this schedule within its sandbox. Auto-generated if not provided.
3669
+ */
3670
+ id?: string;
3671
+ input?: SandboxScheduleInput;
3672
+ /**
3673
+ * Maximum number of execution records kept for this schedule. Once reached, recording a new execution deletes the oldest. Defaults to 100.
3674
+ */
3675
+ maxExecutions?: number;
3676
+ /**
3677
+ * Type of schedule timing. 'cron' for recurring (5-field expression), 'at' for a specific RFC 3339 datetime, 'sleep' for a duration from now (resolved to 'at' on creation).
3678
+ */
3679
+ type?: 'cron' | 'at' | 'sleep';
3680
+ /**
3681
+ * Timing value. For 'cron': a 5-field cron expression (e.g. '0 8 * * 1-5'). For 'at': an RFC 3339 datetime (e.g. '2026-07-01T09:00:00Z'). For 'sleep': a duration (e.g. '2h', '30m', '7d').
3682
+ */
3683
+ value?: string;
3684
+ };
3685
+ /**
3686
+ * Cursor-paginated list of a sandbox's schedule definitions.
3687
+ */
3688
+ export type SandboxScheduleEntryList = {
3689
+ /**
3690
+ * Page of schedule definitions.
3691
+ */
3692
+ data?: Array<SandboxScheduleEntry>;
3693
+ meta?: PaginationMeta;
3694
+ };
3695
+ /**
3696
+ * Cursor-paginated list of a sandbox's schedule definitions.
3697
+ */
3698
+ export type SandboxScheduleEntryListWritable = {
3699
+ /**
3700
+ * Page of schedule definitions.
3701
+ */
3702
+ data?: Array<SandboxScheduleEntryWritable>;
3703
+ meta?: PaginationMeta;
3704
+ };
3705
+ /**
3706
+ * One recorded execution of a sandbox schedule. statusCode is the HTTP status from submitting the command to the sandbox (the scheduler does not wait for the command to finish). Stored in the dedicated scheduleexecutions table.
3707
+ */
3708
+ export type SandboxScheduleExecution = {
3709
+ /**
3710
+ * Creation timestamp (read-only).
3711
+ */
3712
+ readonly createdAt?: string;
3713
+ /**
3714
+ * RFC 3339 time at which the command was submitted.
3715
+ */
3716
+ executedAt?: string;
3717
+ /**
3718
+ * Unique id of this execution within the schedule.
3719
+ */
3720
+ id?: string;
3721
+ /**
3722
+ * Name of the process started in the sandbox for this execution, used to look up its logs.
3723
+ */
3724
+ processName?: string;
3725
+ /**
3726
+ * Id of the schedule this execution belongs to.
3727
+ */
3728
+ scheduleId?: string;
3729
+ /**
3730
+ * HTTP status code returned when the scheduled command was submitted to the sandbox (0 if the sandbox could not be reached). 2xx/3xx means the command was accepted.
3731
+ */
3732
+ statusCode?: number;
3733
+ /**
3734
+ * Process timeout in seconds for this execution. The UI uses it to scope the log view to [executedAt, executedAt+timeout]. 0 when the schedule set no timeout.
3735
+ */
3736
+ timeout?: number;
3737
+ };
3738
+ /**
3739
+ * One recorded execution of a sandbox schedule. statusCode is the HTTP status from submitting the command to the sandbox (the scheduler does not wait for the command to finish). Stored in the dedicated scheduleexecutions table.
3740
+ */
3741
+ export type SandboxScheduleExecutionWritable = {
3742
+ /**
3743
+ * RFC 3339 time at which the command was submitted.
3744
+ */
3745
+ executedAt?: string;
3746
+ /**
3747
+ * Unique id of this execution within the schedule.
3748
+ */
3749
+ id?: string;
3750
+ /**
3751
+ * Name of the process started in the sandbox for this execution, used to look up its logs.
3752
+ */
3753
+ processName?: string;
3754
+ /**
3755
+ * Id of the schedule this execution belongs to.
3756
+ */
3757
+ scheduleId?: string;
3758
+ /**
3759
+ * HTTP status code returned when the scheduled command was submitted to the sandbox (0 if the sandbox could not be reached). 2xx/3xx means the command was accepted.
3760
+ */
3761
+ statusCode?: number;
3762
+ /**
3763
+ * Process timeout in seconds for this execution. The UI uses it to scope the log view to [executedAt, executedAt+timeout]. 0 when the schedule set no timeout.
3764
+ */
3765
+ timeout?: number;
3766
+ };
3767
+ /**
3768
+ * Cursor-paginated list of a sandbox's schedule execution history (across all its schedules).
3769
+ */
3770
+ export type SandboxScheduleExecutionList = {
3771
+ /**
3772
+ * Page of schedule executions.
3773
+ */
3774
+ data?: Array<SandboxScheduleExecution>;
3775
+ meta?: PaginationMeta;
3776
+ };
3777
+ /**
3778
+ * Cursor-paginated list of a sandbox's schedule execution history (across all its schedules).
3779
+ */
3780
+ export type SandboxScheduleExecutionListWritable = {
3781
+ /**
3782
+ * Page of schedule executions.
3783
+ */
3784
+ data?: Array<SandboxScheduleExecutionWritable>;
3785
+ meta?: PaginationMeta;
3786
+ };
3787
+ /**
3788
+ * Process execution configuration for a scheduled sandbox task
3789
+ */
3790
+ export type SandboxScheduleInput = {
3791
+ /**
3792
+ * Shell command to execute inside the sandbox
3793
+ */
3794
+ command?: string;
3795
+ /**
3796
+ * Environment variables to set for the process. May contain secrets, so values are encrypted at rest and masked in API responses unless an admin requests show_secrets=true.
3797
+ */
3798
+ env?: {
3799
+ [key: string]: string;
3800
+ };
3801
+ /**
3802
+ * Keep the sandbox alive (disable scale-to-zero) while the process runs. Defaults to true.
3803
+ */
3804
+ keepAlive?: boolean;
3805
+ /**
3806
+ * Optional name for the process (used to retrieve status/logs)
3807
+ */
3808
+ name?: string;
3809
+ /**
3810
+ * Timeout in seconds for the process. Defaults to 600 (10 minutes). Set to 0 for no timeout.
3811
+ */
3812
+ timeout?: number;
3813
+ /**
3814
+ * Working directory for the command
3815
+ */
3816
+ workingDir?: string;
3817
+ };
3629
3818
  /**
3630
3819
  * Configuration for a sandbox including its image, memory, ports, region, and lifecycle policies
3631
3820
  */
@@ -7202,6 +7391,164 @@ export type DeleteSandboxPreviewTokenResponses = {
7202
7391
  };
7203
7392
  };
7204
7393
  export type DeleteSandboxPreviewTokenResponse = DeleteSandboxPreviewTokenResponses[keyof DeleteSandboxPreviewTokenResponses];
7394
+ export type ListSandboxScheduleExecutionsData = {
7395
+ body?: never;
7396
+ path: {
7397
+ /**
7398
+ * Name of the Sandbox
7399
+ */
7400
+ sandboxName: string;
7401
+ };
7402
+ query?: {
7403
+ /**
7404
+ * Number of items per page
7405
+ */
7406
+ limit?: number;
7407
+ /**
7408
+ * Opaque cursor returned by a previous response's meta.nextCursor. Only valid for the same query (workspace + filters); the server rejects cursors bound to a different query or older than 24h. Omit on the first page.
7409
+ */
7410
+ cursor?: string;
7411
+ /**
7412
+ * Sort spec, formatted as `<key>:<direction>`. Allowed values are `createdAt:desc` (default), `createdAt:asc`, `name:asc`, `name:desc`. The cursor fingerprint is bound to the sort, so a cursor opened with one value cannot be reused with another. Only honoured starting on Blaxel-Version 2026-04-28.
7413
+ */
7414
+ sort?: 'createdAt:desc' | 'createdAt:asc' | 'name:asc' | 'name:desc';
7415
+ /**
7416
+ * Substring search across `metadata.name`, `metadata.displayName` and labels (keys + values). Trimmed and lowercased server-side; queries shorter than 2 characters fall back to the unfiltered listing. Bound into the cursor fingerprint so a cursor opened with one query cannot be reused with another. Only honoured starting on Blaxel-Version 2026-04-28.
7417
+ */
7418
+ q?: string;
7419
+ };
7420
+ url: '/sandboxes/{sandboxName}/schedule-executions';
7421
+ };
7422
+ export type ListSandboxScheduleExecutionsResponses = {
7423
+ /**
7424
+ * successful operation
7425
+ */
7426
+ 200: SandboxScheduleExecutionList;
7427
+ };
7428
+ export type ListSandboxScheduleExecutionsResponse = ListSandboxScheduleExecutionsResponses[keyof ListSandboxScheduleExecutionsResponses];
7429
+ export type ListSandboxSchedulesData = {
7430
+ body?: never;
7431
+ path: {
7432
+ /**
7433
+ * Name of the Sandbox
7434
+ */
7435
+ sandboxName: string;
7436
+ };
7437
+ query?: {
7438
+ /**
7439
+ * Number of items per page
7440
+ */
7441
+ limit?: number;
7442
+ /**
7443
+ * Opaque cursor returned by a previous response's meta.nextCursor. Only valid for the same query (workspace + filters); the server rejects cursors bound to a different query or older than 24h. Omit on the first page.
7444
+ */
7445
+ cursor?: string;
7446
+ /**
7447
+ * Sort spec, formatted as `<key>:<direction>`. Allowed values are `createdAt:desc` (default), `createdAt:asc`, `name:asc`, `name:desc`. The cursor fingerprint is bound to the sort, so a cursor opened with one value cannot be reused with another. Only honoured starting on Blaxel-Version 2026-04-28.
7448
+ */
7449
+ sort?: 'createdAt:desc' | 'createdAt:asc' | 'name:asc' | 'name:desc';
7450
+ /**
7451
+ * Substring search across `metadata.name`, `metadata.displayName` and labels (keys + values). Trimmed and lowercased server-side; queries shorter than 2 characters fall back to the unfiltered listing. Bound into the cursor fingerprint so a cursor opened with one query cannot be reused with another. Only honoured starting on Blaxel-Version 2026-04-28.
7452
+ */
7453
+ q?: string;
7454
+ /**
7455
+ * Filter schedules by timing type. Only cron and at are stored (sleep resolves to at on creation); any other value is ignored.
7456
+ */
7457
+ type?: 'cron' | 'at';
7458
+ };
7459
+ url: '/sandboxes/{sandboxName}/schedules';
7460
+ };
7461
+ export type ListSandboxSchedulesResponses = {
7462
+ /**
7463
+ * successful operation
7464
+ */
7465
+ 200: SandboxScheduleEntryList;
7466
+ };
7467
+ export type ListSandboxSchedulesResponse = ListSandboxSchedulesResponses[keyof ListSandboxSchedulesResponses];
7468
+ export type CreateSandboxScheduleData = {
7469
+ body: SandboxScheduleEntryWritable;
7470
+ path: {
7471
+ /**
7472
+ * Name of the Sandbox
7473
+ */
7474
+ sandboxName: string;
7475
+ };
7476
+ query?: never;
7477
+ url: '/sandboxes/{sandboxName}/schedules';
7478
+ };
7479
+ export type CreateSandboxScheduleResponses = {
7480
+ /**
7481
+ * successful operation
7482
+ */
7483
+ 200: SandboxScheduleEntry;
7484
+ };
7485
+ export type CreateSandboxScheduleResponse = CreateSandboxScheduleResponses[keyof CreateSandboxScheduleResponses];
7486
+ export type DeleteSandboxScheduleData = {
7487
+ body?: never;
7488
+ path: {
7489
+ /**
7490
+ * Name of the Sandbox
7491
+ */
7492
+ sandboxName: string;
7493
+ /**
7494
+ * Id of the Schedule
7495
+ */
7496
+ scheduleId: string;
7497
+ };
7498
+ query?: never;
7499
+ url: '/sandboxes/{sandboxName}/schedules/{scheduleId}';
7500
+ };
7501
+ export type DeleteSandboxScheduleResponses = {
7502
+ /**
7503
+ * successful operation
7504
+ */
7505
+ 200: SandboxScheduleEntry;
7506
+ };
7507
+ export type DeleteSandboxScheduleResponse = DeleteSandboxScheduleResponses[keyof DeleteSandboxScheduleResponses];
7508
+ export type GetSandboxScheduleData = {
7509
+ body?: never;
7510
+ path: {
7511
+ /**
7512
+ * Name of the Sandbox
7513
+ */
7514
+ sandboxName: string;
7515
+ /**
7516
+ * Id of the Schedule
7517
+ */
7518
+ scheduleId: string;
7519
+ };
7520
+ query?: never;
7521
+ url: '/sandboxes/{sandboxName}/schedules/{scheduleId}';
7522
+ };
7523
+ export type GetSandboxScheduleResponses = {
7524
+ /**
7525
+ * successful operation
7526
+ */
7527
+ 200: SandboxScheduleEntry;
7528
+ };
7529
+ export type GetSandboxScheduleResponse = GetSandboxScheduleResponses[keyof GetSandboxScheduleResponses];
7530
+ export type UpdateSandboxScheduleData = {
7531
+ body: SandboxScheduleEntryWritable;
7532
+ path: {
7533
+ /**
7534
+ * Name of the Sandbox
7535
+ */
7536
+ sandboxName: string;
7537
+ /**
7538
+ * Id of the Schedule
7539
+ */
7540
+ scheduleId: string;
7541
+ };
7542
+ query?: never;
7543
+ url: '/sandboxes/{sandboxName}/schedules/{scheduleId}';
7544
+ };
7545
+ export type UpdateSandboxScheduleResponses = {
7546
+ /**
7547
+ * successful operation
7548
+ */
7549
+ 200: SandboxScheduleEntry;
7550
+ };
7551
+ export type UpdateSandboxScheduleResponse = UpdateSandboxScheduleResponses[keyof UpdateSandboxScheduleResponses];
7205
7552
  export type GetSandboxByExternalIdData = {
7206
7553
  body?: never;
7207
7554
  path: {
@@ -3,6 +3,7 @@ export * from "./filesystem/index.js";
3
3
  export * from "./codegen/index.js";
4
4
  export { SandboxDrive, type DriveMountRequest, type DriveMountResponse, type DriveMountInfo, type DriveUnmountResponse } from "./drive/index.js";
5
5
  export * from "./preview.js";
6
+ export * from "./schedule.js";
6
7
  export * from "./session.js";
7
8
  export * from "./sandbox.js";
8
9
  export * from "./system.js";
@@ -6,6 +6,7 @@ import { SandboxFileSystem } from "./filesystem/index.js";
6
6
  import { SandboxNetwork } from "./network/index.js";
7
7
  import { SandboxPreviews } from "./preview.js";
8
8
  import { SandboxProcess } from "./process/index.js";
9
+ import { SandboxSchedules } from "./schedule.js";
9
10
  import { SandboxSessions } from "./session.js";
10
11
  import { SandboxSystem } from "./system.js";
11
12
  import { SandboxConfiguration, SandboxCreateConfiguration, SandboxUpdateMetadata, SandboxUpdateNetwork, SessionWithToken } from "./types.js";
@@ -15,6 +16,7 @@ export declare class SandboxInstance {
15
16
  network: SandboxNetwork;
16
17
  process: SandboxProcess;
17
18
  previews: SandboxPreviews;
19
+ schedules: SandboxSchedules;
18
20
  sessions: SandboxSessions;
19
21
  codegen: SandboxCodegen;
20
22
  system: SandboxSystem;
@@ -0,0 +1,16 @@
1
+ import type { ListSandboxScheduleExecutionsData, ListSandboxSchedulesData, Sandbox, SandboxScheduleEntry, SandboxScheduleExecution } from "../client/index.js";
2
+ /** Optional filters for listing schedules (`type`, `q`, `limit`, `cursor`, `sort`). */
3
+ export type SandboxScheduleListOptions = NonNullable<ListSandboxSchedulesData["query"]>;
4
+ /** Optional filters for listing schedule executions (`q`, `limit`, `cursor`, `sort`). */
5
+ export type SandboxScheduleExecutionListOptions = NonNullable<ListSandboxScheduleExecutionsData["query"]>;
6
+ export declare class SandboxSchedules {
7
+ private sandbox;
8
+ constructor(sandbox: Sandbox);
9
+ get sandboxName(): string;
10
+ list(options?: SandboxScheduleListOptions): Promise<SandboxScheduleEntry[]>;
11
+ create(schedule: SandboxScheduleEntry): Promise<SandboxScheduleEntry>;
12
+ get(scheduleId: string): Promise<SandboxScheduleEntry>;
13
+ update(scheduleId: string, schedule: SandboxScheduleEntry): Promise<SandboxScheduleEntry>;
14
+ delete(scheduleId: string): Promise<SandboxScheduleEntry>;
15
+ executions(options?: SandboxScheduleExecutionListOptions): Promise<SandboxScheduleExecution[]>;
16
+ }