buildwithnexus 0.4.2 → 0.4.4
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/dist/bin.js +14 -11
- package/dist/nexus-release.tar.gz +0 -0
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -524,8 +524,10 @@ async function launchVm(platform, diskPath, initIsoPath, ram, cpus, ports) {
|
|
|
524
524
|
];
|
|
525
525
|
try {
|
|
526
526
|
await execa(platform.qemuBinary, buildArgs(platform.qemuCpuFlag.split(" ")), { env: scrubEnv() });
|
|
527
|
+
process.stderr.write(" [vm] Hardware acceleration (HVF) active\n");
|
|
527
528
|
} catch {
|
|
528
529
|
const fallbackCpu = platform.os === "mac" ? ["-cpu", "max"] : ["-cpu", "qemu64"];
|
|
530
|
+
process.stderr.write(" [vm] WARNING: HVF unavailable \u2014 using software emulation (VM will be slower)\n");
|
|
529
531
|
await execa(platform.qemuBinary, buildArgs(fallbackCpu), { env: scrubEnv() });
|
|
530
532
|
}
|
|
531
533
|
return ports;
|
|
@@ -671,7 +673,7 @@ function addSshConfig(port) {
|
|
|
671
673
|
fs4.writeFileSync(sshConfigPath, block, { mode: 384 });
|
|
672
674
|
}
|
|
673
675
|
}
|
|
674
|
-
async function waitForSsh(port, timeoutMs =
|
|
676
|
+
async function waitForSsh(port, timeoutMs = 9e5) {
|
|
675
677
|
const start = Date.now();
|
|
676
678
|
while (Date.now() - start < timeoutMs) {
|
|
677
679
|
try {
|
|
@@ -681,13 +683,13 @@ async function waitForSsh(port, timeoutMs = 3e5) {
|
|
|
681
683
|
port,
|
|
682
684
|
username: "nexus",
|
|
683
685
|
privateKeyPath: SSH_KEY,
|
|
684
|
-
readyTimeout:
|
|
686
|
+
readyTimeout: 1e4,
|
|
685
687
|
hostVerifier: getHostVerifier()
|
|
686
688
|
});
|
|
687
689
|
ssh.dispose();
|
|
688
690
|
return true;
|
|
689
691
|
} catch {
|
|
690
|
-
await new Promise((r) => setTimeout(r,
|
|
692
|
+
await new Promise((r) => setTimeout(r, 1e4));
|
|
691
693
|
}
|
|
692
694
|
}
|
|
693
695
|
return false;
|
|
@@ -737,6 +739,7 @@ var init_ssh = __esm({
|
|
|
737
739
|
|
|
738
740
|
// src/cli.ts
|
|
739
741
|
import { Command as Command14 } from "commander";
|
|
742
|
+
import { createRequire } from "module";
|
|
740
743
|
|
|
741
744
|
// src/commands/init.ts
|
|
742
745
|
init_banner();
|
|
@@ -1115,14 +1118,12 @@ async function installCloudflared(sshPort, arch) {
|
|
|
1115
1118
|
].join(" && "));
|
|
1116
1119
|
}
|
|
1117
1120
|
async function startTunnel(sshPort) {
|
|
1118
|
-
await sshExec(
|
|
1119
|
-
|
|
1120
|
-
"&& nohup cloudflared tunnel --no-autoupdate --url http://localhost:4200"
|
|
1121
|
-
|
|
1122
|
-
"disown"
|
|
1123
|
-
].join(" "));
|
|
1121
|
+
await sshExec(
|
|
1122
|
+
sshPort,
|
|
1123
|
+
"install -m 600 /dev/null /home/nexus/.nexus/tunnel.log && bash -c 'nohup cloudflared tunnel --no-autoupdate --url http://localhost:4200 > /home/nexus/.nexus/tunnel.log 2>&1 &'"
|
|
1124
|
+
);
|
|
1124
1125
|
const start = Date.now();
|
|
1125
|
-
while (Date.now() - start <
|
|
1126
|
+
while (Date.now() - start < 12e4) {
|
|
1126
1127
|
try {
|
|
1127
1128
|
const { stdout } = await sshExec(sshPort, "grep -oE 'https://[a-z0-9-]+\\.trycloudflare\\.com' /home/nexus/.nexus/tunnel.log 2>/dev/null | head -1");
|
|
1128
1129
|
if (stdout.includes("https://")) {
|
|
@@ -2846,7 +2847,9 @@ var shellCommand2 = new Command13("shell").description("Launch the interactive N
|
|
|
2846
2847
|
});
|
|
2847
2848
|
|
|
2848
2849
|
// src/cli.ts
|
|
2849
|
-
var
|
|
2850
|
+
var _require = createRequire(import.meta.url);
|
|
2851
|
+
var { version } = _require("../package.json");
|
|
2852
|
+
var cli = new Command14().name("buildwithnexus").description("Auto-scaffold and launch a fully autonomous NEXUS runtime").version(version);
|
|
2850
2853
|
cli.addCommand(initCommand);
|
|
2851
2854
|
cli.addCommand(startCommand);
|
|
2852
2855
|
cli.addCommand(stopCommand);
|
|
Binary file
|