@blaxel/core 0.3.32-preview.332 → 0.3.32

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.
@@ -24,8 +24,8 @@ function missingCredentialsMessage() {
24
24
  return "No Blaxel credentials found. Set the BL_API_KEY and BL_WORKSPACE environment variables, or run `bl login`.";
25
25
  }
26
26
  // Build info - these placeholders are replaced at build time by build:replace-imports
27
- const BUILD_VERSION = "0.3.32-preview.332";
28
- const BUILD_COMMIT = "eeb11112e6f23be5c60b770389ef29eda8452fb0";
27
+ const BUILD_VERSION = "0.3.32";
28
+ const BUILD_COMMIT = "85c4e5d52f8c501ac8db9409390611090a3e4df2";
29
29
  const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
30
30
  const BLAXEL_API_VERSION = "2026-09-22";
31
31
  // Bun < 1.3.11 never sends connection-level WINDOW_UPDATE: the pooled h2
@@ -386,17 +386,16 @@ export class SandboxFileSystem extends SandboxAction {
386
386
  try {
387
387
  while (!closed) {
388
388
  const { value, done } = await reader.read();
389
- if (done)
390
- break;
391
- buffer += decoder.decode(value, { stream: true });
389
+ // On end of stream, flush the decoder and terminate a trailing line so it is not dropped.
390
+ buffer += done ? decoder.decode() + '\n' : decoder.decode(value, { stream: true });
392
391
  const lines = buffer.split('\n');
393
392
  buffer = lines.pop();
394
393
  for (const line of lines) {
395
394
  const trimmed = line.trim();
396
395
  if (!trimmed)
397
396
  continue;
398
- // Skip keepalive messages
399
- if (line.startsWith("[keepalive]")) {
397
+ if (trimmed.startsWith("[keepalive]")) {
398
+ options?.onKeepalive?.();
400
399
  continue;
401
400
  }
402
401
  const fileEvent = JSON.parse(trimmed);
@@ -420,13 +419,20 @@ export class SandboxFileSystem extends SandboxAction {
420
419
  await callback(fileEvent);
421
420
  }
422
421
  }
422
+ if (done)
423
+ break;
423
424
  }
424
425
  }
425
426
  finally {
426
427
  reader.releaseLock();
427
428
  }
428
429
  };
429
- start().catch((err) => {
430
+ start().then(() => {
431
+ if (!closed) {
432
+ closed = true;
433
+ options?.onClose?.();
434
+ }
435
+ }).catch((err) => {
430
436
  // Suppress AbortError when closing
431
437
  if (!(err && typeof err === 'object' && 'name' in err && err.name === 'AbortError')) {
432
438
  if (options?.onError) {