@ww_nero/mini-cli 1.0.70 → 1.0.72

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ww_nero/mini-cli",
3
- "version": "1.0.70",
3
+ "version": "1.0.72",
4
4
  "description": "极简的 AI 命令行助手",
5
5
  "bin": {
6
6
  "mini": "bin/mini.js"
package/src/chat.js CHANGED
@@ -87,10 +87,10 @@ const formatWriteOutput = (result) => {
87
87
  }
88
88
  const content = result.content || '';
89
89
  const lines = content.split('\n');
90
- if (lines.length <= 100) {
90
+ if (lines.length <= 20) {
91
91
  return content;
92
92
  }
93
- return lines.slice(0, 100).join('\n') + '\n...(更多内容)';
93
+ return lines.slice(0, 20).join('\n') + '\n...(更多内容)';
94
94
  };
95
95
 
96
96
  const formatReplaceOutput = (result) => {
@@ -22,7 +22,7 @@ const countLines = (text = '') => {
22
22
  const formatWriteHeader = (args = {}) => {
23
23
  const filePath = args.filePath || '';
24
24
  const lineCount = countLines(args.content);
25
- return ` (${filePath}, +${lineCount})`;
25
+ return ` (${filePath}, ${chalk.green(`+${lineCount}`)})`;
26
26
  };
27
27
 
28
28
  const formatReplaceHeader = (args = {}) => {
@@ -194,10 +194,13 @@ const splitThinkContent = (text = '') => {
194
194
  return { content, reasoning };
195
195
  };
196
196
 
197
- const summarizeReasoning = (text = '') => {
197
+ const summarizeReasoning = (text = '', maxLength = 100) => {
198
198
  if (!text) return '';
199
199
  const normalized = text.replace(/\s+/g, ' ').trim();
200
200
  if (!normalized) return '';
201
+ if (normalized.length > maxLength) {
202
+ return normalized.substring(0, maxLength) + '...';
203
+ }
201
204
  return normalized;
202
205
  };
203
206