@blaxel/core 0.2.92-preview.189 → 0.2.93-preview.191

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.92-preview.189";
26
- const BUILD_COMMIT = "0d4a502d0c67cd86b5f09ded9d25c0e76f5ca511";
25
+ const BUILD_VERSION = "0.2.93-preview.191";
26
+ const BUILD_COMMIT = "4533be458ecf975dd86214dda3bf9a64b34ed64f";
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
@@ -1,5 +1,5 @@
1
1
  import { v4 as uuidv4 } from "uuid";
2
- import { createSandbox, deleteSandbox, getSandbox, listSandboxes, updateSandbox } from "../client/index.js";
2
+ import { createSandbox, deleteSandbox, getSandbox, getSandboxByExternalId, listSandboxes, updateSandbox } from "../client/index.js";
3
3
  import { logger } from "../common/logger.js";
4
4
  import { settings } from "../common/settings.js";
5
5
  import { SandboxCodegen } from "./codegen/index.js";
@@ -160,7 +160,7 @@ export class SandboxInstance {
160
160
  const snapshotEnabled = sandbox.snapshotEnabled;
161
161
  const extraArgs = sandbox.extraArgs;
162
162
  sandbox = {
163
- metadata: { name: sandbox.name, labels: sandbox.labels },
163
+ metadata: { name: sandbox.name, labels: sandbox.labels, externalId: sandbox.externalId },
164
164
  spec: {
165
165
  region: region,
166
166
  runtime: {
@@ -236,8 +236,19 @@ export class SandboxInstance {
236
236
  const instance = new SandboxInstance(data);
237
237
  return SandboxInstance.attachH2Session(instance);
238
238
  }
239
- static async list() {
240
- const { data: raw } = await listSandboxes({ throwOnError: true });
239
+ static async getByExternalId(externalId) {
240
+ const { data } = await getSandboxByExternalId({
241
+ path: { externalId },
242
+ throwOnError: true,
243
+ });
244
+ const instance = new SandboxInstance(data);
245
+ return SandboxInstance.attachH2Session(instance);
246
+ }
247
+ static async list({ externalId } = {}) {
248
+ const { data: raw } = await listSandboxes({
249
+ query: externalId ? { externalId } : undefined,
250
+ throwOnError: true,
251
+ });
241
252
  const items = (Array.isArray(raw) ? raw : (raw?.data ?? []));
242
253
  const instances = items.map((sb) => new SandboxInstance(sb));
243
254
  if (!settings.disableH2) {