@lizard-build/sdk 0.1.82 → 1.0.0

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/README.md CHANGED
@@ -106,9 +106,10 @@ if (result.exitCode !== 0) throw new Error(result.stderr)
106
106
  The `desktop` template runs an Openbox desktop with Chromium, streamed to a browser over WebRTC (with noVNC as the fallback). You can watch it, and an agent can drive it:
107
107
 
108
108
  ```ts
109
- import { Sandbox } from '@lizard-build/sdk'
109
+ import { Lizard } from '@lizard-build/sdk'
110
110
 
111
- const sandbox = await Sandbox.create('desktop', { project: 'my-project' })
111
+ const lizard = new Lizard({ project: 'my-project' })
112
+ const sandbox = await lizard.create('desktop')
112
113
  try {
113
114
  const { url, viewOnlyUrl } = await sandbox.desktop.start() // open `url` in a browser
114
115
  await sandbox.desktop.openUrl('https://example.com')
@@ -128,11 +129,10 @@ Treat `url` like a credential: anyone with it can see and control the desktop. S
128
129
  Run Python with the `interpreter` template. Each process command starts a separate Python process, so Python variables do not survive between calls; use `CodeSandbox` when they should.
129
130
 
130
131
  ```ts
131
- import { Sandbox } from '@lizard-build/sdk'
132
+ import { Lizard } from '@lizard-build/sdk'
132
133
 
133
- const sandbox = await Sandbox.create('interpreter', {
134
- project: 'my-project', timeoutMs: 300_000,
135
- })
134
+ const lizard = new Lizard({ project: 'my-project' })
135
+ const sandbox = await lizard.create('interpreter', { timeoutMs: 300_000 })
136
136
  try {
137
137
  const result = await sandbox.process.exec("python -c 'print(2 ** 10)'")
138
138
  if (result.exitCode !== 0) throw new Error(result.stderr)
@@ -164,6 +164,14 @@ Command results contain stdout, stderr, and the exit code. Command timeouts are
164
164
 
165
165
  The SDK and CLI default to a five-minute lifetime. The raw API and dashboard default to no expiration. Set an explicit lifetime: `timeoutMs: 0` at creation disables expiration; a positive value sets a deadline. `setTimeout()` accepts 1000–2147483647 ms, not zero. Commands do not reset the deadline. This is not an idle timer.
166
166
 
167
+ ## Versions and API stability
168
+
169
+ Lizard SDK follows [semantic versioning](https://semver.org) from 1.0.0. A change that breaks a documented method, option or return type ships only in a new major version. New features come in minor versions, fixes in patch versions. The npm and PyPI packages share one version number. The [changelog](https://github.com/lizard-build/lizard-sdk/blob/main/CHANGELOG.md) lists what changed, including the API changes made before 1.0.
170
+
171
+ There are two ways to create a sandbox, and both are stable: `new Lizard({ project }).create(template)` and `Sandbox.create(template, { project })`. The client passes its project to `Sandbox.create()`, so both send the same request. The examples use the client because it also reaches volumes and the platform API. `CodeSandbox.create({ project })` takes the project the same way as `Sandbox.create()`.
172
+
173
+ Platform facts such as prices, limits and templates can change without a new SDK version. See [current limits](https://lizard.build/docs/sandboxes/).
174
+
167
175
  ## Other SDK capabilities
168
176
 
169
177
  The SDK also manages apps, Managed Postgres, Managed Redis, Managed Object Storage and projects. See the [platform guide](https://github.com/lizard-build/lizard-sdk/blob/main/docs/platform.md).
@@ -176,6 +184,7 @@ The SDK also manages apps, Managed Postgres, Managed Redis, Managed Object Stora
176
184
  - [Sandbox reference](https://github.com/lizard-build/lizard-sdk/blob/main/docs/sandboxes.md)
177
185
  - [Platform guide](https://github.com/lizard-build/lizard-sdk/blob/main/docs/platform.md)
178
186
  - [CLI coverage and migration](https://github.com/lizard-build/lizard-sdk/blob/main/docs/cli-parity.md)
187
+ - [Changelog](https://github.com/lizard-build/lizard-sdk/blob/main/CHANGELOG.md)
179
188
  - [Source and issues](https://github.com/lizard-build/lizard-sdk)
180
189
 
181
190
  [Apache-2.0](https://github.com/lizard-build/lizard-sdk/blob/main/LICENSE)
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": "1.0.0",
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",