Skip to content

A desktop coding agent with free access to frontier models.

TypeScript

feat: shared required sandbox rules

ogsamrata92182cd2b9a
diff --git a/apps/server/src/box/PARITY.sha256 b/apps/server/src/box/PARITY.sha256
index de4689ef..58e82b58 100644
--- a/apps/server/src/box/PARITY.sha256
+++ b/apps/server/src/box/PARITY.sha256
@@ -1,9 +1,11 @@
# The sandbox image pins: the same files in omnirush-cli (src/box/) and omnirush-gui (apps/server/src/box/).
# retention.mjs (+ .d.mts): which sandbox images stay across box-version updates (current + previous pins, images in use).
# host-builds.json: the rules and notices for folders with macOS/Windows builds (host-builds.js / host-builds.ts read it).
+# required.json: the mandatory sandbox (setup per OS, build-artefact shadows, host-only projects, texts); required.js / required.ts read it.
# A change to one must be ported to the other and this list updated in both (scripts/box/pins.mjs refreshes the pins' list).
f4cf889b29e169592863020c6ac2b02c69d8887a8df1502dd01c7939805a9b8a images.json
fd7531323e200f2133cdf66ed8608d04af3a38049cfeb01a0a285cbd72813c4d wsl.json
ec1c7507cd3919a1066c870e3f7018424bdca8641fbf34fec9c4eefd9def1d29 host-builds.json
fe040597bec7f113721071097906380c51198d0cc785747c3891b754e55f34a2 retention.mjs
e0478a8e95284a9f1713ee695dd5a2a7123991b2ab2d45297a09369cce037da7 retention.d.mts
+ca1db1f8f9a4fa8d9db22ca606ab83fb05d3483cea2b71efb7b81dcd25b36156 required.json
diff --git a/apps/server/src/box/box-required.test.ts b/apps/server/src/box/box-required.test.ts
new file mode 100644
index 00000000..6fcd0c67
--- /dev/null
+++ b/apps/server/src/box/box-required.test.ts
@@ -0,0 +1,65 @@
+import { describe, expect, test } from "bun:test";
+import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
+import os from "node:os";
+import path from "node:path";
+
+import { desktopText, hostOnlyProject, parseWindowsFacts, requiredFallback, virtualizationError, whyText, windowsInstallScript, windowsWhy } from "./required.js";
+
+const facts = { build: 22631, hypervisorPresent: false, firmwareEnabled: true, model: "Dell Inc. XPS 13", sMode: false };
+
+describe("required sandbox rules", () => {
+ test("fallback and texts", () => {
+ expect(requiredFallback("native_uncounted")).toBe("native_uncounted");
+ expect(requiredFallback("block")).toBe("native");
+ expect(requiredFallback(undefined)).toBe("native");
+ expect(desktopText("opt_out_refused")).toContain("Required for new chats");
+ expect(desktopText("cannot_run", { why: "x" })).toBe("The sandbox can't run on this computer: x.");
+ expect(whyText("firmware_off")).toContain("BIOS/UEFI");
+ expect(whyText("nope")).toBeNull();
+ });
+
+ test("windows: a running hypervisor passes, firmware off, nested VM, S mode, old build, policy", () => {
+ expect(windowsWhy(facts)).toBeNull();
+ expect(windowsWhy({ ...facts, hypervisorPresent: true, firmwareEnabled: false })).toBeNull();
+ expect(windowsWhy({ ...facts, firmwareEnabled: false })).toBe("firmware_off");
+ expect(windowsWhy({ ...facts, firmwareEnabled: false, model: "Microsoft Corporation Virtual Machine" })).toBe("nested_vm");
+ expect(windowsWhy({ ...facts, model: "innotek GmbH VirtualBox", wslSaid: "Error code: Wsl/Service/CreateInstance/0x80370102" })).toBe("nested_vm");
+ expect(windowsWhy({ ...facts, sMode: true })).toBe("s_mode");
+ expect(windowsWhy({ ...facts, build: 18363 })).toBe("old_windows");
+ expect(windowsWhy({ ...facts, policy: true })).toBe("policy");
+ expect(windowsWhy({ build: null, hypervisorPresent: null, firmwareEnabled: null, model: null, sMode: null })).toBeNull();
+ expect(virtualizationError("Please enable the Virtual Machine Platform Windows feature")).toBe(true);
+ expect(virtualizationError("The operation completed successfully.")).toBe(false);
+ });
+
+ test("windows facts parse from the PowerShell JSON line", () => {
+ expect(parseWindowsFacts('{"build":19045,"hypervisor":false,"firmware":true,"model":" LENOVO 20XW ","smode":false}\r\n')).toEqual({ build: 19045, hypervisorPresent: false, firmwareEnabled: true, model: "LENOVO 20XW", sMode: false });
+ expect(parseWindowsFacts("garbage")).toEqual({ build: null, hypervisorPresent: null, firmwareEnabled: null, model: null, sMode: null });
+ });
+
+ test("the install script is the shared one, CRLF, with its log argument", () => {
+ const script = windowsInstallScript();
+ expect(script).toContain("wsl.exe --install --no-distribution");
+ expect(script).toContain("$log = $args[0]");
+ expect(script.endsWith("\r\n")).toBe(true);
+ });
+
+ test("host-only projects: Xcode on macOS, WPF and vcxproj on Windows, never Linux", () => {
+ const root = mkdtempSync(path.join(os.tmpdir(), "hostonly-"));
+ mkdirSync(path.join(root, "App.xcodeproj"));
+ expect(hostOnlyProject(root, { platform: "darwin" })?.things).toEqual(["App.xcodeproj"]);
+ expect(hostOnlyProject(root, { platform: "linux" })).toBeNull();
+ const win = mkdtempSync(path.join(os.tmpdir(), "hostonly-"));
+ mkdirSync(path.join(win, "src"));
+ writeFileSync(path.join(win, "src", "Desk.csproj"), "<Project><PropertyGroup><UseWPF>true</UseWPF></PropertyGroup></Project>");
+ writeFileSync(path.join(win, "Lib.csproj"), "<Project><PropertyGroup><TargetFramework>net8.0</TargetFramework></PropertyGroup></Project>");
+ const found = hostOnlyProject(win, { platform: "win32" });
+ expect(found?.things).toEqual(["Desk.csproj"]);
+ expect(found?.notice).toContain("only builds on Windows (Desk.csproj)");
+ const swift = mkdtempSync(path.join(os.tmpdir(), "hostonly-"));
+ writeFileSync(path.join(swift, "Package.swift"), "let package = Package(name: \"x\", platforms: [.iOS(.v17)])");
+ expect(hostOnlyProject(swift, { platform: "darwin" })?.things).toEqual(["Package.swift"]);
+ writeFileSync(path.join(swift, "Package.swift"), "let package = Package(name: \"x\")");
+ expect(hostOnlyProject(swift, { platform: "darwin" })).toBeNull();
+ });
+});
diff --git a/apps/server/src/box/required.json b/apps/server/src/box/required.json
new file mode 100644
index 00000000..3636c4bf
--- /dev/null
+++ b/apps/server/src/box/required.json
@@ -0,0 +1,134 @@
+{
+ "version": 1,
+ "about": "The mandatory sandbox ('required' level of GET /collect/capabilities local_box) for the CLI (src/box/required.js) and the desktop app (apps/server/src/box/required.ts): what a client told required:true does, the setup it runs per OS, the build-artefact shadows on macOS/Windows hosts and the projects that stay on the host. Shared byte for byte (src/box/PARITY.sha256 and apps/server/src/box/PARITY.sha256).",
+ "capability": {
+ "required_key": "required",
+ "fallback_key": "required_fallback",
+ "fallbacks": ["native", "native_uncounted"],
+ "default_fallback": "native"
+ },
+ "reasons": {
+ "required": "box",
+ "kept_old_chat": "kept_old_chat",
+ "host_only": "host_only",
+ "env_off": "env_off",
+ "setup_needed": "setup_needed",
+ "cannot_run": "cannot_run",
+ "setup_declined": "setup_declined"
+ },
+ "host_only": {
+ "about": "Projects that only build and run on their own OS: their new chats stay on the machine and count as today (launch reason host_only). Markers are matched in the project root and one level down.",
+ "darwin": {
+ "dirs_suffix": [".xcodeproj", ".xcworkspace"],
+ "files": [],
+ "file_patterns": [{ "name": "Package.swift", "contains": "\\.(?:iOS|macOS|tvOS|watchOS|visionOS)\\(" }]
+ },
+ "win32": {
+ "dirs_suffix": [],
+ "files": [],
+ "file_patterns": [
+ { "suffix": ".csproj", "contains": "<(?:UseWPF|UseWindowsForms|UseMaui)>\\s*true|net\\d+\\.\\d+-windows" },
+ { "suffix": ".vcxproj", "contains": "." }
+ ]
+ }
+ },
+ "shadows": {
+ "about": "On macOS/Windows hosts the box keeps its own Linux copy of each build-artefact folder, so the host's builds are never written and the host's Mac/Windows builds never run in the box. Tools that can be pointed elsewhere get an environment variable (no folder appears on the host); node_modules (harmless when empty) and folders that already exist on the host are bind-mounted from the box's own disk (boxrun init Binds). Shadows are never in the box snapshots: a rebuild recreates them from the manifests and the recorded installs. Linux hosts: none.",
+ "hosts": ["darwin", "win32"],
+ "store": "/var/lib/omnirush/shadows",
+ "limits": { "entries": 4000, "ms": 150, "depth": 4, "max": 64 },
+ "skip_dirs": [".git", "node_modules", ".venv", "venv", "target", ".hg", ".svn"],
+ "env": [
+ { "id": "uv", "when_any": ["pyproject.toml", "uv.lock"], "root_only": true, "set": { "UV_PROJECT_ENVIRONMENT": "{store}/venv" } },
+ { "id": "poetry", "when_any": ["poetry.lock"], "root_only": true, "set": { "POETRY_VIRTUALENVS_IN_PROJECT": "false", "POETRY_VIRTUALENVS_PATH": "{store}/poetry" } },
+ { "id": "cargo", "when_any": ["Cargo.toml"], "root_only": true, "set": { "CARGO_TARGET_DIR": "{store}/cargo-target" } }
+ ],
+ "binds": [
+ { "dir": "node_modules", "when_any": ["package.json"], "even_if_absent": true },
+ { "dir": ".venv", "when_any": ["pyvenv.cfg@dir", "pyproject.toml", "requirements.txt"], "even_if_absent": false },
+ { "dir": "venv", "when_any": ["pyvenv.cfg@dir"], "even_if_absent": false },
+ { "dir": "target", "when_any": ["Cargo.toml", "pom.xml"], "even_if_absent": false },
+ { "dir": "build", "when_any": ["build.gradle", "build.gradle.kts", "CMakeLists.txt"], "even_if_absent": false },
+ { "dir": ".gradle", "when_any": ["build.gradle", "build.gradle.kts", "settings.gradle", "settings.gradle.kts"], "even_if_absent": false },
+ { "dir": ".next", "when_any": ["package.json"], "even_if_absent": false },
+ { "dir": ".nuxt", "when_any": ["package.json"], "even_if_absent": false },
+ { "dir": ".svelte-kit", "when_any": ["package.json"], "even_if_absent": false },
+ { "dir": ".turbo", "when_any": ["package.json"], "even_if_absent": false },
+ { "dir": ".parcel-cache", "when_any": ["package.json"], "even_if_absent": false },
+ { "dir": ".dart_tool", "when_any": ["pubspec.yaml"], "even_if_absent": false },
+ { "dir": ".build", "when_any": ["Package.swift"], "even_if_absent": false },
+ { "dir": "vendor/bundle", "when_any": ["Gemfile"], "even_if_absent": false },
+ { "dir": "obj", "when_any": ["*.csproj", "*.fsproj"], "even_if_absent": false },
+ { "dir": "bin", "when_any": ["*.csproj", "*.fsproj"], "even_if_absent": false },
+ { "dir": ".zig-cache", "when_any": ["build.zig"], "even_if_absent": false },
+ { "dir": "zig-out", "when_any": ["build.zig"], "even_if_absent": false },
+ { "dir": "dist", "when_any": ["@host-binaries"], "even_if_absent": false },
+ { "dir": "out", "when_any": ["@host-binaries"], "even_if_absent": false }
+ ],
+ "record_key": "shadows"
+ },
+ "setup": {
+ "linux": {
+ "order": ["bwrap", "podman", "docker"],
+ "enable": { "cli": "sudo omnirush sandbox enable", "desktop": "pkexec" }
+ },
+ "win32": {
+ "min_build": 19041,
+ "virtualization_errors": "0x80370102|0x80370114|HCS_E_HYPERV_NOT_INSTALLED|Please enable the Virtual Machine Platform|virtualization is enabled in the BIOS|WSL_E_VM_MODE_INVALID_STATE",
+ "install_script": [
+ "$ErrorActionPreference = 'Stop'",
+ "$log = $args[0]",
+ "try { & wsl.exe --install --no-distribution 2>&1 | Out-File -Append -Encoding utf8 $log; $code = $LASTEXITCODE } catch { $code = 1 }",
+ "if ($code -ne 0) {",
+ " dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart | Out-File -Append -Encoding utf8 $log",
+ " dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart | Out-File -Append -Encoding utf8 $log",
+ " & wsl.exe --update --web-download 2>&1 | Out-File -Append -Encoding utf8 $log",
+ "}",
+ "'done' | Out-File -Append -Encoding utf8 $log"
+ ],
+ "resume_run_once": "OmniRushSandboxSetup"
+ },
+ "darwin": {
+ "backend": "lima",
+ "min_macos": "13.0",
+ "lima": {
+ "version": "2.2.1",
+ "assets": {
+ "arm64": { "url": "https://github.com/lima-vm/lima/releases/download/v2.2.1/lima-2.2.1-Darwin-arm64.tar.gz", "sha256": "9e9eacce88f37e185c346bad73aa6136f738d8cdf8c3bb23cd42b071824bc66e" },
+ "x64": { "url": "https://github.com/lima-vm/lima/releases/download/v2.2.1/lima-2.2.1-Darwin-x86_64.tar.gz", "sha256": "6b776e4bc41f358e6ee01fefcc78e2eb26f11635a0fcff632234af77a566c6c4" }
+ }
+ },
+ "vm": { "name": "omnirush-box", "cpus_max": 4, "memory_min_gib": 3, "memory_fraction": 0.25, "disk_gib": 30, "idle_stop_min": 30 }
+ }
+ },
+ "texts": {
+ "cli": {
+ "required_line": "This account runs new chats in the OmniRush sandbox (a Linux box set up for you), so sessions can be rebuilt.",
+ "opt_out_refused": "The sandbox is required for new chats on this account; chats started before stay as they were.",
+ "kept_old_chat": "This chat started on this machine before the sandbox was required, so it stays here.",
+ "host_only": "This project only builds on {label} ({things}), so its chats run on {machine}.",
+ "shadows": "In the sandbox, {dirs} are the sandbox's own Linux copies; your {label} copies are left as they are. Install dependencies inside as needed.",
+ "setup_needed": "Setting up the sandbox ({step})…",
+ "cannot_run": "The sandbox can't run on this computer: {why}. This chat runs on {machine}.",
+ "win_setup": "The sandbox needs WSL 2. Run `omnirush sandbox setup` (one Windows admin prompt, then a restart).",
+ "win_restart": "WSL 2 is installed; restart Windows to finish. OmniRush finishes the setup on its next start."
+ },
+ "desktop": {
+ "required_line": "New chats run in the OmniRush sandbox, set up for you.",
+ "opt_out_refused": "Required for new chats on this account. Chats started before keep running where they started.",
+ "kept_old_chat": "Started on this computer before the sandbox was required: it stays here.",
+ "host_only": "This project only builds on {label} ({things}), so its chats run on {machine}.",
+ "shadows": "In the sandbox, {dirs} are the sandbox's own Linux copies; your {label} copies are left as they are.",
+ "cannot_run": "The sandbox can't run on this computer: {why}."
+ },
+ "why": {
+ "firmware_off": "virtualization is turned off in the BIOS/UEFI settings (Intel VT-x or AMD SVM)",
+ "nested_vm": "this Windows runs inside a virtual machine without nested virtualization",
+ "s_mode": "Windows in S mode can't run WSL",
+ "old_windows": "Windows 10 version 2004 (build 19041) or later is needed",
+ "old_macos": "macOS 13 or later is needed",
+ "policy": "your organisation's settings block WSL",
+ "declined": "the setup was cancelled"
+ }
+ }
+}
diff --git a/apps/server/src/box/required.ts b/apps/server/src/box/required.ts
new file mode 100644
index 00000000..725bc23d
--- /dev/null
+++ b/apps/server/src/box/required.ts
@@ -0,0 +1,165 @@
+// Ported from the CLI (omnirush-cli src/box/required.js); keep the two in
+// step. required.json (the rules and the texts) is the same file in both,
+// listed in PARITY.sha256.
+//
+// The mandatory sandbox: a server answer with `local_box.required: true`
+// puts every new chat in the project's box. What stays out: chats started on
+// this machine before (kept_old_chat), projects that only build on this OS
+// (host_only), OMNIRUSH_BOX=0 (env_off), and machines where the box cannot
+// run (the `required_fallback` answer; the setup screen says why).
+
+import { closeSync, openSync, readSync, readdirSync, type Dirent } from "node:fs";
+import path from "node:path";
+
+import { HOST_BUILD_RULES } from "./host-builds.js";
+import rules from "./required.json" with { type: "json" };
+
+export type RequiredFallback = "native" | "native_uncounted";
+export type RequiredReason = "box" | "kept_old_chat" | "host_only" | "env_off" | "setup_needed" | "cannot_run" | "setup_declined";
+export type CannotRunWhy = keyof typeof rules.texts.why;
+type HostOnlyPattern = { name?: string; suffix?: string; contains: string };
+type HostOnlyRules = { dirs_suffix: string[]; files: string[]; file_patterns: HostOnlyPattern[] };
+
+export const REQUIRED_RULES = rules;
+
+/** The fallback a server answer names (`required_fallback`), else the default. */
+export function requiredFallback(value: unknown): RequiredFallback {
+ return value === "native" || value === "native_uncounted" ? value : "native";
+}
+
+/** A desktop text of required.json with its `{name}` parts filled in. */
+export function desktopText(key: keyof typeof rules.texts.desktop, vars: Record<string, string> = {}): string {
+ return fill(rules.texts.desktop[key], vars);
+}
+
+/** Why the box cannot run here, in words (required.json texts.why). */
+export function whyText(why: string | null | undefined): string | null {
+ if (!why) return null;
+ const texts: Record<string, string> = rules.texts.why;
+ return texts[why] ?? null;
+}
+
+function fill(text: string, vars: Record<string, string>): string {
+ return text.replace(/\{(\w+)\}/g, (all, name: string) => vars[name] ?? all);
+}
+
+/** Read at most `max` bytes of a file as text (empty when it cannot be read). */
+function head(file: string, max = 256 * 1024): string {
+ let fd: number | null = null;
+ try {
+ fd = openSync(file, "r");
+ const buf = Buffer.alloc(max);
+ const n = readSync(fd, buf, 0, max, 0);
+ return buf.toString("utf8", 0, n);
+ } catch {
+ return "";
+ } finally {
+ if (fd !== null) closeSync(fd);
+ }
+}
+
+function entries(dir: string, read: (dir: string) => Dirent[]): Dirent[] {
+ try {
+ return read(dir);
+ } catch {
+ return [];
+ }
+}
+
+/**
+ * A project that only builds on this OS (an Xcode project on macOS; a WPF,
+ * WinForms or MAUI app, a C++ .vcxproj on Windows): the markers it has (the
+ * project root and one level down), else null. Linux: never.
+ */
+export function hostOnlyProject(root: string, { platform = process.platform, readDir = (dir: string) => readdirSync(dir, { withFileTypes: true }), readHead = head }: { platform?: string; readDir?: (dir: string) => Dirent[]; readHead?: (file: string) => string } = {}): { things: string[]; notice: string } | null {
+ const table: Record<string, HostOnlyRules> = { darwin: rules.host_only.darwin, win32: rules.host_only.win32 };
+ const set = table[platform];
+ if (!set) return null;
+ const things: string[] = [];
+ const look = (dir: string, depth: number) => {
+ for (const entry of entries(dir, readDir)) {
+ if (things.length >= 3) return;
+ const full = path.join(dir, entry.name);
+ if (entry.isDirectory()) {
+ if (set.dirs_suffix.some((suffix) => entry.name.endsWith(suffix))) things.push(entry.name);
+ else if (depth === 0 && !entry.name.startsWith(".") && entry.name !== "node_modules") look(full, 1);
+ continue;
+ }
+ if (!entry.isFile()) continue;
+ if (set.files.includes(entry.name)) { things.push(entry.name); continue; }
+ const pattern = set.file_patterns.find((p) => (p.name ? entry.name === p.name : p.suffix ? entry.name.endsWith(p.suffix) : false));
+ if (pattern && new RegExp(pattern.contains).test(readHead(full))) things.push(entry.name);
+ }
+ };
+ look(root, 0);
+ if (!things.length) return null;
+ const host = HOST_BUILD_RULES.hosts[platform];
+ return { things, notice: desktopText("host_only", { label: host?.label ?? platform, things: things.join(", "), machine: host?.machine ?? "this computer" }) };
+}
+
+/** What a Windows machine says about running WSL 2 (PowerShell CIM, the build, S mode). */
+export type WindowsFacts = {
+ build: number | null;
+ hypervisorPresent: boolean | null;
+ firmwareEnabled: boolean | null;
+ /** Win32_ComputerSystem Model / Manufacturer (a VM guest names its hypervisor). */
+ model: string | null;
+ sMode: boolean | null;
+ /** WSL's own output (`wsl --status`, the setup log), checked for a virtualization error. */
+ wslSaid?: string | null;
+ /** WSL is blocked by policy (the setup log, `wsl` output). */
+ policy?: boolean;
+};
+
+const VM_MODEL = /virtual machine|vmware|virtualbox|kvm|qemu|hvm domu|parallels|xen|bochs/i;
+
+/**
+ * Why WSL 2 cannot run on this Windows (required.json texts.why keys), or
+ * null when nothing rules it out. A running hypervisor is a pass (the
+ * firmware flag reads false while Hyper-V runs).
+ */
+export function windowsWhy(facts: WindowsFacts): CannotRunWhy | null {
+ if (facts.sMode) return "s_mode";
+ if (facts.build !== null && facts.build < rules.setup.win32.min_build) return "old_windows";
+ if (facts.policy) return "policy";
+ const vmError = Boolean(facts.wslSaid && virtualizationError(facts.wslSaid));
+ if (facts.hypervisorPresent === true && !vmError) return null;
+ if (facts.firmwareEnabled === false || vmError) return facts.model && VM_MODEL.test(facts.model) ? "nested_vm" : "firmware_off";
+ return null;
+}
+
+/** Whether WSL's output is one of its "no virtualization" errors. */
+export function virtualizationError(text: string): boolean {
+ return new RegExp(rules.setup.win32.virtualization_errors, "i").test(text);
+}
+
+/** The PowerShell that reads the facts windowsWhy needs (one JSON line). */
+export const WINDOWS_FACTS_SCRIPT = [
+ "$ErrorActionPreference = 'SilentlyContinue'",
+ "$cpu = Get-CimInstance Win32_Processor | Select-Object -First 1",
+ "$cs = Get-CimInstance Win32_ComputerSystem",
+ "$s = (Get-ItemProperty 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\CI\\Policy' -Name SkuPolicyRequired).SkuPolicyRequired",
+ "[pscustomobject]@{ build = [Environment]::OSVersion.Version.Build; hypervisor = $cs.HypervisorPresent; firmware = $cpu.VirtualizationFirmwareEnabled; model = \"$($cs.Manufacturer) $($cs.Model)\"; smode = ($s -eq 1) } | ConvertTo-Json -Compress",
+].join("; ");
+
+/** The facts from WINDOWS_FACTS_SCRIPT's output (unknown fields: null). */
+export function parseWindowsFacts(stdout: string): WindowsFacts {
+ let value: Record<string, unknown> = {};
+ try {
+ const parsed: unknown = JSON.parse(String(stdout).trim().split("\n").pop() ?? "");
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) value = Object.fromEntries(Object.entries(parsed));
+ } catch { /* nothing known */ }
+ const bool = (v: unknown) => (typeof v === "boolean" ? v : null);
+ return {
+ build: typeof value.build === "number" ? value.build : null,
+ hypervisorPresent: bool(value.hypervisor),
+ firmwareEnabled: bool(value.firmware),
+ model: typeof value.model === "string" ? value.model.trim() || null : null,
+ sMode: bool(value.smode),
+ };
+}
+
+/** The elevated setup script (required.json setup.win32.install_script) as a .ps1 file's text. */
+export function windowsInstallScript(): string {
+ return `${rules.setup.win32.install_script.join("\r\n")}\r\n`;
+}