omnius 1.0.437 → 1.0.439

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/index.js CHANGED
@@ -573657,7 +573657,7 @@ function resolveFocusSupervisorMode(configured, envValue = process.env["OMNIUS_F
573657
573657
  }
573658
573658
  function violatesDirective(directive, input) {
573659
573659
  if (input.toolName === "task_complete") {
573660
- return directive.requiredNextAction !== "report_blocked" && directive.requiredNextAction !== "report_incomplete";
573660
+ return directive.requiredNextAction !== "report_blocked" && directive.requiredNextAction !== "report_incomplete" && directive.requiredNextAction !== "use_cached_evidence";
573661
573661
  }
573662
573662
  if (input.toolName === "ask_user")
573663
573663
  return false;
@@ -603396,30 +603396,114 @@ function cudaHardwarePresent() {
603396
603396
  if (existsSync110("/usr/local/cuda")) return true;
603397
603397
  return isJetsonHost2();
603398
603398
  }
603399
- function jetsonPytorchIndex() {
603400
- let jpVer = "v60";
603399
+ function detectCudaToolkitVersion() {
603400
+ for (const path12 of ["/usr/local/cuda/version.json", "/usr/local/cuda/version.txt"]) {
603401
+ if (!existsSync110(path12)) continue;
603402
+ try {
603403
+ const raw = readFileSync90(path12, "utf8");
603404
+ const match2 = raw.match(/CUDA(?: Toolkit)?[^0-9]*(\d+\.\d+)/i) || raw.match(/"cuda"\s*:\s*"(\d+\.\d+)/i);
603405
+ if (match2?.[1]) return match2[1];
603406
+ } catch {
603407
+ }
603408
+ }
603409
+ const nvcc = spawnSync8("nvcc", ["--version"], { encoding: "utf8", timeout: 5e3 });
603410
+ const match = `${nvcc.stdout || ""}${nvcc.stderr || ""}`.match(/release\s+(\d+\.\d+)/i);
603411
+ return match?.[1] ?? "";
603412
+ }
603413
+ function jetsonPytorchDirs() {
603414
+ let primary = "v60";
603401
603415
  try {
603402
603416
  const tegra = existsSync110("/etc/nv_tegra_release") ? readFileSync90("/etc/nv_tegra_release", "utf8") : "";
603403
603417
  const env2 = process.env["JETSON_L4T_VERSION"] || "";
603404
- if (env2.startsWith("5.") || tegra.includes("R35") || tegra.includes("R34")) jpVer = "v51";
603405
- else if (env2.startsWith("6.1") || tegra.includes("R36.4")) jpVer = "v61";
603406
- else if (env2.startsWith("6.") || tegra.includes("R36")) jpVer = "v60";
603418
+ const cuda = detectCudaToolkitVersion();
603419
+ if (env2.startsWith("5.") || tegra.includes("R35") || tegra.includes("R34")) primary = "v51";
603420
+ else if (env2.startsWith("6.2")) primary = "v62";
603421
+ else if (env2.startsWith("6.1") || tegra.includes("R36.4")) primary = cuda.startsWith("12.2") ? "v60" : "v61";
603422
+ else if (env2.startsWith("6.") || tegra.includes("R36") || cuda.startsWith("12.2")) primary = "v60";
603407
603423
  } catch {
603408
603424
  }
603425
+ const fallbacks = primary === "v51" ? ["v51", "v511"] : primary === "v62" ? ["v62", "v61", "v60"] : primary === "v61" ? ["v61", "v60"] : ["v60", "v60dp", "v61"];
603426
+ return [...new Set(fallbacks)];
603427
+ }
603428
+ function jetsonPytorchIndex() {
603429
+ const jpVer = jetsonPytorchDirs()[0] ?? "v60";
603409
603430
  return `https://developer.download.nvidia.com/compute/redist/jp/${jpVer}/pytorch/`;
603410
603431
  }
603411
- function jetsonTorchInstallSource() {
603412
- const wheel = String(process.env["OMNIUS_JETSON_TORCH_WHEEL"] || process.env["JETSON_TORCH_WHEEL"] || "").trim();
603432
+ function pythonAbiTag(py = getVenvPython()) {
603433
+ const probe = spawnSync8(
603434
+ py,
603435
+ ["-c", "import sys; print(f'cp{sys.version_info.major}{sys.version_info.minor}')"],
603436
+ { encoding: "utf8", timeout: 5e3 }
603437
+ );
603438
+ const tag = String(probe.stdout || "").trim();
603439
+ return /^cp\d+$/.test(tag) ? tag : "cp310";
603440
+ }
603441
+ function discoverJetsonTorchWheel(py = getVenvPython()) {
603442
+ const envWheel = String(process.env["OMNIUS_JETSON_TORCH_WHEEL"] || process.env["JETSON_TORCH_WHEEL"] || "").trim();
603443
+ if (envWheel) return envWheel;
603444
+ const abi = pythonAbiTag(py);
603445
+ const dirs = jetsonPytorchDirs();
603446
+ const urls = dirs.flatMap((dir) => [
603447
+ `https://developer.download.nvidia.com/compute/redist/jp/${dir}/pytorch/`,
603448
+ `https://developer.download.nvidia.cn/compute/redist/jp/${dir}/pytorch/`
603449
+ ]);
603450
+ const probe = spawnSync8(
603451
+ "python3",
603452
+ [
603453
+ "-c",
603454
+ [
603455
+ "import json, re, sys, urllib.parse, urllib.request",
603456
+ "abi = sys.argv[1]",
603457
+ "urls = sys.argv[2:]",
603458
+ "for url in urls:",
603459
+ " try:",
603460
+ " html = urllib.request.urlopen(url, timeout=20).read().decode('utf-8', 'ignore')",
603461
+ " except Exception:",
603462
+ " continue",
603463
+ " wheels = []",
603464
+ ` for href in re.findall("href=[\\\\\\"']([^\\\\\\"']+\\\\.whl)[\\\\\\"']", html, flags=re.I):`,
603465
+ " name = urllib.parse.unquote(href.rsplit('/', 1)[-1])",
603466
+ " if not name.startswith('torch-'):",
603467
+ " continue",
603468
+ " if 'linux_aarch64' not in name or abi not in name:",
603469
+ " continue",
603470
+ " wheels.append(urllib.parse.urljoin(url, href))",
603471
+ " if wheels:",
603472
+ " print(json.dumps(sorted(wheels)[-1]))",
603473
+ " raise SystemExit(0)",
603474
+ "print(json.dumps(''))"
603475
+ ].join("\n"),
603476
+ abi,
603477
+ ...urls
603478
+ ],
603479
+ { encoding: "utf8", timeout: 9e4 }
603480
+ );
603481
+ try {
603482
+ return String(JSON.parse(probe.stdout || '""') || "");
603483
+ } catch {
603484
+ return "";
603485
+ }
603486
+ }
603487
+ function purgeVenvTorch(pip) {
603488
+ const purge = spawnSync8(
603489
+ pip,
603490
+ ["uninstall", "-y", "torch", "torchvision", "torchaudio", "triton"],
603491
+ { encoding: "utf8", timeout: 3e5 }
603492
+ );
603493
+ return `${purge.stdout || ""}${purge.stderr || ""}`;
603494
+ }
603495
+ function jetsonTorchInstallSource(py = getVenvPython()) {
603496
+ const wheel = discoverJetsonTorchWheel(py);
603413
603497
  if (wheel) {
603414
603498
  return {
603415
603499
  source: wheel,
603416
- args: ["install", "--upgrade", "--force-reinstall", "--no-deps", wheel]
603500
+ args: ["install", "--upgrade", "--force-reinstall", "--no-deps", "--no-cache-dir", wheel]
603417
603501
  };
603418
603502
  }
603419
603503
  const indexUrl = jetsonPytorchIndex();
603420
603504
  return {
603421
603505
  source: indexUrl,
603422
- args: ["install", "--upgrade", "--force-reinstall", "--no-deps", "--index-url", indexUrl, "torch"]
603506
+ args: ["install", "--upgrade", "--force-reinstall", "--no-deps", "--no-cache-dir", "--index-url", indexUrl, "torch"]
603423
603507
  };
603424
603508
  }
603425
603509
  function torchCudaProbe(py = getVenvPython()) {
@@ -603442,11 +603526,16 @@ function torchCudaProbe(py = getVenvPython()) {
603442
603526
  { encoding: "utf8", timeout: 3e4 }
603443
603527
  );
603444
603528
  const log22 = `${probe.stdout || ""}${probe.stderr || ""}`.trim();
603445
- return { ok: probe.status === 0, log: log22 };
603529
+ try {
603530
+ return { ok: probe.status === 0, log: log22, json: JSON.parse(probe.stdout || "{}") };
603531
+ } catch {
603532
+ return { ok: probe.status === 0, log: log22 };
603533
+ }
603446
603534
  }
603447
603535
  function ensureEmbedDeps() {
603448
603536
  const venv = getVenvDir();
603449
603537
  let log22 = "";
603538
+ const diagnostics = [];
603450
603539
  try {
603451
603540
  mkdirSync67(venv, { recursive: true });
603452
603541
  } catch {
@@ -603458,6 +603547,7 @@ function ensureEmbedDeps() {
603458
603547
  }
603459
603548
  if (isJetsonHost2() && cudaHardwarePresent() && !asrCpuAllowed()) {
603460
603549
  enableVenvSystemSitePackages(venv);
603550
+ diagnostics.push(`Jetson ASR CUDA repair: python=${getVenvPython()} abi=${pythonAbiTag()} cuda=${detectCudaToolkitVersion() || "unknown"} jp_dirs=${jetsonPytorchDirs().join(",")}`);
603461
603551
  }
603462
603552
  if (venvExisted && !(process.env["OMNIUS_INSTALL_FULL_EMBED_DEPS"] === "1")) {
603463
603553
  const check = spawnSync8(
@@ -603473,6 +603563,7 @@ function ensureEmbedDeps() {
603473
603563
  if (cudaProbe.ok) {
603474
603564
  return { ok: true, log: `embed deps already satisfied; torch CUDA OK ${cudaProbe.log}` };
603475
603565
  }
603566
+ diagnostics.push(`Initial venv torch CUDA failed: ${cudaProbe.log}`);
603476
603567
  log22 += `embed deps import OK but torch CUDA probe failed; repairing ASR torch. ${cudaProbe.log}
603477
603568
  `;
603478
603569
  }
@@ -603484,8 +603575,10 @@ function ensureEmbedDeps() {
603484
603575
  if (cudaHardwarePresent() && !asrCpuAllowed()) {
603485
603576
  const before = torchCudaProbe();
603486
603577
  torchOk = before.ok;
603578
+ if (!torchOk) diagnostics.push(`Pre-repair torch probe: ${before.log}`);
603487
603579
  if (!torchOk && isJetsonHost2()) {
603488
603580
  const systemTorch = torchCudaProbe("python3");
603581
+ diagnostics.push(`System python torch probe: ${systemTorch.log || "unavailable"}`);
603489
603582
  if (systemTorch.ok) {
603490
603583
  log22 += `Venv torch CUDA probe failed, but system Jetson torch CUDA works; enabling system site packages and removing venv-local torch.
603491
603584
  venv=${before.log}
@@ -603505,26 +603598,33 @@ system=${systemTorch.log}
603505
603598
  }
603506
603599
  }
603507
603600
  if (!torchOk && isJetsonHost2()) {
603601
+ log22 += purgeVenvTorch(pip);
603508
603602
  const torchDeps = spawnSync8(
603509
603603
  pip,
603510
- ["install", "--upgrade", "filelock", "typing-extensions", "networkx", "jinja2", "fsspec", "sympy"],
603604
+ ["install", "--upgrade", "numpy==1.26.4", "filelock", "typing-extensions", "networkx", "jinja2", "fsspec", "sympy"],
603511
603605
  { encoding: "utf8", timeout: 3e5 }
603512
603606
  );
603513
603607
  log22 += torchDeps.stdout + torchDeps.stderr;
603514
603608
  const torchSource = jetsonTorchInstallSource();
603609
+ diagnostics.push(`Jetson torch install source: ${torchSource.source || "not found"}`);
603515
603610
  log22 += `Torch CUDA probe failed on Jetson; installing JetPack-compatible PyTorch from ${torchSource.source}
603516
603611
  ${before.log}
603517
603612
  `;
603518
- const torchInstall = spawnSync8(
603519
- pip,
603520
- torchSource.args,
603521
- { encoding: "utf8", timeout: 9e5 }
603522
- );
603523
- log22 += torchInstall.stdout + torchInstall.stderr;
603524
- const after = torchCudaProbe();
603525
- torchOk = after.ok;
603526
- log22 += `Torch CUDA probe after Jetson install: ${after.log}
603613
+ if (!torchSource.source) {
603614
+ torchOk = false;
603615
+ } else {
603616
+ const torchInstall = spawnSync8(
603617
+ pip,
603618
+ torchSource.args,
603619
+ { encoding: "utf8", timeout: 9e5 }
603620
+ );
603621
+ log22 += torchInstall.stdout + torchInstall.stderr;
603622
+ const after = torchCudaProbe();
603623
+ torchOk = after.ok;
603624
+ diagnostics.push(`Post Jetson torch install probe: ${after.log}`);
603625
+ log22 += `Torch CUDA probe after Jetson install: ${after.log}
603527
603626
  `;
603627
+ }
603528
603628
  } else if (!torchOk) {
603529
603629
  log22 += `Torch CUDA probe failed on CUDA host; not allowing ASR CPU fallback. ${before.log}
603530
603630
  `;
@@ -603564,6 +603664,28 @@ ${before.log}
603564
603664
  if (!torchOk) {
603565
603665
  log22 += `Torch CUDA probe still failed after ASR dependency install. ${finalTorch.log}
603566
603666
  `;
603667
+ diagnostics.push(`Post ASR dependency torch probe: ${finalTorch.log}`);
603668
+ if (isJetsonHost2()) {
603669
+ log22 += "Retrying Jetson torch repair after ASR dependency install to remove any incompatible torch resolver side effects.\n";
603670
+ log22 += purgeVenvTorch(pip);
603671
+ const torchSource = jetsonTorchInstallSource();
603672
+ diagnostics.push(`Final Jetson torch repair source: ${torchSource.source || "not found"}`);
603673
+ if (!torchSource.source) {
603674
+ torchOk = false;
603675
+ } else {
603676
+ const retry = spawnSync8(
603677
+ pip,
603678
+ torchSource.args,
603679
+ { encoding: "utf8", timeout: 9e5 }
603680
+ );
603681
+ log22 += retry.stdout + retry.stderr;
603682
+ const repaired = torchCudaProbe();
603683
+ torchOk = repaired.ok;
603684
+ diagnostics.push(`Final repaired torch probe: ${repaired.log}`);
603685
+ log22 += `Torch CUDA probe after final Jetson repair from ${torchSource.source}: ${repaired.log}
603686
+ `;
603687
+ }
603688
+ }
603567
603689
  }
603568
603690
  }
603569
603691
  let fullOk = true;
@@ -603582,6 +603704,21 @@ ${before.log}
603582
603704
  fullOk = full.status === 0;
603583
603705
  }
603584
603706
  const ok3 = asrDepsOk && up.status === 0 && fullOk && torchOk;
603707
+ if (!ok3) {
603708
+ const compact4 = [
603709
+ "ASR dependency setup failed.",
603710
+ ...diagnostics,
603711
+ `pip_base_ok=${up.status === 0}`,
603712
+ `asr_deps_ok=${asrDepsOk}`,
603713
+ `full_embed_deps_ok=${fullOk}`,
603714
+ `torch_cuda_ok=${torchOk}`,
603715
+ "Set OMNIUS_JETSON_TORCH_WHEEL=/path/or/url/to/torch-*-linux_aarch64.whl to override auto-discovery."
603716
+ ].join("\n");
603717
+ return { ok: ok3, log: `${compact4}
603718
+
603719
+ --- raw pip tail ---
603720
+ ${log22.slice(-2e3)}` };
603721
+ }
603585
603722
  return { ok: ok3, log: log22 };
603586
603723
  }
603587
603724
  function runEmbedImage(input) {
@@ -604198,7 +604335,7 @@ var init_listen = __esm({
604198
604335
  const res = ensure();
604199
604336
  if (res?.log) this.emit("status", res.log.slice(-500));
604200
604337
  if (res && res.ok === false) {
604201
- throw new Error(`ASR Python dependency setup failed: ${String(res.log ?? "").slice(-1200)}`);
604338
+ throw new Error(String(res.log ?? "ASR Python dependency setup failed").slice(0, 2400));
604202
604339
  }
604203
604340
  }
604204
604341
  if (typeof getPy === "function") {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.437",
3
+ "version": "1.0.439",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.437",
9
+ "version": "1.0.439",
10
10
  "bundleDependencies": [
11
11
  "image-to-ascii"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.437",
3
+ "version": "1.0.439",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",