@livx.cc/agentx 0.96.12 → 0.96.14

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
@@ -1909,6 +1909,7 @@ var init_tools_shell = __esm({
1909
1909
  import { createInterface } from "readline/promises";
1910
1910
  import { existsSync as existsSync9, readFileSync as readFileSync8, appendFileSync, mkdirSync as mkdirSync11, writeFileSync as writeFileSync9, readdirSync as readdirSync4, statSync as statSync4, unlinkSync as unlinkSync5 } from "fs";
1911
1911
  import { homedir as homedir9, tmpdir as tmpdir3 } from "os";
1912
+ import { spawnSync as spawnSync6 } from "child_process";
1912
1913
 
1913
1914
  // cli/clipboard.ts
1914
1915
  import { execFileSync } from "child_process";
@@ -7213,7 +7214,12 @@ var AecDuplexAudio = class {
7213
7214
  });
7214
7215
  this.proc.stdout.on("data", (chunk) => onChunk(chunk));
7215
7216
  this.proc.stderr.on("data", (d) => {
7216
- for (const ln of String(d).split("\n")) if (ln.trim()) log16.debug(`mic-aec: ${ln.trim()}`);
7217
+ for (const ln of String(d).split("\n")) {
7218
+ const s = ln.trim();
7219
+ if (!s) continue;
7220
+ if (/mic access granted:\s*false/i.test(s)) log16.warn("mic-aec: microphone permission DENIED \u2014 grant it in System Settings \u2192 Privacy & Security \u2192 Microphone for your terminal, then restart it");
7221
+ else log16.debug(`mic-aec: ${s}`);
7222
+ }
7217
7223
  });
7218
7224
  }
7219
7225
  stop() {
@@ -10093,6 +10099,10 @@ async function checkForUpdate(current) {
10093
10099
  if (cM > lM || cM === lM && cm > lm || cM === lM && cm === lm && cp >= lp) return null;
10094
10100
  return `Update available: ${current} \u2192 ${latest}. Run \`bun add -g @livx.cc/agentx\` to update.`;
10095
10101
  }
10102
+ function installUpdate() {
10103
+ const r = spawnSync6("bun", ["add", "-g", "@livx.cc/agentx"], { stdio: "inherit" });
10104
+ return (r.status ?? 1) === 0;
10105
+ }
10096
10106
  var spinner = /* @__PURE__ */ (() => {
10097
10107
  const frames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
10098
10108
  let timer;
@@ -11990,8 +12000,8 @@ ${task}`;
11990
12000
  const wasRaw = process.stdin.isTTY && process.stdin.isRaw;
11991
12001
  if (wasRaw) process.stdin.setRawMode(false);
11992
12002
  try {
11993
- const { spawnSync: spawnSync6 } = await import("child_process");
11994
- const r = spawnSync6("less", ["-R"], { input: text, stdio: ["pipe", "inherit", "inherit"] });
12003
+ const { spawnSync: spawnSync7 } = await import("child_process");
12004
+ const r = spawnSync7("less", ["-R"], { input: text, stdio: ["pipe", "inherit", "inherit"] });
11995
12005
  if (r.error) err(text);
11996
12006
  } finally {
11997
12007
  if (wasRaw) process.stdin.setRawMode(true);
@@ -12387,8 +12397,8 @@ ${task}`;
12387
12397
  const wasRaw = process.stdin.isTTY && process.stdin.isRaw;
12388
12398
  if (wasRaw) process.stdin.setRawMode(false);
12389
12399
  try {
12390
- const { spawnSync: spawnSync6 } = await import("child_process");
12391
- spawnSync6(ed, [idx], { stdio: "inherit" });
12400
+ const { spawnSync: spawnSync7 } = await import("child_process");
12401
+ spawnSync7(ed, [idx], { stdio: "inherit" });
12392
12402
  } finally {
12393
12403
  if (wasRaw) process.stdin.setRawMode(true);
12394
12404
  }
@@ -12817,11 +12827,14 @@ ${task}`;
12817
12827
  run: async () => {
12818
12828
  err(dim(" checking\u2026\n"));
12819
12829
  const msg = await checkForUpdate(VERSION).catch(() => null);
12820
- if (msg) {
12821
- err(yellow(` ${msg}
12830
+ if (!msg) {
12831
+ err(green(" \u2713 up to date\n"));
12832
+ return;
12833
+ }
12834
+ err(yellow(` ${msg.replace(/Run .+$/, "Installing\u2026")}
12822
12835
  `));
12823
- err(dim(" run the command above to update, then restart.\n"));
12824
- } else err(green(" \u2713 up to date\n"));
12836
+ if (installUpdate()) err(green(" \u2713 updated \u2014 restart agentx to use the new version\n"));
12837
+ else err(red(" \u2717 update failed \u2014 run `bun add -g @livx.cc/agentx` manually\n"));
12825
12838
  }
12826
12839
  },
12827
12840
  exit: { desc: "quit", run: () => true },
@@ -13325,9 +13338,7 @@ async function main() {
13325
13338
  return;
13326
13339
  }
13327
13340
  console.log(msg.replace(/Run .+$/, "Installing\u2026"));
13328
- const { spawnSync: spawnSync6 } = await import("child_process");
13329
- const r = spawnSync6("bun", ["add", "-g", "@livx.cc/agentx"], { stdio: "inherit" });
13330
- process.exit(r.status ?? 1);
13341
+ process.exit(installUpdate() ? 0 : 1);
13331
13342
  }
13332
13343
  if (args.debug) process.env.DEBUG ||= "*";
13333
13344
  if (args.print && !args.task && !process.stdin.isTTY) args.task = (await readAllStdin()).trim();