Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

fix(release): align Node support and read-only browser reconnects

Rahmanfbb03a191b2c
diff --git a/app/install/page.tsx b/app/install/page.tsx
index b89aecf7..5c6eeab2 100644
--- a/app/install/page.tsx
+++ b/app/install/page.tsx
@@ -17,7 +17,7 @@ const AGENT_PROMPT = "Install or update MSO from this repo: https://github.com/r
const REQUIREMENTS = [
["A Linux server you own", "A $5 VPS is enough. Debian/Ubuntu, Fedora and Arch are covered by the installer."],
- ["Node 20.9 or newer", "The installer adds it via NodeSource if it is missing."],
+ ["Node 22.12+, 24.x or 26+", "The installer adds it via NodeSource if it is missing."],
["A normal, non-root user", "MSO runs as that user and can do whatever that user can do. Never install it as root."],
["About 2 GB free disk", "Mostly the build. The app itself is small; there is no database."],
];
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index bbade613..67ef43d0 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -12,6 +12,7 @@ this is the *what*, and it is what Settings → About shows as “What's new”.
**Fixed**
+- `release` align Node support and read-only browser reconnects
- `extensions` lock project controls until initial inspection
- `browser` diagnose secure viewer failures without losing power state
diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md
index 6eec829d..c7456ea8 100644
--- a/docs/DEVELOPMENT.md
+++ b/docs/DEVELOPMENT.md
@@ -235,8 +235,8 @@ patch versions; the guard does not download packages or lower coverage threshold
Update both direct versions and `bun.lock` together. Dependabot's `test-toolchain`
group keeps the runner and `@vitest/*` providers out of unrelated dependency groups.
-The Vitest 5 development toolchain requires Node 22.12 or newer on the supported Node 22
-line; see the [official migration guide](https://vitest.dev/guide/migration/).
+The application, installer, doctor and Vitest 5 toolchain share the supported Node range
+`^22.12.0 || ^24.0.0 || >=26.0.0`; see the [official migration guide](https://vitest.dev/guide/migration/).
The application runtime baseline remains `.nvmrc`; `@types/node` tracks that baseline,
so moving its major requires an explicit runtime compatibility review. A successful
compile with newer typings does not prove the APIs exist on the oldest supported runtime.
diff --git a/docs/INSTALL.md b/docs/INSTALL.md
index e836aa82..e4827d42 100644
--- a/docs/INSTALL.md
+++ b/docs/INSTALL.md
@@ -9,7 +9,7 @@
- Linux; systemd is required for the installed background service, but not for the CLI;
- WSL2 is supported for the CLI. Full service mode requires systemd enabled as PID 1;
-- Node.js 20.9+ (Node 22 recommended/current production runtime);
+- Node.js 22.12+, 24.x or 26+ (Node 22 recommended/current production runtime);
- Bun for dependency installation/scripts;
- a non-root user that owns MSO;
- enough memory/swap for a Next production build (build needs more than idle runtime);
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index 7ca2dcab..9756335f 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -1,3 +1,19 @@
+## 2026-09-18 — Resolve release review on Node support and browser retries
+
+The dependency toolchain now requires the same supported Node range everywhere:
+22.12+, 24.x or 26+. Package engines, early installer checks, the independent doctor
+check and install documentation agree; boundary tests exercise both installer and
+runtime predicates. The current Node runtime is not changed. An unsupported newer
+runtime is refused rather than silently downgraded by the installer. The verified
+installer-core checksum is updated with its source.
+
+Camoufox connection retry now creates a fresh read-only connection attempt rather than
+posting a power mutation. Readiness reports each observed service state and ends as
+soon as the browser stops, so the UI does not retain a stale running state after a
+lease expires. Unit and synthetic desktop/mobile browser regressions prove repeated
+retry sends no power POST, TLS failure fetches no VNC credential, and an observed
+stopped browser returns to the start panel. Authorization and rate limits are unchanged.
+
## 2026-09-18 — Keep MCP target controls locked until their first inspection
PR release verification caught the mobile MCP journey leaving Use project disabled after
diff --git a/docs/reference/WORKSPACE-GUIDE.md b/docs/reference/WORKSPACE-GUIDE.md
index bbd34523..5c84e61c 100644
--- a/docs/reference/WORKSPACE-GUIDE.md
+++ b/docs/reference/WORKSPACE-GUIDE.md
@@ -536,7 +536,7 @@ Tested:
Supported deployment shapes:
- WSL2 Ubuntu: CLI/install path works without systemd; the background service requires systemd enabled in WSL
-- Debian 12 and other systemd-based Linux distributions with Node.js 20.9+ and build tools
+- Debian 12 and other systemd-based Linux distributions with Node.js 22.12+, 24.x or 26+ and build tools
Not currently supported:
diff --git a/frontend/slices/camoufox-browser/app.tsx b/frontend/slices/camoufox-browser/app.tsx
index 25b012fb..a9b411f6 100644
--- a/frontend/slices/camoufox-browser/app.tsx
+++ b/frontend/slices/camoufox-browser/app.tsx
@@ -7,34 +7,10 @@ import { PowerPanel } from "./power-panel";
import { fetchStatus, setPower, waitForViewer, verifyViewerTransport, type CamoufoxServiceStatus } from "./service-client";
import { camoufoxViewerOrigin } from "@/lib/camoufox/origin";
-// A REAL Firefox (Camoufox, anti-fingerprinting) running on a headless X display on
-// this host, shown over noVNC. This replaced the old iframe browser because an iframe
-// cannot render most of the web: X-Frame-Options / frame-ancestors refuse framing on
-// the majority of real sites, so that app could only ever show the minority that
-// opted in. Here the page is rendered by an actual browser process and only PIXELS
-// cross into the cockpit — nothing to refuse, and no third-party JS in this origin.
-//
-// noVNC runs only on the reserved split-origin viewer host. proxy.ts verifies the
-// approved device at that host, strips cockpit credentials, and maps every path only
-// to loopback websockify; the historical same-origin /camoufox-vnc path is closed.
-//
-// The window OWNS the host session's power (see service-client + power-panel):
-// hiding this app used to leave a browser, an Xvfb and an x11vnc running for nobody,
-// and only a root shell could stop them. The switch in the header drives the
-// `camoufox-vnc` user unit, so what the UI says is what the host is doing.
-//
-// vnc.html, NOT vnc_lite.html, and this is what makes the app usable on a phone:
-// • vnc_lite has no focusable text input anywhere, and noVNC's on-screen keyboard
-// lives in the full UI (#noVNC_keyboard_button + a hidden textarea), not in core.
-// Tapping a canvas focuses nothing, so on touch the OS keyboard never opens and
-// the remote Firefox can never receive a keystroke — no URL, no search, no login.
-// • resize=remote instead of scale=true. scale only shrinks-to-fit and keeps the
-// aspect ratio, so a 1440x920 desktop landed at 0.273x inside a 393px phone
-// window with ~60% of the window as empty letterbox — the "black rectangle".
-// resize=remote drives the framebuffer to the client's own box (measured 393x727)
-// for 1:1 pixels and no letterbox. It only works because a window manager now runs
-// on the display (see scripts/camoufox-vnc-service) — without one the browser
-// window never reflows on the RANDR change and the client gets a cropped corner.
+// Camoufox runs on the host, streamed as pixels through a separately authenticated
+// noVNC origin. Never embed its third-party JS on the cockpit origin.
+// The full viewer supplies touch keyboard input; resize=remote plus the host
+// window manager reflows the framebuffer rather than scaling a desktop thumbnail.
const VIEWER_ORIGIN = camoufoxViewerOrigin();
const VIEWER = VIEWER_ORIGIN
? `${VIEWER_ORIGIN}/vnc.html?path=websockify&autoconnect=1&resize=remote`
@@ -74,7 +50,7 @@ export default function CamoufoxBrowser() {
// from the power action because it is also the mount path for a session that was
// already up before this window opened.
const connect = useCallback(async (signal: AbortSignal) => {
- const ready = await waitForViewer(signal);
+ const ready = await waitForViewer(signal, 30_000, setStatus);
if (signal.aborted) return;
if (!ready) {
setError("The browser session started but is not answering. Check its logs on the host.");
@@ -117,6 +93,19 @@ export default function CamoufoxBrowser() {
return () => controller.abort();
}, [connect]);
+ const retryConnection = useCallback(async () => {
+ abort.current?.abort();
+ const controller = new AbortController();
+ abort.current = controller;
+ setBusy(true); setError(null); setSrc(null);
+ try { await connect(controller.signal); }
+ catch (cause) {
+ if (!controller.signal.aborted) setError(cause instanceof Error ? cause.message : "The browser session is unreachable");
+ } finally {
+ if (abort.current === controller) setBusy(false);
+ }
+ }, [connect]);
+
const power = useCallback(async (on: boolean) => {
// Reversible in one click, and the browser profile (so any logged-in session)
// lives on disk rather than in the process — but a stop still costs ~10 s to
@@ -189,7 +178,7 @@ export default function CamoufoxBrowser() {
</button>
</header>
{error && <div role="alert" className="shrink-0 bg-destructive/10 px-3 py-2 text-[11px] text-destructive">
- <p>{error}</p><button type="button" disabled={busy} className="mt-2 underline" onClick={() => void power(true)}>Retry connection</button>
+ <p>{error}</p><button type="button" disabled={busy} className="mt-2 underline" onClick={() => void retryConnection()}>Retry connection</button>
</div>}
{src ? (
<iframe
diff --git a/frontend/slices/camoufox-browser/connection-state.test.ts b/frontend/slices/camoufox-browser/connection-state.test.ts
index 93a108a1..a00730d5 100644
--- a/frontend/slices/camoufox-browser/connection-state.test.ts
+++ b/frontend/slices/camoufox-browser/connection-state.test.ts
@@ -7,3 +7,12 @@ it("keeps power truth and offers retry instead of an endless failed spinner", ()
expect(source).toContain("Retry connection");
expect(source).toContain(") : !error ? (");
});
+
+it("retries only the read-only connection path and observes real polled power state", () => {
+ const source = readFileSync(new URL("./app.tsx", import.meta.url), "utf8");
+ const retry = source.split("const retryConnection = useCallback")[1]?.split("const power = useCallback")[0];
+ expect(retry).toContain("await connect(controller.signal)");
+ expect(retry).not.toContain("setPower(");
+ expect(source).toContain("onClick={() => void retryConnection()}>Retry connection");
+ expect(source).toContain("waitForViewer(signal, 30_000, setStatus)");
+});
diff --git a/frontend/slices/camoufox-browser/service-client.test.ts b/frontend/slices/camoufox-browser/service-client.test.ts
index 157703c6..b3264cee 100644
--- a/frontend/slices/camoufox-browser/service-client.test.ts
+++ b/frontend/slices/camoufox-browser/service-client.test.ts
@@ -29,3 +29,32 @@ it("surfaces public TLS failure without changing the process state", async () =>
await expect(verifyViewerTransport(new AbortController().signal)).rejects.toThrow("Viewer TLS failed");
expect(fetchMock).toHaveBeenCalledWith("/api/v1/camoufox/service?probe=viewer", expect.objectContaining({ cache: "no-store" }));
});
+
+it("reports every observed power state and stops polling when the session stops", async () => {
+ vi.useFakeTimers();
+ const running = { installed: true, running: true, enabled: false, viewerReady: false };
+ const stopped = { ...running, running: false };
+ const fetchMock = vi.fn()
+ .mockResolvedValueOnce(new Response(JSON.stringify(running), { status: 200 }))
+ .mockResolvedValueOnce(new Response(JSON.stringify(stopped), { status: 200 }));
+ vi.stubGlobal("fetch", fetchMock);
+ const observed = vi.fn();
+ try {
+ const result = waitForViewer(new AbortController().signal, 30000, observed);
+ await vi.advanceTimersByTimeAsync(700);
+ await expect(result).resolves.toBe(false);
+ expect(observed.mock.calls.map(([status]) => status.running)).toEqual([true, false]);
+ expect(fetchMock).toHaveBeenCalledTimes(2);
+ } finally { vi.useRealTimers(); }
+});
+
+it("does not publish a state observation after cancellation", async () => {
+ const controller = new AbortController();
+ const observed = vi.fn();
+ vi.stubGlobal("fetch", vi.fn(async () => {
+ controller.abort();
+ return new Response(JSON.stringify({ installed: true, running: false, enabled: false }), { status: 200 });
+ }));
+ await expect(waitForViewer(controller.signal, 0, observed)).resolves.toBe(false);
+ expect(observed).not.toHaveBeenCalled();
+});
diff --git a/frontend/slices/camoufox-browser/service-client.ts b/frontend/slices/camoufox-browser/service-client.ts
index 22bfbd01..d8864319 100644
--- a/frontend/slices/camoufox-browser/service-client.ts
+++ b/frontend/slices/camoufox-browser/service-client.ts
@@ -33,12 +33,15 @@ export async function setPower(on: boolean, signal?: AbortSignal): Promise<Camou
/** systemd reports `active` before websockify/noVNC is listening. The cockpit cannot
* fetch the dedicated viewer origin directly without widening CORS, so the authenticated
* same-origin status route performs the bounded loopback probe and returns viewerReady. */
-export async function waitForViewer(signal: AbortSignal, timeoutMs = 30_000): Promise<boolean> {
+export async function waitForViewer(signal: AbortSignal, timeoutMs = 30_000, onStatus?: (status: CamoufoxServiceStatus) => void): Promise<boolean> {
const deadline = Date.now() + timeoutMs;
while (!signal.aborted) {
try {
const status = await fetchStatus(signal);
- if (status.running && status.viewerReady) return true;
+ if (signal.aborted) return false;
+ onStatus?.(status);
+ if (!status.running) return false;
+ if (status.viewerReady) return true;
} catch {
if (signal.aborted) return false;
}
diff --git a/package.json b/package.json
index ce91a1ae..1c0fb26e 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
"version": "0.2.20",
"private": true,
"engines": {
- "node": ">=20.9",
+ "node": "^22.12.0 || ^24.0.0 || >=26.0.0",
"bun": ">=1.4.2 <2"
},
"scripts": {
diff --git a/scripts/check-node-runtime.mjs b/scripts/check-node-runtime.mjs
new file mode 100644
index 00000000..b10b0e23
--- /dev/null
+++ b/scripts/check-node-runtime.mjs
@@ -0,0 +1,16 @@
+#!/usr/bin/env node
+// Dependency-free so installers and doctor can check before package installation.
+import { pathToFileURL } from "node:url";
+export const NODE_RUNTIME_RANGE = "^22.12.0 || ^24.0.0 || >=26.0.0";
+export function supportedNodeRuntime(version) {
+ if (!/^\d+\.\d+\.\d+$/.test(version)) return false;
+ const [major, minor] = version.split(".").map(Number);
+ return (major === 22 && minor >= 12) || major === 24 || major >= 26;
+}
+export function assertNodeRuntime(version = process.versions.node) {
+ if (!supportedNodeRuntime(version)) throw new Error(`MSO requires Node ${NODE_RUNTIME_RANGE}; found ${version}. Upgrade Node before installing or verifying MSO.`);
+}
+if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
+ try { assertNodeRuntime(); console.log(`Node ${process.versions.node} is supported`); }
+ catch (error) { console.error(error.message); process.exitCode = 1; }
+}
diff --git a/scripts/check-test-toolchain.mjs b/scripts/check-test-toolchain.mjs
index daf9c716..e8a3fcb9 100644
--- a/scripts/check-test-toolchain.mjs
+++ b/scripts/check-test-toolchain.mjs
@@ -1,3 +1,5 @@
+import { assertNodeRuntime } from "./check-node-runtime.mjs";
+assertNodeRuntime();
// Test and coverage packages are one versioned contract, including patch releases.
import { createRequire } from "node:module";
import path from "node:path";
diff --git a/scripts/cli/commands-host.sh b/scripts/cli/commands-host.sh
index 0a2bc554..072226b4 100755
--- a/scripts/cli/commands-host.sh
+++ b/scripts/cli/commands-host.sh
@@ -81,7 +81,7 @@ case "$cmd" in
echo "$doctor_label (base $B)"
chk "curl" "command -v curl" "install curl"
chk "jq" "command -v jq" "install jq"
- chk "node" "command -v node" "install Node >=20.9"
+ chk "node" "node '$ROOT/scripts/check-node-runtime.mjs'" "install Node 22.12+, 24.x or 26+"
chk "env file" "[ -f '$ENVF' ]" "no $ENVF — copy .env.example and fill it"
chk "login password" "[ -n '$PASS' ]" "OS_LOGIN_PASSWORD unset in $ENVF"
chk "session secret" "[ -n \"\${OS_SESSION_SECRET-}\" ]" "OS_SESSION_SECRET unset in $ENVF"
diff --git a/scripts/e2e/camoufox-connection.mjs b/scripts/e2e/camoufox-connection.mjs
new file mode 100644
index 00000000..f385f50a
--- /dev/null
+++ b/scripts/e2e/camoufox-connection.mjs
@@ -0,0 +1,49 @@
+import { expect } from "@playwright/test";
+
+// Intercept only the synthetic fixture's browser service. Never start the host browser.
+export async function camoufoxConnectionJourney(page, fixture) {
+ let mode = "tls", reads = 0, posts = 0, credentials = 0;
+ const observe = request => { if (new URL(request.url()).pathname === "/api/v1/camoufox/session") credentials++; };
+ const service = async route => {
+ const request = route.request(), url = new URL(request.url());
+ if (request.method() !== "GET") {
+ posts++;
+ return route.fulfill({ status: 503, json: { error: "Power mutation is forbidden in connection-only retry" } });
+ }
+ if (url.searchParams.get("probe") === "viewer") return route.fulfill({
+ status: 200, json: { reachable: false, state: "tls", message: "Fixture viewer TLS failed" },
+ });
+ reads++;
+ const running = mode === "tls" || reads === 1;
+ return route.fulfill({ status: 200, json: { installed: true, running, enabled: false, viewerReady: mode === "tls" } });
+ };
+ page.on("request", observe);
+ await page.route("**/api/v1/camoufox/service*", service);
+ try {
+ for (const viewport of [{ width: 1280, height: 900 }, { width: 390, height: 844 }]) {
+ mode = "tls"; reads = 0;
+ await page.setViewportSize(viewport);
+ await page.goto(fixture.base + "/browser");
+ const retry = page.getByRole("button", { name: "Retry connection", exact: true });
+ const connectionAlert = page.getByRole("alert").filter({ has: retry });
+ await expect(connectionAlert).toContainText("Fixture viewer TLS failed");
+ await expect(page.getByText("Running on the server", { exact: true })).toBeVisible();
+ for (let i = 0; i < 3; i++) {
+ await retry.click();
+ await expect(retry).toBeEnabled();
+ await expect(connectionAlert).toContainText("Fixture viewer TLS failed");
+ }
+ expect(posts).toBe(0); expect(credentials).toBe(0);
+ mode = "stopping"; reads = 0;
+ await retry.click();
+ await expect(page.getByText("The browser session is off.", { exact: true })).toBeVisible();
+ await expect(page.getByRole("button", { name: "Turn the browser on", exact: true })).toBeVisible();
+ await expect(page.getByText("Running on the server", { exact: true })).toHaveCount(0);
+ expect(posts).toBe(0); expect(reads).toBe(2);
+ }
+ console.log("PASS Camoufox read-only retries, no premature credential fetch, and observed session stop on desktop/mobile");
+ } finally {
+ page.off("request", observe);
+ await page.unroute("**/api/v1/camoufox/service*", service);
+ }
+}
diff --git a/scripts/e2e/release.mjs b/scripts/e2e/release.mjs
index 6643df82..0ca2ac9a 100644
--- a/scripts/e2e/release.mjs
+++ b/scripts/e2e/release.mjs
@@ -9,6 +9,7 @@ import { organizationJourney } from "./organization.mjs";
import { workflowCanvasJourney } from "./workflow-canvas.mjs";
import { storeExtensionsJourney } from "./store-extensions.mjs";
import { releaseFixture } from "./release-fixture.mjs";
+import { camoufoxConnectionJourney } from "./camoufox-connection.mjs";
execFileSync(process.execPath, ["scripts/e2e/mcp-page.mjs"], { stdio: "inherit" });
execFileSync(process.execPath, ["scripts/e2e/organization-flow.mjs"], { stdio: "inherit" });
@@ -120,6 +121,7 @@ try {
expect(exec.status).toBe(200); expect(exec.body.cwd).toBe(fixture.dir);
expect((await call("/api/v1/exec/run", { cmd: "exit 0", cwd: fixture.dir + "/missing" })).status).not.toBe(200);
expect((await call("/api/v1/fs/list?path=" + encodeURIComponent(fixture.dir))).status).toBe(200);
+ await camoufoxConnectionJourney(page, fixture);
await mcpOwnerJourneys(page, fixture);
await automationJourney(page, fixture);
await organizationJourney(page, fixture);
diff --git a/scripts/install-core.sh b/scripts/install-core.sh
index c50a05f4..3ceec9c1 100755
--- a/scripts/install-core.sh
+++ b/scripts/install-core.sh
@@ -243,19 +243,22 @@ ensure_git() {
node_ok() {
command -v node >/dev/null 2>&1 || return 1
- node -e 'const[a,b]=process.versions.node.split(".").map(Number);process.exit(a>20||(a===20&&b>=9)?0:1)'
+ node -e 'const[a,b]=process.versions.node.split(".").map(Number);process.exit((a===22&&b>=12)||a===24||a>=26?0:1)'
}
ensure_node() {
node_ok && { info "node $(node -v) ok"; return; }
- warn "Node >=20.9 not found"
+ warn "Supported Node not found (22.12+, 24.x or 26+)"
+ if command -v node >/dev/null 2>&1 && node -e 'process.exit(Number(process.versions.node.split(".")[0])>22?0:1)'; then
+ die "this Node release is not supported; select Node 22.12+, 24.x or 26+. The installer will not downgrade a newer runtime."
+ fi
if command -v apt-get >/dev/null 2>&1; then
info "installing Node 22 via NodeSource…"
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo_do -E bash -
sudo_do apt-get install -y -qq nodejs
else
- die "install Node >=20.9 (22 recommended) from https://nodejs.org or your distro, then re-run."
+ die "install Node 22.12+, 24.x or 26+ (22 recommended) from https://nodejs.org or your distro, then re-run."
fi
- node_ok || die "Node still <20.9 after install."
+ node_ok || die "Node still outside the supported range after install."
}
# bun installs dependencies; it does NOT run the app. `next start` stays on node
diff --git a/scripts/install.sh b/scripts/install.sh
index 66333de4..0cc0fdb9 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -12,7 +12,7 @@ set -Eeuo pipefail
umask 077
CORE_URL="${MSO_INSTALL_CORE_URL:-https://raw.githubusercontent.com/rahmanef63/mso/main/scripts/install-core.sh}"
-CORE_SHA256="480f13d75d04293560fe8eef1048d0b0c764767890e4b3b6f95e704b80a01388"
+CORE_SHA256="c2b5685734c9474c56b8d4a20cde3d4d4e9e1cfa0209744c4e3b337590a27144"
CORE_EOF='# MSO_INSTALLER_CORE_EOF'
TMP_INSTALLER=''
diff --git a/scripts/node-runtime.test.ts b/scripts/node-runtime.test.ts
new file mode 100644
index 00000000..057c5b92
--- /dev/null
+++ b/scripts/node-runtime.test.ts
@@ -0,0 +1,28 @@
+import { readFileSync } from "node:fs";
+import { runInNewContext } from "node:vm";
+import { describe, expect, it } from "vitest";
+import { NODE_RUNTIME_RANGE, supportedNodeRuntime } from "./check-node-runtime.mjs";
+
+describe("one supported Node runtime contract", () => {
+ it.each([
+ ["20.9.0", false], ["20.19.0", false], ["22.11.0", false], ["22.12.0", true],
+ ["22.23.2", true], ["23.0.0", false], ["24.0.0", true], ["25.0.0", false],
+ ["26.0.0", true], ["28.1.0", true], ["invalid", false],
+ ])("checks %s consistently in the package and early installer", (version, accepted) => {
+ expect(supportedNodeRuntime(version)).toBe(accepted);
+ const core = readFileSync("scripts/install-core.sh", "utf8");
+ const predicate = /node -e '(const\[a,b\][^\n]+)'/.exec(core)?.[1];
+ expect(predicate).toBeDefined();
+ let code = -1;
+ runInNewContext(predicate!, { process: { versions: { node: version }, exit: (value: number) => { code = value; } } });
+ expect(code === 0).toBe(accepted);
+ });
+ it("gates advertised support, doctor and test tools on the same floor", () => {
+ const pkg = JSON.parse(readFileSync("package.json", "utf8"));
+ expect(pkg.engines.node).toBe(NODE_RUNTIME_RANGE);
+ expect(readFileSync("scripts/cli/commands-host.sh", "utf8")).toContain("scripts/check-node-runtime.mjs");
+ expect(readFileSync("scripts/check-test-toolchain.mjs", "utf8")).toContain("assertNodeRuntime()");
+ for (const file of ["docs/INSTALL.md", "app/install/page.tsx", "docs/reference/WORKSPACE-GUIDE.md"])
+ expect(readFileSync(file, "utf8")).not.toContain("20.9");
+ });
+});