@run-cloud/sdk 0.5.1 → 0.7.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 +32 -0
- package/dist/compat/blaxel.d.ts +49 -0
- package/dist/compat/blaxel.js +85 -0
- package/dist/compat/blaxel.js.map +1 -0
- package/dist/compat/cloudflare.d.ts +32 -0
- package/dist/compat/cloudflare.js +66 -0
- package/dist/compat/cloudflare.js.map +1 -0
- package/dist/compat/codesandbox.d.ts +75 -0
- package/dist/compat/codesandbox.js +138 -0
- package/dist/compat/codesandbox.js.map +1 -0
- package/dist/compat/common.d.ts +40 -0
- package/dist/compat/common.js +85 -0
- package/dist/compat/common.js.map +1 -0
- package/dist/compat/daytona.d.ts +67 -0
- package/dist/compat/daytona.js +109 -0
- package/dist/compat/daytona.js.map +1 -0
- package/dist/compat/e2b.d.ts +65 -0
- package/dist/compat/e2b.js +106 -0
- package/dist/compat/e2b.js.map +1 -0
- package/dist/compat/fly.d.ts +28 -0
- package/dist/compat/fly.js +56 -0
- package/dist/compat/fly.js.map +1 -0
- package/dist/compat/modal.d.ts +107 -0
- package/dist/compat/modal.js +181 -0
- package/dist/compat/modal.js.map +1 -0
- package/dist/compat/sprites.d.ts +38 -0
- package/dist/compat/sprites.js +67 -0
- package/dist/compat/sprites.js.map +1 -0
- package/dist/compat/vercel.d.ts +50 -0
- package/dist/compat/vercel.js +84 -0
- package/dist/compat/vercel.js.map +1 -0
- package/package.json +42 -2
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { compatibilityClient, createNative, getNative, listNative, unsupported, } from "./common.js";
|
|
2
|
+
export class Image {
|
|
3
|
+
ref;
|
|
4
|
+
constructor(ref) {
|
|
5
|
+
this.ref = ref;
|
|
6
|
+
}
|
|
7
|
+
static fromRegistry(ref) {
|
|
8
|
+
return new Image(ref);
|
|
9
|
+
}
|
|
10
|
+
static debianSlim() {
|
|
11
|
+
return new Image("debian:12-slim");
|
|
12
|
+
}
|
|
13
|
+
aptInstall() {
|
|
14
|
+
return unsupported("Modal", "Image.aptInstall", "register a prebuilt OCI image with run.cloud");
|
|
15
|
+
}
|
|
16
|
+
pipInstall() {
|
|
17
|
+
return unsupported("Modal", "Image.pipInstall", "register a prebuilt OCI image with run.cloud");
|
|
18
|
+
}
|
|
19
|
+
runCommands() {
|
|
20
|
+
return unsupported("Modal", "Image.runCommands", "register a prebuilt OCI image with run.cloud");
|
|
21
|
+
}
|
|
22
|
+
env() {
|
|
23
|
+
return unsupported("Modal", "Image.env", "register a prebuilt OCI image with run.cloud");
|
|
24
|
+
}
|
|
25
|
+
workdir() {
|
|
26
|
+
return unsupported("Modal", "Image.workdir", "register a prebuilt OCI image with run.cloud");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export class ContainerProcess {
|
|
30
|
+
result;
|
|
31
|
+
stdout;
|
|
32
|
+
stderr;
|
|
33
|
+
returnCode = null;
|
|
34
|
+
constructor(result) {
|
|
35
|
+
this.result = result;
|
|
36
|
+
this.stdout = {
|
|
37
|
+
read: async () => (await this.result).stdout,
|
|
38
|
+
readText: async () => (await this.result).stdout,
|
|
39
|
+
};
|
|
40
|
+
this.stderr = {
|
|
41
|
+
read: async () => (await this.result).stderr,
|
|
42
|
+
readText: async () => (await this.result).stderr,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
async wait() {
|
|
46
|
+
this.returnCode = (await this.result).exitCode;
|
|
47
|
+
return this.returnCode;
|
|
48
|
+
}
|
|
49
|
+
poll() {
|
|
50
|
+
return this.returnCode;
|
|
51
|
+
}
|
|
52
|
+
get returncode() {
|
|
53
|
+
return this.returnCode;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export class App {
|
|
57
|
+
name;
|
|
58
|
+
client;
|
|
59
|
+
constructor(name, client) {
|
|
60
|
+
this.name = name;
|
|
61
|
+
this.client = client;
|
|
62
|
+
}
|
|
63
|
+
static async lookup(name, options = {}) {
|
|
64
|
+
return new App(name, compatibilityClient(options));
|
|
65
|
+
}
|
|
66
|
+
async createSandbox(image, options = {}) {
|
|
67
|
+
return await Sandbox.create({ ...options, app: this, image });
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export class ModalClient {
|
|
71
|
+
options;
|
|
72
|
+
apps = {
|
|
73
|
+
fromName: async (name, options = {}) => await App.lookup(name, { ...this.options, ...options }),
|
|
74
|
+
};
|
|
75
|
+
images = {
|
|
76
|
+
fromRegistry: (ref) => Image.fromRegistry(ref),
|
|
77
|
+
debianSlim: () => Image.debianSlim(),
|
|
78
|
+
};
|
|
79
|
+
sandboxes = {
|
|
80
|
+
create: async (app, image, options = {}) => await Sandbox.create({
|
|
81
|
+
app,
|
|
82
|
+
image,
|
|
83
|
+
command: options.command,
|
|
84
|
+
cpu: options.cpu,
|
|
85
|
+
memory: options.memoryMiB,
|
|
86
|
+
timeout: options.timeoutMs ? Math.ceil(options.timeoutMs / 1000) : undefined,
|
|
87
|
+
idleTimeout: options.idleTimeoutMs
|
|
88
|
+
? Math.ceil(options.idleTimeoutMs / 1000)
|
|
89
|
+
: undefined,
|
|
90
|
+
name: options.name,
|
|
91
|
+
region: options.regions?.[0],
|
|
92
|
+
volumes: options.volumes,
|
|
93
|
+
}),
|
|
94
|
+
fromId: async (sandboxId) => await Sandbox.fromId(sandboxId, compatibilityClient(this.options)),
|
|
95
|
+
fromName: async (appName, name) => await Sandbox.fromName(await App.lookup(appName, this.options), name),
|
|
96
|
+
};
|
|
97
|
+
constructor(options = {}) {
|
|
98
|
+
this.options = options;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
export class Sandbox {
|
|
102
|
+
native;
|
|
103
|
+
app;
|
|
104
|
+
entrypoint;
|
|
105
|
+
constructor(native, app) {
|
|
106
|
+
this.native = native;
|
|
107
|
+
this.app = app;
|
|
108
|
+
}
|
|
109
|
+
static async create(options = {}) {
|
|
110
|
+
if (options.volumes)
|
|
111
|
+
unsupported("Modal", "volumes");
|
|
112
|
+
if (Array.isArray(options.cpu)) {
|
|
113
|
+
unsupported("Modal", "CPU request/limit tuples", "pass a single CPU reservation");
|
|
114
|
+
}
|
|
115
|
+
const client = options.app?.client ?? compatibilityClient();
|
|
116
|
+
const native = await createNative(client, {
|
|
117
|
+
image: options.image instanceof Image ? options.image.ref : options.image,
|
|
118
|
+
cpu: options.cpu,
|
|
119
|
+
memory: options.memory,
|
|
120
|
+
timeoutSeconds: options.timeout,
|
|
121
|
+
idlePauseSeconds: options.idleTimeout,
|
|
122
|
+
name: options.name,
|
|
123
|
+
region: options.region,
|
|
124
|
+
});
|
|
125
|
+
const sandbox = new Sandbox(native, options.app);
|
|
126
|
+
if (options.command?.length)
|
|
127
|
+
sandbox.entrypoint = sandbox.exec(options.command);
|
|
128
|
+
return sandbox;
|
|
129
|
+
}
|
|
130
|
+
static async fromId(id, client) {
|
|
131
|
+
const actualClient = client ?? compatibilityClient();
|
|
132
|
+
return new Sandbox(await getNative(actualClient, id));
|
|
133
|
+
}
|
|
134
|
+
static async fromName(app, name) {
|
|
135
|
+
const match = (await listNative(app.client)).find((sandbox) => sandbox.name === name);
|
|
136
|
+
if (!match)
|
|
137
|
+
throw new Error(`no sandbox named ${name}`);
|
|
138
|
+
return new Sandbox(match, app);
|
|
139
|
+
}
|
|
140
|
+
static async list(app) {
|
|
141
|
+
const client = app?.client ?? compatibilityClient();
|
|
142
|
+
return (await listNative(client)).map((sandbox) => new Sandbox(sandbox, app));
|
|
143
|
+
}
|
|
144
|
+
get objectId() {
|
|
145
|
+
return this.native.id;
|
|
146
|
+
}
|
|
147
|
+
get sandboxId() {
|
|
148
|
+
return this.native.id;
|
|
149
|
+
}
|
|
150
|
+
exec(command, options = {}) {
|
|
151
|
+
return new ContainerProcess(this.native.exec(command, {
|
|
152
|
+
cwd: options.workdir,
|
|
153
|
+
env: options.env,
|
|
154
|
+
timeoutSeconds: options.timeout,
|
|
155
|
+
}));
|
|
156
|
+
}
|
|
157
|
+
async terminate() {
|
|
158
|
+
await this.native.destroy();
|
|
159
|
+
return this.entrypoint?.returncode ?? null;
|
|
160
|
+
}
|
|
161
|
+
detach() { }
|
|
162
|
+
async poll() {
|
|
163
|
+
await this.native.refresh();
|
|
164
|
+
return ["running", "starting", "pending", "creating"].includes(this.native.state) ? null : 0;
|
|
165
|
+
}
|
|
166
|
+
tunnels() {
|
|
167
|
+
return unsupported("Modal", "tunnels", "run.cloud public port capabilities are not available in the SDK yet");
|
|
168
|
+
}
|
|
169
|
+
setTags() {
|
|
170
|
+
return unsupported("Modal", "server-side tags", "use the native sandbox name field");
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
export class Probe {
|
|
174
|
+
static withTcp() {
|
|
175
|
+
return unsupported("Modal", "TCP readiness probes");
|
|
176
|
+
}
|
|
177
|
+
static withExec() {
|
|
178
|
+
return unsupported("Modal", "exec readiness probes");
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal.js","sourceRoot":"","sources":["../../src/compat/modal.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,UAAU,EAGV,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,MAAM,OAAO,KAAK;IACa;IAA7B,YAA6B,GAAW;QAAX,QAAG,GAAH,GAAG,CAAQ;IAAG,CAAC;IAE5C,MAAM,CAAC,YAAY,CAAC,GAAW;QAC7B,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,UAAU;QACf,OAAO,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACrC,CAAC;IAED,UAAU;QACR,OAAO,WAAW,CAAC,OAAO,EAAE,kBAAkB,EAAE,8CAA8C,CAAC,CAAC;IAClG,CAAC;IAED,UAAU;QACR,OAAO,WAAW,CAAC,OAAO,EAAE,kBAAkB,EAAE,8CAA8C,CAAC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AAO,WAAW,CAChB,OAAO,EACP,SAAS,EACT,qEAAqE,CACtE,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,WAAW,CAAC,OAAO,EAAE,kBAAkB,EAAE,mCAAmC,CAAC,CAAC;IACvF,CAAC;CACF;AAED,MAAM,OAAO,KAAK;IAChB,MAAM,CAAC,OAAO;QACZ,OAAO,WAAW,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC;IACtD,CAAC;IAED,MAAM,CAAC,QAAQ;QACb,OAAO,WAAW,CAAC,OAAO,EAAE,uBAAuB,CAAC,CAAC;IACvD,CAAC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type CompatibilityClientOptions, type NativeSandbox } from "./common.js";
|
|
2
|
+
export declare class Sprite {
|
|
3
|
+
readonly native: NativeSandbox;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
constructor(native: NativeSandbox, name: string);
|
|
6
|
+
exec(command: string, options?: {
|
|
7
|
+
cwd?: string;
|
|
8
|
+
env?: Record<string, string>;
|
|
9
|
+
}): Promise<import("../index.js").ExecResult>;
|
|
10
|
+
execFile(file: string, args?: string[], options?: {
|
|
11
|
+
cwd?: string;
|
|
12
|
+
env?: Record<string, string>;
|
|
13
|
+
}): Promise<import("../index.js").ExecResult>;
|
|
14
|
+
run(command: string, options?: {
|
|
15
|
+
cwd?: string;
|
|
16
|
+
env?: Record<string, string>;
|
|
17
|
+
}): Promise<import("../index.js").ExecResult>;
|
|
18
|
+
filesystem(): never;
|
|
19
|
+
url(): never;
|
|
20
|
+
delete(): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export declare class SpritesClient {
|
|
23
|
+
private readonly options;
|
|
24
|
+
constructor(tokenOrOptions?: string | CompatibilityClientOptions, options?: CompatibilityClientOptions);
|
|
25
|
+
private find;
|
|
26
|
+
createSprite(name: string, options?: {
|
|
27
|
+
image?: string;
|
|
28
|
+
region?: string;
|
|
29
|
+
ramMB?: number;
|
|
30
|
+
cpus?: number;
|
|
31
|
+
storageGB?: number;
|
|
32
|
+
}): Promise<Sprite>;
|
|
33
|
+
sprite(name: string): Promise<Sprite>;
|
|
34
|
+
getSprite(name: string): Promise<Sprite>;
|
|
35
|
+
listSprites(): Promise<Sprite[]>;
|
|
36
|
+
destroySprite(name: string): Promise<void>;
|
|
37
|
+
deleteSprite(name: string): Promise<void>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { compatibilityClient, createNative, listNative, unsupported, } from "./common.js";
|
|
2
|
+
export class Sprite {
|
|
3
|
+
native;
|
|
4
|
+
name;
|
|
5
|
+
constructor(native, name) {
|
|
6
|
+
this.native = native;
|
|
7
|
+
this.name = name;
|
|
8
|
+
}
|
|
9
|
+
async exec(command, options = {}) {
|
|
10
|
+
return await this.native.exec(command, options);
|
|
11
|
+
}
|
|
12
|
+
async execFile(file, args = [], options = {}) {
|
|
13
|
+
return await this.native.exec([file, ...args], options);
|
|
14
|
+
}
|
|
15
|
+
run(command, options = {}) {
|
|
16
|
+
return this.exec(command, options);
|
|
17
|
+
}
|
|
18
|
+
filesystem() {
|
|
19
|
+
return unsupported("Fly Sprites", "filesystem writes and listing");
|
|
20
|
+
}
|
|
21
|
+
url() {
|
|
22
|
+
return unsupported("Fly Sprites", "public URLs", "run.cloud public port capabilities are not available in the SDK yet");
|
|
23
|
+
}
|
|
24
|
+
async delete() {
|
|
25
|
+
await this.native.destroy();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export class SpritesClient {
|
|
29
|
+
options;
|
|
30
|
+
constructor(tokenOrOptions = {}, options = {}) {
|
|
31
|
+
this.options = typeof tokenOrOptions === "string" ? options : tokenOrOptions;
|
|
32
|
+
}
|
|
33
|
+
async find(name) {
|
|
34
|
+
return (await listNative(compatibilityClient(this.options))).find((sandbox) => sandbox.name === name);
|
|
35
|
+
}
|
|
36
|
+
async createSprite(name, options = {}) {
|
|
37
|
+
const client = compatibilityClient(this.options);
|
|
38
|
+
return new Sprite(await createNative(client, {
|
|
39
|
+
name,
|
|
40
|
+
image: options.image,
|
|
41
|
+
region: options.region,
|
|
42
|
+
memory: options.ramMB,
|
|
43
|
+
cpu: options.cpus,
|
|
44
|
+
disk: options.storageGB,
|
|
45
|
+
}), name);
|
|
46
|
+
}
|
|
47
|
+
async sprite(name) {
|
|
48
|
+
const existing = await this.find(name);
|
|
49
|
+
return existing ? new Sprite(existing, name) : await this.createSprite(name);
|
|
50
|
+
}
|
|
51
|
+
async getSprite(name) {
|
|
52
|
+
const existing = await this.find(name);
|
|
53
|
+
if (!existing)
|
|
54
|
+
throw new Error(`no sprite named ${name}`);
|
|
55
|
+
return new Sprite(existing, name);
|
|
56
|
+
}
|
|
57
|
+
async listSprites() {
|
|
58
|
+
return (await listNative(compatibilityClient(this.options))).map((sandbox) => new Sprite(sandbox, sandbox.name));
|
|
59
|
+
}
|
|
60
|
+
async destroySprite(name) {
|
|
61
|
+
await (await this.getSprite(name)).delete();
|
|
62
|
+
}
|
|
63
|
+
async deleteSprite(name) {
|
|
64
|
+
await this.destroySprite(name);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=sprites.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sprites.js","sourceRoot":"","sources":["../../src/compat/sprites.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,UAAU,EAGV,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,MAAM,OAAO,MAAM;IAEN;IACA;IAFX,YACW,MAAqB,EACrB,IAAY;QADZ,WAAM,GAAN,MAAM,CAAe;QACrB,SAAI,GAAJ,IAAI,CAAQ;IACpB,CAAC;IAEJ,KAAK,CAAC,IAAI,CACR,OAAe,EACf,UAA0D,EAAE;QAE5D,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAED,KAAK,CAAC,QAAQ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@@
|
|
|
1
|
+
import { type CompatibilityClientOptions, type NativeSandbox } from "./common.js";
|
|
2
|
+
export interface CreateOpts extends CompatibilityClientOptions {
|
|
3
|
+
runtime?: string;
|
|
4
|
+
image?: string;
|
|
5
|
+
resources?: {
|
|
6
|
+
vcpus?: number;
|
|
7
|
+
memory?: number;
|
|
8
|
+
};
|
|
9
|
+
timeout?: number;
|
|
10
|
+
region?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface CommandFinished {
|
|
14
|
+
exitCode: number;
|
|
15
|
+
stdout(): Promise<string>;
|
|
16
|
+
stderr(): Promise<string>;
|
|
17
|
+
output(stream?: "stdout" | "stderr" | "both"): Promise<string>;
|
|
18
|
+
}
|
|
19
|
+
export declare class Sandbox {
|
|
20
|
+
readonly native: NativeSandbox;
|
|
21
|
+
private readonly client;
|
|
22
|
+
readonly runtime?: string | undefined;
|
|
23
|
+
private constructor();
|
|
24
|
+
static create(options?: CreateOpts): Promise<Sandbox>;
|
|
25
|
+
static get(id: string | {
|
|
26
|
+
id?: string;
|
|
27
|
+
name?: string;
|
|
28
|
+
}, options?: CompatibilityClientOptions): Promise<Sandbox>;
|
|
29
|
+
static list(options?: CompatibilityClientOptions): Promise<Sandbox[]>;
|
|
30
|
+
get sandboxId(): string;
|
|
31
|
+
get name(): string;
|
|
32
|
+
runCommand(command: string, args?: string[], options?: {
|
|
33
|
+
cwd?: string;
|
|
34
|
+
env?: Record<string, string>;
|
|
35
|
+
timeoutMs?: number;
|
|
36
|
+
signal?: AbortSignal;
|
|
37
|
+
}): Promise<CommandFinished>;
|
|
38
|
+
runCommandDetached(): never;
|
|
39
|
+
readFileToBuffer(options: {
|
|
40
|
+
path: string;
|
|
41
|
+
}): Promise<Uint8Array>;
|
|
42
|
+
readFile(options: {
|
|
43
|
+
path: string;
|
|
44
|
+
}): Promise<string>;
|
|
45
|
+
writeFiles(): never;
|
|
46
|
+
mkDir(): never;
|
|
47
|
+
domain(): never;
|
|
48
|
+
stop(): Promise<void>;
|
|
49
|
+
delete(): Promise<void>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { bytesToText, compatibilityClient, createNative, getNative, listNative, unsupported, } from "./common.js";
|
|
2
|
+
function finished(exitCode, stdout, stderr) {
|
|
3
|
+
return {
|
|
4
|
+
exitCode,
|
|
5
|
+
stdout: async () => stdout,
|
|
6
|
+
stderr: async () => stderr,
|
|
7
|
+
output: async (stream = "both") => stream === "stdout" ? stdout : stream === "stderr" ? stderr : stdout + stderr,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export class Sandbox {
|
|
11
|
+
native;
|
|
12
|
+
client;
|
|
13
|
+
runtime;
|
|
14
|
+
constructor(native, client, runtime) {
|
|
15
|
+
this.native = native;
|
|
16
|
+
this.client = client;
|
|
17
|
+
this.runtime = runtime;
|
|
18
|
+
}
|
|
19
|
+
static async create(options = {}) {
|
|
20
|
+
const client = compatibilityClient(options);
|
|
21
|
+
return new Sandbox(await createNative(client, {
|
|
22
|
+
image: options.image,
|
|
23
|
+
cpu: options.resources?.vcpus,
|
|
24
|
+
memory: options.resources?.memory,
|
|
25
|
+
timeoutSeconds: options.timeout ? Math.ceil(options.timeout / 1000) : undefined,
|
|
26
|
+
region: options.region,
|
|
27
|
+
name: options.name,
|
|
28
|
+
}), client, options.runtime);
|
|
29
|
+
}
|
|
30
|
+
static async get(id, options = {}) {
|
|
31
|
+
const client = compatibilityClient(options);
|
|
32
|
+
const sandboxId = typeof id === "string"
|
|
33
|
+
? id
|
|
34
|
+
: id.sandboxId ?? id.id ?? id.name;
|
|
35
|
+
if (!sandboxId)
|
|
36
|
+
throw new Error("sandbox id is required");
|
|
37
|
+
return new Sandbox(await getNative(client, sandboxId), client);
|
|
38
|
+
}
|
|
39
|
+
static async list(options = {}) {
|
|
40
|
+
const client = compatibilityClient(options);
|
|
41
|
+
return (await listNative(client)).map((sandbox) => new Sandbox(sandbox, client));
|
|
42
|
+
}
|
|
43
|
+
get sandboxId() {
|
|
44
|
+
return this.native.id;
|
|
45
|
+
}
|
|
46
|
+
get name() {
|
|
47
|
+
return this.native.name || this.native.id;
|
|
48
|
+
}
|
|
49
|
+
async runCommand(command, args = [], options = {}) {
|
|
50
|
+
const result = await this.native.exec([command, ...args], {
|
|
51
|
+
cwd: options.cwd,
|
|
52
|
+
env: options.env,
|
|
53
|
+
timeoutSeconds: options.timeoutMs
|
|
54
|
+
? Math.ceil(options.timeoutMs / 1000)
|
|
55
|
+
: undefined,
|
|
56
|
+
});
|
|
57
|
+
return finished(result.exitCode, result.stdout, result.stderr);
|
|
58
|
+
}
|
|
59
|
+
runCommandDetached() {
|
|
60
|
+
return unsupported("Vercel Sandbox", "detached commands");
|
|
61
|
+
}
|
|
62
|
+
async readFileToBuffer(options) {
|
|
63
|
+
return await this.native.readFile(options.path);
|
|
64
|
+
}
|
|
65
|
+
async readFile(options) {
|
|
66
|
+
return bytesToText(await this.native.readFile(options.path));
|
|
67
|
+
}
|
|
68
|
+
writeFiles() {
|
|
69
|
+
return unsupported("Vercel Sandbox", "file writes", "use an image or a command that writes the content");
|
|
70
|
+
}
|
|
71
|
+
mkDir() {
|
|
72
|
+
return unsupported("Vercel Sandbox", "directory creation");
|
|
73
|
+
}
|
|
74
|
+
domain() {
|
|
75
|
+
return unsupported("Vercel Sandbox", "domain", "run.cloud public port capabilities are not available in the SDK yet");
|
|
76
|
+
}
|
|
77
|
+
async stop() {
|
|
78
|
+
await this.native.destroy();
|
|
79
|
+
}
|
|
80
|
+
async delete() {
|
|
81
|
+
await this.native.destroy();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=vercel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vercel.js","sourceRoot":"","sources":["../../src/compat/vercel.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,UAAU,EAGV,WAAW,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I,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;gBACrC,CAAC,CAAC,SAAS;SACd,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACjE,CAAC;IAED,kBAAkB;QAChB,OAAO,WAAW,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,OAAyB;QAC9C,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,OAAyB;QACtC,OAAO,WAAW,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED,UAAU;QACR,OAAO,WAAW,CAAC,gBAAgB,EAAE,aAAa,EAAE,mDAAmD,CAAC,CAAC;IAC3G,CAAC;IAED,KAAK;QACH,OAAO,WAAW,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM;QACJ,OAAO,WAAW,CAChB,gBAAgB,EAChB,QAAQ,EACR,qEAAqE,CACtE,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,MAAM;QACV,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IAC9B,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@run-cloud/sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "TypeScript client for run.cloud
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "TypeScript client for run.cloud, including sandbox-provider compatibility adapters",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"runcloud",
|
|
@@ -47,6 +47,46 @@
|
|
|
47
47
|
".": {
|
|
48
48
|
"types": "./dist/index.d.ts",
|
|
49
49
|
"import": "./dist/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./compat": {
|
|
52
|
+
"types": "./dist/compat/common.d.ts",
|
|
53
|
+
"import": "./dist/compat/common.js"
|
|
54
|
+
},
|
|
55
|
+
"./compat/modal": {
|
|
56
|
+
"types": "./dist/compat/modal.d.ts",
|
|
57
|
+
"import": "./dist/compat/modal.js"
|
|
58
|
+
},
|
|
59
|
+
"./compat/e2b": {
|
|
60
|
+
"types": "./dist/compat/e2b.d.ts",
|
|
61
|
+
"import": "./dist/compat/e2b.js"
|
|
62
|
+
},
|
|
63
|
+
"./compat/daytona": {
|
|
64
|
+
"types": "./dist/compat/daytona.d.ts",
|
|
65
|
+
"import": "./dist/compat/daytona.js"
|
|
66
|
+
},
|
|
67
|
+
"./compat/vercel": {
|
|
68
|
+
"types": "./dist/compat/vercel.d.ts",
|
|
69
|
+
"import": "./dist/compat/vercel.js"
|
|
70
|
+
},
|
|
71
|
+
"./compat/blaxel": {
|
|
72
|
+
"types": "./dist/compat/blaxel.d.ts",
|
|
73
|
+
"import": "./dist/compat/blaxel.js"
|
|
74
|
+
},
|
|
75
|
+
"./compat/sprites": {
|
|
76
|
+
"types": "./dist/compat/sprites.d.ts",
|
|
77
|
+
"import": "./dist/compat/sprites.js"
|
|
78
|
+
},
|
|
79
|
+
"./compat/cloudflare": {
|
|
80
|
+
"types": "./dist/compat/cloudflare.d.ts",
|
|
81
|
+
"import": "./dist/compat/cloudflare.js"
|
|
82
|
+
},
|
|
83
|
+
"./compat/codesandbox": {
|
|
84
|
+
"types": "./dist/compat/codesandbox.d.ts",
|
|
85
|
+
"import": "./dist/compat/codesandbox.js"
|
|
86
|
+
},
|
|
87
|
+
"./compat/fly": {
|
|
88
|
+
"types": "./dist/compat/fly.d.ts",
|
|
89
|
+
"import": "./dist/compat/fly.js"
|
|
50
90
|
}
|
|
51
91
|
},
|
|
52
92
|
"files": [
|