open-agents-ai 0.187.47 → 0.187.48

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.
Files changed (2) hide show
  1. package/dist/index.js +52 -50
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -290048,65 +290048,58 @@ async function handleUpdate(subcommand, ctx3) {
290048
290048
  process.stdout.write(text);
290049
290049
  }
290050
290050
  };
290051
- const particles = [" ", "\u2801", "\u2802", "\u2840", "\u2804", "\u2820", "\u2812", "\u28C0", "\u2824", "\u28C4", "\xB7", "\u2591", "\u28E4", "\u2592", "\u28F6", "\u2593", "\u28FF", "\u2588"];
290052
- const hash = (r2, c4, f2) => {
290053
- const x = r2 * 7 + c4 * 13 + f2 * 3 + 37;
290054
- return (x * x * 31 + x * 17 + 59) % 97 / 97;
290055
- };
290056
- function renderInstallFrame(version4, frame, statusLine) {
290051
+ const PROGRESS_BLOCKS = [" ", "\u2801", "\u2803", "\u2807", "\u280F", "\u281F", "\u283F", "\u28FF"];
290052
+ let _installProgress = 0;
290053
+ let _installTotal = 10;
290054
+ function renderInstallFrame(version4, _frame, statusLine) {
290057
290055
  const cols = process.stdout.columns ?? 80;
290058
290056
  const rows = process.stdout.rows ?? 24;
290059
- const bgDark = 0;
290060
290057
  const yellow = 178;
290061
290058
  const contentTop = 4;
290062
290059
  const contentBottom = rows - 3;
290063
290060
  const contentHeight = Math.max(5, contentBottom - contentTop + 1);
290064
290061
  let buf = "\x1B[?2026h\x1B7\x1B[?25l";
290065
290062
  for (let r2 = contentTop; r2 <= contentBottom; r2++) {
290066
- buf += `\x1B[${r2};1H\x1B[48;5;${bgDark}m\x1B[2K`;
290063
+ buf += `\x1B[${r2};1H\x1B[48;5;0m\x1B[2K`;
290067
290064
  }
290068
290065
  const centerRow = contentTop + Math.floor(contentHeight / 2);
290069
290066
  const centerCol = Math.floor(cols / 2);
290070
- const boxW = Math.min(44, cols - 4);
290071
- const boxH = 7;
290067
+ const boxW = Math.min(50, cols - 4);
290068
+ const boxH = 5;
290072
290069
  const boxTop = centerRow - Math.floor(boxH / 2);
290073
290070
  const boxLeft = centerCol - Math.floor(boxW / 2);
290074
- buf += `\x1B[${boxTop};${boxLeft}H\x1B[38;5;${yellow}m\u250C`;
290075
- buf += `\x1B[${boxTop};${boxLeft + boxW - 1}H\u2510`;
290076
- buf += `\x1B[${boxTop + boxH - 1};${boxLeft}H\u2514`;
290077
- buf += `\x1B[${boxTop + boxH - 1};${boxLeft + boxW - 1}H\u2518`;
290078
- for (let c4 = 1; c4 < boxW - 1; c4++) {
290079
- const density = Math.sin(c4 * 0.3 + frame * 0.4) * 0.5 + 0.5;
290080
- const noise2 = hash(0, c4, frame);
290081
- const charIdx = noise2 < density ? Math.min(particles.length - 1, Math.floor(density * particles.length)) : 0;
290082
- const ch = particles[charIdx];
290083
- buf += `\x1B[${boxTop};${boxLeft + c4}H\x1B[38;5;${yellow}m${ch}`;
290084
- const density2 = Math.sin(c4 * 0.3 + frame * 0.4 + 1.5) * 0.5 + 0.5;
290085
- const noise22 = hash(boxH, c4, frame);
290086
- const charIdx2 = noise22 < density2 ? Math.min(particles.length - 1, Math.floor(density2 * particles.length)) : 0;
290087
- buf += `\x1B[${boxTop + boxH - 1};${boxLeft + c4}H${particles[charIdx2]}`;
290088
- }
290071
+ const innerW = boxW - 2;
290072
+ buf += `\x1B[${boxTop};${boxLeft}H\x1B[38;5;${yellow}m\u256D${"\u2500".repeat(innerW)}\u256E`;
290089
290073
  for (let r2 = 1; r2 < boxH - 1; r2++) {
290090
- const density = Math.sin(r2 * 0.5 + frame * 0.35) * 0.5 + 0.5;
290091
- const noise2 = hash(r2, 0, frame);
290092
- const charIdx = noise2 < density ? Math.min(particles.length - 1, Math.floor(density * particles.length)) : 0;
290093
- buf += `\x1B[${boxTop + r2};${boxLeft}H\x1B[38;5;${yellow}m${particles[charIdx]}`;
290094
- const density2 = Math.sin(r2 * 0.5 + frame * 0.35 + 2) * 0.5 + 0.5;
290095
- const noise22 = hash(r2, boxW, frame);
290096
- const charIdx2 = noise22 < density2 ? Math.min(particles.length - 1, Math.floor(density2 * particles.length)) : 0;
290097
- buf += `\x1B[${boxTop + r2};${boxLeft + boxW - 1}H${particles[charIdx2]}`;
290098
- }
290099
- const label = statusLine === "__DONE__" ? "INSTALLED" : "INSTALLING";
290100
- const labelColor = statusLine === "__DONE__" ? 82 : yellow;
290074
+ buf += `\x1B[${boxTop + r2};${boxLeft}H\x1B[38;5;${yellow}m\u2502${" ".repeat(innerW)}\u2502`;
290075
+ }
290076
+ buf += `\x1B[${boxTop + boxH - 1};${boxLeft}H\x1B[38;5;${yellow}m\u2570${"\u2500".repeat(innerW)}\u256F`;
290077
+ const isDone = statusLine === "__DONE__";
290078
+ const label = isDone ? "INSTALLED" : "INSTALLING";
290079
+ const labelColor = isDone ? 82 : yellow;
290101
290080
  const labelCol = centerCol - Math.floor(label.length / 2);
290102
- buf += `\x1B[${centerRow - 1};${labelCol}H\x1B[1;38;5;${labelColor}m${label}`;
290103
- const vLabel = `v${version4}`;
290104
- const vCol = centerCol - Math.floor(vLabel.length / 2);
290105
- buf += `\x1B[${centerRow};${vCol}H\x1B[0;38;5;245m\x1B[48;5;${bgDark}m${vLabel}`;
290106
- if (statusLine && centerRow + 2 <= contentBottom) {
290107
- const sCol = centerCol - Math.floor(statusLine.length / 2);
290108
- buf += `\x1B[${centerRow + 2};${Math.max(1, sCol)}H\x1B[38;5;240m\x1B[48;5;${bgDark}m${statusLine.slice(0, cols - 2)}`;
290081
+ buf += `\x1B[${boxTop + 1};${labelCol}H\x1B[1;38;5;${labelColor}m${label}\x1B[0m`;
290082
+ const progress = isDone ? 1 : Math.min(0.95, _installProgress / Math.max(1, _installTotal));
290083
+ const barW = innerW - 4;
290084
+ const filledCols = Math.floor(progress * barW);
290085
+ let bar = "";
290086
+ for (let c4 = 0; c4 < barW; c4++) {
290087
+ if (c4 < filledCols) {
290088
+ bar += PROGRESS_BLOCKS[PROGRESS_BLOCKS.length - 1];
290089
+ } else if (c4 === filledCols) {
290090
+ const subProgress = progress * barW - filledCols;
290091
+ const idx = Math.floor(subProgress * (PROGRESS_BLOCKS.length - 1));
290092
+ bar += PROGRESS_BLOCKS[idx] ?? " ";
290093
+ } else {
290094
+ bar += PROGRESS_BLOCKS[0];
290095
+ }
290109
290096
  }
290097
+ const barCol = boxLeft + 3;
290098
+ buf += `\x1B[${boxTop + 2};${barCol}H\x1B[38;5;${yellow}m${bar}\x1B[0m`;
290099
+ const statusText = isDone ? `v${version4}` : statusLine || `v${version4}`;
290100
+ const statusTrunc = statusText.slice(0, innerW - 2);
290101
+ const sCol = centerCol - Math.floor(statusTrunc.length / 2);
290102
+ buf += `\x1B[${boxTop + 3};${sCol}H\x1B[38;5;240m${statusTrunc}\x1B[0m`;
290110
290103
  buf += `\x1B[0m\x1B8\x1B[?25h\x1B[?2026l`;
290111
290104
  process.stdout.write(buf);
290112
290105
  }
@@ -290117,7 +290110,7 @@ async function handleUpdate(subcommand, ctx3) {
290117
290110
  const timer = setInterval(() => {
290118
290111
  frame++;
290119
290112
  renderInstallFrame(version4, frame, status);
290120
- }, 80);
290113
+ }, 200);
290121
290114
  return {
290122
290115
  setStatus(text) {
290123
290116
  status = text;
@@ -290326,6 +290319,8 @@ async function handleUpdate(subcommand, ctx3) {
290326
290319
  const targetVersion = info?.latestVersion ?? currentVersion;
290327
290320
  const installOverlay = startInstallOverlay(targetVersion);
290328
290321
  let installError = "";
290322
+ _installProgress = 0;
290323
+ _installTotal = 10;
290329
290324
  const runInstall2 = (cmd) => new Promise((resolve39) => {
290330
290325
  const child = exec4(cmd, { timeout: 18e4 }, (err, _stdout, stderr) => {
290331
290326
  if (err)
@@ -290335,15 +290330,22 @@ async function handleUpdate(subcommand, ctx3) {
290335
290330
  child.stdout?.on("data", (chunk) => {
290336
290331
  const text = String(chunk);
290337
290332
  for (const line of text.split("\n")) {
290338
- if (line.trim())
290339
- installOverlay.setStatus(line.trim().slice(0, 50));
290333
+ const trimmed = line.trim();
290334
+ if (trimmed) {
290335
+ _installProgress++;
290336
+ if (!trimmed.startsWith("npm") && trimmed.length < 50) {
290337
+ installOverlay.setStatus(trimmed);
290338
+ }
290339
+ }
290340
290340
  }
290341
290341
  });
290342
290342
  child.stderr?.on("data", (chunk) => {
290343
290343
  const text = String(chunk);
290344
290344
  for (const line of text.split("\n")) {
290345
- if (line.trim() && !line.includes("npm warn")) {
290346
- installOverlay.setStatus(line.trim().slice(0, 50));
290345
+ const trimmed = line.trim();
290346
+ if (trimmed && !trimmed.includes("npm warn") && !trimmed.includes("npm notice")) {
290347
+ _installProgress++;
290348
+ installOverlay.setStatus(trimmed.slice(0, 40));
290347
290349
  }
290348
290350
  }
290349
290351
  });
@@ -290373,7 +290375,7 @@ async function handleUpdate(subcommand, ctx3) {
290373
290375
  const installCmd = `${sudoPrefix}npm install -g open-agents-ai@latest --prefer-online`;
290374
290376
  let installOk = await runInstall2(installCmd);
290375
290377
  if (!installOk && process.platform === "win32" && /EPERM|EACCES|access|denied|permission/i.test(installError)) {
290376
- installOverlay.setStatus("Needs admin \u2014 retrying with elevation...");
290378
+ installOverlay.setStatus("Elevating permissions...");
290377
290379
  installError = "";
290378
290380
  installOk = await runInstall2(`powershell -NoProfile -Command "Start-Process -FilePath 'npm' -ArgumentList 'install -g open-agents-ai@latest --prefer-online' -Verb RunAs -Wait"`);
290379
290381
  }
@@ -290392,7 +290394,7 @@ async function handleUpdate(subcommand, ctx3) {
290392
290394
  }
290393
290395
  } catch {
290394
290396
  }
290395
- installOverlay.setStatus("Retrying install...");
290397
+ installOverlay.setStatus("Installing...");
290396
290398
  installError = "";
290397
290399
  installOk = await runInstall2(`${process.platform === "win32" ? "" : sudoPrefix}npm install -g open-agents-ai@latest --force --prefer-online`);
290398
290400
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.47",
3
+ "version": "0.187.48",
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",