open-agents-ai 0.124.0 → 0.126.0

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 +55 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -41534,22 +41534,46 @@ async function handleVoiceMenu(ctx, save, hasLocal) {
41534
41534
  const currentMode = ctx.voiceGetMode?.() ?? "action";
41535
41535
  const currentModel = ctx.voiceGetModel?.() ?? "unknown";
41536
41536
  const enabledLabel = isEnabled ? selectColors.green("\u25CF Voice: Enabled") : selectColors.dim("\u25CB Voice: Disabled");
41537
+ const clones = ctx.voiceListClones?.() ?? [];
41538
+ const activeClone = clones.find((c3) => c3.isActive);
41539
+ const cloneStatus = activeClone ? `clone: ${selectColors.cyan(activeClone.name)}` : "no clone active";
41537
41540
  const items = [
41538
41541
  { key: "header-status", label: selectColors.dim("\u2500\u2500\u2500 Voice Status \u2500\u2500\u2500") },
41539
41542
  { key: "toggle", label: isEnabled ? "Disable Voice" : "Enable Voice", detail: enabledLabel },
41543
+ { key: "info-voice", label: selectColors.dim(` Engine: ${currentModel} Mode: ${currentMode} ${cloneStatus}`) },
41540
41544
  { key: "header-config", label: selectColors.dim("\u2500\u2500\u2500 Configuration \u2500\u2500\u2500") },
41541
41545
  { key: "mode", label: "Voice Mode", detail: `${selectColors.green(currentMode)} \u2014 ${modeLabels[currentMode]}` },
41542
41546
  { key: "voice", label: "Change TTS Voice", detail: `current: ${selectColors.green(currentModel)}` },
41543
41547
  { key: "system", label: "Change TTS System", detail: "onnx / mlx / luxtts" },
41544
41548
  { key: "clone", label: "Clone Voice", detail: "drag & drop audio file" },
41545
- { key: "list", label: "Manage Clone Voices", detail: "rename, play, delete" }
41549
+ { key: "list", label: "Manage Clone Voices", detail: `${clones.length} clone(s)` },
41550
+ { key: "header-test", label: selectColors.dim("\u2500\u2500\u2500 Preview \u2500\u2500\u2500") },
41551
+ { key: "preview", label: "Preview Voice", detail: "speak a random test phrase (or press p)" }
41546
41552
  ];
41547
41553
  const result = await tuiSelect({
41548
41554
  items,
41549
41555
  title: "Voice Configuration",
41550
41556
  rl: ctx.rl,
41551
41557
  availableRows: ctx.availableContentRows?.(),
41552
- skipKeys: ["header-status", "header-config"]
41558
+ skipKeys: ["header-status", "header-config", "info-voice", "header-test"],
41559
+ customKeyHint: " p preview",
41560
+ onCustomKey(item, key, helpers) {
41561
+ if (key === "p" || key === "P") {
41562
+ const testPhrases = [
41563
+ "Testing voice output. The agent is ready to assist you.",
41564
+ "All systems operational. Voice synthesis configured and active.",
41565
+ "Hello! This is your AI coding assistant speaking.",
41566
+ "Voice clone engaged. Ready for the next task.",
41567
+ "Open Agents, powered by open-weight models. No API keys required.",
41568
+ "The distributed cognitive commons awaits your contribution."
41569
+ ];
41570
+ const phrase = testPhrases[Math.floor(Math.random() * testPhrases.length)];
41571
+ ctx.voiceSpeak?.(phrase);
41572
+ helpers.done();
41573
+ return true;
41574
+ }
41575
+ return false;
41576
+ }
41553
41577
  });
41554
41578
  if (!result.confirmed || !result.key)
41555
41579
  return;
@@ -41560,6 +41584,19 @@ async function handleVoiceMenu(ctx, save, hasLocal) {
41560
41584
  save({ voice: isOn });
41561
41585
  continue;
41562
41586
  }
41587
+ case "preview": {
41588
+ const testPhrases = [
41589
+ "Testing voice output. The agent is ready to assist you.",
41590
+ "All systems operational. Voice synthesis configured and active.",
41591
+ "Hello! This is your AI coding assistant speaking.",
41592
+ "Voice clone engaged. Ready for the next task.",
41593
+ "Open Agents, powered by open-weight models.",
41594
+ "The distributed cognitive commons awaits."
41595
+ ];
41596
+ const phrase = testPhrases[Math.floor(Math.random() * testPhrases.length)];
41597
+ ctx.voiceSpeak?.(phrase);
41598
+ continue;
41599
+ }
41563
41600
  case "mode": {
41564
41601
  const modeItems = [
41565
41602
  { key: "chat", label: "Chat", detail: "speaks streamed model text at normal pitch" },
@@ -41569,7 +41606,7 @@ async function handleVoiceMenu(ctx, save, hasLocal) {
41569
41606
  const modeResult = await tuiSelect({
41570
41607
  items: modeItems,
41571
41608
  activeKey: currentMode,
41572
- title: "Voice Mode",
41609
+ title: "Voice \u203A Mode",
41573
41610
  rl: ctx.rl,
41574
41611
  availableRows: ctx.availableContentRows?.()
41575
41612
  });
@@ -41596,7 +41633,7 @@ async function handleVoiceMenu(ctx, save, hasLocal) {
41596
41633
  const voiceResult = await tuiSelect({
41597
41634
  items: voiceItems,
41598
41635
  activeKey: currentModel,
41599
- title: "Select TTS Voice",
41636
+ title: "Voice \u203A Engine",
41600
41637
  rl: ctx.rl,
41601
41638
  availableRows: ctx.availableContentRows?.(),
41602
41639
  skipKeys: ["header-onnx", "header-mlx", "header-clone"]
@@ -42448,9 +42485,13 @@ async function handleUpdate(subcommand, ctx) {
42448
42485
  if (needsSudo) {
42449
42486
  process.stdout.write("\x1B[?1049l");
42450
42487
  renderInfo("Global npm directory requires elevated permissions.");
42488
+ renderInfo("Enter your password if prompted...");
42451
42489
  safeWrite("\n");
42452
42490
  try {
42453
- es2("sudo -v", { stdio: "inherit", timeout: 6e4 });
42491
+ const { spawnSync } = await import("node:child_process");
42492
+ const sudoResult = spawnSync("sudo", ["-v"], { stdio: "inherit", timeout: 6e4 });
42493
+ if (sudoResult.status !== 0)
42494
+ throw new Error("sudo failed");
42454
42495
  } catch {
42455
42496
  renderWarning("Could not acquire sudo credentials. Try: sudo npm i -g open-agents-ai");
42456
42497
  return;
@@ -42470,17 +42511,22 @@ async function handleUpdate(subcommand, ctx) {
42470
42511
  const installCmd = `${sudoPrefix}npm install -g open-agents-ai@latest --prefer-online`;
42471
42512
  let installOk = await runInstall2(installCmd);
42472
42513
  if (!installOk && /ENOTEMPTY|errno -39/i.test(installError)) {
42473
- installSpinner.stop("Cleaning stale npm temp files...");
42514
+ installSpinner.stop("ENOTEMPTY \u2014 cleaning stale npm artifacts...");
42515
+ process.stdout.write(` ${c2.dim("\u2502")} Removing stale temp directories and npm cache...
42516
+ `);
42474
42517
  try {
42475
42518
  const prefix = await execA("npm prefix -g", { timeout: 5e3 });
42476
42519
  const globalModules = prefix.endsWith("/lib") ? prefix + "/node_modules" : prefix + "/lib/node_modules";
42477
- await execA(`${sudoPrefix}find "${globalModules}" -maxdepth 1 -name ".open-agents-ai-*" -type d -exec rm -rf {} + 2>/dev/null || true`, { timeout: 15e3 });
42520
+ await execA(`${sudoPrefix}find "${globalModules}" -maxdepth 1 -name ".open-agents*" -type d -exec rm -rf {} + 2>/dev/null || true`, { timeout: 15e3 });
42478
42521
  await execA(`${sudoPrefix}rm -rf "${globalModules}/open-agents-ai" 2>/dev/null || true`, { timeout: 15e3 });
42522
+ await execA(`${sudoPrefix}npm cache clean --force 2>/dev/null || true`, { timeout: 3e4 });
42479
42523
  } catch {
42480
42524
  }
42481
- const retrySpinner = startInlineSpinner("Retrying install");
42525
+ process.stdout.write(` ${c2.dim("\u2502")} Retrying with --force...
42526
+ `);
42527
+ const retrySpinner = startInlineSpinner("Retrying install (force)");
42482
42528
  installError = "";
42483
- installOk = await runInstall2(installCmd);
42529
+ installOk = await runInstall2(`${sudoPrefix}npm install -g open-agents-ai@latest --force --prefer-online`);
42484
42530
  if (!installOk) {
42485
42531
  retrySpinner.stop("Retry failed.");
42486
42532
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.124.0",
3
+ "version": "0.126.0",
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",