withruntime 0.11.2 → 0.14.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/BLAXEL.md +2 -2
- package/COMPATIBILITY.md +74 -9
- package/DAYTONA.md +33 -5
- package/E2B.md +85 -24
- package/README.md +11 -10
- package/README.src.md +10 -9
- package/VERCEL.md +43 -5
- package/compatibility-lock.json +58 -49
- package/dist/billing-cli.d.ts +1 -1
- package/dist/billing-cli.js +85 -5
- package/dist/blaxel/errors.d.ts +14 -0
- package/dist/blaxel/errors.js +29 -0
- package/dist/blaxel/index.d.ts +2 -2
- package/dist/blaxel/index.js +4 -4
- package/dist/blaxel/interpreter.d.ts +2 -5
- package/dist/blaxel/sandbox.d.ts +15 -6
- package/dist/blaxel/sandbox.js +64 -8
- package/dist/blaxel/snapshot.d.ts +4 -0
- package/dist/blaxel/snapshot.js +4 -0
- package/dist/cli/logs.d.ts +21 -0
- package/dist/cli/logs.js +188 -0
- package/dist/cli-extras.d.ts +3 -3
- package/dist/cli-extras.js +17 -12
- package/dist/cli-words.d.ts +10 -1
- package/dist/cli-words.js +18 -0
- package/dist/cli.d.ts +22 -3
- package/dist/cli.js +647 -273
- package/dist/client.d.ts +2 -4
- package/dist/client.js +27 -11
- package/dist/cloudflare/errors.d.ts +143 -0
- package/dist/cloudflare/errors.js +167 -0
- package/dist/cloudflare/index.d.ts +175 -6
- package/dist/cloudflare/index.js +416 -26
- package/dist/cloudflare/interpreter.d.ts +119 -0
- package/dist/cloudflare/interpreter.js +223 -0
- package/dist/cloudflare/streams.d.ts +38 -0
- package/dist/cloudflare/streams.js +145 -0
- package/dist/cloudflare/watch.d.ts +9 -0
- package/dist/cloudflare/watch.js +24 -0
- package/dist/codesandbox/index.d.ts +216 -28
- package/dist/codesandbox/index.js +478 -78
- package/dist/compat/core.d.ts +18 -0
- package/dist/compat/core.js +29 -0
- package/dist/compat/files.d.ts +1 -0
- package/dist/compat/files.js +25 -5
- package/dist/credentials.d.ts +3 -0
- package/dist/credentials.js +15 -0
- package/dist/daytona/computer-use.d.ts +13 -4
- package/dist/daytona/computer-use.js +66 -8
- package/dist/daytona/daytona.d.ts +7 -1
- package/dist/daytona/daytona.js +31 -4
- package/dist/daytona/errors.d.ts +11 -0
- package/dist/daytona/errors.js +18 -0
- package/dist/daytona/filesystem.js +2 -1
- package/dist/daytona/image.d.ts +13 -9
- package/dist/daytona/image.js +18 -12
- package/dist/daytona/index.d.ts +1 -1
- package/dist/daytona/sandbox.d.ts +8 -2
- package/dist/daytona/sandbox.js +16 -2
- package/dist/domains/index.d.ts +9 -0
- package/dist/domains/index.js +10 -0
- package/dist/e2b/commands.d.ts +1 -1
- package/dist/e2b/commands.js +6 -7
- package/dist/e2b/errors.d.ts +17 -0
- package/dist/e2b/errors.js +40 -1
- package/dist/e2b/index.d.ts +2 -2
- package/dist/e2b/index.js +1 -1
- package/dist/e2b/sandbox.d.ts +28 -22
- package/dist/e2b/sandbox.js +34 -8
- package/dist/e2b/unsupported.js +1 -1
- package/dist/errors.d.ts +11 -2
- package/dist/errors.js +17 -5
- package/dist/freestyle/index.d.ts +285 -37
- package/dist/freestyle/index.js +656 -144
- package/dist/identity.d.ts +3 -0
- package/dist/identity.js +27 -0
- package/dist/images/index.d.ts +9 -0
- package/dist/images/index.js +10 -0
- package/dist/index.d.ts +3 -1
- package/dist/ips/index.d.ts +9 -0
- package/dist/ips/index.js +10 -0
- package/dist/jobs/index.d.ts +9 -0
- package/dist/jobs/index.js +10 -0
- package/dist/keys.js +2 -0
- package/dist/login.js +2 -0
- package/dist/machine.d.ts +27 -4
- package/dist/machine.js +46 -14
- package/dist/mcp.js +144 -20
- package/dist/modal/index.d.ts +339 -61
- package/dist/modal/index.js +781 -121
- package/dist/network-cli.d.ts +3 -1
- package/dist/network-cli.js +78 -36
- package/dist/networks/index.d.ts +11 -0
- package/dist/networks/index.js +10 -0
- package/dist/ports/index.d.ts +9 -0
- package/dist/ports/index.js +10 -0
- package/dist/product-names.d.ts +52 -0
- package/dist/product-names.js +164 -0
- package/dist/product-renames.d.ts +103 -0
- package/dist/product-renames.js +189 -0
- package/dist/products/api-keys.d.ts +73 -0
- package/dist/products/api-keys.js +23 -0
- package/dist/products/apps.d.ts +157 -0
- package/dist/products/apps.js +60 -0
- package/dist/products/balancers.d.ts +87 -0
- package/dist/products/balancers.js +8 -0
- package/dist/products/billing.d.ts +41 -0
- package/dist/products/billing.js +13 -0
- package/dist/products/browser.d.ts +10 -0
- package/dist/products/browsers.d.ts +71 -0
- package/dist/products/browsers.js +102 -0
- package/dist/products/builds.d.ts +156 -0
- package/dist/products/builds.js +227 -0
- package/dist/products/index.d.ts +5 -16
- package/dist/products/index.js +5 -14
- package/dist/products/jobs.d.ts +19 -2
- package/dist/products/jobs.js +28 -11
- package/dist/products/logs.d.ts +245 -0
- package/dist/products/logs.js +274 -0
- package/dist/products/network-products.d.ts +38 -7
- package/dist/products/network-products.js +31 -18
- package/dist/products/observability.d.ts +8 -2
- package/dist/products/private-network.js +1 -1
- package/dist/products/queues.d.ts +149 -0
- package/dist/products/queues.js +213 -0
- package/dist/products/referrals.d.ts +21 -7
- package/dist/products/referrals.js +3 -3
- package/dist/products/resources.d.ts +54 -0
- package/dist/products/resources.js +122 -0
- package/dist/products/secrets.d.ts +29 -3
- package/dist/products/secrets.js +47 -18
- package/dist/products/signed-requests.d.ts +21 -0
- package/dist/products/signed-requests.js +11 -0
- package/dist/products/streams.d.ts +73 -0
- package/dist/products/streams.js +17 -0
- package/dist/products/switching.d.ts +35 -7
- package/dist/products/switching.js +4 -3
- package/dist/products/volumes.d.ts +6 -0
- package/dist/record-cli.d.ts +23 -0
- package/dist/record-cli.js +308 -0
- package/dist/renamed-products.d.ts +38 -0
- package/dist/renamed-products.js +34 -0
- package/dist/runloop/index.d.ts +9 -2
- package/dist/runloop/index.js +29 -8
- package/dist/runloop/sdk.d.ts +131 -0
- package/dist/runloop/sdk.js +167 -0
- package/dist/sandbox.d.ts +7 -2
- package/dist/sandbox.js +41 -11
- package/dist/sandboxes/index.d.ts +11 -0
- package/dist/sandboxes/index.js +12 -0
- package/dist/snapshots/index.d.ts +9 -0
- package/dist/snapshots/index.js +11 -0
- package/dist/snapshots.d.ts +7 -4
- package/dist/sprites/index.d.ts +343 -31
- package/dist/sprites/index.js +866 -84
- package/dist/ssh.d.ts +1 -1
- package/dist/ssh.js +11 -11
- package/dist/terminal.d.ts +24 -0
- package/dist/terminal.js +32 -0
- package/dist/transport.d.ts +18 -1
- package/dist/transport.js +80 -6
- package/dist/tunnel.js +1 -1
- package/dist/types.d.ts +71 -4
- package/dist/vercel/sandbox.d.ts +1 -1
- package/dist/vercel/sandbox.js +6 -4
- package/dist/vercel/snapshot.js +10 -2
- package/dist/volumes/index.d.ts +9 -0
- package/dist/volumes/index.js +10 -0
- package/dist/wallet.d.ts +4 -1
- package/dist/wallet.js +2 -1
- package/package.json +48 -14
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { Runtime } from "../client.js";
|
|
2
2
|
import type { Process as NativeProcess, Sandbox as NativeSandbox } from "../sandbox.js";
|
|
3
|
-
import { CompatibilityError, type ClientOptions } from "../compat/core.js";
|
|
3
|
+
import { CompatibilityError, type Refused, type RefusedAsync, type ClientOptions } from "../compat/core.js";
|
|
4
|
+
import { type CodeContext, type CreateContextOptions, type RunCodeOptions } from "./interpreter.js";
|
|
4
5
|
export { CompatibilityError };
|
|
6
|
+
export * from "./errors.js";
|
|
7
|
+
export { CodeInterpreter } from "./interpreter.js";
|
|
8
|
+
export type { CodeContext, CreateContextOptions, ExecutionError, OutputMessage, RunCodeOptions, } from "./interpreter.js";
|
|
9
|
+
export { collectFile, isExecResult, isProcess, isProcessStatus, parseSSEStream, streamFile, } from "./streams.js";
|
|
10
|
+
export type { FileChunk, FileMetadata, FileStreamEvent } from "./streams.js";
|
|
5
11
|
export declare class SandboxSecurityError extends Error {
|
|
6
12
|
readonly code: string;
|
|
7
13
|
constructor(message: string, code: string);
|
|
@@ -23,6 +29,56 @@ export interface ExecOptions {
|
|
|
23
29
|
onComplete?: (result: ExecResult) => void;
|
|
24
30
|
onError?: (error: Error) => void;
|
|
25
31
|
signal?: AbortSignal;
|
|
32
|
+
/** Cloudflare's log level for the command; it changes nothing else. */
|
|
33
|
+
origin?: "user" | "internal";
|
|
34
|
+
}
|
|
35
|
+
export interface StreamOptions extends Omit<ExecOptions, "stream" | "onOutput" | "onComplete" | "onError"> {
|
|
36
|
+
sessionId?: string;
|
|
37
|
+
/** Accepted as Cloudflare accepts it: its SDK does not use it either. */
|
|
38
|
+
bufferSize?: number;
|
|
39
|
+
}
|
|
40
|
+
export interface WatchOptions {
|
|
41
|
+
recursive?: boolean;
|
|
42
|
+
include?: string[];
|
|
43
|
+
exclude?: string[];
|
|
44
|
+
sessionId?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface CheckChangesOptions extends WatchOptions {
|
|
47
|
+
since?: string;
|
|
48
|
+
}
|
|
49
|
+
export type CheckChangesResult = {
|
|
50
|
+
success: true;
|
|
51
|
+
status: "unchanged" | "changed";
|
|
52
|
+
version: string;
|
|
53
|
+
timestamp: string;
|
|
54
|
+
} | {
|
|
55
|
+
success: true;
|
|
56
|
+
status: "resync";
|
|
57
|
+
reason: "expired" | "restarted";
|
|
58
|
+
version: string;
|
|
59
|
+
timestamp: string;
|
|
60
|
+
};
|
|
61
|
+
export interface GitCheckoutResult {
|
|
62
|
+
success: boolean;
|
|
63
|
+
repoUrl: string;
|
|
64
|
+
branch: string;
|
|
65
|
+
targetDir: string;
|
|
66
|
+
timestamp: string;
|
|
67
|
+
exitCode?: number;
|
|
68
|
+
}
|
|
69
|
+
export type BucketProvider = "r2" | "s3" | "gcs";
|
|
70
|
+
export interface MountBucketOptions {
|
|
71
|
+
endpoint?: string;
|
|
72
|
+
provider?: BucketProvider;
|
|
73
|
+
credentials?: {
|
|
74
|
+
accessKeyId: string;
|
|
75
|
+
secretAccessKey: string;
|
|
76
|
+
};
|
|
77
|
+
readOnly?: boolean;
|
|
78
|
+
s3fsOptions?: string[];
|
|
79
|
+
prefix?: string;
|
|
80
|
+
credentialProxy?: boolean;
|
|
81
|
+
localBucket?: boolean;
|
|
26
82
|
}
|
|
27
83
|
export interface ExecResult {
|
|
28
84
|
success: boolean;
|
|
@@ -65,6 +121,8 @@ export interface ProcessOptions {
|
|
|
65
121
|
cwd?: string;
|
|
66
122
|
encoding?: string;
|
|
67
123
|
sessionId?: string;
|
|
124
|
+
processId?: string;
|
|
125
|
+
autoCleanup?: boolean;
|
|
68
126
|
onOutput?: (stream: "stdout" | "stderr", data: string) => void;
|
|
69
127
|
onExit?: (code: number | null) => void;
|
|
70
128
|
onStart?: (process: Process) => void;
|
|
@@ -75,12 +133,39 @@ export declare function validateSandboxConfiguration(options: Pick<SandboxOption
|
|
|
75
133
|
* through options.runtime in Workers; Node also supports RUNTIME_API_KEY/login. */
|
|
76
134
|
export declare function getSandbox(namespace: unknown, id: string, options?: SandboxOptions): Sandbox;
|
|
77
135
|
export declare class Sandbox {
|
|
136
|
+
#private;
|
|
78
137
|
readonly runtime: Runtime;
|
|
79
138
|
private readonly options;
|
|
80
139
|
private pending?;
|
|
81
140
|
private existing?;
|
|
82
141
|
readonly id: string;
|
|
142
|
+
/** The port Cloudflare's container serves on; Runtime previews any port. */
|
|
143
|
+
readonly defaultPort = 3000;
|
|
144
|
+
/** What setEnvVars gave this handle; the sandbox keeps them for every command. */
|
|
145
|
+
envVars: Record<string, string>;
|
|
146
|
+
readonly client: Refused;
|
|
147
|
+
readonly tunnels: Refused;
|
|
148
|
+
readonly callTunnels: RefusedAsync;
|
|
149
|
+
readonly setSandboxName: RefusedAsync;
|
|
150
|
+
readonly setContainerTimeouts: RefusedAsync;
|
|
151
|
+
readonly setTransport: RefusedAsync;
|
|
152
|
+
readonly onStart: RefusedAsync;
|
|
153
|
+
readonly onStop: RefusedAsync;
|
|
154
|
+
readonly onError: Refused;
|
|
155
|
+
readonly onActivityExpired: RefusedAsync;
|
|
156
|
+
readonly fetch: RefusedAsync;
|
|
157
|
+
readonly containerFetch: RefusedAsync;
|
|
158
|
+
readonly wsConnect: RefusedAsync;
|
|
159
|
+
readonly getContainerPlacementId: RefusedAsync;
|
|
160
|
+
readonly validatePortToken: RefusedAsync;
|
|
161
|
+
readonly createBackup: RefusedAsync;
|
|
162
|
+
readonly restoreBackup: RefusedAsync;
|
|
83
163
|
constructor(runtime: Runtime, id: string, options?: SandboxOptions);
|
|
164
|
+
get sleepAfter(): string | number;
|
|
165
|
+
setSleepAfter(sleepAfter: string | number): Promise<void>;
|
|
166
|
+
setKeepAlive(keepAlive: boolean): Promise<void>;
|
|
167
|
+
/** Replaces the sandbox's labels, as Cloudflare's does. */
|
|
168
|
+
setLabels(labels: Record<string, string>): Promise<void>;
|
|
84
169
|
configure(options: Pick<SandboxOptions, "sleepAfter" | "keepAlive">): Promise<void>;
|
|
85
170
|
/** Only a successfully initialized native handle can supply a recovery id. */
|
|
86
171
|
existingNativeId(): string | undefined;
|
|
@@ -91,8 +176,13 @@ export declare class Sandbox {
|
|
|
91
176
|
}>;
|
|
92
177
|
native(): Promise<NativeSandbox>;
|
|
93
178
|
private session;
|
|
179
|
+
/** A session by id: its saved settings, or a fresh session of that id, as
|
|
180
|
+
* Cloudflare starts one again after its shell ended. */
|
|
181
|
+
private sessionFor;
|
|
94
182
|
exec(command: string, options?: ExecOptions): Promise<ExecResult>;
|
|
95
|
-
|
|
183
|
+
execWithSessionToken(command: string, sessionId: string, options?: ExecOptions): Promise<ExecResult>;
|
|
184
|
+
execStream(command: string, options?: StreamOptions): Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>;
|
|
185
|
+
execStreamWithSessionToken(command: string, sessionId: string, options?: StreamOptions): Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>;
|
|
96
186
|
startProcess(command: string, options?: ProcessOptions): Promise<Process>;
|
|
97
187
|
createSession(options?: SessionOptions): Promise<ExecutionSession>;
|
|
98
188
|
getSession(id: string): Promise<ExecutionSession>;
|
|
@@ -103,8 +193,11 @@ export declare class Sandbox {
|
|
|
103
193
|
}>;
|
|
104
194
|
destroy(): Promise<void>;
|
|
105
195
|
setEnvVars(env: Record<string, string | undefined>): Promise<void>;
|
|
196
|
+
/** Stops the sandbox; its files stay, and the next call starts it again. */
|
|
197
|
+
stop(signal?: unknown): Promise<void>;
|
|
106
198
|
writeFile(path: string, content: string | ReadableStream<Uint8Array>, options?: {
|
|
107
199
|
encoding?: string;
|
|
200
|
+
sessionId?: string;
|
|
108
201
|
}): Promise<{
|
|
109
202
|
success: boolean;
|
|
110
203
|
path: string;
|
|
@@ -113,29 +206,38 @@ export declare class Sandbox {
|
|
|
113
206
|
}>;
|
|
114
207
|
readFile(path: string, options: {
|
|
115
208
|
encoding: "none";
|
|
209
|
+
sessionId?: string;
|
|
116
210
|
}): Promise<ReadFileStreamResult>;
|
|
117
211
|
readFile(path: string, options?: {
|
|
118
212
|
encoding?: "utf8" | "utf-8" | "base64";
|
|
213
|
+
sessionId?: string;
|
|
119
214
|
}): Promise<ReadFileResult>;
|
|
215
|
+
/** The file as Cloudflare streams it: `data:` lines of a metadata event,
|
|
216
|
+
* chunks (base64 for a binary file) and a complete event; read it with
|
|
217
|
+
* streamFile() or collectFile(). */
|
|
218
|
+
readFileStream(path: string, options?: {
|
|
219
|
+
sessionId?: string;
|
|
220
|
+
}): Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>;
|
|
120
221
|
mkdir(path: string, options?: {
|
|
121
222
|
recursive?: boolean;
|
|
223
|
+
sessionId?: string;
|
|
122
224
|
}): Promise<{
|
|
123
225
|
success: boolean;
|
|
124
226
|
path: string;
|
|
125
227
|
timestamp: string;
|
|
126
228
|
}>;
|
|
127
|
-
deleteFile(path: string): Promise<{
|
|
229
|
+
deleteFile(path: string, sessionId?: string): Promise<{
|
|
128
230
|
success: boolean;
|
|
129
231
|
path: string;
|
|
130
232
|
timestamp: string;
|
|
131
233
|
}>;
|
|
132
|
-
renameFile(from: string, to: string): Promise<{
|
|
234
|
+
renameFile(from: string, to: string, sessionId?: string): Promise<{
|
|
133
235
|
success: boolean;
|
|
134
236
|
path: string;
|
|
135
237
|
newPath: string;
|
|
136
238
|
timestamp: string;
|
|
137
239
|
}>;
|
|
138
|
-
moveFile(from: string, to: string): Promise<{
|
|
240
|
+
moveFile(from: string, to: string, sessionId?: string): Promise<{
|
|
139
241
|
success: boolean;
|
|
140
242
|
path: string;
|
|
141
243
|
newPath: string;
|
|
@@ -144,6 +246,7 @@ export declare class Sandbox {
|
|
|
144
246
|
listFiles(path: string, options?: {
|
|
145
247
|
recursive?: boolean;
|
|
146
248
|
includeHidden?: boolean;
|
|
249
|
+
sessionId?: string;
|
|
147
250
|
}): Promise<{
|
|
148
251
|
success: boolean;
|
|
149
252
|
path: string;
|
|
@@ -170,7 +273,7 @@ export declare class Sandbox {
|
|
|
170
273
|
count: number;
|
|
171
274
|
timestamp: string;
|
|
172
275
|
}>;
|
|
173
|
-
exists(path: string): Promise<{
|
|
276
|
+
exists(path: string, sessionId?: string): Promise<{
|
|
174
277
|
success: boolean;
|
|
175
278
|
path: string;
|
|
176
279
|
exists: boolean;
|
|
@@ -195,7 +298,70 @@ export declare class Sandbox {
|
|
|
195
298
|
name: string | undefined;
|
|
196
299
|
}>;
|
|
197
300
|
unexposePort(port: number): Promise<void>;
|
|
301
|
+
/** Runtime's previews have their own addresses: hostname is not used to build them. */
|
|
302
|
+
getExposedPorts(_hostname: string): Promise<{
|
|
303
|
+
url: string;
|
|
304
|
+
port: number;
|
|
305
|
+
status: "active";
|
|
306
|
+
}[]>;
|
|
307
|
+
isPortExposed(port: number): Promise<boolean>;
|
|
308
|
+
/** Cloudflare's returns 0 too: a process's record outlives it on both. */
|
|
309
|
+
cleanupCompletedProcesses(_sessionId?: string): Promise<number>;
|
|
310
|
+
/** The process's output as `data:` lines of stdout, stderr and exit events. */
|
|
311
|
+
streamProcessLogs(processId: string, options?: {
|
|
312
|
+
signal?: AbortSignal;
|
|
313
|
+
}): Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>;
|
|
314
|
+
/** Clones with git in the sandbox, as Cloudflare's container does. */
|
|
315
|
+
gitCheckout(repoUrl: string, options?: {
|
|
316
|
+
branch?: string;
|
|
317
|
+
targetDir?: string;
|
|
318
|
+
sessionId?: string;
|
|
319
|
+
depth?: number;
|
|
320
|
+
cloneTimeoutMs?: number;
|
|
321
|
+
}): Promise<GitCheckoutResult>;
|
|
322
|
+
/** Changes under a directory as `data:` lines of Cloudflare's watch events,
|
|
323
|
+
* once the watch is established, until the stream is cancelled. */
|
|
324
|
+
watch(path: string, options?: WatchOptions): Promise<ReadableStream<Uint8Array>>;
|
|
325
|
+
/** Whether anything under a path changed since a version this returned:
|
|
326
|
+
* the version is a digest of every entry's path, size, time and mode, tied
|
|
327
|
+
* to this boot of the sandbox. */
|
|
328
|
+
checkChanges(path: string, options?: CheckChangesOptions): Promise<CheckChangesResult>;
|
|
329
|
+
/** Mounts an S3, R2 or Google Cloud Storage bucket with Runtime's mounts. A
|
|
330
|
+
* private bucket needs a Runtime secret: store its keys with
|
|
331
|
+
* runtime.secrets.set and mount with sandbox.mounts.add({ secret }). */
|
|
332
|
+
mountBucket(bucket: string, mountPath: string, options: MountBucketOptions): Promise<void>;
|
|
333
|
+
unmountBucket(mountPath: string): Promise<void>;
|
|
334
|
+
createCodeContext(options?: CreateContextOptions): Promise<CodeContext>;
|
|
335
|
+
runCode(code: string, options?: RunCodeOptions): Promise<{
|
|
336
|
+
code: string;
|
|
337
|
+
logs: {
|
|
338
|
+
stdout: string[];
|
|
339
|
+
stderr: string[];
|
|
340
|
+
};
|
|
341
|
+
error: import("./interpreter.js").ExecutionError | undefined;
|
|
342
|
+
executionCount: number | undefined;
|
|
343
|
+
results: {
|
|
344
|
+
text: string | undefined;
|
|
345
|
+
html: string | undefined;
|
|
346
|
+
png: string | undefined;
|
|
347
|
+
jpeg: string | undefined;
|
|
348
|
+
svg: string | undefined;
|
|
349
|
+
latex: string | undefined;
|
|
350
|
+
markdown: string | undefined;
|
|
351
|
+
javascript: string | undefined;
|
|
352
|
+
json: unknown;
|
|
353
|
+
chart: undefined;
|
|
354
|
+
data: Record<string, unknown> | undefined;
|
|
355
|
+
}[];
|
|
356
|
+
}>;
|
|
357
|
+
runCodeStream(code: string, options?: RunCodeOptions): Promise<ReadableStream<any>>;
|
|
358
|
+
listCodeContexts(): Promise<CodeContext[]>;
|
|
359
|
+
deleteCodeContext(contextId: string): Promise<void>;
|
|
198
360
|
}
|
|
361
|
+
/** Cloudflare's Worker-side terminal proxy has no Runtime counterpart. */
|
|
362
|
+
export declare function proxyTerminal(..._args: unknown[]): Promise<Response>;
|
|
363
|
+
/** Runtime previews are served by Runtime, not through your Worker. */
|
|
364
|
+
export declare function proxyToSandbox(..._args: unknown[]): Promise<Response | null>;
|
|
199
365
|
export declare class ExecutionSession {
|
|
200
366
|
private readonly sandbox;
|
|
201
367
|
readonly id: string;
|
|
@@ -205,6 +371,8 @@ export declare class ExecutionSession {
|
|
|
205
371
|
exec(command: string, options?: ExecOptions): Promise<ExecResult>;
|
|
206
372
|
execStream(command: string, options?: ExecOptions): Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>;
|
|
207
373
|
startProcess(command: string, options?: ProcessOptions): Promise<Process>;
|
|
374
|
+
/** A path as this session sees it: relative paths from its working directory. */
|
|
375
|
+
resolve(path: string): Promise<string>;
|
|
208
376
|
private path;
|
|
209
377
|
writeFile(path: string, content: string | ReadableStream<Uint8Array>, options?: {
|
|
210
378
|
encoding?: string;
|
|
@@ -276,6 +444,7 @@ export declare class ExecutionSession {
|
|
|
276
444
|
setEnvVars(env: Record<string, string | undefined>): Promise<void>;
|
|
277
445
|
}
|
|
278
446
|
export declare class Process {
|
|
447
|
+
#private;
|
|
279
448
|
private readonly sandbox;
|
|
280
449
|
private readonly native;
|
|
281
450
|
readonly sessionId?: string | undefined;
|