omnius 1.0.437 → 1.0.438

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
  }
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
+ }
603411
603495
  function jetsonTorchInstallSource() {
603412
- const wheel = String(process.env["OMNIUS_JETSON_TORCH_WHEEL"] || process.env["JETSON_TORCH_WHEEL"] || "").trim();
603496
+ const wheel = discoverJetsonTorchWheel();
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()) {
@@ -603505,9 +603589,10 @@ system=${systemTorch.log}
603505
603589
  }
603506
603590
  }
603507
603591
  if (!torchOk && isJetsonHost2()) {
603592
+ log22 += purgeVenvTorch(pip);
603508
603593
  const torchDeps = spawnSync8(
603509
603594
  pip,
603510
- ["install", "--upgrade", "filelock", "typing-extensions", "networkx", "jinja2", "fsspec", "sympy"],
603595
+ ["install", "--upgrade", "numpy==1.26.4", "filelock", "typing-extensions", "networkx", "jinja2", "fsspec", "sympy"],
603511
603596
  { encoding: "utf8", timeout: 3e5 }
603512
603597
  );
603513
603598
  log22 += torchDeps.stdout + torchDeps.stderr;
@@ -603564,6 +603649,21 @@ ${before.log}
603564
603649
  if (!torchOk) {
603565
603650
  log22 += `Torch CUDA probe still failed after ASR dependency install. ${finalTorch.log}
603566
603651
  `;
603652
+ if (isJetsonHost2()) {
603653
+ log22 += "Retrying Jetson torch repair after ASR dependency install to remove any incompatible torch resolver side effects.\n";
603654
+ log22 += purgeVenvTorch(pip);
603655
+ const torchSource = jetsonTorchInstallSource();
603656
+ const retry = spawnSync8(
603657
+ pip,
603658
+ torchSource.args,
603659
+ { encoding: "utf8", timeout: 9e5 }
603660
+ );
603661
+ log22 += retry.stdout + retry.stderr;
603662
+ const repaired = torchCudaProbe();
603663
+ torchOk = repaired.ok;
603664
+ log22 += `Torch CUDA probe after final Jetson repair from ${torchSource.source}: ${repaired.log}
603665
+ `;
603666
+ }
603567
603667
  }
603568
603668
  }
603569
603669
  let fullOk = true;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.437",
3
+ "version": "1.0.438",
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.438",
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.438",
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",