@lizard-build/sdk 0.1.82 → 0.1.83

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/index.d.mts CHANGED
@@ -1872,6 +1872,7 @@ declare class SandboxClient {
1872
1872
  }>;
1873
1873
  protected static killSandbox(sandboxId: string, opts?: ConnectionOpts): Promise<boolean>;
1874
1874
  protected static pauseSandbox(sandboxId: string, opts?: ConnectionOpts & {
1875
+ fast?: boolean;
1875
1876
  memory?: boolean;
1876
1877
  }): Promise<boolean>;
1877
1878
  protected static resumeSandbox(sandboxId: string, opts?: ConnectionOpts): Promise<boolean>;
@@ -2080,10 +2081,12 @@ declare class Sandbox extends SandboxClient {
2080
2081
  /**
2081
2082
  * Pause the sandbox: its memory, running processes and files are kept and
2082
2083
  * compute stops. Wait with `waitForStatus('paused')` before resuming.
2083
- * `{ memory: false }` keeps files only: about a second whatever the RAM, but
2084
- * processes end and the resume boots the sandbox fresh.
2084
+ * `{ fast: true }` keeps files only: about a second whatever the RAM, but
2085
+ * processes end and the resume boots the sandbox fresh (`memory: false` is
2086
+ * the same).
2085
2087
  */
2086
2088
  pause(opts?: ConnectionOpts & {
2089
+ fast?: boolean;
2087
2090
  memory?: boolean;
2088
2091
  }): Promise<boolean>;
2089
2092
  /**
package/dist/index.d.ts CHANGED
@@ -1872,6 +1872,7 @@ declare class SandboxClient {
1872
1872
  }>;
1873
1873
  protected static killSandbox(sandboxId: string, opts?: ConnectionOpts): Promise<boolean>;
1874
1874
  protected static pauseSandbox(sandboxId: string, opts?: ConnectionOpts & {
1875
+ fast?: boolean;
1875
1876
  memory?: boolean;
1876
1877
  }): Promise<boolean>;
1877
1878
  protected static resumeSandbox(sandboxId: string, opts?: ConnectionOpts): Promise<boolean>;
@@ -2080,10 +2081,12 @@ declare class Sandbox extends SandboxClient {
2080
2081
  /**
2081
2082
  * Pause the sandbox: its memory, running processes and files are kept and
2082
2083
  * compute stops. Wait with `waitForStatus('paused')` before resuming.
2083
- * `{ memory: false }` keeps files only: about a second whatever the RAM, but
2084
- * processes end and the resume boots the sandbox fresh.
2084
+ * `{ fast: true }` keeps files only: about a second whatever the RAM, but
2085
+ * processes end and the resume boots the sandbox fresh (`memory: false` is
2086
+ * the same).
2085
2087
  */
2086
2088
  pause(opts?: ConnectionOpts & {
2089
+ fast?: boolean;
2087
2090
  memory?: boolean;
2088
2091
  }): Promise<boolean>;
2089
2092
  /**
package/dist/index.js CHANGED
@@ -1725,7 +1725,8 @@ var SandboxClient = class {
1725
1725
  const config = new ConnectionConfig(opts);
1726
1726
  const res = await fetch(`${config.apiUrl}/api/sandboxes/${sandboxId}/pause`, {
1727
1727
  method: "POST",
1728
- ...opts?.memory === false ? { headers: { ...config.headers, "Content-Type": "application/json" }, body: JSON.stringify({ memory: false }) } : { headers: config.headers }
1728
+ // Sent as memory:false, which every server that has fast pause accepts.
1729
+ ...opts?.fast === true || opts?.memory === false ? { headers: { ...config.headers, "Content-Type": "application/json" }, body: JSON.stringify({ memory: false }) } : { headers: config.headers }
1729
1730
  });
1730
1731
  if (res.status === 404) return false;
1731
1732
  if (!res.ok) await handleApiError(res);
@@ -1835,8 +1836,9 @@ var Sandbox = class extends SandboxClient {
1835
1836
  /**
1836
1837
  * Pause the sandbox: its memory, running processes and files are kept and
1837
1838
  * compute stops. Wait with `waitForStatus('paused')` before resuming.
1838
- * `{ memory: false }` keeps files only: about a second whatever the RAM, but
1839
- * processes end and the resume boots the sandbox fresh.
1839
+ * `{ fast: true }` keeps files only: about a second whatever the RAM, but
1840
+ * processes end and the resume boots the sandbox fresh (`memory: false` is
1841
+ * the same).
1840
1842
  */
1841
1843
  async pause(opts) {
1842
1844
  return SandboxClient.pauseSandbox(this.sandboxId, this.resolveOpts(opts));
package/dist/index.mjs CHANGED
@@ -1653,7 +1653,8 @@ var SandboxClient = class {
1653
1653
  const config = new ConnectionConfig(opts);
1654
1654
  const res = await fetch(`${config.apiUrl}/api/sandboxes/${sandboxId}/pause`, {
1655
1655
  method: "POST",
1656
- ...opts?.memory === false ? { headers: { ...config.headers, "Content-Type": "application/json" }, body: JSON.stringify({ memory: false }) } : { headers: config.headers }
1656
+ // Sent as memory:false, which every server that has fast pause accepts.
1657
+ ...opts?.fast === true || opts?.memory === false ? { headers: { ...config.headers, "Content-Type": "application/json" }, body: JSON.stringify({ memory: false }) } : { headers: config.headers }
1657
1658
  });
1658
1659
  if (res.status === 404) return false;
1659
1660
  if (!res.ok) await handleApiError(res);
@@ -1763,8 +1764,9 @@ var Sandbox = class extends SandboxClient {
1763
1764
  /**
1764
1765
  * Pause the sandbox: its memory, running processes and files are kept and
1765
1766
  * compute stops. Wait with `waitForStatus('paused')` before resuming.
1766
- * `{ memory: false }` keeps files only: about a second whatever the RAM, but
1767
- * processes end and the resume boots the sandbox fresh.
1767
+ * `{ fast: true }` keeps files only: about a second whatever the RAM, but
1768
+ * processes end and the resume boots the sandbox fresh (`memory: false` is
1769
+ * the same).
1768
1770
  */
1769
1771
  async pause(opts) {
1770
1772
  return SandboxClient.pauseSandbox(this.sandboxId, this.resolveOpts(opts));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lizard-build/sdk",
3
- "version": "0.1.82",
3
+ "version": "0.1.83",
4
4
  "description": "TypeScript and JavaScript SDK for Lizard (lizard.build): cloud sandboxes for AI agents and code execution.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",