withruntime 1.0.0 → 1.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/CHANGELOG.md +76 -0
- package/README.md +145 -0
- package/dist/generated/agentSessions.d.ts +218 -0
- package/dist/generated/agentSessions.js +154 -0
- package/dist/generated/agents.d.ts +193 -0
- package/dist/generated/agents.js +166 -0
- package/dist/generated/apps.d.ts +87 -28
- package/dist/generated/apps.js +153 -41
- package/dist/generated/audit.d.ts +2 -2
- package/dist/generated/audit.js +3 -3
- package/dist/generated/browsers.d.ts +87 -28
- package/dist/generated/browsers.js +153 -41
- package/dist/generated/builds.d.ts +87 -28
- package/dist/generated/builds.js +153 -41
- package/dist/generated/ci.d.ts +87 -28
- package/dist/generated/ci.js +153 -41
- package/dist/generated/containers.d.ts +87 -28
- package/dist/generated/containers.js +153 -41
- package/dist/generated/desktops.d.ts +89 -30
- package/dist/generated/desktops.js +155 -43
- package/dist/generated/domains.d.ts +52 -15
- package/dist/generated/domains.js +74 -14
- package/dist/generated/egressIps.d.ts +6 -6
- package/dist/generated/egressIps.js +4 -4
- package/dist/generated/events.d.ts +4 -2
- package/dist/generated/events.js +3 -3
- package/dist/generated/feedback.d.ts +1 -1
- package/dist/generated/feedback.js +3 -3
- package/dist/generated/functions.d.ts +87 -28
- package/dist/generated/functions.js +153 -41
- package/dist/generated/identities.d.ts +2 -2
- package/dist/generated/identities.js +5 -5
- package/dist/generated/images.d.ts +68 -14
- package/dist/generated/images.js +96 -15
- package/dist/generated/index.d.ts +9 -0
- package/dist/generated/index.js +12 -0
- package/dist/generated/jobRuns.d.ts +11 -4
- package/dist/generated/jobRuns.js +6 -6
- package/dist/generated/jobs.d.ts +58 -9
- package/dist/generated/jobs.js +98 -14
- package/dist/generated/keys.d.ts +8 -6
- package/dist/generated/keys.js +6 -6
- package/dist/generated/me.d.ts +2 -2
- package/dist/generated/me.js +3 -3
- package/dist/generated/messages.d.ts +67 -0
- package/dist/generated/messages.js +17 -0
- package/dist/generated/networks.d.ts +4 -4
- package/dist/generated/networks.js +4 -4
- package/dist/generated/notebooks.d.ts +87 -28
- package/dist/generated/notebooks.js +153 -41
- package/dist/generated/otel.d.ts +2 -2
- package/dist/generated/otel.js +5 -5
- package/dist/generated/ports.d.ts +11 -11
- package/dist/generated/ports.js +8 -8
- package/dist/generated/previews.d.ts +50 -15
- package/dist/generated/previews.js +70 -18
- package/dist/generated/projects.d.ts +30 -6
- package/dist/generated/projects.js +13 -9
- package/dist/generated/roles.d.ts +11 -2
- package/dist/generated/roles.js +9 -5
- package/dist/generated/routes.js +1 -1
- package/dist/generated/runtime.d.ts +15 -3
- package/dist/generated/runtime.js +31 -18
- package/dist/generated/sandboxes.d.ts +213 -66
- package/dist/generated/sandboxes.js +171 -43
- package/dist/generated/secrets.d.ts +45 -6
- package/dist/generated/secrets.js +69 -9
- package/dist/generated/sessions.d.ts +1 -1
- package/dist/generated/sessions.js +4 -4
- package/dist/generated/signing.js +3 -1
- package/dist/generated/sites.d.ts +87 -28
- package/dist/generated/sites.js +153 -41
- package/dist/generated/snapshots.d.ts +70 -5
- package/dist/generated/snapshots.js +107 -7
- package/dist/generated/tunnels.d.ts +8 -8
- package/dist/generated/tunnels.js +4 -4
- package/dist/generated/usage.d.ts +57 -6
- package/dist/generated/usage.js +4 -4
- package/dist/generated/volumes.d.ts +72 -7
- package/dist/generated/volumes.js +114 -10
- package/dist/generated/webhooks.d.ts +2 -2
- package/dist/generated/webhooks.js +5 -5
- package/dist/generated/workspaces.d.ts +87 -28
- package/dist/generated/workspaces.js +153 -41
- package/dist/v2/bin.d.ts +2 -0
- package/dist/v2/bin.js +15 -0
- package/dist/v2/cli.d.ts +15 -2
- package/dist/v2/cli.js +158 -53
- package/dist/v2/json.d.ts +9 -0
- package/dist/v2/json.js +5 -0
- package/dist/v2/mcp.js +14 -1
- package/dist/v2/openapi.json +7695 -4382
- package/dist/v2/shims/fly.js +49 -13
- package/dist/v2/shims/morph.js +1 -1
- package/dist/v2/table.d.ts +7 -4
- package/dist/v2/table.js +97 -34
- package/package.json +7 -5
package/dist/v2/shims/fly.js
CHANGED
|
@@ -2,8 +2,15 @@
|
|
|
2
2
|
withruntime fly-api`, then point FLY_API_HOSTNAME at it) or a fetch handler. A
|
|
3
3
|
machine is a sandbox: create, get, list, exec, stop (pause), start (wake), wait
|
|
4
4
|
and delete; an app is a label. */
|
|
5
|
+
import { arr, num, obj, str, strs } from "../json.js";
|
|
5
6
|
import { client, run } from "./base.js";
|
|
6
|
-
const STATE = {
|
|
7
|
+
const STATE = {
|
|
8
|
+
starting: "starting",
|
|
9
|
+
running: "started",
|
|
10
|
+
paused: "stopped",
|
|
11
|
+
deleted: "destroyed",
|
|
12
|
+
error: "failed",
|
|
13
|
+
};
|
|
7
14
|
function machine(s, app) {
|
|
8
15
|
return {
|
|
9
16
|
id: s.id,
|
|
@@ -12,7 +19,13 @@ function machine(s, app) {
|
|
|
12
19
|
region: "us-east",
|
|
13
20
|
instance_id: s.id,
|
|
14
21
|
created_at: s.createdAt,
|
|
15
|
-
config: {
|
|
22
|
+
config: {
|
|
23
|
+
guest: {
|
|
24
|
+
cpus: s.vcpu,
|
|
25
|
+
memory_mb: s.memoryGB === undefined ? undefined : Math.round(s.memoryGB * 1024),
|
|
26
|
+
},
|
|
27
|
+
metadata: { app },
|
|
28
|
+
},
|
|
16
29
|
};
|
|
17
30
|
}
|
|
18
31
|
const json = (status, body) => new Response(JSON.stringify(body), { status, headers: { "content-type": "application/json" } });
|
|
@@ -24,15 +37,20 @@ export function machinesApi(k) {
|
|
|
24
37
|
if (!m)
|
|
25
38
|
return json(404, { error: "not found" });
|
|
26
39
|
const [, app = "", id, action] = m;
|
|
27
|
-
const body = req.method === "POST" ? (await req.json().catch(() => ({}))) : {};
|
|
40
|
+
const body = req.method === "POST" ? obj(await req.json().catch(() => ({}))) : {};
|
|
28
41
|
try {
|
|
29
42
|
if (!id && req.method === "POST") {
|
|
30
|
-
const
|
|
43
|
+
const config = obj(body["config"]);
|
|
44
|
+
const guest = obj(config["guest"]);
|
|
45
|
+
const name = str(body["name"]);
|
|
46
|
+
const image = str(config["image"]);
|
|
47
|
+
const cpus = num(guest["cpus"]);
|
|
48
|
+
const memoryMb = num(guest["memory_mb"]);
|
|
31
49
|
const s = await k.sandboxes.create({
|
|
32
|
-
...(
|
|
33
|
-
...(
|
|
34
|
-
...(
|
|
35
|
-
...(
|
|
50
|
+
...(name ? { name } : {}),
|
|
51
|
+
...(image ? { image } : {}),
|
|
52
|
+
...(cpus ? { vcpu: cpus } : {}),
|
|
53
|
+
...(memoryMb ? { memoryGB: memoryMb / 1024 } : {}),
|
|
36
54
|
labels: { "fly-app": app },
|
|
37
55
|
});
|
|
38
56
|
return json(200, machine(s.info, app));
|
|
@@ -44,8 +62,12 @@ export function machinesApi(k) {
|
|
|
44
62
|
if (!action && req.method === "DELETE")
|
|
45
63
|
return json(200, { ok: true, ...machine(await k.sandboxes.delete(id), app) });
|
|
46
64
|
if (action === "exec") {
|
|
47
|
-
const
|
|
48
|
-
const
|
|
65
|
+
const given = body["command"] ?? body["cmd"];
|
|
66
|
+
const cmd = typeof given === "string" ? given : strs(given);
|
|
67
|
+
if (!cmd.length || (Array.isArray(given) && cmd.length !== arr(given).length))
|
|
68
|
+
return json(400, { error: "command must be text or a list of text" });
|
|
69
|
+
const timeout = num(body["timeout"]);
|
|
70
|
+
const r = await run(k, id, cmd, { timeoutMs: timeout ? timeout * 1000 : undefined });
|
|
49
71
|
return json(200, { exit_code: r.exitCode ?? -1, stdout: r.stdout, stderr: r.stderr });
|
|
50
72
|
}
|
|
51
73
|
if (action === "stop" || action === "suspend")
|
|
@@ -68,7 +90,10 @@ export function machinesApi(k) {
|
|
|
68
90
|
}
|
|
69
91
|
catch (e) {
|
|
70
92
|
const err = e;
|
|
71
|
-
return json(err.status && err.status >= 400 ? err.status : 500, {
|
|
93
|
+
return json(err.status && err.status >= 400 ? err.status : 500, {
|
|
94
|
+
error: err.message ?? String(e),
|
|
95
|
+
code: err.code,
|
|
96
|
+
});
|
|
72
97
|
}
|
|
73
98
|
};
|
|
74
99
|
}
|
|
@@ -76,15 +101,26 @@ export function machinesApi(k) {
|
|
|
76
101
|
export async function serveMachinesApi(port = 4280, o = {}) {
|
|
77
102
|
const { createServer } = await import("node:http");
|
|
78
103
|
const handle = machinesApi(client(o));
|
|
79
|
-
|
|
104
|
+
const serve = async (req, res) => {
|
|
80
105
|
const chunks = [];
|
|
81
106
|
for await (const c of req)
|
|
82
107
|
chunks.push(c);
|
|
83
|
-
const r = await handle(new Request(`http://localhost${req.url}`, {
|
|
108
|
+
const r = await handle(new Request(`http://localhost${req.url}`, {
|
|
109
|
+
method: req.method,
|
|
110
|
+
headers: req.headers,
|
|
111
|
+
...(chunks.length ? { body: Buffer.concat(chunks) } : {}),
|
|
112
|
+
}));
|
|
84
113
|
const headers = {};
|
|
85
114
|
r.headers.forEach((v, k) => (headers[k] = v));
|
|
86
115
|
res.writeHead(r.status, headers);
|
|
87
116
|
res.end(Buffer.from(await r.arrayBuffer()));
|
|
117
|
+
};
|
|
118
|
+
createServer((req, res) => {
|
|
119
|
+
serve(req, res).catch((e) => {
|
|
120
|
+
if (!res.headersSent)
|
|
121
|
+
res.writeHead(500, { "content-type": "application/json" });
|
|
122
|
+
res.end(JSON.stringify({ error: e instanceof Error ? e.message : String(e) }));
|
|
123
|
+
});
|
|
88
124
|
}).listen(port, "127.0.0.1");
|
|
89
125
|
process.stderr.write(`Fly Machines API on http://127.0.0.1:${port} (FLY_API_HOSTNAME=http://127.0.0.1:${port})\n`);
|
|
90
126
|
return new Promise(() => undefined);
|
package/dist/v2/shims/morph.js
CHANGED
|
@@ -70,7 +70,7 @@ export class MorphCloudClient {
|
|
|
70
70
|
};
|
|
71
71
|
this.instances = {
|
|
72
72
|
async start(p) {
|
|
73
|
-
return new Instance(k, (await k.sandboxes.create({
|
|
73
|
+
return new Instance(k, (await k.sandboxes.create({ from: p.snapshotId })).id);
|
|
74
74
|
},
|
|
75
75
|
async get(p) {
|
|
76
76
|
return new Instance(k, (await k.sandboxes.get(p.instanceId)).id);
|
package/dist/v2/table.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Json } from "./json.js";
|
|
1
2
|
/** One flag: a field of a verb's query or body, or a shortcut's argument. */
|
|
2
3
|
export interface Flag {
|
|
3
4
|
flag: string;
|
|
@@ -6,6 +7,10 @@ export interface Flag {
|
|
|
6
7
|
list: boolean;
|
|
7
8
|
/** A command (text run by bash -lc, or a list run without a shell): what follows `--` on the command line. */
|
|
8
9
|
command?: boolean;
|
|
10
|
+
/** A secret (writeOnly): never a flag, where shell history and `ps` keep it; read from standard input or --from-file. */
|
|
11
|
+
secret?: boolean;
|
|
12
|
+
/** The values it takes, when its schema lists them. */
|
|
13
|
+
choices?: string[];
|
|
9
14
|
required: boolean;
|
|
10
15
|
doc: string;
|
|
11
16
|
}
|
|
@@ -41,13 +46,11 @@ export interface Shortcut {
|
|
|
41
46
|
}
|
|
42
47
|
/** `getNetwork` as `get-network`. */
|
|
43
48
|
export declare function kebab(name: string): string;
|
|
44
|
-
type Schema = Record<string, any>;
|
|
45
49
|
/** Every command a document names: each operation, then each shortcut. */
|
|
46
|
-
export declare function commandsOf(doc:
|
|
50
|
+
export declare function commandsOf(doc: Json): Command[];
|
|
47
51
|
/** The API's document: the server's when it answers (a 304 keeps the copy
|
|
48
52
|
* on disk), else the last one kept, else the shipped one. */
|
|
49
53
|
export declare function document(baseUrl: string, fetcher?: typeof fetch): Promise<{
|
|
50
|
-
doc:
|
|
54
|
+
doc: Json;
|
|
51
55
|
from: "server" | "cache" | "shipped";
|
|
52
56
|
}>;
|
|
53
|
-
export {};
|
package/dist/v2/table.js
CHANGED
|
@@ -7,76 +7,137 @@ import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
|
7
7
|
import { homedir } from "node:os";
|
|
8
8
|
import { dirname, join } from "node:path";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
|
+
import { arr, num, obj, str, strs } from "./json.js";
|
|
10
11
|
/** `getNetwork` as `get-network`. */
|
|
11
12
|
export function kebab(name) {
|
|
12
|
-
return name
|
|
13
|
+
return name
|
|
14
|
+
.replace(/MiB/g, "Mib")
|
|
15
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1-$2")
|
|
16
|
+
.toLowerCase();
|
|
13
17
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
/** A schema, followed through its `$ref` within `doc`. */
|
|
19
|
+
function resolve(doc, v) {
|
|
20
|
+
const s = obj(v);
|
|
21
|
+
const ref = str(s["$ref"]);
|
|
22
|
+
return ref === undefined
|
|
23
|
+
? s
|
|
24
|
+
: ref
|
|
25
|
+
.replace(/^#\//, "")
|
|
26
|
+
.split("/")
|
|
27
|
+
.reduce((o, k) => obj(o[k]), doc);
|
|
17
28
|
}
|
|
18
29
|
function flagsOf(props, required, skip) {
|
|
19
30
|
return Object.entries(props)
|
|
20
31
|
.filter(([name]) => !skip.includes(name))
|
|
21
|
-
.map(([name,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
.map(([name, v]) => {
|
|
33
|
+
const s = obj(v);
|
|
34
|
+
const one = s["type"] === "array" ? obj(s["items"]) : s;
|
|
35
|
+
return {
|
|
36
|
+
flag: kebab(name),
|
|
37
|
+
field: name,
|
|
38
|
+
// Its one value's type, a list's item's: each flag's value is typed by it (cli.ts `value`).
|
|
39
|
+
type: one["additionalProperties"]
|
|
40
|
+
? "map"
|
|
41
|
+
: one["$ref"]
|
|
42
|
+
? "object"
|
|
43
|
+
: (str(one["type"]) ?? "string"),
|
|
44
|
+
// A command's schema is text or a list (oneOf): given as its program and arguments, after `--`.
|
|
45
|
+
list: s["type"] === "array" || Array.isArray(s["oneOf"]),
|
|
46
|
+
command: Array.isArray(s["oneOf"]),
|
|
47
|
+
secret: s["writeOnly"] === true,
|
|
48
|
+
...(Array.isArray(one["enum"])
|
|
49
|
+
? { choices: arr(one["enum"]).map((c) => String(c)) }
|
|
50
|
+
: {}),
|
|
51
|
+
required: required.includes(name),
|
|
52
|
+
doc: str(s["description"]) ?? "",
|
|
53
|
+
};
|
|
54
|
+
});
|
|
31
55
|
}
|
|
32
56
|
/** Every command a document names: each operation, then each shortcut. */
|
|
33
57
|
export function commandsOf(doc) {
|
|
34
58
|
const out = [];
|
|
35
|
-
for (const methods of Object.values(doc["paths"]
|
|
36
|
-
for (const
|
|
37
|
-
const
|
|
38
|
-
|
|
59
|
+
for (const methods of Object.values(obj(doc["paths"]))) {
|
|
60
|
+
for (const v of Object.values(obj(methods))) {
|
|
61
|
+
const op = obj(v);
|
|
62
|
+
const id = str(op["operationId"]);
|
|
63
|
+
if (id === undefined || !id.includes("."))
|
|
39
64
|
continue;
|
|
40
|
-
const [product, verb] = id.split(".");
|
|
41
|
-
const params = op["parameters"]
|
|
42
|
-
const content = op["requestBody"]
|
|
43
|
-
const body = resolve(doc, content["application/json"]
|
|
65
|
+
const [product = "", verb = ""] = id.split(".");
|
|
66
|
+
const params = arr(op["parameters"]).map(obj);
|
|
67
|
+
const content = obj(obj(op["requestBody"])["content"]);
|
|
68
|
+
const body = resolve(doc, obj(content["application/json"])["schema"]);
|
|
69
|
+
const named = (p) => str(p["name"]) ?? "";
|
|
44
70
|
const query = params.filter((p) => p["in"] === "query");
|
|
45
71
|
const flags = [
|
|
46
|
-
...flagsOf(Object.fromEntries(query.map((p) => [p
|
|
47
|
-
...flagsOf(body["properties"]
|
|
72
|
+
...flagsOf(Object.fromEntries(query.map((p) => [named(p), { ...obj(p["schema"]), description: p["description"] }])), query.filter((p) => p["required"] === true).map(named), []),
|
|
73
|
+
...flagsOf(obj(body["properties"]), strs(body["required"]), []),
|
|
48
74
|
];
|
|
49
75
|
out.push({
|
|
50
76
|
name: id,
|
|
51
77
|
product,
|
|
52
78
|
verb: kebab(verb),
|
|
53
|
-
doc:
|
|
54
|
-
args: params.filter((p) => p["in"] === "path").map(
|
|
79
|
+
doc: str(op["summary"]) ?? "",
|
|
80
|
+
args: params.filter((p) => p["in"] === "path").map(named),
|
|
55
81
|
flags,
|
|
56
|
-
stdin:
|
|
82
|
+
stdin: "application/octet-stream" in content,
|
|
57
83
|
});
|
|
58
84
|
}
|
|
59
85
|
}
|
|
60
|
-
for (const
|
|
86
|
+
for (const v of arr(doc["x-shortcuts"])) {
|
|
87
|
+
const s = shortcutOf(obj(v));
|
|
88
|
+
if (!s)
|
|
89
|
+
continue;
|
|
90
|
+
const input = obj(obj(v)["inputSchema"]);
|
|
61
91
|
out.push({
|
|
62
92
|
name: s.name,
|
|
63
93
|
product: s.name,
|
|
64
94
|
verb: "",
|
|
65
95
|
doc: s.description,
|
|
66
96
|
args: [],
|
|
67
|
-
flags: flagsOf(
|
|
97
|
+
flags: flagsOf(obj(input["properties"]), strs(input["required"]), []),
|
|
68
98
|
stdin: false,
|
|
69
99
|
shortcut: s,
|
|
70
100
|
});
|
|
71
101
|
}
|
|
72
102
|
return out;
|
|
73
103
|
}
|
|
104
|
+
/** A shortcut as the document names it, or undefined when it is not one. */
|
|
105
|
+
function shortcutOf(s) {
|
|
106
|
+
const name = str(s["name"]);
|
|
107
|
+
const answer = num(s["answer"]);
|
|
108
|
+
if (name === undefined || answer === undefined)
|
|
109
|
+
return undefined;
|
|
110
|
+
const steps = [];
|
|
111
|
+
for (const t of arr(s["steps"]).map(obj)) {
|
|
112
|
+
const verb = str(t["verb"]);
|
|
113
|
+
if (verb === undefined)
|
|
114
|
+
return undefined;
|
|
115
|
+
const args = {};
|
|
116
|
+
for (const [k, a] of Object.entries(obj(t["args"]))) {
|
|
117
|
+
const from = obj(a);
|
|
118
|
+
const arg = str(from["arg"]);
|
|
119
|
+
const step = num(from["step"]);
|
|
120
|
+
const field = str(from["field"]);
|
|
121
|
+
if (arg !== undefined)
|
|
122
|
+
args[k] = { arg };
|
|
123
|
+
else if (step !== undefined && field !== undefined)
|
|
124
|
+
args[k] = { step, field };
|
|
125
|
+
else
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
steps.push({ verb, args, always: t["always"] === true });
|
|
129
|
+
}
|
|
130
|
+
return { name, description: str(s["description"]) ?? "", steps, answer };
|
|
131
|
+
}
|
|
74
132
|
/** The copy of the document shipped in the package, beside this file. */
|
|
75
133
|
function shipped() {
|
|
76
134
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
77
|
-
for (const p of [
|
|
135
|
+
for (const p of [
|
|
136
|
+
join(here, "openapi.json"),
|
|
137
|
+
join(here, "../../../../engines/front/crates/spec/openapi/v2.json"),
|
|
138
|
+
]) {
|
|
78
139
|
try {
|
|
79
|
-
return JSON.parse(readFileSync(p, "utf8"));
|
|
140
|
+
return obj(JSON.parse(readFileSync(p, "utf8")));
|
|
80
141
|
}
|
|
81
142
|
catch {
|
|
82
143
|
// the next place
|
|
@@ -87,11 +148,13 @@ function shipped() {
|
|
|
87
148
|
/** The API's document: the server's when it answers (a 304 keeps the copy
|
|
88
149
|
* on disk), else the last one kept, else the shipped one. */
|
|
89
150
|
export async function document(baseUrl, fetcher = fetch) {
|
|
90
|
-
const dir = process.env["RUNTIME_CACHE_DIR"] ??
|
|
151
|
+
const dir = process.env["RUNTIME_CACHE_DIR"] ??
|
|
152
|
+
join(process.env["XDG_CACHE_HOME"] ?? join(homedir(), ".cache"), "runtime");
|
|
91
153
|
const file = join(dir, `openapi-${encodeURIComponent(new URL(baseUrl).host)}.json`);
|
|
92
154
|
let kept;
|
|
93
155
|
try {
|
|
94
|
-
|
|
156
|
+
const k = obj(JSON.parse(readFileSync(file, "utf8")));
|
|
157
|
+
kept = { etag: str(k["etag"]), doc: obj(k["doc"]) };
|
|
95
158
|
}
|
|
96
159
|
catch {
|
|
97
160
|
kept = undefined;
|
|
@@ -104,7 +167,7 @@ export async function document(baseUrl, fetcher = fetch) {
|
|
|
104
167
|
if (res.status === 304 && kept)
|
|
105
168
|
return { doc: kept.doc, from: "server" };
|
|
106
169
|
if (res.ok) {
|
|
107
|
-
const doc = (await res.json());
|
|
170
|
+
const doc = obj(await res.json());
|
|
108
171
|
try {
|
|
109
172
|
mkdirSync(dir, { recursive: true });
|
|
110
173
|
writeFileSync(file, JSON.stringify({ etag: res.headers.get("etag") ?? undefined, doc }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "withruntime",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Runtime Cloud: Linux sandboxes for agents. new Runtime(), a sandbox handle, every verb of the API typed, the runtime CLI, its MCP bridge and drop-ins for E2B, Daytona, Vercel, Blaxel, Morph, Modal, Cloudflare and Fly.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -16,14 +16,16 @@
|
|
|
16
16
|
"./cloudflare": { "types": "./dist/v2/shims/cloudflare.d.ts", "default": "./dist/v2/shims/cloudflare.js" },
|
|
17
17
|
"./fly": { "types": "./dist/v2/shims/fly.d.ts", "default": "./dist/v2/shims/fly.js" }
|
|
18
18
|
},
|
|
19
|
-
"bin": { "runtime": "dist/v2/
|
|
20
|
-
"files": ["dist", "LICENSE"],
|
|
19
|
+
"bin": { "runtime": "dist/v2/bin.js", "withruntime": "dist/v2/bin.js" },
|
|
20
|
+
"files": ["dist", "LICENSE", "README.md", "CHANGELOG.md"],
|
|
21
|
+
"keywords": ["sandbox", "cloud", "agents", "ai-agents", "microvm", "firecracker", "code-execution", "code-interpreter", "mcp", "browser", "desktop", "jupyter", "ci", "serverless", "containers"],
|
|
21
22
|
"scripts": {
|
|
22
|
-
"build": "tsc -p tsconfig.json && chmod +x dist/v2/
|
|
23
|
+
"build": "tsc -p tsconfig.json && chmod +x dist/v2/bin.js && cp openapi.json dist/v2/openapi.json"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": { "typescript": "5.9.3", "@types/node": "22.15.0" },
|
|
25
26
|
"engines": { "node": ">=22.12" },
|
|
26
27
|
"homepage": "https://withruntime.com",
|
|
27
|
-
"repository": { "type": "git", "url": "git+https://github.com/withruntime/runtime.git" },
|
|
28
|
+
"repository": { "type": "git", "url": "git+https://github.com/withruntime/runtime.git", "directory": "packages/cloud-sdk" },
|
|
29
|
+
"bugs": { "url": "https://github.com/withruntime/runtime/issues" },
|
|
28
30
|
"publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" }
|
|
29
31
|
}
|