@zhongqian97-code/ecode 0.5.57 → 0.5.58

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/index.js CHANGED
@@ -923,7 +923,7 @@ Node.js 16/18 \u8BF7\u4F7F\u7528 --web \u6216 --pipe \u6A21\u5F0F\u3002
923
923
  );
924
924
  process.exit(1);
925
925
  }
926
- const { App, React, render, createStdinFilter } = await import("./ui-RG76L7OR.js");
926
+ const { App, React, render, createStdinFilter } = await import("./ui-STSJVDXD.js");
927
927
  const stdinFilter = process.stdin.isTTY ? createStdinFilter(process.stdin) : process.stdin;
928
928
  render(
929
929
  React.createElement(App, { config: finalConfig, version: VERSION, autoMode, registry, trustedSkillDirs, initialMessages, stdinFilter }),
@@ -200,6 +200,7 @@ function StatusBar({
200
200
  import { Box as Box2, Text as Text2 } from "ink";
201
201
 
202
202
  // src/ui/messageLines.ts
203
+ import stringWidth from "string-width";
203
204
  var TOOL_RESULT_MAX_LINES = 3;
204
205
  function wrapText(text, terminalWidth) {
205
206
  const logicalLines = text.split("\n");
@@ -210,9 +211,20 @@ function wrapText(text, terminalWidth) {
210
211
  result.push("");
211
212
  continue;
212
213
  }
213
- for (let i = 0; i < line.length; i += terminalWidth) {
214
- result.push(line.slice(i, i + terminalWidth));
214
+ let chunk = "";
215
+ let chunkW = 0;
216
+ for (const ch of line) {
217
+ const w = stringWidth(ch);
218
+ if (chunkW + w > terminalWidth && chunk.length > 0) {
219
+ result.push(chunk);
220
+ chunk = ch;
221
+ chunkW = w;
222
+ } else {
223
+ chunk += ch;
224
+ chunkW += w;
225
+ }
215
226
  }
227
+ if (chunk.length > 0) result.push(chunk);
216
228
  }
217
229
  return result;
218
230
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhongqian97-code/ecode",
3
- "version": "0.5.57",
3
+ "version": "0.5.58",
4
4
  "description": "A minimal Claude Code clone with REPL interface and bash tool calling",
5
5
  "type": "module",
6
6
  "author": "zhongqian97-code",
@@ -49,7 +49,8 @@
49
49
  "fastify": "^5.8.5",
50
50
  "ink": "^7.0.2",
51
51
  "openai": "^4.0.0",
52
- "react": "^19.2.5"
52
+ "react": "^19.2.5",
53
+ "string-width": "^8.2.1"
53
54
  },
54
55
  "devDependencies": {
55
56
  "@playwright/test": "^1.60.0",