@livx.cc/agentx 0.96.5 → 0.96.7

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
@@ -3545,7 +3545,8 @@ var Agent = class _Agent {
3545
3545
  bodyStr = void 0;
3546
3546
  }
3547
3547
  if (bodyStr && err2 instanceof Error && !err2.message.includes(bodyStr)) err2.detail = bodyStr;
3548
- log4.error(`chat() failed: ${err2?.message ?? err2}${bodyStr ? ` \u2014 ${bodyStr}` : ""}`, err2);
3548
+ const errLog = err2 instanceof Error ? { message: err2.message, ...err2.detail ? { detail: err2.detail } : {}, stack: err2.stack } : err2;
3549
+ log4.error(`chat() failed: ${err2?.message ?? err2}${bodyStr ? ` \u2014 ${bodyStr}` : ""}`, errLog);
3549
3550
  return { text: "", steps, finishReason: "error", messages: this.transcript, usage, usageEstimated, error: err2 };
3550
3551
  }
3551
3552
  if (o.signal?.aborted) return kill("aborted");
@@ -7088,7 +7089,7 @@ var Player = class {
7088
7089
  var nativeDir = () => join6(dirname3(fileURLToPath(import.meta.url)), "native");
7089
7090
  function detectFfmpegMic() {
7090
7091
  if (process.env.MIC_DEVICE) return process.env.MIC_DEVICE;
7091
- const out = spawnSync2("ffmpeg", ["-f", "avfoundation", "-list_devices", "true", "-i", ""], { encoding: "utf8" }).stderr;
7092
+ const out = spawnSync2("ffmpeg", ["-f", "avfoundation", "-list_devices", "true", "-i", ""], { encoding: "utf8" }).stderr ?? "";
7092
7093
  const audio = out.slice(out.indexOf("audio devices"));
7093
7094
  const devices = [...audio.matchAll(/\[(\d+)\] (.+)/g)].map(([, idx, name]) => ({ idx, name: name.trim() }));
7094
7095
  const mic = devices.find((d) => /microphone|built-in/i.test(d.name) && !/teams|blackhole|loopback/i.test(d.name)) ?? devices[0];
@@ -10239,7 +10240,7 @@ Flags:
10239
10240
  --plan plan mode: edits blocked until you approve a plan
10240
10241
  --ask confirm each mutating tool (bash/Shell/Write/Edit/\u2026)
10241
10242
  --yes, -y auto-approve mutating tools (no prompts) \u2014 for trusted/unattended runs
10242
- --update check for updates and exit (no keys needed)
10243
+ --update check for updates and install if available (no keys needed)
10243
10244
  --no-update-check skip the automatic update check on startup
10244
10245
  --verbose, --debug verbose logs (sets DEBUG=* \u2014 tool args, hook decisions, retries)
10245
10246
  --allowedTools <l> comma-list of tools to allow w/o asking, e.g. "Edit,Shell(git *)"
@@ -13289,9 +13290,14 @@ async function main() {
13289
13290
  }
13290
13291
  if (args.update) {
13291
13292
  const msg = await checkForUpdate(VERSION).catch(() => null);
13292
- if (msg) console.log(msg);
13293
- else console.log("\u2713 up to date (v" + VERSION + ")");
13294
- return;
13293
+ if (!msg) {
13294
+ console.log("\u2713 up to date (v" + VERSION + ")");
13295
+ return;
13296
+ }
13297
+ console.log(msg.replace(/Run .+$/, "Installing\u2026"));
13298
+ const { spawnSync: spawnSync6 } = await import("child_process");
13299
+ const r = spawnSync6("bun", ["add", "-g", "@livx.cc/agentx"], { stdio: "inherit" });
13300
+ process.exit(r.status ?? 1);
13295
13301
  }
13296
13302
  if (args.debug) process.env.DEBUG ||= "*";
13297
13303
  if (args.print && !args.task && !process.stdin.isTTY) args.task = (await readAllStdin()).trim();