omnius 1.0.104 → 1.0.105

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
@@ -578128,7 +578128,8 @@ function recommendModel(specs) {
578128
578128
  return QWEN_VARIANTS.find((v) => v.tag === "qwen3.5:cloud");
578129
578129
  }
578130
578130
  function calculateContextWindow(specs, modelSizeGB2, kvBytesPerToken, archMax) {
578131
- const totalAvail = Math.max(specs.gpuVramGB, specs.totalRamGB);
578131
+ const ramBudget = specs.availableRamGB > 0 ? specs.availableRamGB : specs.totalRamGB;
578132
+ const totalAvail = Math.max(specs.gpuVramGB, ramBudget);
578132
578133
  const remaining = Math.max(0, totalAvail - modelSizeGB2);
578133
578134
  const usableGB = remaining * 0.85;
578134
578135
  let numCtx;
@@ -578155,11 +578156,18 @@ function formatContextLabel(numCtx) {
578155
578156
  return numCtx >= 1024 ? `${Math.floor(numCtx / 1024)}K` : String(numCtx);
578156
578157
  }
578157
578158
  function calculateExpandedVariantContextWindow(specs, modelSizeGB2, kvBytesPerToken, archMax) {
578159
+ const memoryBudget = calculateContextWindow(
578160
+ specs,
578161
+ modelSizeGB2,
578162
+ kvBytesPerToken,
578163
+ archMax
578164
+ );
578158
578165
  if (archMax && archMax > 0) {
578159
- const numCtx = Math.max(2048, Math.floor(archMax / 1024) * 1024);
578166
+ const archCtx = Math.max(2048, Math.floor(archMax / 1024) * 1024);
578167
+ const numCtx = Math.min(archCtx, memoryBudget.numCtx);
578160
578168
  return { numCtx, label: formatContextLabel(numCtx) };
578161
578169
  }
578162
- return calculateContextWindow(specs, modelSizeGB2, kvBytesPerToken, archMax);
578170
+ return memoryBudget;
578163
578171
  }
578164
578172
  function ask(rl, question) {
578165
578173
  return new Promise((resolve52) => {
@@ -579437,7 +579445,10 @@ function getVenvDir2() {
579437
579445
  }
579438
579446
  function hasVenvModule() {
579439
579447
  try {
579440
- execSync50("python3 -m venv --help", { stdio: "pipe", timeout: 5e3 });
579448
+ execSync50('python3 -c "import ensurepip, venv"', {
579449
+ stdio: "pipe",
579450
+ timeout: 5e3
579451
+ });
579441
579452
  return true;
579442
579453
  } catch {
579443
579454
  return false;
@@ -579470,15 +579481,15 @@ function ensureVenv(log22) {
579470
579481
  }
579471
579482
  }
579472
579483
  }
579473
- log22("Creating Python venv for vision deps...");
579474
579484
  if (!hasCmd(pythonCmd) && !hasCmd("python3")) {
579475
579485
  log22(`${pythonCmd} not found — cannot create venv.`);
579476
579486
  return null;
579477
579487
  }
579478
579488
  if (!isWin2 && !hasVenvModule()) {
579479
- log22("python3 venv module not available — venv creation skipped.");
579489
+ log22("python3-venv is not installed — venv creation skipped. Install with: sudo apt-get install python3-venv");
579480
579490
  return null;
579481
579491
  }
579492
+ log22("Creating Python venv for vision deps...");
579482
579493
  try {
579483
579494
  mkdirSync52(join107(homedir34(), ".omnius"), { recursive: true });
579484
579495
  const pyCmd = hasCmd(pythonCmd) ? pythonCmd : "python3";
@@ -580034,7 +580045,10 @@ async function repairExpandedVariantIfStale(variantModel, fallbackBaseModel, bac
580034
580045
  return { repaired: false, currentNumCtx: state.currentNumCtx, baseModel: null, resolvedModel: variantName };
580035
580046
  }
580036
580047
  const canonicalModel = expandedModelName(baseModel);
580037
- const needsCtxRepair = !(state.currentNumCtx > 0 && state.currentNumCtx >= targetNumCtx);
580048
+ const hasCtx = state.currentNumCtx > 0;
580049
+ const tooSmall = hasCtx && state.currentNumCtx < targetNumCtx;
580050
+ const tooLarge = hasCtx && state.currentNumCtx > Math.floor(targetNumCtx * 1.1);
580051
+ const needsCtxRepair = !hasCtx || tooSmall || tooLarge;
580038
580052
  const needsCanonicalVariant = variantName !== canonicalModel;
580039
580053
  let repaired = false;
580040
580054
  if (needsCtxRepair) {
@@ -652800,15 +652814,41 @@ ${result.summary}`
652800
652814
  },
652801
652815
  () => new Promise((resolve52) => {
652802
652816
  depSudoPromptPending = true;
652817
+ if (process.stdout.isTTY) {
652818
+ process.stdout.write("\x1B[?1000l\x1B[?1002l\x1B[?1006l");
652819
+ }
652820
+ const origProvider = statusBar.inputStateProvider;
652821
+ if (statusBar?.isActive) {
652822
+ statusBar.inputStateProvider = () => {
652823
+ const state = origProvider?.() ?? { line: "", cursor: 0 };
652824
+ return { line: "●".repeat(state.line.length), cursor: state.cursor };
652825
+ };
652826
+ }
652827
+ const footerPwPrompt = `\x1B[38;5;198m● password:\x1B[0m `;
652828
+ const prevPromptText = statusBar.promptText;
652829
+ const prevPromptWidth = statusBar.promptWidth;
652830
+ if (statusBar?.isActive) {
652831
+ statusBar.setPromptText(footerPwPrompt, 12);
652832
+ }
652803
652833
  depSudoResolver = (pw2) => {
652804
652834
  depSudoPromptPending = false;
652805
652835
  depSudoResolver = null;
652836
+ if (statusBar?.isActive) {
652837
+ statusBar.inputStateProvider = origProvider ?? (() => ({ line: rl.line ?? "", cursor: rl.cursor ?? 0 }));
652838
+ if (prevPromptText !== void 0 && prevPromptWidth !== void 0) {
652839
+ statusBar.setPromptText(prevPromptText, prevPromptWidth);
652840
+ }
652841
+ }
652842
+ if (process.stdout.isTTY) {
652843
+ process.stdout.write("\x1B[?1002h\x1B[?1006h");
652844
+ }
652806
652845
  if (pw2) sessionSudoPassword = pw2;
652807
652846
  resolve52(pw2);
652808
652847
  };
652809
652848
  const pwPrompt = `
652810
- ${c3.bold(c3.yellow("🔑 Password needed for dependency install:"))}
652811
- ${c3.dim("Type your sudo password below and press Enter.")}
652849
+ \x1B[5;38;5;198m⚠ Password needed for dependency install\x1B[0m
652850
+ ${c3.dim("Type your sudo password below and press Enter. Input is hidden.")}
652851
+
652812
652852
  `;
652813
652853
  if (isNeovimActive()) {
652814
652854
  writeToNeovimOutput(pwPrompt);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.104",
3
+ "version": "1.0.105",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.104",
9
+ "version": "1.0.105",
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.104",
3
+ "version": "1.0.105",
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",