shenxiang-ai-cli 0.5.6 → 0.5.8

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 +11 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1864,7 +1864,7 @@ var Agent = class {
1864
1864
  spinner.text = "AI \u6B63\u5728\u601D\u8003...";
1865
1865
  spinner.start();
1866
1866
  }
1867
- }, 800);
1867
+ }, 500);
1868
1868
  };
1869
1869
  const clearIdleTimer = () => {
1870
1870
  if (idleTimer) {
@@ -1887,7 +1887,7 @@ var Agent = class {
1887
1887
  process.stdout.write("\n");
1888
1888
  }
1889
1889
  if (chunk.type === "tool_call" && !hasTextOutput) {
1890
- spinner.text = "\u6B63\u5728\u51C6\u5907\u64CD\u4F5C...";
1890
+ spinner.text = "\u6B63\u5728\u89C4\u5212\u64CD\u4F5C...";
1891
1891
  spinner.start();
1892
1892
  toolSpinnerStarted = true;
1893
1893
  }
@@ -1981,6 +1981,7 @@ var Agent = class {
1981
1981
  if (responseText) {
1982
1982
  process.stdout.write("\n");
1983
1983
  }
1984
+ if (spinner.isSpinning) spinner.stop();
1984
1985
  if (hasError) return "";
1985
1986
  if (toolCalls.length === 0) {
1986
1987
  const msg = { role: "assistant", content: responseText };
@@ -2217,7 +2218,7 @@ function showBanner() {
2217
2218
  console.clear();
2218
2219
  const p = chalk3.hex("#A78BFA");
2219
2220
  const w = chalk3.white;
2220
- const version = "v0.5.6";
2221
+ const version = "v0.5.8";
2221
2222
  const avatarLines = [
2222
2223
  ` ${p("\u2584\u2580\u2580\u2580\u2584")}`,
2223
2224
  ` ${p("\u2588")} ${w("\u2580")} ${w("\u2580")} ${p("\u2588")}`,
@@ -2268,11 +2269,16 @@ function showBanner() {
2268
2269
  ...wrappedQuote.map((l) => theme.dim(l)),
2269
2270
  ""
2270
2271
  ];
2272
+ const getVisualWidth = (str) => {
2273
+ return stripAnsi(str).split("").reduce((width, char) => {
2274
+ return width + (char.codePointAt(0) > 255 ? 2 : 1);
2275
+ }, 0);
2276
+ };
2271
2277
  const maxLines = Math.max(leftContent.length, rightContent.length);
2272
2278
  const lines = [];
2273
2279
  for (let i = 0; i < maxLines; i++) {
2274
2280
  const left = leftContent[i] || "";
2275
- const leftVisible = stripAnsi(left).length;
2281
+ const leftVisible = getVisualWidth(left);
2276
2282
  const leftPadding = " ".repeat(Math.max(0, leftColWidth - leftVisible));
2277
2283
  const right = rightContent[i] || "";
2278
2284
  lines.push(`${left}${leftPadding} ${theme.dim("\u2502")} ${right}`);
@@ -3387,7 +3393,7 @@ function fmtTokens3(n) {
3387
3393
  var program = new Command();
3388
3394
  var config2 = getConfig();
3389
3395
  setLocale(config2.locale);
3390
- program.name("sxai").description(t("description")).version("0.5.6");
3396
+ program.name("sxai").description(t("description")).version("0.5.8");
3391
3397
  program.command("chat", { isDefault: true }).description("\u542F\u52A8\u4EA4\u4E92\u5F0FAI\u5BF9\u8BDD\uFF08\u9ED8\u8BA4\u547D\u4EE4\uFF09").option("-m, --model <model>", "\u6307\u5B9AAI\u6A21\u578B", config2.model).option("-y, --yolo", "\u81EA\u52A8\u6A21\u5F0F\uFF1A\u8DF3\u8FC7\u6240\u6709\u786E\u8BA4\uFF0C\u8BA9AI\u81EA\u4E3B\u6267\u884C").action(async (options) => {
3392
3398
  if (options.model && options.model !== config2.model) {
3393
3399
  setConfig("model", options.model);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shenxiang-ai-cli",
3
- "version": "0.5.6",
3
+ "version": "0.5.8",
4
4
  "description": "沈翔的AI助手 - 终端里的AI全栈开发搭档",
5
5
  "type": "module",
6
6
  "bin": {