buildwithnexus 0.2.7 → 0.2.8

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 CHANGED
@@ -16,7 +16,7 @@ var BANNER = `
16
16
  `;
17
17
  function showBanner() {
18
18
  console.log(BANNER);
19
- console.log(chalk.dim(" v0.2.7 \xB7 buildwithnexus.dev\n"));
19
+ console.log(chalk.dim(" v0.2.8 \xB7 buildwithnexus.dev\n"));
20
20
  }
21
21
  function showPhase(phase, total, description) {
22
22
  const progress = chalk.cyan(`[${phase}/${total}]`);
@@ -369,7 +369,7 @@ function detectPlatform() {
369
369
  os: "mac",
370
370
  arch: arch === "arm64" ? "arm64" : "x64",
371
371
  qemuBinary: "qemu-system-aarch64",
372
- qemuCpuFlag: "-cpu host",
372
+ qemuCpuFlag: "-accel hvf -cpu host",
373
373
  ubuntuImage: "jammy-server-cloudimg-arm64.img",
374
374
  biosPath: "/opt/homebrew/share/qemu/edk2-aarch64-code.fd"
375
375
  };
@@ -593,31 +593,38 @@ async function resolvePortConflicts(ports) {
593
593
  async function launchVm(platform, diskPath, initIsoPath, ram, cpus, ports) {
594
594
  const machineArg = platform.os === "mac" ? "-machine virt,gic-version=3" : "-machine pc";
595
595
  const biosArgs = fs3.existsSync(platform.biosPath) ? ["-bios", platform.biosPath] : [];
596
- const args = [
597
- ...machineArg.split(" "),
598
- ...platform.qemuCpuFlag.split(" "),
599
- "-m",
600
- `${ram}G`,
601
- "-smp",
602
- `${cpus}`,
603
- "-drive",
604
- `file=${diskPath},if=virtio,cache=writethrough`,
605
- "-drive",
606
- `file=${initIsoPath},if=virtio,format=raw,cache=writethrough`,
607
- "-display",
608
- "none",
609
- "-serial",
610
- "none",
611
- "-net",
612
- "nic,model=virtio",
613
- "-net",
614
- `user,hostfwd=tcp::${ports.ssh}-:22,hostfwd=tcp::${ports.http}-:4200,hostfwd=tcp::${ports.https}-:443`,
615
- ...biosArgs,
616
- "-pidfile",
617
- PID_FILE,
618
- "-daemonize"
619
- ];
620
- await execa(platform.qemuBinary, args, { env: scrubEnv() });
596
+ function buildArgs(cpuFlag) {
597
+ return [
598
+ ...machineArg.split(" "),
599
+ ...cpuFlag.split(" "),
600
+ "-m",
601
+ `${ram}G`,
602
+ "-smp",
603
+ `${cpus}`,
604
+ "-drive",
605
+ `file=${diskPath},if=virtio,cache=writethrough`,
606
+ "-drive",
607
+ `file=${initIsoPath},if=virtio,format=raw,cache=writethrough`,
608
+ "-display",
609
+ "none",
610
+ "-serial",
611
+ "none",
612
+ "-net",
613
+ "nic,model=virtio",
614
+ "-net",
615
+ `user,hostfwd=tcp::${ports.ssh}-:22,hostfwd=tcp::${ports.http}-:4200,hostfwd=tcp::${ports.https}-:443`,
616
+ ...biosArgs,
617
+ "-pidfile",
618
+ PID_FILE,
619
+ "-daemonize"
620
+ ];
621
+ }
622
+ try {
623
+ await execa(platform.qemuBinary, buildArgs(platform.qemuCpuFlag), { env: scrubEnv() });
624
+ } catch {
625
+ const fallbackCpu = platform.os === "mac" ? "-cpu max" : "-cpu qemu64";
626
+ await execa(platform.qemuBinary, buildArgs(fallbackCpu), { env: scrubEnv() });
627
+ }
621
628
  return ports;
622
629
  }
623
630
  function readValidPid() {
@@ -1693,7 +1700,7 @@ var brainstormCommand = new Command11("brainstorm").description("Brainstorm an i
1693
1700
  });
1694
1701
 
1695
1702
  // src/cli.ts
1696
- var cli = new Command12().name("buildwithnexus").description("Auto-scaffold and launch a fully autonomous NEXUS runtime").version("0.2.7");
1703
+ var cli = new Command12().name("buildwithnexus").description("Auto-scaffold and launch a fully autonomous NEXUS runtime").version("0.2.8");
1697
1704
  cli.addCommand(initCommand);
1698
1705
  cli.addCommand(startCommand);
1699
1706
  cli.addCommand(stopCommand);
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "buildwithnexus",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Launch an autonomous AI runtime with triple-nested VM isolation in one command",
5
5
  "type": "module",
6
6
  "bin": {