job51-gitlab-cr-node-skill-prompt-optimize 1.4.9 → 1.5.0

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 +7 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -367,13 +367,16 @@ ${diffObject.diff}`;
367
367
  if (!reviewResult) return null;
368
368
 
369
369
  // 解析<LINE_INFO>[{"new_path":"xxx","new_line":87,"old_path":"yyy","old_line":85}]</LINE_INFO>格式
370
- const lineInfoRegex = /<LINE_INFO>([\s\S]*?)<\/LINE_INFO>/;
370
+ const lineInfoRegex = /<LINE_INFO>\s*([\s\S]*?)\s*<\/LINE_INFO>/;
371
371
  const match = reviewResult.match(lineInfoRegex);
372
372
 
373
373
  if (match) {
374
374
  try {
375
- // 去除换行和空白字符,支持多行格式
376
- const lineInfoJson = match[1].replace(/\s/g, '');
375
+ // 提取 JSON 内容并去除首尾空白字符
376
+ const lineInfoJson = match[1].trim();
377
+
378
+ debugLog(`解析 LINE_INFO 原始内容:${match[1]}`);
379
+ debugLog(`解析 LINE_INFO 处理后内容:${lineInfoJson}`);
377
380
 
378
381
  // 如果是空数组,返回 null 使用后备方案
379
382
  if (lineInfoJson === '[]') {
@@ -382,6 +385,7 @@ ${diffObject.diff}`;
382
385
  }
383
386
 
384
387
  const lineInfoArray = JSON.parse(lineInfoJson);
388
+ debugLog(`解析 LINE_INFO JSON 成功:${JSON.stringify(lineInfoArray)}`);
385
389
 
386
390
  if (Array.isArray(lineInfoArray) && lineInfoArray.length > 0) {
387
391
  debugLog(`从 LINE_INFO 中解析出行号信息:${JSON.stringify(lineInfoArray)}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "job51-gitlab-cr-node-skill-prompt-optimize",
3
- "version": "1.4.9",
3
+ "version": "1.5.0",
4
4
  "description": "GitLab merge request code review tool with AI-powered analysis and project context support",
5
5
  "main": "index.js",
6
6
  "bin": {