@blaxel/core 0.3.27-preview.317 → 0.3.28

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.27-preview.317";
28
- const BUILD_COMMIT = "b818d0f5560b92040baeb620b8d89bf148cba56d";
27
+ const BUILD_VERSION = "0.3.28";
28
+ const BUILD_COMMIT = "643251a25f011082e6849e55e91f3b06e3a1efb3";
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
@@ -592,7 +592,7 @@ describe("ImageInstance.build worker resources", () => {
592
592
  vi.unstubAllGlobals();
593
593
  });
594
594
  it("sends build memory and volume as labels and signed upload headers", async () => {
595
- const { create, upload } = await buildWith({ buildMemoryMb: 16384, buildVolumeMb: 32768 });
595
+ const { create, upload } = await buildWith({ buildMemory: 16384, buildVolume: 32768 });
596
596
  const labels = create.body.metadata?.labels;
597
597
  expect(labels?.["x-blaxel-build-memory"]).toBe("16384");
598
598
  expect(labels?.["x-blaxel-build-volume"]).toBe("32768");
@@ -602,20 +602,25 @@ describe("ImageInstance.build worker resources", () => {
602
602
  expect(upload.headers["x-amz-meta-x-blaxel-auto-generated"]).toBeUndefined();
603
603
  });
604
604
  it("asks again when creating a sandbox does not sign the settings", async () => {
605
- const { upload } = await buildWith({ buildMemoryMb: 2048 }, undefined, "update");
605
+ const { upload } = await buildWith({ buildMemory: 2048 }, undefined, "update");
606
606
  expect(calls.filter((call) => call.url.includes("upload=true")).map((call) => call.method)).toEqual(["PUT", "POST", "PUT"]);
607
607
  expect(upload.headers["x-amz-meta-x-blaxel-build-memory"]).toBe("2048");
608
608
  });
609
609
  it("fails clearly when the settings are never signed", async () => {
610
- await expect(buildWith({ buildVolumeMb: 32768 }, undefined, "none")).rejects.toThrow("x-blaxel-build-volume");
610
+ await expect(buildWith({ buildVolume: 32768 }, undefined, "none")).rejects.toThrow("x-blaxel-build-volume");
611
611
  expect(calls.some((call) => call.url.startsWith("https://upload.test"))).toBe(false);
612
612
  });
613
613
  it("drops stored labels the upload URL was not signed for", async () => {
614
614
  const { upload } = await buildWith({}, { "x-blaxel-auto-generated": "true", "x-blaxel-build-memory": "8192" }, "none");
615
615
  expect(upload.headers["x-amz-meta-x-blaxel-build-memory"]).toBeUndefined();
616
616
  });
617
+ it("still accepts the deprecated Mb spellings", async () => {
618
+ const { create, upload } = await buildWith({ buildMemoryMb: 8192, buildVolumeMb: 0 });
619
+ expect(create.body.metadata?.labels?.["x-blaxel-build-memory"]).toBe("8192");
620
+ expect(upload.headers["x-amz-meta-x-blaxel-build-volume"]).toBe("0");
621
+ });
617
622
  it("keeps an explicit zero volume", async () => {
618
- const { upload } = await buildWith({ buildVolumeMb: 0 });
623
+ const { upload } = await buildWith({ buildVolume: 0 });
619
624
  expect(upload.headers["x-amz-meta-x-blaxel-build-volume"]).toBe("0");
620
625
  expect(upload.headers["x-amz-meta-x-blaxel-build-memory"]).toBeUndefined();
621
626
  });
@@ -628,11 +633,15 @@ describe("ImageInstance.build worker resources", () => {
628
633
  expect(upload.headers["x-amz-meta-x-blaxel-build-memory"]).toBe("8192");
629
634
  });
630
635
  it.each([
631
- [{ buildMemoryMb: 0 }, "buildMemoryMb"],
632
- [{ buildMemoryMb: 32769 }, "buildMemoryMb"],
633
- [{ buildMemoryMb: 1.5 }, "buildMemoryMb"],
634
- [{ buildVolumeMb: -1 }, "buildVolumeMb"],
635
- [{ buildVolumeMb: 131073 }, "buildVolumeMb"],
636
+ [{ buildMemory: 0 }, "buildMemory must"],
637
+ [{ buildMemory: 32769 }, "buildMemory must"],
638
+ [{ buildMemory: 1.5 }, "buildMemory must"],
639
+ [{ buildVolume: -1 }, "buildVolume must"],
640
+ [{ buildVolume: 131073 }, "buildVolume must"],
641
+ [{ buildMemoryMb: 0 }, "buildMemoryMb must"],
642
+ [{ buildVolumeMb: -1 }, "buildVolumeMb must"],
643
+ [{ buildMemory: 2048, buildMemoryMb: 2048 }, "not both"],
644
+ [{ buildVolume: 0, buildVolumeMb: 0 }, "not both"],
636
645
  ])("rejects out-of-range %o before any request", async (options, option) => {
637
646
  const fetchSpy = vi.fn();
638
647
  vi.stubGlobal("fetch", fetchSpy);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaxel/core",
3
- "version": "0.3.27-preview.317",
3
+ "version": "0.3.28",
4
4
  "description": "Blaxel Core SDK for TypeScript",
5
5
  "license": "MIT",
6
6
  "author": "Blaxel, INC (https://blaxel.ai)",