@lizard-build/sdk 0.1.68 → 0.1.70

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
@@ -1,6 +1,6 @@
1
1
  # Lizard SDK for TypeScript
2
2
 
3
- Run commands, work with files and execute code in Linux sandboxes (Firecracker microVMs). The SDK also manages Lizard apps, databases, storage and projects.
3
+ Run commands, work with files and execute code in Linux sandboxes with Firecracker support. The SDK also manages Lizard apps, databases, storage and projects.
4
4
 
5
5
  ## Install
6
6
 
@@ -40,7 +40,7 @@ The package includes TypeScript declarations and ESM and CommonJS builds. For Co
40
40
 
41
41
  ## Machine size
42
42
 
43
- Sandboxes come in three sizes: `small` (2 vCPU / 4 GB, $0.0162/h), `medium` (4 vCPU / 8 GB, $0.0324/h, the default) and `large` (8 vCPU / 16 GB, $0.0648/h). Billing is flat by size, per second while the sandbox runs; measured CPU/RAM are not charged, egress is free, and volumes bill separately.
43
+ Sandboxes come in three sizes: `small` (2 vCPU / 4 GB, $0.0162/h), `medium` (4 vCPU / 8 GB, $0.0324/h, the default) and `large` (8 vCPU / 16 GB, $0.0648/h). Billing is flat by size, per second while the sandbox runs, including idle time. CPU and RAM are included. The sandbox egress allowance is [2 TB per account over a rolling 30 days](https://lizard.build/docs/platform/limits/#sandbox-egress), with no separate per-GB charge. A successful pause stops compute charges; storage in Persistent Volumes is billed separately, including while paused.
44
44
 
45
45
  ```ts
46
46
  const sandbox = await lizard.create('base', { size: 'large' })
@@ -125,7 +125,7 @@ Pass `timeoutMs` to `create()` to set the sandbox lifetime. The default is five
125
125
 
126
126
  ## Runtime limits
127
127
 
128
- Each sandbox is a Firecracker microVM with its own kernel. Use volumes mounted at `/workspace` to keep files after a sandbox ends. `pause()`/`resume()` keep memory and running processes; `snapshot()` is ready in about 2 s and `Sandbox.restore()` starts a copy in about 0.4 s; `fork()` clones a running sandbox. File watching and sandbox log streaming are not available on Firecracker sandboxes yet. Volumes can grow but not shrink, and a sandbox with a volume attached cannot be forked. See the [snapshot guide](../../docs/sandboxes.md#pause-resume-snapshots-and-fork).
128
+ Lizard Sandboxes support Firecracker microVMs with their own kernel. Older pod volumes or snapshots, account or region settings, and some Firecracker startup failures can select a container that shares the host kernel. Check `getInfo().runtime` in TypeScript or `get_info().runtime` in Python before running code that requires a separate kernel. Use volumes mounted at `/workspace` to keep files after a sandbox ends. `pause()`/`resume()` keep memory and running processes; `snapshot()` is ready in about 2 s and `Sandbox.restore()` starts a copy in about 0.4 s; `fork()` clones a running sandbox. File watching and sandbox log streaming are not available on Firecracker sandboxes yet. Volumes can grow but not shrink, and a sandbox with a volume attached cannot be forked. See the [snapshot guide](../../docs/sandboxes.md#pause-resume-snapshots-and-fork).
129
129
 
130
130
  `getHost()` returns a hostname without `https://`; the port is private, so send `sandbox.accessToken` as the `X-Lizard-Access-Token` header (or use `exposePort()`, which also returns a browser `url` carrying the token). File writes accept text or bytes (binary is sent exactly); `readBytes()` supports binary downloads.
131
131
 
package/dist/index.d.mts CHANGED
@@ -911,7 +911,10 @@ interface SandboxOpts extends ConnectionOpts {
911
911
  * - `'medium'` — 4 vCPU / 8 GB, $0.0324/h (default)
912
912
  * - `'large'` — 8 vCPU / 16 GB, $0.0648/h
913
913
  *
914
- * Measured CPU/RAM are not charged and egress is free. Ignored with {@link SandboxOpts.snapshotId}.
914
+ * CPU/RAM are included; running time includes idle time. Sandbox egress includes 2 TB per
915
+ * account over a rolling 30 days: https://lizard.build/docs/platform/limits/#sandbox-egress
916
+ * A successful pause stops compute charges; Persistent Volumes storage bills separately.
917
+ * Ignored with {@link SandboxOpts.snapshotId}.
915
918
  */
916
919
  size?: 'small' | 'medium' | 'large';
917
920
  /** Your own key/value labels for the sandbox, returned by `getInfo()` and `list()`. */
@@ -1494,12 +1497,16 @@ interface WorkspaceLimits {
1494
1497
  maxCpuVcpus: number | null;
1495
1498
  /** Memory (MB) its apps and databases may be using right now (measured). */
1496
1499
  maxMemoryMb: number | null;
1500
+ /** SSD (GB) its databases and volumes may hold (measured: data written, not sizes asked for). */
1501
+ maxDiskGb: number | null;
1497
1502
  }
1498
1503
  interface WorkspaceUsage {
1499
1504
  runningSandboxes: number;
1500
1505
  /** Measured, all regions, its apps and databases. */
1501
1506
  cpuVcpus: number;
1502
1507
  memoryMb: number;
1508
+ /** SSD (GB) its databases and volumes hold, last measurement of each. */
1509
+ diskGb: number;
1503
1510
  /** Unix ms of the oldest reading in the sum; null when nothing was measured. */
1504
1511
  measuredAt: number | null;
1505
1512
  }
@@ -1587,9 +1594,12 @@ declare class WorkspacesAPI {
1587
1594
  * not their configured limits). While at or over a cap, deploys, redeploys, restarts,
1588
1595
  * scale-ups, new databases and resumes there fail with HTTP 429 `WORKSPACE_USAGE_LIMIT`;
1589
1596
  * services already running keep running.
1597
+ * - `maxDiskGb`: the SSD its databases and volumes hold (measured, not their sizes). While at
1598
+ * or over it, new volumes, volume growth, new databases and template deploys fail with
1599
+ * HTTP 429 `WORKSPACE_USAGE_LIMIT`; data already written stays.
1590
1600
  *
1591
1601
  * ```ts
1592
- * await lizard.workspaces.setLimits(ws.id, { maxRunningSandboxes: 5, maxCpuVcpus: 2, maxMemoryMb: 4096 })
1602
+ * await lizard.workspaces.setLimits(ws.id, { maxRunningSandboxes: 5, maxCpuVcpus: 2, maxMemoryMb: 4096, maxDiskGb: 20 })
1593
1603
  * ```
1594
1604
  */
1595
1605
  setLimits(id: string, limits: Partial<WorkspaceLimits>): Promise<WorkspaceLimitsInfo>;
@@ -2274,6 +2284,7 @@ declare class LimitExceededError extends LizardError {
2274
2284
  runningSandboxes: number;
2275
2285
  cpuVcpus: number;
2276
2286
  memoryMb: number;
2287
+ diskGb?: number;
2277
2288
  measuredAt: number | null;
2278
2289
  };
2279
2290
  /** `WORKSPACE_USAGE_LIMIT`: the workspace's limits. */
@@ -2281,6 +2292,7 @@ declare class LimitExceededError extends LizardError {
2281
2292
  maxRunningSandboxes: number | null;
2282
2293
  maxCpuVcpus: number | null;
2283
2294
  maxMemoryMb: number | null;
2295
+ maxDiskGb?: number | null;
2284
2296
  };
2285
2297
  constructor(message?: string);
2286
2298
  }
package/dist/index.d.ts CHANGED
@@ -911,7 +911,10 @@ interface SandboxOpts extends ConnectionOpts {
911
911
  * - `'medium'` — 4 vCPU / 8 GB, $0.0324/h (default)
912
912
  * - `'large'` — 8 vCPU / 16 GB, $0.0648/h
913
913
  *
914
- * Measured CPU/RAM are not charged and egress is free. Ignored with {@link SandboxOpts.snapshotId}.
914
+ * CPU/RAM are included; running time includes idle time. Sandbox egress includes 2 TB per
915
+ * account over a rolling 30 days: https://lizard.build/docs/platform/limits/#sandbox-egress
916
+ * A successful pause stops compute charges; Persistent Volumes storage bills separately.
917
+ * Ignored with {@link SandboxOpts.snapshotId}.
915
918
  */
916
919
  size?: 'small' | 'medium' | 'large';
917
920
  /** Your own key/value labels for the sandbox, returned by `getInfo()` and `list()`. */
@@ -1494,12 +1497,16 @@ interface WorkspaceLimits {
1494
1497
  maxCpuVcpus: number | null;
1495
1498
  /** Memory (MB) its apps and databases may be using right now (measured). */
1496
1499
  maxMemoryMb: number | null;
1500
+ /** SSD (GB) its databases and volumes may hold (measured: data written, not sizes asked for). */
1501
+ maxDiskGb: number | null;
1497
1502
  }
1498
1503
  interface WorkspaceUsage {
1499
1504
  runningSandboxes: number;
1500
1505
  /** Measured, all regions, its apps and databases. */
1501
1506
  cpuVcpus: number;
1502
1507
  memoryMb: number;
1508
+ /** SSD (GB) its databases and volumes hold, last measurement of each. */
1509
+ diskGb: number;
1503
1510
  /** Unix ms of the oldest reading in the sum; null when nothing was measured. */
1504
1511
  measuredAt: number | null;
1505
1512
  }
@@ -1587,9 +1594,12 @@ declare class WorkspacesAPI {
1587
1594
  * not their configured limits). While at or over a cap, deploys, redeploys, restarts,
1588
1595
  * scale-ups, new databases and resumes there fail with HTTP 429 `WORKSPACE_USAGE_LIMIT`;
1589
1596
  * services already running keep running.
1597
+ * - `maxDiskGb`: the SSD its databases and volumes hold (measured, not their sizes). While at
1598
+ * or over it, new volumes, volume growth, new databases and template deploys fail with
1599
+ * HTTP 429 `WORKSPACE_USAGE_LIMIT`; data already written stays.
1590
1600
  *
1591
1601
  * ```ts
1592
- * await lizard.workspaces.setLimits(ws.id, { maxRunningSandboxes: 5, maxCpuVcpus: 2, maxMemoryMb: 4096 })
1602
+ * await lizard.workspaces.setLimits(ws.id, { maxRunningSandboxes: 5, maxCpuVcpus: 2, maxMemoryMb: 4096, maxDiskGb: 20 })
1593
1603
  * ```
1594
1604
  */
1595
1605
  setLimits(id: string, limits: Partial<WorkspaceLimits>): Promise<WorkspaceLimitsInfo>;
@@ -2274,6 +2284,7 @@ declare class LimitExceededError extends LizardError {
2274
2284
  runningSandboxes: number;
2275
2285
  cpuVcpus: number;
2276
2286
  memoryMb: number;
2287
+ diskGb?: number;
2277
2288
  measuredAt: number | null;
2278
2289
  };
2279
2290
  /** `WORKSPACE_USAGE_LIMIT`: the workspace's limits. */
@@ -2281,6 +2292,7 @@ declare class LimitExceededError extends LizardError {
2281
2292
  maxRunningSandboxes: number | null;
2282
2293
  maxCpuVcpus: number | null;
2283
2294
  maxMemoryMb: number | null;
2295
+ maxDiskGb?: number | null;
2284
2296
  };
2285
2297
  constructor(message?: string);
2286
2298
  }
package/dist/index.js CHANGED
@@ -1786,9 +1786,12 @@ var WorkspacesAPI = class {
1786
1786
  * not their configured limits). While at or over a cap, deploys, redeploys, restarts,
1787
1787
  * scale-ups, new databases and resumes there fail with HTTP 429 `WORKSPACE_USAGE_LIMIT`;
1788
1788
  * services already running keep running.
1789
+ * - `maxDiskGb`: the SSD its databases and volumes hold (measured, not their sizes). While at
1790
+ * or over it, new volumes, volume growth, new databases and template deploys fail with
1791
+ * HTTP 429 `WORKSPACE_USAGE_LIMIT`; data already written stays.
1789
1792
  *
1790
1793
  * ```ts
1791
- * await lizard.workspaces.setLimits(ws.id, { maxRunningSandboxes: 5, maxCpuVcpus: 2, maxMemoryMb: 4096 })
1794
+ * await lizard.workspaces.setLimits(ws.id, { maxRunningSandboxes: 5, maxCpuVcpus: 2, maxMemoryMb: 4096, maxDiskGb: 20 })
1792
1795
  * ```
1793
1796
  */
1794
1797
  setLimits(id, limits) {
package/dist/index.mjs CHANGED
@@ -1732,9 +1732,12 @@ var WorkspacesAPI = class {
1732
1732
  * not their configured limits). While at or over a cap, deploys, redeploys, restarts,
1733
1733
  * scale-ups, new databases and resumes there fail with HTTP 429 `WORKSPACE_USAGE_LIMIT`;
1734
1734
  * services already running keep running.
1735
+ * - `maxDiskGb`: the SSD its databases and volumes hold (measured, not their sizes). While at
1736
+ * or over it, new volumes, volume growth, new databases and template deploys fail with
1737
+ * HTTP 429 `WORKSPACE_USAGE_LIMIT`; data already written stays.
1735
1738
  *
1736
1739
  * ```ts
1737
- * await lizard.workspaces.setLimits(ws.id, { maxRunningSandboxes: 5, maxCpuVcpus: 2, maxMemoryMb: 4096 })
1740
+ * await lizard.workspaces.setLimits(ws.id, { maxRunningSandboxes: 5, maxCpuVcpus: 2, maxMemoryMb: 4096, maxDiskGb: 20 })
1738
1741
  * ```
1739
1742
  */
1740
1743
  setLimits(id, limits) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lizard-build/sdk",
3
- "version": "0.1.68",
3
+ "version": "0.1.70",
4
4
  "description": "TypeScript SDK for Lizard: Firecracker microVM sandboxes, code execution and cloud apps.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",