@livx.cc/agentx 0.96.7 → 0.96.9

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/cli.js CHANGED
@@ -7089,7 +7089,9 @@ var Player = class {
7089
7089
  var nativeDir = () => join6(dirname3(fileURLToPath(import.meta.url)), "native");
7090
7090
  function detectFfmpegMic() {
7091
7091
  if (process.env.MIC_DEVICE) return process.env.MIC_DEVICE;
7092
- const out = spawnSync2("ffmpeg", ["-f", "avfoundation", "-list_devices", "true", "-i", ""], { encoding: "utf8" }).stderr ?? "";
7092
+ const r = spawnSync2("ffmpeg", ["-f", "avfoundation", "-list_devices", "true", "-i", ""], { encoding: "utf8" });
7093
+ if (r.error?.code === "ENOENT") throw new Error("ffmpeg not installed \u2014 run `brew install ffmpeg` to enable voice");
7094
+ const out = r.stderr ?? "";
7093
7095
  const audio = out.slice(out.indexOf("audio devices"));
7094
7096
  const devices = [...audio.matchAll(/\[(\d+)\] (.+)/g)].map(([, idx, name]) => ({ idx, name: name.trim() }));
7095
7097
  const mic = devices.find((d) => /microphone|built-in/i.test(d.name) && !/teams|blackhole|loopback/i.test(d.name)) ?? devices[0];
@@ -13057,6 +13059,10 @@ ${out}
13057
13059
  } catch (e) {
13058
13060
  err(yellow(` \u26A0 voice I/O failed to start: ${e?.message ?? e} \u2014 continuing text-only
13059
13061
  `));
13062
+ try {
13063
+ voiceIO.stop();
13064
+ } catch {
13065
+ }
13060
13066
  voiceIO = void 0;
13061
13067
  return false;
13062
13068
  }