job51-gitlab-cr-node-jt-1 1.4.2 → 1.4.3

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/index.js +2 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -55,7 +55,7 @@ class GitLabCodeReviewer {
55
55
  async reviewDiffWithClaude(diff) {
56
56
  debugLog(`开始审核文件: ${diff.new_path || diff.old_path}, diff长度: ${diff.diff.length}`);
57
57
 
58
- const prompt = '@simple-code-review' + ' ' + `${diff.diff}`;
58
+ const prompt = '/simple-code-review' + ' ' + `${diff.diff}`;
59
59
 
60
60
  // 最多重试3次,直到结果包含"🤖 AI代码审查结果"或达到最大重试次数
61
61
  let attempts = 0;
@@ -527,7 +527,7 @@ function runClaudeCommand(promptContent) {
527
527
 
528
528
  debugLog("AI review命令开始时间")
529
529
  // 使用spawn替代exec,更安全地处理命令执行并实现环境隔离
530
- const claudeProcess = spawn('claude', ['-p', promptContent, '--tools', 'default'], {
530
+ const claudeProcess = spawn('claude', ['-p', '--', promptContent, '--tools', 'default'], {
531
531
  shell: true, // ✅ 启用 shell,支持别名和完整 PATH
532
532
  cwd: __dirname, // ✅ 设置工作目录为当前脚本所在目录
533
533
  env: process.env,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "job51-gitlab-cr-node-jt-1",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "GitLab merge request code review tool with AI-powered analysis",
5
5
  "main": "index.js",
6
6
  "bin": {