@aerol-ai/aerolvm-sdk 0.1.1 → 0.1.2

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.
package/dist/MicroVM.d.ts CHANGED
@@ -19,6 +19,7 @@ export declare class MicroVM {
19
19
  destroy(id: string): Promise<void>;
20
20
  resize(id: string, options: ResizeOptions): Promise<Sandbox>;
21
21
  updateLifecycle(id: string, lifecycle: Lifecycle): Promise<Sandbox>;
22
+ reconcile(): Promise<void>;
22
23
  health(): Promise<HealthStatus>;
23
24
  mounts(sandboxID: string): Promise<MountSpecRedacted[]>;
24
25
  execStream(sandboxID: string, options: ExecStreamOptions): ExecStreamHandle;
package/dist/MicroVM.js CHANGED
@@ -51,6 +51,9 @@ export class MicroVM {
51
51
  const sandbox = await this.client.updateLifecycle(id, lifecycle);
52
52
  return this.wrap(sandbox.toJSON());
53
53
  }
54
+ async reconcile() {
55
+ await this.client.reconcile();
56
+ }
54
57
  async health() {
55
58
  return this.client.health();
56
59
  }
@@ -33,6 +33,7 @@ export declare class APIClient {
33
33
  downloadFile(id: string, targetPath: string): Promise<Uint8Array>;
34
34
  exposePort(id: string, port: number): Promise<string>;
35
35
  unexposePort(id: string, port: number): Promise<void>;
36
+ reconcile(): Promise<void>;
36
37
  health(): Promise<HealthStatus>;
37
38
  mounts(id: string): Promise<MountSpecRedacted[]>;
38
39
  private wrap;
@@ -99,6 +99,9 @@ export class APIClient {
99
99
  async unexposePort(id, port) {
100
100
  await this.doJSON("DELETE", `/v1/sandboxes/${id}/ports/${port}`);
101
101
  }
102
+ async reconcile() {
103
+ await this.doJSON("POST", "/v1/admin/reconcile");
104
+ }
102
105
  async health() {
103
106
  const response = await this.doJSON("GET", "/health");
104
107
  return fromApiHealthStatus(response);
@@ -511,7 +514,7 @@ function openExecStream(baseURL, patToken, sandboxID, options) {
511
514
  }
512
515
  });
513
516
  ws.addEventListener("close", () => {
514
- finishWith({ code: 0 });
517
+ failWith("stream closed before exit");
515
518
  });
516
519
  ws.addEventListener("error", () => {
517
520
  failWith("websocket error");
@@ -530,7 +533,6 @@ function openExecStream(baseURL, patToken, sandboxID, options) {
530
533
  },
531
534
  close() {
532
535
  ws.send(JSON.stringify({ type: "close" }));
533
- ws.close();
534
536
  },
535
537
  done,
536
538
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aerol-ai/aerolvm-sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -15,6 +15,8 @@
15
15
  "build": "tsc -p tsconfig.json",
16
16
  "example:create": "npm run build && node dist/examples/createSandbox.js",
17
17
  "example:create:src": "npx tsx src/examples/createSandbox.ts",
18
+ "example:delete": "npm run build && node dist/examples/deleteSandbox.js",
19
+ "example:delete:src": "npx tsx src/examples/deleteSandbox.ts",
18
20
  "test": "tsc -p tsconfig.test.json --outDir dist-test && node --test dist-test/*.test.js"
19
21
  },
20
22
  "devDependencies": {