@krotovm/gitlab-ai-review 1.0.41 → 1.0.43

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.
@@ -2,15 +2,13 @@
2
2
  import { truncateWithMarker } from "../utils.js";
3
3
  export function buildMainReviewUserContent(params) {
4
4
  const { stats, toolNote, changesText } = params;
5
- return [
6
- `Review the following code changes (git diff format). ${stats}`,
7
- toolNote,
8
- "",
9
- "Changes:",
10
- changesText || "(no changes provided)",
11
- "",
12
- "Produce your review now. Follow the system instructions strictly.",
13
- ].join("\n");
5
+ return `Review the following code changes (git diff format). ${stats}
6
+ ${toolNote}
7
+
8
+ Changes:
9
+ ${changesText || "(no changes provided)"}
10
+
11
+ Produce your review now. Follow the system instructions strictly.`;
14
12
  }
15
13
  export function buildTriageUserContent(changes, maxDiffChars) {
16
14
  const fileEntries = changes.map((c) => {
@@ -32,43 +30,37 @@ export function buildFileReviewUserContent(params) {
32
30
  const otherFilesNote = otherChangedFiles.length > 0
33
31
  ? `\nOther files changed in this MR: ${otherChangedFiles.join(", ")}`
34
32
  : "";
35
- return [
36
- `MR Summary: ${summary}`,
37
- otherFilesNote,
38
- "",
39
- toolNote,
40
- "",
41
- `File: ${filePath}`,
42
- "Diff:",
43
- fileDiff,
44
- "",
45
- "Review this file now.",
46
- ].join("\n");
33
+ return `MR Summary: ${summary}
34
+ ${otherFilesNote}
35
+
36
+ ${toolNote}
37
+
38
+ File: ${filePath}
39
+ Diff:
40
+ ${fileDiff}
41
+
42
+ Review this file now.`;
47
43
  }
48
44
  export function buildConsolidateUserContent(params) {
49
45
  const { summary, findingsText, maxFindings } = params;
50
- return [
51
- `MR Summary: ${summary}`,
52
- "",
53
- "Per-file findings:",
54
- findingsText,
55
- "",
56
- `Return the top ${maxFindings} findings in the required bullet format.`,
57
- ].join("\n");
46
+ return `MR Summary: ${summary}
47
+
48
+ Per-file findings:
49
+ ${findingsText}
50
+
51
+ Return the top ${maxFindings} findings in the required bullet format.`;
58
52
  }
59
53
  export function buildVerificationUserContent(params) {
60
54
  const { summary, findingsText, consolidatedFindings, refs } = params;
61
- return [
62
- `MR Summary: ${summary}`,
63
- "",
64
- `Refs for tools: head (post-change)="${refs.head}", base="${refs.base}". Prefer head when checking whether the issue exists in the MR.`,
65
- "",
66
- "Per-file findings (evidence pool):",
67
- findingsText,
68
- "",
69
- "Draft consolidated findings to verify:",
70
- consolidatedFindings,
71
- "",
72
- "Return only the verified final findings.",
73
- ].join("\n");
55
+ return `MR Summary: ${summary}
56
+
57
+ Refs for tools: head (post-change)="${refs.head}", base="${refs.base}". Prefer head when checking whether the issue exists in the MR.
58
+
59
+ Per-file findings (evidence pool):
60
+ ${findingsText}
61
+
62
+ Draft consolidated findings to verify:
63
+ ${consolidatedFindings}
64
+
65
+ Return only the verified final findings.`;
74
66
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@krotovm/gitlab-ai-review",
4
- "version": "1.0.41",
4
+ "version": "1.0.43",
5
5
  "description": "CLI tool to generate AI code reviews for GitLab merge requests.",
6
6
  "main": "dist/cli.js",
7
7
  "bin": {
@@ -16,8 +16,7 @@
16
16
  "LICENSE"
17
17
  ],
18
18
  "scripts": {
19
- "build:ts": "tsc",
20
- "prepublishOnly": "pnpm build:ts"
19
+ "prepare": "tsc"
21
20
  },
22
21
  "keywords": [
23
22
  "gitlab",