withruntime 0.8.4 → 0.9.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/COMPATIBILITY.md +145 -0
- package/E2B.md +23 -13
- package/README.md +8 -5
- package/README.src.md +8 -5
- package/compatibility-lock.json +281 -0
- package/dist/ai-harness/index.js +2 -2
- package/dist/api-defaults.d.ts +17 -0
- package/dist/api-defaults.js +22 -0
- package/dist/blaxel/preview.d.ts +1 -1
- package/dist/blaxel/preview.js +1 -1
- package/dist/blaxel/process.d.ts +1 -1
- package/dist/blaxel/process.js +11 -2
- package/dist/cli-words.d.ts +27 -0
- package/dist/cli-words.js +135 -0
- package/dist/cli.js +162 -31
- package/dist/client.d.ts +4 -1
- package/dist/client.js +8 -2
- package/dist/cloudflare/index.d.ts +294 -0
- package/dist/cloudflare/index.js +554 -0
- package/dist/cloudflare/worker.d.ts +415 -0
- package/dist/cloudflare/worker.js +297 -0
- package/dist/codesandbox/guest-service.d.ts +31 -0
- package/dist/codesandbox/guest-service.js +453 -0
- package/dist/codesandbox/index.d.ts +386 -0
- package/dist/codesandbox/index.js +1313 -0
- package/dist/compat/core.d.ts +39 -0
- package/dist/compat/core.js +199 -0
- package/dist/compat/files.d.ts +26 -0
- package/dist/compat/files.js +115 -0
- package/dist/compat/shell.d.ts +4 -0
- package/dist/compat/shell.js +165 -0
- package/dist/daytona/context.js +2 -1
- package/dist/daytona/process.d.ts +1 -1
- package/dist/daytona/process.js +27 -4
- package/dist/e2b/code-interpreter.d.ts +4 -5
- package/dist/e2b/code-interpreter.js +54 -56
- package/dist/e2b/commands.d.ts +5 -4
- package/dist/e2b/commands.js +37 -29
- package/dist/e2b/errors.js +1 -1
- package/dist/e2b/filesystem.d.ts +8 -6
- package/dist/e2b/filesystem.js +127 -28
- package/dist/e2b/sandbox.d.ts +4 -3
- package/dist/e2b/sandbox.js +10 -10
- package/dist/errors.d.ts +8 -0
- package/dist/errors.js +15 -2
- package/dist/freestyle/index.d.ts +301 -0
- package/dist/freestyle/index.js +310 -0
- package/dist/index.d.ts +1 -0
- package/dist/mcp.js +2 -2
- package/dist/modal/index.d.ts +205 -0
- package/dist/modal/index.js +485 -0
- package/dist/network-cli.js +1 -1
- package/dist/openai-agents/index.js +9 -26
- package/dist/products/audit.d.ts +3 -0
- package/dist/products/index.d.ts +2 -0
- package/dist/products/index.js +2 -0
- package/dist/products/interpreter.d.ts +11 -4
- package/dist/products/interpreter.js +33 -9
- package/dist/products/jobs.js +3 -2
- package/dist/products/limits.d.ts +10 -0
- package/dist/products/previews.d.ts +10 -2
- package/dist/products/previews.js +3 -2
- package/dist/products/tailscale.d.ts +57 -0
- package/dist/products/tailscale.js +17 -0
- package/dist/products/watch.d.ts +25 -4
- package/dist/products/watch.js +75 -14
- package/dist/runloop/index.d.ts +340 -0
- package/dist/runloop/index.js +438 -0
- package/dist/runloop/pagination.d.ts +46 -0
- package/dist/runloop/pagination.js +82 -0
- package/dist/runloop/snapshots.d.ts +52 -0
- package/dist/runloop/snapshots.js +244 -0
- package/dist/sandbox.d.ts +40 -9
- package/dist/sandbox.js +273 -76
- package/dist/snapshots.d.ts +11 -1
- package/dist/snapshots.js +11 -1
- package/dist/sprites/index.d.ts +251 -0
- package/dist/sprites/index.js +552 -0
- package/dist/tar.d.ts +8 -1
- package/dist/tar.js +185 -35
- package/dist/tools/index.js +2 -1
- package/dist/transport.d.ts +20 -2
- package/dist/transport.js +48 -11
- package/dist/types.d.ts +52 -3
- package/dist/vercel/command.js +12 -1
- package/dist/vercel/errors.d.ts +2 -2
- package/dist/vercel/errors.js +12 -1
- package/dist/vercel/filesystem.d.ts +21 -18
- package/dist/vercel/filesystem.js +95 -48
- package/dist/vercel/sandbox.js +5 -5
- package/package.json +45 -3
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { EventEmitter } from "node:events";
|
|
2
|
+
import { PassThrough, Writable } from "node:stream";
|
|
3
|
+
import type { Runtime } from "../client.js";
|
|
4
|
+
import type { Sandbox } from "../sandbox.js";
|
|
5
|
+
import { CompatibilityError, type ClientOptions as RuntimeClientOptions } from "../compat/core.js";
|
|
6
|
+
export { CompatibilityError };
|
|
7
|
+
export interface ClientOptions extends RuntimeClientOptions {
|
|
8
|
+
baseURL?: string;
|
|
9
|
+
timeout?: number;
|
|
10
|
+
controlMode?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface SpriteConfig {
|
|
13
|
+
ramMB?: number;
|
|
14
|
+
cpus?: number;
|
|
15
|
+
region?: string;
|
|
16
|
+
storageGB?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface CreateSpriteOptions {
|
|
19
|
+
config?: SpriteConfig;
|
|
20
|
+
environment?: Record<string, string>;
|
|
21
|
+
labels?: string[];
|
|
22
|
+
urlSettings?: {
|
|
23
|
+
auth?: string;
|
|
24
|
+
privateAccess?: string;
|
|
25
|
+
};
|
|
26
|
+
runtime?: "default" | "dev";
|
|
27
|
+
waitForCapacity?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface SpawnOptions {
|
|
30
|
+
cwd?: string;
|
|
31
|
+
env?: Record<string, string>;
|
|
32
|
+
tty?: boolean;
|
|
33
|
+
rows?: number;
|
|
34
|
+
cols?: number;
|
|
35
|
+
detachable?: boolean;
|
|
36
|
+
sessionId?: string;
|
|
37
|
+
controlMode?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface ExecOptions extends SpawnOptions {
|
|
40
|
+
encoding?: BufferEncoding;
|
|
41
|
+
maxBuffer?: number;
|
|
42
|
+
signal?: AbortSignal;
|
|
43
|
+
timeout?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface ExecResult {
|
|
46
|
+
stdout: string | Buffer;
|
|
47
|
+
stderr: string | Buffer;
|
|
48
|
+
exitCode: number;
|
|
49
|
+
}
|
|
50
|
+
export type FilesystemErrorCode = "ENOENT" | "EEXIST" | "ENOTDIR" | "EISDIR" | "EACCES" | "EPERM" | "ENOTEMPTY" | "EINVAL" | "EIO" | "UNKNOWN";
|
|
51
|
+
export declare class FilesystemError extends Error {
|
|
52
|
+
readonly code: FilesystemErrorCode;
|
|
53
|
+
readonly path: string;
|
|
54
|
+
readonly syscall?: string | undefined;
|
|
55
|
+
constructor(message: string, code: FilesystemErrorCode, path: string, syscall?: string | undefined);
|
|
56
|
+
}
|
|
57
|
+
export interface Dirent {
|
|
58
|
+
name: string;
|
|
59
|
+
parentPath: string;
|
|
60
|
+
isDirectory(): boolean;
|
|
61
|
+
isFile(): boolean;
|
|
62
|
+
isSymbolicLink(): boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface ReaddirOptions {
|
|
65
|
+
withFileTypes?: boolean;
|
|
66
|
+
recursive?: boolean;
|
|
67
|
+
pattern?: string;
|
|
68
|
+
encoding?: BufferEncoding;
|
|
69
|
+
}
|
|
70
|
+
export declare class ExecError extends Error {
|
|
71
|
+
readonly exitCode: number;
|
|
72
|
+
readonly stdout: string | Buffer;
|
|
73
|
+
readonly stderr: string | Buffer;
|
|
74
|
+
constructor(message: string, exitCode: number, stdout: string | Buffer, stderr: string | Buffer);
|
|
75
|
+
}
|
|
76
|
+
export declare class SpritesClient {
|
|
77
|
+
readonly runtime: Runtime;
|
|
78
|
+
constructor(token?: string, options?: ClientOptions);
|
|
79
|
+
sprite(name: string): Sprite;
|
|
80
|
+
createSprite(name: string, input?: SpriteConfig | CreateSpriteOptions, extra?: Omit<CreateSpriteOptions, "config">): Promise<Sprite>;
|
|
81
|
+
getSprite(name: string): Promise<Sprite>;
|
|
82
|
+
deleteSprite(name: string): Promise<void>;
|
|
83
|
+
listSprites(options?: {
|
|
84
|
+
prefix?: string;
|
|
85
|
+
maxResults?: number;
|
|
86
|
+
continuationToken?: string;
|
|
87
|
+
bulkLoad?: boolean;
|
|
88
|
+
}): Promise<{
|
|
89
|
+
sprites: {
|
|
90
|
+
id: string;
|
|
91
|
+
name: string;
|
|
92
|
+
status: "paused" | "stopped" | "stopping" | "starting" | "running" | "pausing" | "resuming";
|
|
93
|
+
createdAt: Date;
|
|
94
|
+
updatedAt: Date;
|
|
95
|
+
config: {
|
|
96
|
+
cpus: number;
|
|
97
|
+
ramMB: number;
|
|
98
|
+
storageGB: number;
|
|
99
|
+
region: string;
|
|
100
|
+
};
|
|
101
|
+
}[];
|
|
102
|
+
hasMore: boolean;
|
|
103
|
+
nextContinuationToken: string | undefined;
|
|
104
|
+
}>;
|
|
105
|
+
listAllSprites(prefix?: string): Promise<Sprite[]>;
|
|
106
|
+
restartSprite(name: string): Promise<{
|
|
107
|
+
spriteName: string;
|
|
108
|
+
machineId: string;
|
|
109
|
+
message: string;
|
|
110
|
+
}>;
|
|
111
|
+
updateURLSettings(name: string, settings: {
|
|
112
|
+
auth?: string;
|
|
113
|
+
privateAccess?: string;
|
|
114
|
+
}): Promise<void>;
|
|
115
|
+
}
|
|
116
|
+
export declare class Sprite {
|
|
117
|
+
readonly name: string;
|
|
118
|
+
readonly client: SpritesClient;
|
|
119
|
+
id?: string;
|
|
120
|
+
status?: string;
|
|
121
|
+
config?: SpriteConfig;
|
|
122
|
+
createdAt?: Date;
|
|
123
|
+
updatedAt?: Date;
|
|
124
|
+
url?: string;
|
|
125
|
+
labels: string[];
|
|
126
|
+
constructor(name: string, client: SpritesClient);
|
|
127
|
+
hydrate(s: Sandbox): void;
|
|
128
|
+
native(): Promise<Sandbox>;
|
|
129
|
+
spawn(command: string, args?: string[], options?: SpawnOptions): SpriteCommand;
|
|
130
|
+
exec(command: string, options?: ExecOptions): Promise<ExecResult>;
|
|
131
|
+
execFile(file: string, args?: string[], options?: ExecOptions): Promise<ExecResult>;
|
|
132
|
+
execFileHTTP(file: string, args?: string[], options?: ExecOptions): Promise<ExecResult>;
|
|
133
|
+
createSession(command: string, args?: string[], options?: SpawnOptions): SpriteCommand;
|
|
134
|
+
attachSession(sessionId: string, options?: SpawnOptions): SpriteCommand;
|
|
135
|
+
listSessions(): Promise<{
|
|
136
|
+
id: string;
|
|
137
|
+
command: string;
|
|
138
|
+
created: Date;
|
|
139
|
+
workdir: string;
|
|
140
|
+
isActive: boolean;
|
|
141
|
+
tty: boolean;
|
|
142
|
+
}[]>;
|
|
143
|
+
delete(): Promise<void>;
|
|
144
|
+
destroy(): Promise<void>;
|
|
145
|
+
restart(): Promise<{
|
|
146
|
+
spriteName: string;
|
|
147
|
+
machineId: string;
|
|
148
|
+
message: string;
|
|
149
|
+
}>;
|
|
150
|
+
filesystem(workingDir?: string): SpriteFilesystem;
|
|
151
|
+
createCheckpoint(_comment?: string): Promise<never>;
|
|
152
|
+
listCheckpoints(): Promise<never>;
|
|
153
|
+
getCheckpoint(_id: string): Promise<never>;
|
|
154
|
+
updateURLSettings(settings: {
|
|
155
|
+
auth?: string;
|
|
156
|
+
privateAccess?: string;
|
|
157
|
+
}): Promise<void>;
|
|
158
|
+
update(options: {
|
|
159
|
+
labels?: string[];
|
|
160
|
+
urlSettings?: {
|
|
161
|
+
auth?: string;
|
|
162
|
+
privateAccess?: string;
|
|
163
|
+
};
|
|
164
|
+
}): Promise<this>;
|
|
165
|
+
}
|
|
166
|
+
export declare class SpriteCommand extends EventEmitter {
|
|
167
|
+
readonly stdout: PassThrough;
|
|
168
|
+
readonly stderr: PassThrough;
|
|
169
|
+
readonly stdin: Writable;
|
|
170
|
+
private readonly process;
|
|
171
|
+
private readonly completion;
|
|
172
|
+
private code;
|
|
173
|
+
private readonly controller;
|
|
174
|
+
constructor(sprite: Sprite, command: string, args?: string[], options?: SpawnOptions);
|
|
175
|
+
private follow;
|
|
176
|
+
start(): Promise<void>;
|
|
177
|
+
wait(): Promise<number>;
|
|
178
|
+
kill(signal?: string): void;
|
|
179
|
+
signal(signal: string): void;
|
|
180
|
+
resize(cols: number, rows: number): void;
|
|
181
|
+
close(): void;
|
|
182
|
+
exitCode(): number;
|
|
183
|
+
}
|
|
184
|
+
export declare class SpriteFilesystem {
|
|
185
|
+
private readonly get;
|
|
186
|
+
private readonly files;
|
|
187
|
+
constructor(get: () => Promise<Sandbox>, cwd?: string);
|
|
188
|
+
readFile(path: string, encoding: "utf8"): Promise<string>;
|
|
189
|
+
readFile(path: string, encoding?: null): Promise<Buffer>;
|
|
190
|
+
writeFile(path: string, data: string | Uint8Array, options?: {
|
|
191
|
+
mode?: number;
|
|
192
|
+
}): Promise<void>;
|
|
193
|
+
readdir(path: string, options?: ReaddirOptions & {
|
|
194
|
+
withFileTypes?: false;
|
|
195
|
+
}): Promise<string[]>;
|
|
196
|
+
readdir(path: string, options: ReaddirOptions & {
|
|
197
|
+
withFileTypes: true;
|
|
198
|
+
}): Promise<Dirent[]>;
|
|
199
|
+
mkdir(path: string, options?: {
|
|
200
|
+
recursive?: boolean;
|
|
201
|
+
mode?: number;
|
|
202
|
+
}): Promise<void>;
|
|
203
|
+
rm(path: string, options?: {
|
|
204
|
+
recursive?: boolean;
|
|
205
|
+
force?: boolean;
|
|
206
|
+
}): Promise<void>;
|
|
207
|
+
stat(path: string): Promise<{
|
|
208
|
+
size: number;
|
|
209
|
+
mode: number;
|
|
210
|
+
mtime: Date;
|
|
211
|
+
atime: Date;
|
|
212
|
+
birthtime: Date;
|
|
213
|
+
isDirectory: () => boolean;
|
|
214
|
+
isFile: () => boolean;
|
|
215
|
+
isSymbolicLink: () => boolean;
|
|
216
|
+
}>;
|
|
217
|
+
rename(from: string, to: string): Promise<void>;
|
|
218
|
+
copyFile(from: string, to: string, options?: {
|
|
219
|
+
recursive?: boolean;
|
|
220
|
+
}): Promise<void>;
|
|
221
|
+
chmod(path: string, mode: number, options?: {
|
|
222
|
+
recursive?: boolean;
|
|
223
|
+
}): Promise<void>;
|
|
224
|
+
exists(path: string): Promise<boolean>;
|
|
225
|
+
appendFile(path: string, data: string | Uint8Array): Promise<void>;
|
|
226
|
+
readJSON<T = unknown>(path: string): Promise<T>;
|
|
227
|
+
writeJSON(path: string, data: unknown, options?: {
|
|
228
|
+
spaces?: number;
|
|
229
|
+
}): Promise<void>;
|
|
230
|
+
}
|
|
231
|
+
export declare class CheckpointStream {
|
|
232
|
+
private readonly messages;
|
|
233
|
+
private index;
|
|
234
|
+
constructor(messages: {
|
|
235
|
+
type: "complete" | "error" | "info";
|
|
236
|
+
data?: string;
|
|
237
|
+
error?: string;
|
|
238
|
+
}[]);
|
|
239
|
+
next(): Promise<{
|
|
240
|
+
type: "complete" | "error" | "info";
|
|
241
|
+
data?: string;
|
|
242
|
+
error?: string;
|
|
243
|
+
} | null>;
|
|
244
|
+
processAll(handler: (message: (typeof this.messages)[number]) => void | Promise<void>): Promise<void>;
|
|
245
|
+
close(): void;
|
|
246
|
+
[Symbol.asyncIterator](): AsyncGenerator<{
|
|
247
|
+
type: "complete" | "error" | "info";
|
|
248
|
+
data?: string;
|
|
249
|
+
error?: string;
|
|
250
|
+
}, void, unknown>;
|
|
251
|
+
}
|