hong-review-cli 1.0.11 → 1.0.12

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/commands/mr.js +17 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hong-review-cli",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "main": "index.js",
5
5
  "bin": {
6
6
  "hong-review": "bin/hong-review.js"
@@ -77,6 +77,9 @@ module.exports = async function (mrId, options) {
77
77
  projectId,
78
78
  mrId: mrIid,
79
79
  status: '已向 AI 递交初始的文件变更大纲',
80
+ speaker: '系统',
81
+ actionTitle: '文件大纲',
82
+ content: initialMessage,
80
83
  contextFiles: fileOverviews.map(f => f.path)
81
84
  });
82
85
 
@@ -98,6 +101,13 @@ module.exports = async function (mrId, options) {
98
101
 
99
102
  if (action.action === 'generate_report') {
100
103
  await hooks.emit('onReviewProgress', { projectId, mrId: mrIid, status: 'AI 审查完成,正在生成最终报告' });
104
+ await hooks.emit('onReviewAgentAction', {
105
+ projectId, mrId: mrIid,
106
+ status: 'AI 审查完成',
107
+ speaker: 'AI',
108
+ actionTitle: '生成报告',
109
+ content: '审查报告已生成'
110
+ });
101
111
  reviewResult = action.result;
102
112
  break;
103
113
  } else if (action.action === 'request_files') {
@@ -109,6 +119,8 @@ module.exports = async function (mrId, options) {
109
119
  projectId,
110
120
  mrId: mrIid,
111
121
  status: 'AI 要求查阅代码细节',
122
+ speaker: 'AI',
123
+ actionTitle: '请求更多上下文',
112
124
  reasoning: action.reasoning,
113
125
  requestedFiles: action.files
114
126
  });
@@ -122,6 +134,9 @@ module.exports = async function (mrId, options) {
122
134
  projectId,
123
135
  mrId: mrIid,
124
136
  status: `已向 AI 补充 ${action.files.length} 个文件内容`,
137
+ speaker: '系统',
138
+ actionTitle: '执行回调',
139
+ content: `已提供 ${action.files.length} 个文件的变更内容:\n\n${action.files.map(f => '📄 ' + f).join('\n')}`,
125
140
  providedFiles: action.files
126
141
  });
127
142
 
@@ -145,9 +160,9 @@ module.exports = async function (mrId, options) {
145
160
  // 判断后续状态
146
161
  const isSuccess = reviewResult.riskLevel !== 'high';
147
162
  if (isSuccess) {
148
- await hooks.emit('onReviewSuccess', { projectId, mrId: mrIid, result: reviewResult });
163
+ await hooks.emit('onReviewSuccess', { projectId, mrId: mrIid, speaker: '系统', actionTitle: '整体总结', result: reviewResult });
149
164
  } else {
150
- await hooks.emit('onReviewFailed', { projectId, mrId: mrIid, result: reviewResult });
165
+ await hooks.emit('onReviewFailed', { projectId, mrId: mrIid, speaker: '系统', actionTitle: '发现严重问题', result: reviewResult });
151
166
  }
152
167
 
153
168
  // 处理自动评论参数 -c