@lizard-build/sdk 0.1.1
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 +479 -0
- package/dist/index.d.ts +479 -0
- package/dist/index.js +611 -0
- package/dist/index.mjs +579 -0
- package/package.json +38 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
interface ConnectionOpts {
|
|
2
|
+
apiKey?: string;
|
|
3
|
+
apiUrl?: string;
|
|
4
|
+
timeoutMs?: number;
|
|
5
|
+
requestTimeoutMs?: number;
|
|
6
|
+
}
|
|
7
|
+
declare class ConnectionConfig {
|
|
8
|
+
readonly apiKey: string;
|
|
9
|
+
readonly apiUrl: string;
|
|
10
|
+
readonly timeoutMs: number;
|
|
11
|
+
constructor(opts?: ConnectionOpts);
|
|
12
|
+
get headers(): Record<string, string>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The result of a process execution inside a Lizard microVM.
|
|
17
|
+
*/
|
|
18
|
+
interface ProcessResult {
|
|
19
|
+
stdout: string;
|
|
20
|
+
stderr: string;
|
|
21
|
+
exitCode: number;
|
|
22
|
+
}
|
|
23
|
+
interface ProcessOpts {
|
|
24
|
+
timeoutMs?: number;
|
|
25
|
+
envs?: Record<string, string>;
|
|
26
|
+
user?: string;
|
|
27
|
+
workdir?: string;
|
|
28
|
+
onStdout?: (data: string) => void;
|
|
29
|
+
onStderr?: (data: string) => void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Runs processes inside a Lizard sandbox microVM.
|
|
33
|
+
*
|
|
34
|
+
* Access via `sandbox.process`.
|
|
35
|
+
*/
|
|
36
|
+
declare class Process {
|
|
37
|
+
private readonly sandboxId;
|
|
38
|
+
private readonly config;
|
|
39
|
+
constructor(sandboxId: string, config: ConnectionConfig);
|
|
40
|
+
/**
|
|
41
|
+
* Execute a command inside the microVM and wait for it to complete.
|
|
42
|
+
*
|
|
43
|
+
* The command runs in a shell inside the Lizard sandbox and returns
|
|
44
|
+
* stdout, stderr, and the exit code when it finishes.
|
|
45
|
+
*
|
|
46
|
+
* @param cmd Shell command to run inside the microVM.
|
|
47
|
+
* @param opts Optional execution options — environment variables, working
|
|
48
|
+
* directory, user, and timeout.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* const result = await sandbox.process.exec('node index.js')
|
|
53
|
+
* console.log(result.stdout)
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @example Run with a custom working directory and env vars:
|
|
57
|
+
* ```ts
|
|
58
|
+
* const result = await sandbox.process.exec('npm test', {
|
|
59
|
+
* workdir: '/app',
|
|
60
|
+
* envs: { NODE_ENV: 'test' },
|
|
61
|
+
* })
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
exec(cmd: string, opts?: ProcessOpts): Promise<ProcessResult>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface FsOpts {
|
|
68
|
+
user?: string;
|
|
69
|
+
}
|
|
70
|
+
interface FileInfo {
|
|
71
|
+
name: string;
|
|
72
|
+
path: string;
|
|
73
|
+
type: 'file' | 'dir';
|
|
74
|
+
size: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Read and write files inside a Lizard sandbox microVM.
|
|
78
|
+
*
|
|
79
|
+
* Access via `sandbox.fs`.
|
|
80
|
+
*/
|
|
81
|
+
declare class Fs {
|
|
82
|
+
private readonly sandboxId;
|
|
83
|
+
private readonly config;
|
|
84
|
+
constructor(sandboxId: string, config: ConnectionConfig);
|
|
85
|
+
/**
|
|
86
|
+
* Write a file into the microVM filesystem.
|
|
87
|
+
*
|
|
88
|
+
* Creates parent directories automatically if they don't exist.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* await sandbox.fs.write('/app/index.js', 'console.log("hello")')
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* @example Write binary data:
|
|
96
|
+
* ```ts
|
|
97
|
+
* await sandbox.fs.write('/app/data.bin', buffer)
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
write(path: string, data: string | Uint8Array, opts?: FsOpts): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* Read a file from the microVM filesystem.
|
|
103
|
+
*
|
|
104
|
+
* @returns The file contents as a UTF-8 string.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* const content = await sandbox.fs.read('/app/index.js')
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
read(path: string, opts?: FsOpts): Promise<string>;
|
|
112
|
+
/**
|
|
113
|
+
* List files and directories at the given path inside the microVM.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```ts
|
|
117
|
+
* const entries = await sandbox.fs.list('/app')
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
list(path: string, opts?: FsOpts): Promise<FileInfo[]>;
|
|
121
|
+
/**
|
|
122
|
+
* Remove a file or directory from the microVM filesystem.
|
|
123
|
+
*/
|
|
124
|
+
remove(path: string, opts?: FsOpts): Promise<void>;
|
|
125
|
+
/**
|
|
126
|
+
* Create a directory (and any missing parents) inside the microVM.
|
|
127
|
+
*/
|
|
128
|
+
makeDir(path: string, opts?: FsOpts): Promise<void>;
|
|
129
|
+
private execInternal;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
interface SandboxInfo {
|
|
133
|
+
sandboxId: string;
|
|
134
|
+
template: string;
|
|
135
|
+
startedAt: string;
|
|
136
|
+
endAt: string;
|
|
137
|
+
metadata?: Record<string, string>;
|
|
138
|
+
}
|
|
139
|
+
interface SandboxOpts extends ConnectionOpts {
|
|
140
|
+
template?: string;
|
|
141
|
+
metadata?: Record<string, string>;
|
|
142
|
+
envs?: Record<string, string>;
|
|
143
|
+
timeoutMs?: number;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Low-level HTTP client for the Lizard sandbox API.
|
|
147
|
+
* Extended by the `Sandbox` class — you typically don't use this directly.
|
|
148
|
+
*/
|
|
149
|
+
declare class SandboxClient {
|
|
150
|
+
protected static createSandbox(template: string, timeoutMs: number, opts?: SandboxOpts): Promise<{
|
|
151
|
+
sandboxId: string;
|
|
152
|
+
}>;
|
|
153
|
+
protected static killSandbox(sandboxId: string, opts?: ConnectionOpts): Promise<boolean>;
|
|
154
|
+
protected static pauseSandbox(sandboxId: string, opts?: ConnectionOpts): Promise<boolean>;
|
|
155
|
+
protected static resumeSandbox(sandboxId: string, opts?: ConnectionOpts): Promise<boolean>;
|
|
156
|
+
protected static listSandboxes(opts?: ConnectionOpts): Promise<SandboxInfo[]>;
|
|
157
|
+
protected static getSandboxInfo(sandboxId: string, opts?: ConnectionOpts): Promise<SandboxInfo>;
|
|
158
|
+
protected static setTimeoutSandbox(sandboxId: string, timeoutMs: number, opts?: ConnectionOpts): Promise<void>;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* A Lizard sandbox — an isolated Firecracker microVM that boots in milliseconds.
|
|
163
|
+
*
|
|
164
|
+
* Each sandbox is a full Linux environment with its own filesystem, network,
|
|
165
|
+
* and process namespace. Sandboxes are spun up from templates and can be
|
|
166
|
+
* paused to a snapshot, then resumed instantly — perfect for stateful AI
|
|
167
|
+
* agent sessions or ephemeral code execution.
|
|
168
|
+
*
|
|
169
|
+
* @example Basic usage:
|
|
170
|
+
* ```ts
|
|
171
|
+
* import { Sandbox } from 'lizard'
|
|
172
|
+
*
|
|
173
|
+
* const sandbox = await Sandbox.create('node22')
|
|
174
|
+
* await sandbox.fs.write('/app/index.js', 'console.log("hello world")')
|
|
175
|
+
* const result = await sandbox.process.exec('node /app/index.js')
|
|
176
|
+
* console.log(result.stdout) // "hello world"
|
|
177
|
+
* await sandbox.kill()
|
|
178
|
+
* ```
|
|
179
|
+
*
|
|
180
|
+
* @example Pause and resume a long-running session:
|
|
181
|
+
* ```ts
|
|
182
|
+
* const sandbox = await Sandbox.create('python312')
|
|
183
|
+
* await sandbox.process.exec('pip install numpy')
|
|
184
|
+
* const id = sandbox.sandboxId
|
|
185
|
+
* await sandbox.pause()
|
|
186
|
+
*
|
|
187
|
+
* // Later — resume exactly where it left off:
|
|
188
|
+
* const resumed = await Sandbox.connect(id)
|
|
189
|
+
* await resumed.process.exec('python -c "import numpy; print(numpy.__version__)"')
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
192
|
+
declare class Sandbox extends SandboxClient {
|
|
193
|
+
protected static readonly defaultTemplate: string;
|
|
194
|
+
protected static readonly defaultTimeoutMs: number;
|
|
195
|
+
/**
|
|
196
|
+
* Unique identifier of this sandbox microVM.
|
|
197
|
+
*/
|
|
198
|
+
readonly sandboxId: string;
|
|
199
|
+
/**
|
|
200
|
+
* Read and write files inside the microVM filesystem.
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```ts
|
|
204
|
+
* await sandbox.fs.write('/app/main.py', 'print("hello")')
|
|
205
|
+
* const src = await sandbox.fs.read('/app/main.py')
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
readonly fs: Fs;
|
|
209
|
+
/**
|
|
210
|
+
* Execute processes inside the microVM.
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```ts
|
|
214
|
+
* const { stdout } = await sandbox.process.exec('python main.py')
|
|
215
|
+
* ```
|
|
216
|
+
*/
|
|
217
|
+
readonly process: Process;
|
|
218
|
+
protected readonly connectionConfig: ConnectionConfig;
|
|
219
|
+
constructor(opts: {
|
|
220
|
+
sandboxId: string;
|
|
221
|
+
} & ConnectionOpts);
|
|
222
|
+
/**
|
|
223
|
+
* Create a new Lizard sandbox from the default `base` template.
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* ```ts
|
|
227
|
+
* const sandbox = await Sandbox.create()
|
|
228
|
+
* ```
|
|
229
|
+
*/
|
|
230
|
+
static create(opts?: SandboxOpts): Promise<Sandbox>;
|
|
231
|
+
/**
|
|
232
|
+
* Create a new Lizard sandbox from the specified template.
|
|
233
|
+
*
|
|
234
|
+
* Available templates include `base`, `node22`, and `python312`. Custom
|
|
235
|
+
* templates can be built and pushed via `lizard push`.
|
|
236
|
+
*
|
|
237
|
+
* @param template Name of the sandbox template to boot from.
|
|
238
|
+
*
|
|
239
|
+
* @example
|
|
240
|
+
* ```ts
|
|
241
|
+
* const sandbox = await Sandbox.create('node22')
|
|
242
|
+
* const sandbox = await Sandbox.create('python312', { timeoutMs: 10 * 60 * 1000 })
|
|
243
|
+
* ```
|
|
244
|
+
*/
|
|
245
|
+
static create(template: string, opts?: SandboxOpts): Promise<Sandbox>;
|
|
246
|
+
/**
|
|
247
|
+
* Connect to an existing sandbox by its ID.
|
|
248
|
+
*
|
|
249
|
+
* If the sandbox is currently paused, it will be automatically resumed
|
|
250
|
+
* from its last snapshot before this call returns.
|
|
251
|
+
*
|
|
252
|
+
* @example
|
|
253
|
+
* ```ts
|
|
254
|
+
* const sandbox = await Sandbox.connect('sandbox_abc123')
|
|
255
|
+
* ```
|
|
256
|
+
*/
|
|
257
|
+
static connect(sandboxId: string, opts?: ConnectionOpts): Promise<Sandbox>;
|
|
258
|
+
/**
|
|
259
|
+
* List all running sandboxes for the authenticated account.
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* ```ts
|
|
263
|
+
* const sandboxes = await Sandbox.list()
|
|
264
|
+
* ```
|
|
265
|
+
*/
|
|
266
|
+
static list(opts?: ConnectionOpts): Promise<SandboxInfo[]>;
|
|
267
|
+
/**
|
|
268
|
+
* Kill the sandbox and release its resources immediately.
|
|
269
|
+
*
|
|
270
|
+
* @returns `true` if the microVM was terminated, `false` if it was already gone.
|
|
271
|
+
*/
|
|
272
|
+
kill(opts?: ConnectionOpts): Promise<boolean>;
|
|
273
|
+
/**
|
|
274
|
+
* Snapshot and pause the sandbox microVM.
|
|
275
|
+
*
|
|
276
|
+
* The sandbox state — memory, filesystem, and running processes — is saved
|
|
277
|
+
* to a snapshot. Resume with `sandbox.resume()` or `Sandbox.connect(id)`.
|
|
278
|
+
*
|
|
279
|
+
* @returns `true` if paused successfully.
|
|
280
|
+
*/
|
|
281
|
+
pause(opts?: ConnectionOpts): Promise<boolean>;
|
|
282
|
+
/**
|
|
283
|
+
* Resume a paused sandbox from its last snapshot.
|
|
284
|
+
*
|
|
285
|
+
* @returns `true` if resumed successfully.
|
|
286
|
+
*/
|
|
287
|
+
resume(opts?: ConnectionOpts): Promise<boolean>;
|
|
288
|
+
/**
|
|
289
|
+
* Get metadata and status information about this sandbox.
|
|
290
|
+
*/
|
|
291
|
+
getInfo(opts?: ConnectionOpts): Promise<SandboxInfo>;
|
|
292
|
+
/**
|
|
293
|
+
* Extend or reduce the sandbox timeout.
|
|
294
|
+
*
|
|
295
|
+
* @param timeoutMs New timeout in milliseconds measured from now.
|
|
296
|
+
*/
|
|
297
|
+
setTimeout(timeoutMs: number, opts?: ConnectionOpts): Promise<void>;
|
|
298
|
+
/**
|
|
299
|
+
* Get the public HTTPS URL for a port exposed inside the sandbox.
|
|
300
|
+
*
|
|
301
|
+
* Useful for accessing HTTP servers started inside the microVM from your
|
|
302
|
+
* agent or tests without additional tunneling.
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* ```ts
|
|
306
|
+
* await sandbox.process.exec('npx -y serve -p 3000 &')
|
|
307
|
+
* const url = sandbox.getHost(3000)
|
|
308
|
+
* // https://{sandboxId}-3000.sandbox.lizard.run
|
|
309
|
+
* ```
|
|
310
|
+
*/
|
|
311
|
+
getHost(port: number): string;
|
|
312
|
+
private resolveOpts;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
declare class LizardError extends Error {
|
|
316
|
+
constructor(message: string);
|
|
317
|
+
}
|
|
318
|
+
declare class AuthenticationError extends LizardError {
|
|
319
|
+
constructor(message?: string);
|
|
320
|
+
}
|
|
321
|
+
declare class NotFoundError extends LizardError {
|
|
322
|
+
constructor(message?: string);
|
|
323
|
+
}
|
|
324
|
+
declare class TimeoutError extends LizardError {
|
|
325
|
+
constructor(message?: string);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/** A single output item produced during code execution. */
|
|
329
|
+
type OutputItem = {
|
|
330
|
+
type: 'stdout';
|
|
331
|
+
data: string;
|
|
332
|
+
ts: number;
|
|
333
|
+
} | {
|
|
334
|
+
type: 'stderr';
|
|
335
|
+
data: string;
|
|
336
|
+
ts: number;
|
|
337
|
+
} | {
|
|
338
|
+
type: 'result';
|
|
339
|
+
mime: string;
|
|
340
|
+
data: string;
|
|
341
|
+
} | {
|
|
342
|
+
type: 'error';
|
|
343
|
+
name: string;
|
|
344
|
+
message: string;
|
|
345
|
+
traceback: string;
|
|
346
|
+
};
|
|
347
|
+
/** Error thrown when executed code raises an exception. */
|
|
348
|
+
declare class ExecutionError extends Error {
|
|
349
|
+
readonly name: string;
|
|
350
|
+
readonly traceback: string;
|
|
351
|
+
constructor(name: string, message: string, traceback: string);
|
|
352
|
+
}
|
|
353
|
+
/** Full result of a runCode() call. */
|
|
354
|
+
declare class Execution {
|
|
355
|
+
/** All stdout text, concatenated. */
|
|
356
|
+
stdout: string;
|
|
357
|
+
/** All stderr text, concatenated. */
|
|
358
|
+
stderr: string;
|
|
359
|
+
/** Rich output items (images, JSON, HTML, plain values). */
|
|
360
|
+
results: OutputItem[];
|
|
361
|
+
/** Execution error if the code threw an exception. */
|
|
362
|
+
error?: ExecutionError;
|
|
363
|
+
/** Monotonically increasing counter for this context. */
|
|
364
|
+
executionCount: number;
|
|
365
|
+
get success(): boolean;
|
|
366
|
+
get text(): string;
|
|
367
|
+
}
|
|
368
|
+
/** An isolated stateful execution context. */
|
|
369
|
+
type CodeContext = {
|
|
370
|
+
id: string;
|
|
371
|
+
language: string;
|
|
372
|
+
cwd: string;
|
|
373
|
+
};
|
|
374
|
+
type RunCodeLanguage = 'python' | 'javascript' | 'bash' | (string & Record<never, never>);
|
|
375
|
+
interface RunCodeOpts {
|
|
376
|
+
/** Language to run in. Defaults to python. */
|
|
377
|
+
language?: RunCodeLanguage;
|
|
378
|
+
/** Use a specific context instead of the per-language default. */
|
|
379
|
+
context?: CodeContext;
|
|
380
|
+
/** Extra environment variables available to the code. */
|
|
381
|
+
envs?: Record<string, string>;
|
|
382
|
+
/** Max time to wait for the code to finish, in ms. Default: 60_000. */
|
|
383
|
+
timeoutMs?: number;
|
|
384
|
+
onStdout?: (data: string) => void;
|
|
385
|
+
onStderr?: (data: string) => void;
|
|
386
|
+
onResult?: (item: OutputItem) => void;
|
|
387
|
+
onError?: (err: ExecutionError) => void;
|
|
388
|
+
}
|
|
389
|
+
interface CreateContextOpts {
|
|
390
|
+
language?: RunCodeLanguage;
|
|
391
|
+
cwd?: string;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* A Lizard sandbox with built-in stateful code execution.
|
|
396
|
+
*
|
|
397
|
+
* Extends the base Sandbox with `runCode()` — executes code in a persistent
|
|
398
|
+
* kernel so variables and imports survive between calls.
|
|
399
|
+
*
|
|
400
|
+
* Supports Python, JavaScript (Node.js), and Bash out of the box.
|
|
401
|
+
*
|
|
402
|
+
* @example
|
|
403
|
+
* ```ts
|
|
404
|
+
* import { CodeSandbox } from 'lizard/code-interpreter'
|
|
405
|
+
*
|
|
406
|
+
* const sandbox = await CodeSandbox.create()
|
|
407
|
+
*
|
|
408
|
+
* await sandbox.runCode('x = 42')
|
|
409
|
+
* const result = await sandbox.runCode('print(x * 2)')
|
|
410
|
+
* console.log(result.stdout) // "84\n"
|
|
411
|
+
*
|
|
412
|
+
* await sandbox.kill()
|
|
413
|
+
* ```
|
|
414
|
+
*
|
|
415
|
+
* @example Run JavaScript:
|
|
416
|
+
* ```ts
|
|
417
|
+
* const result = await sandbox.runCode('1 + 1', { language: 'javascript' })
|
|
418
|
+
* console.log(result.results[0].data) // "2"
|
|
419
|
+
* ```
|
|
420
|
+
*/
|
|
421
|
+
declare class CodeSandbox extends Sandbox {
|
|
422
|
+
protected static readonly defaultTemplate = "code-interpreter-v1";
|
|
423
|
+
private get serverUrl();
|
|
424
|
+
/**
|
|
425
|
+
* Execute code in a persistent kernel.
|
|
426
|
+
*
|
|
427
|
+
* Variables, imports, and function definitions from previous calls are
|
|
428
|
+
* available in subsequent calls within the same context.
|
|
429
|
+
*
|
|
430
|
+
* @param code Source code to run.
|
|
431
|
+
* @param opts Language, context, env vars, timeout, and streaming callbacks.
|
|
432
|
+
*
|
|
433
|
+
* @returns Execution result with stdout, stderr, results, and any error.
|
|
434
|
+
*
|
|
435
|
+
* @throws {ExecutionError} if you pass neither language nor context and no
|
|
436
|
+
* default context exists — which cannot happen in normal usage.
|
|
437
|
+
*
|
|
438
|
+
* @example
|
|
439
|
+
* ```ts
|
|
440
|
+
* const result = await sandbox.runCode(`
|
|
441
|
+
* import math
|
|
442
|
+
* print(math.sqrt(144))
|
|
443
|
+
* `)
|
|
444
|
+
* console.log(result.stdout) // "12.0\n"
|
|
445
|
+
* ```
|
|
446
|
+
*/
|
|
447
|
+
runCode(code: string, opts?: RunCodeOpts): Promise<Execution>;
|
|
448
|
+
/**
|
|
449
|
+
* Create a new isolated execution context.
|
|
450
|
+
*
|
|
451
|
+
* Each context maintains its own variable namespace and process state.
|
|
452
|
+
* Useful for running multiple independent sessions in the same sandbox.
|
|
453
|
+
*
|
|
454
|
+
* @example
|
|
455
|
+
* ```ts
|
|
456
|
+
* const ctx = await sandbox.createContext({ language: 'python' })
|
|
457
|
+
* await sandbox.runCode('x = 10', { context: ctx })
|
|
458
|
+
* await sandbox.runCode('print(x)', { context: ctx }) // prints 10
|
|
459
|
+
* ```
|
|
460
|
+
*/
|
|
461
|
+
createContext(opts?: CreateContextOpts): Promise<CodeContext>;
|
|
462
|
+
/**
|
|
463
|
+
* List all active execution contexts in this sandbox.
|
|
464
|
+
*/
|
|
465
|
+
listContexts(): Promise<CodeContext[]>;
|
|
466
|
+
/**
|
|
467
|
+
* Delete an execution context and free its resources.
|
|
468
|
+
*/
|
|
469
|
+
deleteContext(context: CodeContext | string): Promise<void>;
|
|
470
|
+
/**
|
|
471
|
+
* Restart a context, clearing all variables and state.
|
|
472
|
+
*/
|
|
473
|
+
restartContext(context: CodeContext | string): Promise<void>;
|
|
474
|
+
static create(opts?: SandboxOpts): Promise<CodeSandbox>;
|
|
475
|
+
static create(template: string, opts?: SandboxOpts): Promise<CodeSandbox>;
|
|
476
|
+
static connect(sandboxId: string, opts?: ConnectionOpts): Promise<CodeSandbox>;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
export { AuthenticationError, type CodeContext, CodeSandbox, type ConnectionOpts, type CreateContextOpts, Execution, ExecutionError, type FileInfo, type FsOpts, LizardError, NotFoundError, type ProcessOpts, type ProcessResult, type RunCodeLanguage, type RunCodeOpts, Sandbox, type SandboxInfo, type SandboxOpts, TimeoutError };
|