@ww_nero/mini-cli 1.0.92 → 1.0.93

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/package.json +1 -1
  2. package/src/chat.js +9 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ww_nero/mini-cli",
3
- "version": "1.0.92",
3
+ "version": "1.0.93",
4
4
  "description": "极简的 AI 命令行助手",
5
5
  "bin": {
6
6
  "mini": "bin/mini.js"
package/src/chat.js CHANGED
@@ -1005,6 +1005,15 @@ const startChatSession = async ({
1005
1005
  if (editOutput) {
1006
1006
  console.log(editOutput);
1007
1007
  }
1008
+ } else if (functionName === 'read') {
1009
+ // read 工具特殊处理:成功时显示行数,失败时显示错误信息
1010
+ const normalized = rawToolContent.replace(/\r\n/g, '\n').replace(/\r/g, '\n').trim();
1011
+ const lineCount = countLines(normalized);
1012
+ if (normalized && !normalized.startsWith('读取失败') && !normalized.startsWith('无效路径') && !normalized.startsWith('filePath 参数不能为空')) {
1013
+ console.log(chalk.gray(`已读取,共${lineCount}行`));
1014
+ } else {
1015
+ console.log(chalk.gray(indentToolResult(rawToolContent)));
1016
+ }
1008
1017
  } else {
1009
1018
  const displayResult = formatToolResultForDisplay(rawToolContent, 100);
1010
1019
  if (displayResult) {