@blaxel/core 0.2.90 → 0.2.91

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.
@@ -22,8 +22,8 @@ function missingCredentialsMessage() {
22
22
  return "No Blaxel credentials found. Set the BL_API_KEY and BL_WORKSPACE environment variables, or run `bl login`.";
23
23
  }
24
24
  // Build info - these placeholders are replaced at build time by build:replace-imports
25
- const BUILD_VERSION = "0.2.90";
26
- const BUILD_COMMIT = "e47f7913315215d00a881153cf552d424046a303";
25
+ const BUILD_VERSION = "0.2.91";
26
+ const BUILD_COMMIT = "cdff025b5376324a557208ede9a2794aeeeff785";
27
27
  const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
28
28
  const BLAXEL_API_VERSION = "2026-04-16";
29
29
  // Cache for config.yaml tracking value
@@ -238,8 +238,34 @@ export class SandboxInstance {
238
238
  }
239
239
  static async list() {
240
240
  const { data } = await listSandboxes({ throwOnError: true });
241
- const instances = data.map((sandbox) => new SandboxInstance(sandbox));
242
- return Promise.all(instances.map((instance) => SandboxInstance.attachH2Session(instance)));
241
+ const instances = data.map((sb) => new SandboxInstance(sb));
242
+ if (!settings.disableH2) {
243
+ const { h2Pool } = await import("../common/h2pool.js");
244
+ const uniqueDomains = [
245
+ ...new Set(instances
246
+ .map((i) => SandboxInstance.edgeDomainForRegion(i.spec?.region))
247
+ .filter((d) => d !== null)),
248
+ ];
249
+ const sessionByDomain = new Map();
250
+ await Promise.all(uniqueDomains.map(async (domain) => {
251
+ try {
252
+ sessionByDomain.set(domain, await h2Pool.get(domain));
253
+ }
254
+ catch {
255
+ sessionByDomain.set(domain, null);
256
+ }
257
+ }));
258
+ for (const instance of instances) {
259
+ const domain = SandboxInstance.edgeDomainForRegion(instance.spec?.region);
260
+ if (domain) {
261
+ const session = sessionByDomain.get(domain) ?? null;
262
+ instance.h2Session = session;
263
+ instance.sandbox.h2Session = session;
264
+ instance.sandbox.h2Domain = domain;
265
+ }
266
+ }
267
+ }
268
+ return instances;
243
269
  }
244
270
  static async delete(sandboxName) {
245
271
  const { data } = await deleteSandbox({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaxel/core",
3
- "version": "0.2.90",
3
+ "version": "0.2.91",
4
4
  "description": "Blaxel Core SDK for TypeScript",
5
5
  "license": "MIT",
6
6
  "author": "Blaxel, INC (https://blaxel.ai)",