@lizard-build/sdk 0.1.83 → 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 +15 -6
- package/package.json +1 -1
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 {
|
|
109
|
+
import { Lizard } from '@lizard-build/sdk'
|
|
110
110
|
|
|
111
|
-
const
|
|
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 {
|
|
132
|
+
import { Lizard } from '@lizard-build/sdk'
|
|
132
133
|
|
|
133
|
-
const
|
|
134
|
-
|
|
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/package.json
CHANGED