@lizard-build/sdk 0.1.80 → 0.1.82

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
@@ -556,7 +556,7 @@ interface CommitFilesOpts {
556
556
  branch: string;
557
557
  message: string;
558
558
  files: FileChange[];
559
- /** The commit the branch must still point at (compare-and-swap); a moved branch answers 409. */
559
+ /** The commit your change was made against. A branch that moved since is merged on the server; only a real conflict answers 409. */
560
560
  expect?: string;
561
561
  /** Create `branch` from this ref when it doesn't exist yet. */
562
562
  createFrom?: string;
@@ -1871,7 +1871,9 @@ declare class SandboxClient {
1871
1871
  sandboxId: string;
1872
1872
  }>;
1873
1873
  protected static killSandbox(sandboxId: string, opts?: ConnectionOpts): Promise<boolean>;
1874
- protected static pauseSandbox(sandboxId: string, opts?: ConnectionOpts): Promise<boolean>;
1874
+ protected static pauseSandbox(sandboxId: string, opts?: ConnectionOpts & {
1875
+ memory?: boolean;
1876
+ }): Promise<boolean>;
1875
1877
  protected static resumeSandbox(sandboxId: string, opts?: ConnectionOpts): Promise<boolean>;
1876
1878
  protected static listSandboxes(opts?: ConnectionOpts & {
1877
1879
  projectId?: string;
@@ -2078,8 +2080,12 @@ declare class Sandbox extends SandboxClient {
2078
2080
  /**
2079
2081
  * Pause the sandbox: its memory, running processes and files are kept and
2080
2082
  * 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.
2081
2085
  */
2082
- pause(opts?: ConnectionOpts): Promise<boolean>;
2086
+ pause(opts?: ConnectionOpts & {
2087
+ memory?: boolean;
2088
+ }): Promise<boolean>;
2083
2089
  /**
2084
2090
  * Resume a paused sandbox exactly where it stopped, processes included. Wait
2085
2091
  * with `waitForStatus('running')` before running commands.
package/dist/index.d.ts CHANGED
@@ -556,7 +556,7 @@ interface CommitFilesOpts {
556
556
  branch: string;
557
557
  message: string;
558
558
  files: FileChange[];
559
- /** The commit the branch must still point at (compare-and-swap); a moved branch answers 409. */
559
+ /** The commit your change was made against. A branch that moved since is merged on the server; only a real conflict answers 409. */
560
560
  expect?: string;
561
561
  /** Create `branch` from this ref when it doesn't exist yet. */
562
562
  createFrom?: string;
@@ -1871,7 +1871,9 @@ declare class SandboxClient {
1871
1871
  sandboxId: string;
1872
1872
  }>;
1873
1873
  protected static killSandbox(sandboxId: string, opts?: ConnectionOpts): Promise<boolean>;
1874
- protected static pauseSandbox(sandboxId: string, opts?: ConnectionOpts): Promise<boolean>;
1874
+ protected static pauseSandbox(sandboxId: string, opts?: ConnectionOpts & {
1875
+ memory?: boolean;
1876
+ }): Promise<boolean>;
1875
1877
  protected static resumeSandbox(sandboxId: string, opts?: ConnectionOpts): Promise<boolean>;
1876
1878
  protected static listSandboxes(opts?: ConnectionOpts & {
1877
1879
  projectId?: string;
@@ -2078,8 +2080,12 @@ declare class Sandbox extends SandboxClient {
2078
2080
  /**
2079
2081
  * Pause the sandbox: its memory, running processes and files are kept and
2080
2082
  * 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.
2081
2085
  */
2082
- pause(opts?: ConnectionOpts): Promise<boolean>;
2086
+ pause(opts?: ConnectionOpts & {
2087
+ memory?: boolean;
2088
+ }): Promise<boolean>;
2083
2089
  /**
2084
2090
  * Resume a paused sandbox exactly where it stopped, processes included. Wait
2085
2091
  * with `waitForStatus('running')` before running commands.
package/dist/index.js CHANGED
@@ -1725,7 +1725,7 @@ 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
- headers: config.headers
1728
+ ...opts?.memory === false ? { headers: { ...config.headers, "Content-Type": "application/json" }, body: JSON.stringify({ memory: false }) } : { headers: config.headers }
1729
1729
  });
1730
1730
  if (res.status === 404) return false;
1731
1731
  if (!res.ok) await handleApiError(res);
@@ -1835,6 +1835,8 @@ var Sandbox = class extends SandboxClient {
1835
1835
  /**
1836
1836
  * Pause the sandbox: its memory, running processes and files are kept and
1837
1837
  * 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.
1838
1840
  */
1839
1841
  async pause(opts) {
1840
1842
  return SandboxClient.pauseSandbox(this.sandboxId, this.resolveOpts(opts));
package/dist/index.mjs CHANGED
@@ -1653,7 +1653,7 @@ 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
- headers: config.headers
1656
+ ...opts?.memory === false ? { headers: { ...config.headers, "Content-Type": "application/json" }, body: JSON.stringify({ memory: false }) } : { headers: config.headers }
1657
1657
  });
1658
1658
  if (res.status === 404) return false;
1659
1659
  if (!res.ok) await handleApiError(res);
@@ -1763,6 +1763,8 @@ var Sandbox = class extends SandboxClient {
1763
1763
  /**
1764
1764
  * Pause the sandbox: its memory, running processes and files are kept and
1765
1765
  * 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.
1766
1768
  */
1767
1769
  async pause(opts) {
1768
1770
  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.80",
3
+ "version": "0.1.82",
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",