Lines 15-94javascript
15 if (current[index] > minimum[index]) return true;
16 if (current[index] < minimum[index]) return false;
21function unsupportedNodeMessage(versions) {
22 versions = versions || process.versions;
23 if (versions.bun) return null;
25 var version = String(versions.node || "unknown");
26 if (supportedNodeVersion(version)) return null;
27 var major = Number.parseInt(version, 10);
28 var detail = major === MIN_NODE_MAJOR
29 ? "This Node.js 22 release is below Hara's supported " + MIN_NODE_VERSION + " floor."
30 : "This Node.js release is below Hara's supported " + MIN_NODE_VERSION + " floor.";
32 "Hara requires Node.js " + MIN_NODE_VERSION + " or newer (detected " + version + ").",
34 "Upgrade with: nvm install " + MIN_NODE_MAJOR + " && nvm use " + MIN_NODE_MAJOR,
35 "Or install the standalone Hara binary, which does not require Node.js:",
36 " curl -fsSL https://raw.githubusercontent.com/hara-cli/hara/main/install.sh | sh",
40function normalizePortableWindowsHome(value) {
41 var home = String(value || "").trim();
42 var drive = /^\/([a-zA-Z])(?:\/(.*))?$/.exec(home);
43 if (drive) return drive[1].toUpperCase() + ":\\" + String(drive[2] || "").replace(/\//g, "\\");
44 if (/^\/\/[^/]/.test(home)) return "\\\\" + home.slice(2).replace(/\//g, "\\");
45 if (/^[a-zA-Z]:[\\/]/.test(home)) return home.charAt(0).toUpperCase() + home.slice(1).replace(/\//g, "
49function applyPortableHomeEnv(env, runtimePlatform) {
50 env = env || process.env;
51 runtimePlatform = runtimePlatform || process.platform;
52 if (runtimePlatform !== "win32") return false;
53 var home = normalizePortableWindowsHome(env.HOME || "");
54 if (!home || env.USERPROFILE === home) return false;
55 env.USERPROFILE = home;
59function failStart(error) {
60 var message = error && error.message ? error.message : String(error);
61 process.stderr.write("hara: failed to start: " + message + "\n");
66 var runtimeError = unsupportedNodeMessage(process.versions);
68 process.stderr.write(runtimeError + "\n");
74 applyPortableHomeEnv(process.env, process.platform);
75 // Keeping import() inside a string prevents legacy parsers from seeing unsupported ESM syntax. This
76 // branch is reached only on the supported Node floor (or Bun when used as a script runtime).
MediumDynamic Require
Package source references dynamic require/import behavior.
runtime-bootstrap.cjsView on unpkg · L74 77 var load = Function("specifier", "return import(specifier)");
78 var entry = require("url").pathToFileURL(require("path").join(__dirname, "dist", "index.js")).href;
HighSandbox Evasion Gated Capability
Source gates dangerous network, credential, or execution behavior behind CI, host, platform, time, or geo fingerprint checks.
runtime-bootstrap.cjsView on unpkg · L35 79 load(entry).catch(failStart);
86 MIN_NODE_MAJOR: MIN_NODE_MAJOR,
87 MIN_NODE_VERSION: MIN_NODE_VERSION,
88 supportedNodeVersion: supportedNodeVersion,
89 unsupportedNodeMessage: unsupportedNodeMessage,
90 applyPortableHomeEnv: applyPortableHomeEnv,
91 normalizePortableWindowsHome: normalizePortableWindowsHome,
94if (require.main === module) main();