overvues 0.0.1 → 0.4.10
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 +58 -2
- package/dist/ansi.js +24 -0
- package/dist/attach-client.js +586 -0
- package/dist/auth-connect-browser.js +112 -0
- package/dist/auth-connect.js +306 -0
- package/dist/browser-bootstrap.js +190 -0
- package/dist/browser-loopback.js +289 -0
- package/dist/build-identity.js +6 -0
- package/dist/codex-reviewer-apparmor.json +4 -0
- package/dist/codex-reviewer-seccomp.json +1238 -0
- package/dist/codex-runtime-protocol.js +1 -0
- package/dist/codex-subscription.js +53 -0
- package/dist/config.js +297 -0
- package/dist/connect-comparison-code.js +26 -0
- package/dist/development-runner.js +109 -0
- package/dist/dns-doctor.js +390 -0
- package/dist/docker-names.js +47 -0
- package/dist/doctor.js +114 -0
- package/dist/gadget-job.js +804 -0
- package/dist/health-check.js +112 -0
- package/dist/help.js +71 -0
- package/dist/host-auth.js +22 -0
- package/dist/host-diagnostics.js +20 -0
- package/dist/host-runtime-identity.js +39 -0
- package/dist/host-runtime-metadata.js +56 -0
- package/dist/host-service.js +377 -0
- package/dist/host-stack.js +484 -0
- package/dist/host-supervisor.js +237 -0
- package/dist/host-update.js +387 -0
- package/dist/hub-address.js +100 -0
- package/dist/hub-client.js +459 -0
- package/dist/hub-kind.js +88 -0
- package/dist/identity.js +73 -0
- package/dist/index.js +185 -0
- package/dist/init.js +295 -0
- package/dist/isolated-run-cache.js +116 -0
- package/dist/local-stack.js +685 -0
- package/dist/machine-capacity.js +128 -0
- package/dist/managed-runner-image.js +13 -0
- package/dist/os-acted-record.js +49 -0
- package/dist/os-adapter.js +8190 -0
- package/dist/os-command.js +292 -0
- package/dist/os-handoff.js +274 -0
- package/dist/os-keychain.js +247 -0
- package/dist/os-machine.js +818 -0
- package/dist/os-owner.js +61 -0
- package/dist/os-private-file.js +98 -0
- package/dist/os-protocol.js +468 -0
- package/dist/os-session-store.js +133 -0
- package/dist/os-status.js +102 -0
- package/dist/picker.js +863 -0
- package/dist/portable-workspace-capability.js +60 -0
- package/dist/project-environment-capability.js +62 -0
- package/dist/project-environment.js +28 -0
- package/dist/project-preparation.js +134 -0
- package/dist/readiness.js +28 -0
- package/dist/redaction.js +27 -0
- package/dist/reviewer-isolation-capability.js +61 -0
- package/dist/runner-api-auth.js +80 -0
- package/dist/runner-command-fence.js +536 -0
- package/dist/runner-inspection.js +57 -0
- package/dist/runner-inventory.js +587 -0
- package/dist/runner-server.js +2520 -0
- package/dist/runner-session.js +470 -0
- package/dist/runner-slug-folder.js +39 -0
- package/dist/runner-slug.js +40 -0
- package/dist/setup.js +139 -0
- package/dist/shutdown.js +102 -0
- package/dist/splash.js +65 -0
- package/dist/staged-workspaces.js +441 -0
- package/dist/staging-disk.js +97 -0
- package/dist/terminal-lane.js +339 -0
- package/dist/terminal-recovery.js +502 -0
- package/licenses/capnweb.txt +23 -0
- package/licenses/moby-profiles.txt +212 -0
- package/licenses/ws.txt +22 -0
- package/package.json +28 -7
- package/cli.js +0 -2
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { resolve4 } from "node:dns/promises";
|
|
3
|
+
function isIpv4Address(hostname) {
|
|
4
|
+
return /^\d+\.\d+\.\d+\.\d+$/.test(hostname);
|
|
5
|
+
}
|
|
6
|
+
async function resolveHostname(hostname) {
|
|
7
|
+
try {
|
|
8
|
+
await resolve4(hostname);
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
async function resolveViaCloudflareDns(hostname) {
|
|
16
|
+
try {
|
|
17
|
+
const response = await fetch(`https://cloudflare-dns.com/dns-query?name=${encodeURIComponent(hostname)}&type=A`, {
|
|
18
|
+
headers: { accept: "application/dns-json" },
|
|
19
|
+
signal: AbortSignal.timeout(2500),
|
|
20
|
+
});
|
|
21
|
+
if (!response.ok)
|
|
22
|
+
return [];
|
|
23
|
+
const body = await response.json();
|
|
24
|
+
if (body.Status !== 0 || !Array.isArray(body.Answer))
|
|
25
|
+
return [];
|
|
26
|
+
return body.Answer
|
|
27
|
+
.filter((answer) => answer?.type === 1 && typeof answer.data === "string" && answer.data.trim())
|
|
28
|
+
.map((answer) => answer.data.trim());
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function curlHealthCheck(url, ip, headers) {
|
|
35
|
+
const target = new URL(url);
|
|
36
|
+
const port = target.port || (target.protocol === "https:" ? "443" : "80");
|
|
37
|
+
const curlArgs = [
|
|
38
|
+
"--silent",
|
|
39
|
+
"--show-error",
|
|
40
|
+
"--output",
|
|
41
|
+
"/dev/null",
|
|
42
|
+
"--write-out",
|
|
43
|
+
"%{http_code}",
|
|
44
|
+
"--resolve",
|
|
45
|
+
`${target.hostname}:${port}:${ip}`,
|
|
46
|
+
];
|
|
47
|
+
const headerInput = headers
|
|
48
|
+
? Array.from(new Headers(headers).entries(), ([name, value]) => `${name}: ${value}\n`).join("")
|
|
49
|
+
: "";
|
|
50
|
+
if (headerInput)
|
|
51
|
+
curlArgs.push("--header", "@-");
|
|
52
|
+
curlArgs.push(url);
|
|
53
|
+
const childEnv = { ...process.env };
|
|
54
|
+
delete childEnv.TILLER_CLIENT_ID;
|
|
55
|
+
delete childEnv.TILLER_CLIENT_SECRET;
|
|
56
|
+
const result = spawnSync("curl", curlArgs, {
|
|
57
|
+
encoding: "utf8",
|
|
58
|
+
env: childEnv,
|
|
59
|
+
input: headerInput,
|
|
60
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
61
|
+
timeout: 5000,
|
|
62
|
+
});
|
|
63
|
+
if (result.status !== 0) {
|
|
64
|
+
return {
|
|
65
|
+
ok: false,
|
|
66
|
+
detail: result.stderr.trim() || result.stdout.trim() || `curl exited with ${result.status ?? "unknown"}`,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const statusCode = Number.parseInt(result.stdout.trim(), 10);
|
|
70
|
+
if (statusCode >= 200 && statusCode < 300) {
|
|
71
|
+
return { ok: true, detail: url };
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
ok: false,
|
|
75
|
+
detail: `${url} -> ${Number.isFinite(statusCode) ? statusCode : result.stdout.trim() || "unknown"}`,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export async function checkHttpHealth(url, headers) {
|
|
79
|
+
try {
|
|
80
|
+
const hostname = new URL(url).hostname;
|
|
81
|
+
if (hostname && !isIpv4Address(hostname)) {
|
|
82
|
+
const resolved = await resolveHostname(hostname);
|
|
83
|
+
if (!resolved) {
|
|
84
|
+
const fallbackIps = await resolveViaCloudflareDns(hostname);
|
|
85
|
+
let lastFailure;
|
|
86
|
+
for (const ip of fallbackIps) {
|
|
87
|
+
const result = curlHealthCheck(url, ip, headers);
|
|
88
|
+
if (result.ok)
|
|
89
|
+
return result;
|
|
90
|
+
lastFailure = result;
|
|
91
|
+
}
|
|
92
|
+
if (lastFailure)
|
|
93
|
+
return lastFailure;
|
|
94
|
+
return { ok: false, detail: `DNS not yet available for ${hostname}` };
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const response = await fetch(url, {
|
|
98
|
+
headers,
|
|
99
|
+
redirect: "manual",
|
|
100
|
+
signal: AbortSignal.timeout(2500),
|
|
101
|
+
});
|
|
102
|
+
return response.ok
|
|
103
|
+
? { ok: true, detail: url }
|
|
104
|
+
: { ok: false, detail: `${url} -> ${response.status}` };
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
return {
|
|
108
|
+
ok: false,
|
|
109
|
+
detail: error instanceof Error ? error.message : String(error),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
package/dist/help.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { CLI, osWords } from "./identity.js";
|
|
2
|
+
// The `tiller` help is unchanged. The `overvues` help lists what a person connecting a machine to
|
|
3
|
+
// an Overvues Dev hub needs; the commands it leaves out (subscription logins, setup checks, DNS
|
|
4
|
+
// repair, the release's guarded update flags) still run.
|
|
5
|
+
export function cliHelp(identity = CLI) {
|
|
6
|
+
if (identity.name === "overvues") {
|
|
7
|
+
const c = identity.command;
|
|
8
|
+
return [
|
|
9
|
+
`Usage: ${c} <command> [--hub-url https://<your hub>]`,
|
|
10
|
+
"",
|
|
11
|
+
`Connect this computer to your ${identity.productName} hub, so the hub can build, preview and deploy your apps here.`,
|
|
12
|
+
"",
|
|
13
|
+
"Commands:",
|
|
14
|
+
` ${c} host setup Connect this computer to the hub and start it in the background`,
|
|
15
|
+
` ${c} os connect Sign this computer in to Overvues, so it can deploy and preview as you`,
|
|
16
|
+
` ${c} os status Show whether this computer is signed in to Overvues, as whom, and until when`,
|
|
17
|
+
` ${c} os forget Forget the Overvues sign-in kept on this computer`,
|
|
18
|
+
` ${c} attach Pick a workspace and session on the hub and attach to it`,
|
|
19
|
+
` ${c} host Run the machine in this terminal instead of in the background`,
|
|
20
|
+
` ${c} host update Update this computer's runtime to what the hub expects (--dry-run, --yes)`,
|
|
21
|
+
` ${c} status Show whether the machine is running`,
|
|
22
|
+
` ${c} down Stop the machine`,
|
|
23
|
+
` ${c} doctor Check this computer's setup and say what to fix`,
|
|
24
|
+
"",
|
|
25
|
+
`Update ${c} itself with: npm install -g ${identity.npmPackage}`,
|
|
26
|
+
].join("\n");
|
|
27
|
+
}
|
|
28
|
+
return [
|
|
29
|
+
`Usage: ${identity.command} [auth connect [codex|claude]|os [connect|status|forget]|host [setup|install-service|update]|setup|status|down|doctor [dns [status|repair|restore]]] [--hub-url https://<exact-host>.workers.dev] [--history]`,
|
|
30
|
+
"",
|
|
31
|
+
"Commands:",
|
|
32
|
+
" host setup Connect and install this execution machine",
|
|
33
|
+
" host Start the execution-machine daemon",
|
|
34
|
+
" host install-service Install the persistent execution-machine service",
|
|
35
|
+
" host update Pin this machine's runtime image to the current Hub build (`--dry-run`, `--yes`)",
|
|
36
|
+
" Optional target guard: --expect-release-id ID --expect-runtime-image DIGEST_REF --expect-cli-version VERSION (all three required)",
|
|
37
|
+
" auth connect Connect Codex and Claude subscriptions (or one named provider)",
|
|
38
|
+
` os connect Connect this machine to Overvues (paste an ${osWords(identity).noun} session at a prompt); \`os status\`, \`os forget\``,
|
|
39
|
+
" setup Run setup checks",
|
|
40
|
+
" status Show execution-machine health",
|
|
41
|
+
" down Stop the running execution-machine daemon",
|
|
42
|
+
" doctor Diagnose execution-machine setup and service health",
|
|
43
|
+
" doctor dns Diagnose hub DNS resolution and, on macOS, repair stale local DNS",
|
|
44
|
+
"",
|
|
45
|
+
"Default:",
|
|
46
|
+
` ${identity.command} Open the env/session picker and attach`,
|
|
47
|
+
].join("\n");
|
|
48
|
+
}
|
|
49
|
+
export function hostHelp(identity = CLI) {
|
|
50
|
+
if (identity.name === "overvues") {
|
|
51
|
+
const c = identity.command;
|
|
52
|
+
return [
|
|
53
|
+
`Usage: ${c} host [setup|update] [--hub-url https://<your hub>]`,
|
|
54
|
+
"",
|
|
55
|
+
"Commands:",
|
|
56
|
+
` ${c} host setup Connect this computer to the hub and start it in the background`,
|
|
57
|
+
` ${c} host Run the machine in this terminal instead of in the background`,
|
|
58
|
+
` ${c} host update Update this computer's runtime to what the hub expects (--dry-run, --yes)`,
|
|
59
|
+
].join("\n");
|
|
60
|
+
}
|
|
61
|
+
return [
|
|
62
|
+
`Usage: ${identity.command} host [setup|install-service|update] [--hub-url https://<exact-host>.workers.dev]`,
|
|
63
|
+
"",
|
|
64
|
+
"Commands:",
|
|
65
|
+
" host Start the execution-machine daemon",
|
|
66
|
+
" host setup Connect and install this execution machine",
|
|
67
|
+
" host install-service Install the persistent service",
|
|
68
|
+
" host update Pin this machine's runtime image to the current Hub build",
|
|
69
|
+
" --dry-run, --yes; optional target guard requires --expect-release-id ID --expect-runtime-image DIGEST_REF --expect-cli-version VERSION",
|
|
70
|
+
].join("\n");
|
|
71
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { HUB_URL, hubControlHeaders, } from "./config.js";
|
|
2
|
+
import { fetchHubSetupStatus, isHubSetupStatusAuthError, } from "./codex-subscription.js";
|
|
3
|
+
import { CLI } from "./identity.js";
|
|
4
|
+
export const HOST_CREDENTIAL_SETUP_INSTRUCTION = `Run \`${CLI.command} host setup --hub-url https://<exact-host>.workers.dev\`.`;
|
|
5
|
+
/**
|
|
6
|
+
* Noninteractive commands may validate saved credentials, but never launch a
|
|
7
|
+
* browser. Transient Hub failures remain reconnectable; a definitive Access
|
|
8
|
+
* rejection fails with the interactive setup instruction.
|
|
9
|
+
*/
|
|
10
|
+
export async function readSetupStatusWithValidatedCredential(hubUrl = HUB_URL, headers = hubControlHeaders) {
|
|
11
|
+
if (!hubUrl)
|
|
12
|
+
return null;
|
|
13
|
+
try {
|
|
14
|
+
return await fetchHubSetupStatus(hubUrl, headers);
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
if (isHubSetupStatusAuthError(error)) {
|
|
18
|
+
throw new Error(`The saved Hub service credential is invalid. ${HOST_CREDENTIAL_SETUP_INSTRUCTION}`, { cause: error });
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CLI } from "./identity.js";
|
|
2
|
+
export function collectHubHostChecks(status) {
|
|
3
|
+
const connection = status.hostConnected
|
|
4
|
+
? {
|
|
5
|
+
id: "hub-host-connection",
|
|
6
|
+
label: "Hub execution-machine connection",
|
|
7
|
+
level: "ok",
|
|
8
|
+
detail: "connected",
|
|
9
|
+
}
|
|
10
|
+
: {
|
|
11
|
+
id: "hub-host-connection",
|
|
12
|
+
label: "Hub execution-machine connection",
|
|
13
|
+
level: "fail",
|
|
14
|
+
detail: status.hostRegistered ? "registered, but the Hub reports the live machine session disconnected" : "no execution machine is registered with the Hub",
|
|
15
|
+
fixHint: status.hostRegistered
|
|
16
|
+
? `restart \`${CLI.systemdServiceName}\`; if it stays disconnected, inspect \`journalctl -u ${CLI.systemdServiceName.replace(/\.service$/, "")}\` for reconnect errors`
|
|
17
|
+
: `run \`${CLI.command} host setup\`, then start or restart \`${CLI.systemdServiceName}\``,
|
|
18
|
+
};
|
|
19
|
+
return [connection];
|
|
20
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
export const HOST_PACKAGE_VERSION = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
|
|
4
|
+
export function parseHostRuntimeIdentity(value) {
|
|
5
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
6
|
+
return undefined;
|
|
7
|
+
const record = value;
|
|
8
|
+
if (typeof record.instanceId !== "string" || !/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(record.instanceId) ||
|
|
9
|
+
typeof record.packageVersion !== "string" || !/^\d+\.\d+\.\d+(?:-[a-zA-Z0-9.-]+)?$/.test(record.packageVersion) || record.packageVersion.length > 100 ||
|
|
10
|
+
typeof record.runtimeImage !== "string" || !record.runtimeImage.trim() || record.runtimeImage.length > 512 || /[\s\u0000-\u001f\u007f]/u.test(record.runtimeImage))
|
|
11
|
+
return undefined;
|
|
12
|
+
return { instanceId: record.instanceId, packageVersion: record.packageVersion, runtimeImage: record.runtimeImage,
|
|
13
|
+
...(typeof record.runtimePlatform === "string" && /^[a-z0-9]+\/[a-z0-9]+$/.test(record.runtimePlatform) ? { runtimePlatform: record.runtimePlatform } : {}) };
|
|
14
|
+
}
|
|
15
|
+
/** Inspect the container image, not the CLI OS (which may be macOS). */
|
|
16
|
+
export function readRuntimeImagePlatform(image) {
|
|
17
|
+
try {
|
|
18
|
+
const result = spawnSync("docker", ["image", "inspect", "--format", "{{.Os}}/{{.Architecture}}", "--", image], { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], timeout: 2000, maxBuffer: 4096 });
|
|
19
|
+
const platform = result.stdout?.trim();
|
|
20
|
+
return result.status === 0 && /^[a-z0-9]+\/[a-z0-9]+$/.test(platform) ? platform : undefined;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export async function readHostRuntimeHealth(url) {
|
|
27
|
+
try {
|
|
28
|
+
const response = await fetch(url, { redirect: "manual", cache: "no-store", signal: AbortSignal.timeout(2500) });
|
|
29
|
+
if (!response.ok)
|
|
30
|
+
return { ok: false, detail: `Local runner returned HTTP ${response.status}` };
|
|
31
|
+
const body = await response.json();
|
|
32
|
+
if (!body || body.ok !== true)
|
|
33
|
+
return { ok: false, detail: "Local runner did not report healthy state" };
|
|
34
|
+
return { ok: true, identity: parseHostRuntimeIdentity(body.identity) };
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
return { ok: false, detail: error instanceof Error ? error.message : String(error) };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { hubControlHeaders } from "./config.js";
|
|
2
|
+
import { parseManagedLocalRunnerImageSourceId } from "./managed-runner-image.js";
|
|
3
|
+
import { CLI } from "./identity.js";
|
|
4
|
+
function resolveSelfHostRuntimeImage(value) {
|
|
5
|
+
if (typeof value !== "string" || !value.trim()) {
|
|
6
|
+
throw new Error("Malformed Hub release info response: `currentRelease.selfHostRuntimeImage` must be present.");
|
|
7
|
+
}
|
|
8
|
+
const image = value.trim();
|
|
9
|
+
const imageDigest = parseManagedLocalRunnerImageSourceId(image);
|
|
10
|
+
if (!/^sha256:[0-9a-f]{64}$/.test(imageDigest ?? "")) {
|
|
11
|
+
throw new Error("Malformed Hub release info response: `currentRelease.selfHostRuntimeImage` must be "
|
|
12
|
+
+ "docker.io/jamieatlason/tiller-sandbox@sha256:<64-character lowercase digest>.");
|
|
13
|
+
}
|
|
14
|
+
return image;
|
|
15
|
+
}
|
|
16
|
+
export function resolveHostUpdateTargetImage(currentRelease) {
|
|
17
|
+
return resolveSelfHostRuntimeImage(currentRelease.selfHostRuntimeImage);
|
|
18
|
+
}
|
|
19
|
+
export async function fetchHostUpdateCheck(hubUrl, headers = hubControlHeaders) {
|
|
20
|
+
const response = await fetch(`${hubUrl}/api/update/check`, {
|
|
21
|
+
headers: { Accept: "application/json", ...headers },
|
|
22
|
+
});
|
|
23
|
+
const contentType = response.headers.get("content-type")?.toLowerCase() ?? "";
|
|
24
|
+
const body = contentType.includes("application/json")
|
|
25
|
+
? await response.json().catch(() => ({ error: `HTTP ${response.status}` }))
|
|
26
|
+
: { error: `HTTP ${response.status}` };
|
|
27
|
+
if (response.status === 401 || response.status === 403 || !contentType.includes("application/json")) {
|
|
28
|
+
throw new Error("The saved Hub service credential is invalid. Run "
|
|
29
|
+
+ `\`${CLI.command} host setup --hub-url https://<exact-host>.workers.dev\`.`);
|
|
30
|
+
}
|
|
31
|
+
if (!response.ok) {
|
|
32
|
+
const message = typeof body === "object" && body && "error" in body && typeof body.error === "string"
|
|
33
|
+
? body.error
|
|
34
|
+
: `HTTP ${response.status}`;
|
|
35
|
+
throw new Error(`Failed to check Hub release info: ${message}`);
|
|
36
|
+
}
|
|
37
|
+
// A machine runs only the runner image its own hub names by digest. Every
|
|
38
|
+
// hub deployed today names one (release builds and `npm run deploy:dev`
|
|
39
|
+
// alike), so a hub that names none was built without it.
|
|
40
|
+
if (body && typeof body === "object" && "currentRelease" in body &&
|
|
41
|
+
body.currentRelease && typeof body.currentRelease === "object" &&
|
|
42
|
+
!("selfHostRuntimeImage" in body.currentRelease)) {
|
|
43
|
+
throw new Error("This hub does not name the runner image its machines run, so this machine cannot be set up or updated "
|
|
44
|
+
+ "against it. The hub's operator has to deploy it again (an Overvues Dev hub: `npm run deploy:dev`). "
|
|
45
|
+
+ "No host configuration was changed.");
|
|
46
|
+
}
|
|
47
|
+
if (typeof body !== "object"
|
|
48
|
+
|| body === null
|
|
49
|
+
|| !("currentRelease" in body)
|
|
50
|
+
|| typeof body.currentRelease !== "object"
|
|
51
|
+
|| body.currentRelease === null
|
|
52
|
+
|| !("selfHostRuntimeImage" in body.currentRelease)) {
|
|
53
|
+
throw new Error("Malformed Hub release info response.");
|
|
54
|
+
}
|
|
55
|
+
return body;
|
|
56
|
+
}
|