@blaxel/core 0.2.28 → 0.2.29-preview.65

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.
@@ -21,7 +21,9 @@ export declare class SandboxInstance {
21
21
  maxWait?: number;
22
22
  interval?: number;
23
23
  }): Promise<this>;
24
- static create(sandbox?: SandboxModel | SandboxCreateConfiguration): Promise<SandboxInstance>;
24
+ static create(sandbox?: SandboxModel | SandboxCreateConfiguration, { safe }?: {
25
+ safe?: boolean;
26
+ }): Promise<SandboxInstance>;
25
27
  static get(sandboxName: string): Promise<SandboxInstance>;
26
28
  static list(): Promise<SandboxInstance[]>;
27
29
  static delete(sandboxName: string): Promise<SandboxModel>;
@@ -42,7 +42,7 @@ class SandboxInstance {
42
42
  logger_js_1.logger.warn("⚠️ Warning: sandbox.wait() is deprecated. You don't need to wait for the sandbox to be deployed anymore.");
43
43
  return this;
44
44
  }
45
- static async create(sandbox) {
45
+ static async create(sandbox, { safe = true } = {}) {
46
46
  const defaultName = `sandbox-${(0, uuid_1.v4)().replace(/-/g, '').substring(0, 8)}`;
47
47
  const defaultImage = "blaxel/prod-base:latest";
48
48
  const defaultMemory = 4096;
@@ -98,7 +98,12 @@ class SandboxInstance {
98
98
  });
99
99
  const instance = new SandboxInstance(data);
100
100
  // TODO remove this part once we have a better way to handle this
101
- await instance.fs.ls('/');
101
+ if (safe) {
102
+ try {
103
+ await instance.fs.ls('/');
104
+ }
105
+ catch { }
106
+ }
102
107
  return instance;
103
108
  }
104
109
  static async get(sandboxName) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaxel/core",
3
- "version": "0.2.28",
3
+ "version": "0.2.29-preview.65",
4
4
  "description": "Blaxel Core SDK for TypeScript",
5
5
  "license": "MIT",
6
6
  "author": "Blaxel, INC (https://blaxel.ai)",