@blaxel/core 0.3.31-preview.326 → 0.3.31-preview.328

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.
@@ -30,8 +30,8 @@ function missingCredentialsMessage() {
30
30
  return "No Blaxel credentials found. Set the BL_API_KEY and BL_WORKSPACE environment variables, or run `bl login`.";
31
31
  }
32
32
  // Build info - these placeholders are replaced at build time by build:replace-imports
33
- const BUILD_VERSION = "0.3.31-preview.326";
34
- const BUILD_COMMIT = "1e3ab82ebd271d4c725b184a045d882862bcb015";
33
+ const BUILD_VERSION = "0.3.31-preview.328";
34
+ const BUILD_COMMIT = "e08b96df13cebc750a05401ee4d824d42f37a191";
35
35
  const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
36
36
  const BLAXEL_API_VERSION = "2026-09-22";
37
37
  // Bun < 1.3.11 never sends connection-level WINDOW_UPDATE: the pooled h2
@@ -349,7 +349,9 @@ class SandboxInstance {
349
349
  'network' in sandbox ||
350
350
  'snapshotEnabled' in sandbox ||
351
351
  'labels' in sandbox ||
352
- 'extraArgs' in sandbox) {
352
+ 'extraArgs' in sandbox ||
353
+ 'terminationGracePeriodSeconds' in sandbox ||
354
+ 'standbyGracePeriodSeconds' in sandbox) {
353
355
  if (!sandbox)
354
356
  sandbox = {};
355
357
  if (!sandbox.image)
@@ -370,6 +372,7 @@ class SandboxInstance {
370
372
  const network = sandbox.network;
371
373
  const snapshotEnabled = sandbox.snapshotEnabled;
372
374
  const extraArgs = sandbox.extraArgs;
375
+ const { terminationGracePeriodSeconds, standbyGracePeriodSeconds } = sandbox;
373
376
  sandbox = {
374
377
  metadata: { name: sandbox.name, labels: sandbox.labels, externalId: sandbox.externalId },
375
378
  spec: {
@@ -382,6 +385,8 @@ class SandboxInstance {
382
385
  generation: "mk3",
383
386
  snapshotEnabled,
384
387
  extraArgs,
388
+ terminationGracePeriodSeconds,
389
+ standbyGracePeriodSeconds,
385
390
  },
386
391
  volumes: volumes,
387
392
  lifecycle: lifecycle,
@@ -3932,6 +3932,10 @@ export type SandboxRuntime = {
3932
3932
  */
3933
3933
  memory?: number;
3934
3934
  ports?: Ports;
3935
+ /**
3936
+ * Seconds the sandbox gets after a SIGUSR2 to prepare before it goes to standby (scale to zero). The workload can say it is ready earlier by writing +1 to $BLAXEL_SCALE_FILE when it starts preparing and -1 when it is done. Defaults to 0: no signal, immediate standby.
3937
+ */
3938
+ standbyGracePeriodSeconds?: number;
3935
3939
  /**
3936
3940
  * Duration in seconds the pod needs to terminate gracefully. Defaults to 0 for immediate termination.
3937
3941
  */
@@ -61,6 +61,10 @@ export type SandboxCreateConfiguration = {
61
61
  labels?: Record<string, string>;
62
62
  extraArgs?: Record<string, string>;
63
63
  externalId?: string;
64
+ /** Seconds the sandbox gets after SIGTERM to exit before it is deleted. Defaults to 0. */
65
+ terminationGracePeriodSeconds?: number;
66
+ /** Seconds the sandbox gets after SIGUSR2 to prepare before standby. Defaults to 0. */
67
+ standbyGracePeriodSeconds?: number;
64
68
  };
65
69
  export declare function normalizePorts(ports?: (Port | Record<string, any>)[]): Port[] | undefined;
66
70
  export declare function normalizeEnvs(envs?: EnvVar[]): EnvVar[] | undefined;