sales-frontend-gemini-cli 0.4.4 → 0.5.1
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.
- package/dist/common/helper.cjs +108 -19
- package/dist/common/helper.js +108 -19
- package/dist/common/types.cjs +0 -2
- package/dist/common/types.d.cts +3 -1
- package/dist/common/types.d.ts +3 -1
- package/dist/common/types.js +0 -2
- package/dist/etc/installation-gcloud.cjs +0 -2
- package/dist/etc/installation-gcloud.js +0 -2
- package/dist/etc/interactive-version/index.cjs +0 -2
- package/dist/etc/interactive-version/index.js +0 -2
- package/dist/etc/login.cjs +0 -2
- package/dist/etc/login.js +0 -2
- package/dist/etc/vertex-version/index.cjs +0 -2
- package/dist/etc/vertex-version/index.js +0 -2
- package/dist/pr-review/claude/claude-commander.cjs +0 -2
- package/dist/pr-review/claude/claude-commander.js +0 -2
- package/dist/pr-review/claude/installation-claude.cjs +0 -2
- package/dist/pr-review/claude/installation-claude.js +0 -2
- package/dist/pr-review/codex/codex-commander.cjs +0 -2
- package/dist/pr-review/codex/codex-commander.js +0 -2
- package/dist/pr-review/codex/installation-codex.cjs +0 -2
- package/dist/pr-review/codex/installation-codex.js +0 -2
- package/dist/pr-review/gemini/gemini-commander.cjs +0 -2
- package/dist/pr-review/gemini/gemini-commander.js +0 -2
- package/dist/pr-review/gemini/installation-gemini.cjs +0 -2
- package/dist/pr-review/gemini/installation-gemini.js +0 -2
- package/dist/pr-review/review-one-by-one.cjs +75 -22
- package/dist/pr-review/review-one-by-one.js +75 -22
- package/dist/pr-review/review.cjs +109 -20
- package/dist/pr-review/review.js +109 -20
- package/package.json +1 -1
- package/dist/common/helper.cjs.map +0 -1
- package/dist/common/helper.js.map +0 -1
- package/dist/common/types.cjs.map +0 -1
- package/dist/common/types.js.map +0 -1
- package/dist/etc/installation-gcloud.cjs.map +0 -1
- package/dist/etc/installation-gcloud.js.map +0 -1
- package/dist/etc/interactive-version/index.cjs.map +0 -1
- package/dist/etc/interactive-version/index.js.map +0 -1
- package/dist/etc/login.cjs.map +0 -1
- package/dist/etc/login.js.map +0 -1
- package/dist/etc/vertex-version/index.cjs.map +0 -1
- package/dist/etc/vertex-version/index.js.map +0 -1
- package/dist/pr-review/claude/claude-commander.cjs.map +0 -1
- package/dist/pr-review/claude/claude-commander.js.map +0 -1
- package/dist/pr-review/claude/installation-claude.cjs.map +0 -1
- package/dist/pr-review/claude/installation-claude.js.map +0 -1
- package/dist/pr-review/codex/codex-commander.cjs.map +0 -1
- package/dist/pr-review/codex/codex-commander.js.map +0 -1
- package/dist/pr-review/codex/installation-codex.cjs.map +0 -1
- package/dist/pr-review/codex/installation-codex.js.map +0 -1
- package/dist/pr-review/gemini/gemini-commander.cjs.map +0 -1
- package/dist/pr-review/gemini/gemini-commander.js.map +0 -1
- package/dist/pr-review/gemini/installation-gemini.cjs.map +0 -1
- package/dist/pr-review/gemini/installation-gemini.js.map +0 -1
- package/dist/pr-review/review-one-by-one.cjs.map +0 -1
- package/dist/pr-review/review-one-by-one.js.map +0 -1
- package/dist/pr-review/review.cjs.map +0 -1
- package/dist/pr-review/review.js.map +0 -1
package/dist/common/helper.cjs
CHANGED
|
@@ -209,15 +209,51 @@ function runGitCommand(args, options = {}) {
|
|
|
209
209
|
throw error;
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
+
function resolveShellLaunchConfig() {
|
|
213
|
+
const candidates = [];
|
|
214
|
+
const seen = /* @__PURE__ */ new Set();
|
|
215
|
+
const appendCandidate = (executable, shellArgs) => {
|
|
216
|
+
const normalizedExecutable = executable?.trim();
|
|
217
|
+
if (!normalizedExecutable) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (path__default.default.isAbsolute(normalizedExecutable) && !fs__default.default.existsSync(normalizedExecutable)) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const key = `${normalizedExecutable}::${shellArgs.join("\0")}`;
|
|
224
|
+
if (seen.has(key)) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
seen.add(key);
|
|
228
|
+
candidates.push({
|
|
229
|
+
executable: normalizedExecutable,
|
|
230
|
+
shellArgs
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
const shellFromEnv = process.env.SHELL?.trim();
|
|
234
|
+
const envShellName = shellFromEnv ? path__default.default.basename(shellFromEnv) : "";
|
|
235
|
+
if (["bash", "zsh", "ksh"].includes(envShellName)) {
|
|
236
|
+
appendCandidate(shellFromEnv, ["-lc"]);
|
|
237
|
+
}
|
|
238
|
+
["/bin/bash", "/usr/bin/bash", "bash", "/bin/zsh", "/usr/bin/zsh", "zsh"].forEach((shellPath) => {
|
|
239
|
+
appendCandidate(shellPath, ["-lc"]);
|
|
240
|
+
});
|
|
241
|
+
["/bin/sh", "/usr/bin/sh", "sh"].forEach((shellPath) => {
|
|
242
|
+
appendCandidate(shellPath, ["-c"]);
|
|
243
|
+
});
|
|
244
|
+
return candidates[0] || { executable: "sh", shellArgs: ["-c"] };
|
|
245
|
+
}
|
|
212
246
|
async function executeShellCommandWithProgress(command, options = {}) {
|
|
213
247
|
const { progressIntervalMs = 1e4, progressMessage = "\u23F3 \uBA85\uB839\uC744 \uC2E4\uD589\uD558\uB294 \uC911\uC785\uB2C8\uB2E4...", streamOutput = false } = options;
|
|
214
248
|
const { spawn } = await import('child_process');
|
|
249
|
+
const shellLaunchConfig = resolveShellLaunchConfig();
|
|
215
250
|
return new Promise((resolve, reject) => {
|
|
216
251
|
let stdout = "";
|
|
217
252
|
let stderr = "";
|
|
218
253
|
const startedAt = Date.now();
|
|
219
254
|
console.log(progressMessage);
|
|
220
|
-
|
|
255
|
+
helperTrace("shell-command:launcher", `${shellLaunchConfig.executable} ${shellLaunchConfig.shellArgs.join(" ")}`);
|
|
256
|
+
const child = spawn(shellLaunchConfig.executable, [...shellLaunchConfig.shellArgs, command], {
|
|
221
257
|
stdio: ["ignore", "pipe", "pipe"]
|
|
222
258
|
});
|
|
223
259
|
const progressTimer = setInterval(() => {
|
|
@@ -603,6 +639,62 @@ function truncateCommitSubject(subject) {
|
|
|
603
639
|
}
|
|
604
640
|
return `${subject.slice(0, 69)}...`;
|
|
605
641
|
}
|
|
642
|
+
function formatReviewTargetFileCount(fileCount) {
|
|
643
|
+
return fileCount === 0 ? "\uBCC0\uACBD \uC5C6\uC74C" : `${fileCount}\uAC1C \uD30C\uC77C`;
|
|
644
|
+
}
|
|
645
|
+
function buildReviewTargetSectionTitle(target) {
|
|
646
|
+
return target.kind === "commit" ? `${target.hash} ${target.subject}` : `${target.hash} | ${target.subject}`;
|
|
647
|
+
}
|
|
648
|
+
function buildReviewTargetSummaryLine(target) {
|
|
649
|
+
if (target.kind === "commit") {
|
|
650
|
+
return `- ${target.hash} | ${target.subject} | ${target.author} | ${target.relativeDate}`;
|
|
651
|
+
}
|
|
652
|
+
return `- ${target.hash} | ${target.subject}`;
|
|
653
|
+
}
|
|
654
|
+
function buildReviewTargetDiffArgs(target, filePath) {
|
|
655
|
+
const reviewPathspecArgs = getReviewPathspecArgs();
|
|
656
|
+
if (target.kind === "commit") {
|
|
657
|
+
return filePath ? ["show", "--stat", "--patch", "--format=", target.hash, "--", filePath] : ["show", "--stat", "--patch", "--format=", target.hash, "--", ...reviewPathspecArgs];
|
|
658
|
+
}
|
|
659
|
+
const diffArgs = ["diff"];
|
|
660
|
+
if (target.kind === "staged") {
|
|
661
|
+
diffArgs.push("--cached");
|
|
662
|
+
}
|
|
663
|
+
diffArgs.push("--stat", "--patch", "--");
|
|
664
|
+
return filePath ? [...diffArgs, filePath] : [...diffArgs, ...reviewPathspecArgs];
|
|
665
|
+
}
|
|
666
|
+
function buildReviewTargetFileArgs(target) {
|
|
667
|
+
const reviewPathspecArgs = getReviewPathspecArgs();
|
|
668
|
+
if (target.kind === "commit") {
|
|
669
|
+
return ["show", "--pretty=format:", "--name-only", target.hash, "--", ...reviewPathspecArgs];
|
|
670
|
+
}
|
|
671
|
+
const diffArgs = ["diff"];
|
|
672
|
+
if (target.kind === "staged") {
|
|
673
|
+
diffArgs.push("--cached");
|
|
674
|
+
}
|
|
675
|
+
return [...diffArgs, "--name-only", "--", ...reviewPathspecArgs];
|
|
676
|
+
}
|
|
677
|
+
function getReviewTargetFiles(target) {
|
|
678
|
+
const output = runGitCommand(buildReviewTargetFileArgs(target), {
|
|
679
|
+
allowFailure: true
|
|
680
|
+
});
|
|
681
|
+
return output.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
682
|
+
}
|
|
683
|
+
function createWorkingTreeReviewOption(kind) {
|
|
684
|
+
const files = getReviewTargetFiles({
|
|
685
|
+
hash: kind,
|
|
686
|
+
kind});
|
|
687
|
+
const subject = kind === "unstaged" ? "\uC544\uC9C1 git add \uD558\uC9C0 \uC54A\uC740 \uBCC0\uACBD\uC0AC\uD56D" : "git add \uB41C \uBCC0\uACBD\uC0AC\uD56D";
|
|
688
|
+
return {
|
|
689
|
+
author: "",
|
|
690
|
+
description: `${subject} | ${formatReviewTargetFileCount(files.length)}`,
|
|
691
|
+
hash: kind,
|
|
692
|
+
kind,
|
|
693
|
+
label: kind,
|
|
694
|
+
relativeDate: "",
|
|
695
|
+
subject
|
|
696
|
+
};
|
|
697
|
+
}
|
|
606
698
|
function getRecentCommitOptions() {
|
|
607
699
|
const output = runGitCommand(
|
|
608
700
|
["log", `-${COMMIT_FETCH_LIMIT}`, "--date=relative", "--pretty=format:%h%x09%an%x09%ar%x09%s"],
|
|
@@ -618,62 +710,61 @@ function getRecentCommitOptions() {
|
|
|
618
710
|
author,
|
|
619
711
|
description: `${author} | ${relativeDate}`,
|
|
620
712
|
hash,
|
|
713
|
+
kind: "commit",
|
|
621
714
|
label: `${hash} | ${truncateCommitSubject(subject)}`,
|
|
622
715
|
relativeDate,
|
|
623
716
|
subject
|
|
624
717
|
};
|
|
625
718
|
});
|
|
626
719
|
}
|
|
720
|
+
function getReviewTargetOptions() {
|
|
721
|
+
return [createWorkingTreeReviewOption("unstaged"), createWorkingTreeReviewOption("staged"), ...getRecentCommitOptions()];
|
|
722
|
+
}
|
|
627
723
|
function buildSelectedCommitSummary(commits) {
|
|
628
|
-
return commits.map((commit) =>
|
|
724
|
+
return commits.map((commit) => buildReviewTargetSummaryLine(commit)).join("\n");
|
|
629
725
|
}
|
|
630
726
|
function getReviewPathspecArgs() {
|
|
631
727
|
const { includePatterns, excludePatterns } = getGitDiffPathspecs();
|
|
632
728
|
return [...includePatterns, ...excludePatterns];
|
|
633
729
|
}
|
|
634
730
|
function buildSelectedCommitDiff(commits) {
|
|
635
|
-
const reviewPathspecArgs = getReviewPathspecArgs();
|
|
636
731
|
const sections = commits.map((commit) => {
|
|
637
|
-
const diff = runGitCommand(
|
|
732
|
+
const diff = runGitCommand(buildReviewTargetDiffArgs(commit), {
|
|
638
733
|
allowFailure: true,
|
|
639
734
|
trimOutput: false
|
|
640
735
|
}).trim();
|
|
641
736
|
if (!diff) {
|
|
642
737
|
return "";
|
|
643
738
|
}
|
|
644
|
-
return [`## ${commit
|
|
739
|
+
return [`## ${buildReviewTargetSectionTitle(commit)}`, diff].join("\n\n");
|
|
645
740
|
}).filter(Boolean).join("\n\n");
|
|
646
741
|
if (!sections) {
|
|
647
742
|
return "";
|
|
648
743
|
}
|
|
649
|
-
return ["# \uC120\uD0DD\uD55C \
|
|
744
|
+
return ["# \uC120\uD0DD\uD55C \uB9AC\uBDF0 \uB300\uC0C1", buildSelectedCommitSummary(commits), "", "# \uB9AC\uBDF0 \uB300\uC0C1 diff", sections].join("\n");
|
|
650
745
|
}
|
|
651
746
|
function getSelectedCommitFiles(commits) {
|
|
652
|
-
const reviewPathspecArgs = getReviewPathspecArgs();
|
|
653
747
|
const files = /* @__PURE__ */ new Set();
|
|
654
748
|
commits.forEach((commit) => {
|
|
655
|
-
|
|
656
|
-
allowFailure: true
|
|
657
|
-
});
|
|
658
|
-
output.split("\n").map((line) => line.trim()).filter(Boolean).forEach((filePath) => files.add(filePath));
|
|
749
|
+
getReviewTargetFiles(commit).forEach((filePath) => files.add(filePath));
|
|
659
750
|
});
|
|
660
751
|
return [...files];
|
|
661
752
|
}
|
|
662
753
|
function buildSelectedFileDiff(commits, filePath) {
|
|
663
754
|
const sections = commits.map((commit) => {
|
|
664
|
-
const diff = runGitCommand(
|
|
755
|
+
const diff = runGitCommand(buildReviewTargetDiffArgs(commit, filePath), {
|
|
665
756
|
allowFailure: true,
|
|
666
757
|
trimOutput: false
|
|
667
758
|
}).trim();
|
|
668
759
|
if (!diff) {
|
|
669
760
|
return "";
|
|
670
761
|
}
|
|
671
|
-
return [`## ${commit
|
|
762
|
+
return [`## ${buildReviewTargetSectionTitle(commit)}`, diff].join("\n\n");
|
|
672
763
|
}).filter(Boolean).join("\n\n");
|
|
673
764
|
if (!sections) {
|
|
674
765
|
return "";
|
|
675
766
|
}
|
|
676
|
-
return ["# \uC120\uD0DD\uD55C \
|
|
767
|
+
return ["# \uC120\uD0DD\uD55C \uB9AC\uBDF0 \uB300\uC0C1", buildSelectedCommitSummary(commits), "", `# \uD30C\uC77C: ${filePath}`, sections].join("\n\n");
|
|
677
768
|
}
|
|
678
769
|
function openReport(reportPath) {
|
|
679
770
|
const resolvedPath = path__default.default.resolve(reportPath);
|
|
@@ -859,13 +950,13 @@ async function showMultiSelect(question, options, windowSize = COMMIT_SELECTION_
|
|
|
859
950
|
});
|
|
860
951
|
}
|
|
861
952
|
async function selectReviewCommits() {
|
|
862
|
-
const commits =
|
|
953
|
+
const commits = getReviewTargetOptions();
|
|
863
954
|
if (commits.length === 0) {
|
|
864
|
-
console.log("\u2139\uFE0F \uB9AC\uBDF0\uD560 \
|
|
955
|
+
console.log("\u2139\uFE0F \uB9AC\uBDF0\uD560 \uB300\uC0C1\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
865
956
|
return [];
|
|
866
957
|
}
|
|
867
958
|
return showMultiSelect(
|
|
868
|
-
"\uB9AC\uBDF0\uD560 \
|
|
959
|
+
"\uB9AC\uBDF0\uD560 \uB300\uC0C1\uC744 \uC120\uD0DD\uD574\uC8FC\uC138\uC694.",
|
|
869
960
|
commits.map((commit) => ({
|
|
870
961
|
description: commit.description,
|
|
871
962
|
label: commit.label,
|
|
@@ -1002,5 +1093,3 @@ exports.showSelectionAIService = showSelectionAIService;
|
|
|
1002
1093
|
exports.tempDiffPath = tempDiffPath;
|
|
1003
1094
|
exports.writeErrorReport = writeErrorReport;
|
|
1004
1095
|
exports.writeExecutionLog = writeExecutionLog;
|
|
1005
|
-
//# sourceMappingURL=helper.cjs.map
|
|
1006
|
-
//# sourceMappingURL=helper.cjs.map
|
package/dist/common/helper.js
CHANGED
|
@@ -200,15 +200,51 @@ function runGitCommand(args, options = {}) {
|
|
|
200
200
|
throw error;
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
+
function resolveShellLaunchConfig() {
|
|
204
|
+
const candidates = [];
|
|
205
|
+
const seen = /* @__PURE__ */ new Set();
|
|
206
|
+
const appendCandidate = (executable, shellArgs) => {
|
|
207
|
+
const normalizedExecutable = executable?.trim();
|
|
208
|
+
if (!normalizedExecutable) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (path.isAbsolute(normalizedExecutable) && !fs.existsSync(normalizedExecutable)) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const key = `${normalizedExecutable}::${shellArgs.join("\0")}`;
|
|
215
|
+
if (seen.has(key)) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
seen.add(key);
|
|
219
|
+
candidates.push({
|
|
220
|
+
executable: normalizedExecutable,
|
|
221
|
+
shellArgs
|
|
222
|
+
});
|
|
223
|
+
};
|
|
224
|
+
const shellFromEnv = process.env.SHELL?.trim();
|
|
225
|
+
const envShellName = shellFromEnv ? path.basename(shellFromEnv) : "";
|
|
226
|
+
if (["bash", "zsh", "ksh"].includes(envShellName)) {
|
|
227
|
+
appendCandidate(shellFromEnv, ["-lc"]);
|
|
228
|
+
}
|
|
229
|
+
["/bin/bash", "/usr/bin/bash", "bash", "/bin/zsh", "/usr/bin/zsh", "zsh"].forEach((shellPath) => {
|
|
230
|
+
appendCandidate(shellPath, ["-lc"]);
|
|
231
|
+
});
|
|
232
|
+
["/bin/sh", "/usr/bin/sh", "sh"].forEach((shellPath) => {
|
|
233
|
+
appendCandidate(shellPath, ["-c"]);
|
|
234
|
+
});
|
|
235
|
+
return candidates[0] || { executable: "sh", shellArgs: ["-c"] };
|
|
236
|
+
}
|
|
203
237
|
async function executeShellCommandWithProgress(command, options = {}) {
|
|
204
238
|
const { progressIntervalMs = 1e4, progressMessage = "\u23F3 \uBA85\uB839\uC744 \uC2E4\uD589\uD558\uB294 \uC911\uC785\uB2C8\uB2E4...", streamOutput = false } = options;
|
|
205
239
|
const { spawn } = await import('child_process');
|
|
240
|
+
const shellLaunchConfig = resolveShellLaunchConfig();
|
|
206
241
|
return new Promise((resolve, reject) => {
|
|
207
242
|
let stdout = "";
|
|
208
243
|
let stderr = "";
|
|
209
244
|
const startedAt = Date.now();
|
|
210
245
|
console.log(progressMessage);
|
|
211
|
-
|
|
246
|
+
helperTrace("shell-command:launcher", `${shellLaunchConfig.executable} ${shellLaunchConfig.shellArgs.join(" ")}`);
|
|
247
|
+
const child = spawn(shellLaunchConfig.executable, [...shellLaunchConfig.shellArgs, command], {
|
|
212
248
|
stdio: ["ignore", "pipe", "pipe"]
|
|
213
249
|
});
|
|
214
250
|
const progressTimer = setInterval(() => {
|
|
@@ -594,6 +630,62 @@ function truncateCommitSubject(subject) {
|
|
|
594
630
|
}
|
|
595
631
|
return `${subject.slice(0, 69)}...`;
|
|
596
632
|
}
|
|
633
|
+
function formatReviewTargetFileCount(fileCount) {
|
|
634
|
+
return fileCount === 0 ? "\uBCC0\uACBD \uC5C6\uC74C" : `${fileCount}\uAC1C \uD30C\uC77C`;
|
|
635
|
+
}
|
|
636
|
+
function buildReviewTargetSectionTitle(target) {
|
|
637
|
+
return target.kind === "commit" ? `${target.hash} ${target.subject}` : `${target.hash} | ${target.subject}`;
|
|
638
|
+
}
|
|
639
|
+
function buildReviewTargetSummaryLine(target) {
|
|
640
|
+
if (target.kind === "commit") {
|
|
641
|
+
return `- ${target.hash} | ${target.subject} | ${target.author} | ${target.relativeDate}`;
|
|
642
|
+
}
|
|
643
|
+
return `- ${target.hash} | ${target.subject}`;
|
|
644
|
+
}
|
|
645
|
+
function buildReviewTargetDiffArgs(target, filePath) {
|
|
646
|
+
const reviewPathspecArgs = getReviewPathspecArgs();
|
|
647
|
+
if (target.kind === "commit") {
|
|
648
|
+
return filePath ? ["show", "--stat", "--patch", "--format=", target.hash, "--", filePath] : ["show", "--stat", "--patch", "--format=", target.hash, "--", ...reviewPathspecArgs];
|
|
649
|
+
}
|
|
650
|
+
const diffArgs = ["diff"];
|
|
651
|
+
if (target.kind === "staged") {
|
|
652
|
+
diffArgs.push("--cached");
|
|
653
|
+
}
|
|
654
|
+
diffArgs.push("--stat", "--patch", "--");
|
|
655
|
+
return filePath ? [...diffArgs, filePath] : [...diffArgs, ...reviewPathspecArgs];
|
|
656
|
+
}
|
|
657
|
+
function buildReviewTargetFileArgs(target) {
|
|
658
|
+
const reviewPathspecArgs = getReviewPathspecArgs();
|
|
659
|
+
if (target.kind === "commit") {
|
|
660
|
+
return ["show", "--pretty=format:", "--name-only", target.hash, "--", ...reviewPathspecArgs];
|
|
661
|
+
}
|
|
662
|
+
const diffArgs = ["diff"];
|
|
663
|
+
if (target.kind === "staged") {
|
|
664
|
+
diffArgs.push("--cached");
|
|
665
|
+
}
|
|
666
|
+
return [...diffArgs, "--name-only", "--", ...reviewPathspecArgs];
|
|
667
|
+
}
|
|
668
|
+
function getReviewTargetFiles(target) {
|
|
669
|
+
const output = runGitCommand(buildReviewTargetFileArgs(target), {
|
|
670
|
+
allowFailure: true
|
|
671
|
+
});
|
|
672
|
+
return output.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
673
|
+
}
|
|
674
|
+
function createWorkingTreeReviewOption(kind) {
|
|
675
|
+
const files = getReviewTargetFiles({
|
|
676
|
+
hash: kind,
|
|
677
|
+
kind});
|
|
678
|
+
const subject = kind === "unstaged" ? "\uC544\uC9C1 git add \uD558\uC9C0 \uC54A\uC740 \uBCC0\uACBD\uC0AC\uD56D" : "git add \uB41C \uBCC0\uACBD\uC0AC\uD56D";
|
|
679
|
+
return {
|
|
680
|
+
author: "",
|
|
681
|
+
description: `${subject} | ${formatReviewTargetFileCount(files.length)}`,
|
|
682
|
+
hash: kind,
|
|
683
|
+
kind,
|
|
684
|
+
label: kind,
|
|
685
|
+
relativeDate: "",
|
|
686
|
+
subject
|
|
687
|
+
};
|
|
688
|
+
}
|
|
597
689
|
function getRecentCommitOptions() {
|
|
598
690
|
const output = runGitCommand(
|
|
599
691
|
["log", `-${COMMIT_FETCH_LIMIT}`, "--date=relative", "--pretty=format:%h%x09%an%x09%ar%x09%s"],
|
|
@@ -609,62 +701,61 @@ function getRecentCommitOptions() {
|
|
|
609
701
|
author,
|
|
610
702
|
description: `${author} | ${relativeDate}`,
|
|
611
703
|
hash,
|
|
704
|
+
kind: "commit",
|
|
612
705
|
label: `${hash} | ${truncateCommitSubject(subject)}`,
|
|
613
706
|
relativeDate,
|
|
614
707
|
subject
|
|
615
708
|
};
|
|
616
709
|
});
|
|
617
710
|
}
|
|
711
|
+
function getReviewTargetOptions() {
|
|
712
|
+
return [createWorkingTreeReviewOption("unstaged"), createWorkingTreeReviewOption("staged"), ...getRecentCommitOptions()];
|
|
713
|
+
}
|
|
618
714
|
function buildSelectedCommitSummary(commits) {
|
|
619
|
-
return commits.map((commit) =>
|
|
715
|
+
return commits.map((commit) => buildReviewTargetSummaryLine(commit)).join("\n");
|
|
620
716
|
}
|
|
621
717
|
function getReviewPathspecArgs() {
|
|
622
718
|
const { includePatterns, excludePatterns } = getGitDiffPathspecs();
|
|
623
719
|
return [...includePatterns, ...excludePatterns];
|
|
624
720
|
}
|
|
625
721
|
function buildSelectedCommitDiff(commits) {
|
|
626
|
-
const reviewPathspecArgs = getReviewPathspecArgs();
|
|
627
722
|
const sections = commits.map((commit) => {
|
|
628
|
-
const diff = runGitCommand(
|
|
723
|
+
const diff = runGitCommand(buildReviewTargetDiffArgs(commit), {
|
|
629
724
|
allowFailure: true,
|
|
630
725
|
trimOutput: false
|
|
631
726
|
}).trim();
|
|
632
727
|
if (!diff) {
|
|
633
728
|
return "";
|
|
634
729
|
}
|
|
635
|
-
return [`## ${commit
|
|
730
|
+
return [`## ${buildReviewTargetSectionTitle(commit)}`, diff].join("\n\n");
|
|
636
731
|
}).filter(Boolean).join("\n\n");
|
|
637
732
|
if (!sections) {
|
|
638
733
|
return "";
|
|
639
734
|
}
|
|
640
|
-
return ["# \uC120\uD0DD\uD55C \
|
|
735
|
+
return ["# \uC120\uD0DD\uD55C \uB9AC\uBDF0 \uB300\uC0C1", buildSelectedCommitSummary(commits), "", "# \uB9AC\uBDF0 \uB300\uC0C1 diff", sections].join("\n");
|
|
641
736
|
}
|
|
642
737
|
function getSelectedCommitFiles(commits) {
|
|
643
|
-
const reviewPathspecArgs = getReviewPathspecArgs();
|
|
644
738
|
const files = /* @__PURE__ */ new Set();
|
|
645
739
|
commits.forEach((commit) => {
|
|
646
|
-
|
|
647
|
-
allowFailure: true
|
|
648
|
-
});
|
|
649
|
-
output.split("\n").map((line) => line.trim()).filter(Boolean).forEach((filePath) => files.add(filePath));
|
|
740
|
+
getReviewTargetFiles(commit).forEach((filePath) => files.add(filePath));
|
|
650
741
|
});
|
|
651
742
|
return [...files];
|
|
652
743
|
}
|
|
653
744
|
function buildSelectedFileDiff(commits, filePath) {
|
|
654
745
|
const sections = commits.map((commit) => {
|
|
655
|
-
const diff = runGitCommand(
|
|
746
|
+
const diff = runGitCommand(buildReviewTargetDiffArgs(commit, filePath), {
|
|
656
747
|
allowFailure: true,
|
|
657
748
|
trimOutput: false
|
|
658
749
|
}).trim();
|
|
659
750
|
if (!diff) {
|
|
660
751
|
return "";
|
|
661
752
|
}
|
|
662
|
-
return [`## ${commit
|
|
753
|
+
return [`## ${buildReviewTargetSectionTitle(commit)}`, diff].join("\n\n");
|
|
663
754
|
}).filter(Boolean).join("\n\n");
|
|
664
755
|
if (!sections) {
|
|
665
756
|
return "";
|
|
666
757
|
}
|
|
667
|
-
return ["# \uC120\uD0DD\uD55C \
|
|
758
|
+
return ["# \uC120\uD0DD\uD55C \uB9AC\uBDF0 \uB300\uC0C1", buildSelectedCommitSummary(commits), "", `# \uD30C\uC77C: ${filePath}`, sections].join("\n\n");
|
|
668
759
|
}
|
|
669
760
|
function openReport(reportPath) {
|
|
670
761
|
const resolvedPath = path.resolve(reportPath);
|
|
@@ -850,13 +941,13 @@ async function showMultiSelect(question, options, windowSize = COMMIT_SELECTION_
|
|
|
850
941
|
});
|
|
851
942
|
}
|
|
852
943
|
async function selectReviewCommits() {
|
|
853
|
-
const commits =
|
|
944
|
+
const commits = getReviewTargetOptions();
|
|
854
945
|
if (commits.length === 0) {
|
|
855
|
-
console.log("\u2139\uFE0F \uB9AC\uBDF0\uD560 \
|
|
946
|
+
console.log("\u2139\uFE0F \uB9AC\uBDF0\uD560 \uB300\uC0C1\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
856
947
|
return [];
|
|
857
948
|
}
|
|
858
949
|
return showMultiSelect(
|
|
859
|
-
"\uB9AC\uBDF0\uD560 \
|
|
950
|
+
"\uB9AC\uBDF0\uD560 \uB300\uC0C1\uC744 \uC120\uD0DD\uD574\uC8FC\uC138\uC694.",
|
|
860
951
|
commits.map((commit) => ({
|
|
861
952
|
description: commit.description,
|
|
862
953
|
label: commit.label,
|
|
@@ -954,5 +1045,3 @@ async function showSelectionAIService() {
|
|
|
954
1045
|
}
|
|
955
1046
|
|
|
956
1047
|
export { AIServices, COMMIT_FETCH_LIMIT, COMMIT_SELECTION_WINDOW, REPORT_DIR, buildSelectedCommitDiff, buildSelectedCommitSummary, buildSelectedFileDiff, clearTraceMessages, codingConventionRulesPath, createReportDirectory, createTraceLogger, deleteFile, deleteTempDiff, executeShellCommandWithProgress, exitWithError, formatReviewTargetFiles, getAvailableFilePath, getErrorLogTimestamp, getErrorSummary, getGitDiffFilter, getNextFilePath, getNowString, getRecentCommitOptions, getSelectedCommitFiles, getTraceMessages, ignoreList, isTestMode, namingRulesPath, openReport, reviewFormOneByOnePath, reviewFormPath, rulesPath, selectAIService, selectReviewCommits, shouldStreamAIOutput, showMultiSelect, showSelectionAIService, tempDiffPath, writeErrorReport, writeExecutionLog };
|
|
957
|
-
//# sourceMappingURL=helper.js.map
|
|
958
|
-
//# sourceMappingURL=helper.js.map
|
package/dist/common/types.cjs
CHANGED
package/dist/common/types.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
type AIServiceType = 'gemini' | 'claude' | 'codex';
|
|
2
|
+
type ReviewTargetKind = 'commit' | 'staged' | 'unstaged';
|
|
2
3
|
/**
|
|
3
4
|
* @description
|
|
4
5
|
* 리뷰 대상 커밋을 선택 UI와 실행 로직에서 동일하게 다루기 위한 기본 메타데이터입니다.
|
|
@@ -8,6 +9,7 @@ type CommitOption = {
|
|
|
8
9
|
author: string;
|
|
9
10
|
description: string;
|
|
10
11
|
hash: string;
|
|
12
|
+
kind: ReviewTargetKind;
|
|
11
13
|
label: string;
|
|
12
14
|
relativeDate: string;
|
|
13
15
|
subject: string;
|
|
@@ -23,4 +25,4 @@ type MultiSelectOption<T> = {
|
|
|
23
25
|
value: T;
|
|
24
26
|
};
|
|
25
27
|
|
|
26
|
-
export type { AIServiceType, CommitOption, MultiSelectOption };
|
|
28
|
+
export type { AIServiceType, CommitOption, MultiSelectOption, ReviewTargetKind };
|
package/dist/common/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
type AIServiceType = 'gemini' | 'claude' | 'codex';
|
|
2
|
+
type ReviewTargetKind = 'commit' | 'staged' | 'unstaged';
|
|
2
3
|
/**
|
|
3
4
|
* @description
|
|
4
5
|
* 리뷰 대상 커밋을 선택 UI와 실행 로직에서 동일하게 다루기 위한 기본 메타데이터입니다.
|
|
@@ -8,6 +9,7 @@ type CommitOption = {
|
|
|
8
9
|
author: string;
|
|
9
10
|
description: string;
|
|
10
11
|
hash: string;
|
|
12
|
+
kind: ReviewTargetKind;
|
|
11
13
|
label: string;
|
|
12
14
|
relativeDate: string;
|
|
13
15
|
subject: string;
|
|
@@ -23,4 +25,4 @@ type MultiSelectOption<T> = {
|
|
|
23
25
|
value: T;
|
|
24
26
|
};
|
|
25
27
|
|
|
26
|
-
export type { AIServiceType, CommitOption, MultiSelectOption };
|
|
28
|
+
export type { AIServiceType, CommitOption, MultiSelectOption, ReviewTargetKind };
|
package/dist/common/types.js
CHANGED
|
@@ -38,5 +38,3 @@ if (process.argv[1] && ((typeof document === 'undefined' ? require('u' + 'rl').p
|
|
|
38
38
|
|
|
39
39
|
exports.installGcloud = installGcloud;
|
|
40
40
|
exports.isInstalledGcloud = isInstalledGcloud;
|
|
41
|
-
//# sourceMappingURL=installation-gcloud.cjs.map
|
|
42
|
-
//# sourceMappingURL=installation-gcloud.cjs.map
|
|
@@ -18438,5 +18438,3 @@ gtoken/build/cjs/src/index.cjs:
|
|
|
18438
18438
|
*/
|
|
18439
18439
|
|
|
18440
18440
|
exports.runReview = runReview;
|
|
18441
|
-
//# sourceMappingURL=index.cjs.map
|
|
18442
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -18428,5 +18428,3 @@ gtoken/build/cjs/src/index.cjs:
|
|
|
18428
18428
|
*/
|
|
18429
18429
|
|
|
18430
18430
|
export { runReview };
|
|
18431
|
-
//# sourceMappingURL=index.js.map
|
|
18432
|
-
//# sourceMappingURL=index.js.map
|
package/dist/etc/login.cjs
CHANGED
|
@@ -18387,5 +18387,3 @@ gtoken/build/cjs/src/index.cjs:
|
|
|
18387
18387
|
|
|
18388
18388
|
exports.getTokenAndProjectId = getTokenAndProjectId;
|
|
18389
18389
|
exports.logout = logout;
|
|
18390
|
-
//# sourceMappingURL=login.cjs.map
|
|
18391
|
-
//# sourceMappingURL=login.cjs.map
|
package/dist/etc/login.js
CHANGED
|
@@ -18377,5 +18377,3 @@ gtoken/build/cjs/src/index.cjs:
|
|
|
18377
18377
|
*/
|
|
18378
18378
|
|
|
18379
18379
|
export { getTokenAndProjectId, logout };
|
|
18380
|
-
//# sourceMappingURL=login.js.map
|
|
18381
|
-
//# sourceMappingURL=login.js.map
|
|
@@ -16247,5 +16247,3 @@ if (process.argv[1] && ((typeof document === 'undefined' ? require('u' + 'rl').p
|
|
|
16247
16247
|
* limitations under the License.
|
|
16248
16248
|
*)
|
|
16249
16249
|
*/
|
|
16250
|
-
//# sourceMappingURL=index.cjs.map
|
|
16251
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -16235,5 +16235,3 @@ if (process.argv[1] && (import.meta.url.endsWith(process.argv[1]) || process.arg
|
|
|
16235
16235
|
* limitations under the License.
|
|
16236
16236
|
*)
|
|
16237
16237
|
*/
|
|
16238
|
-
//# sourceMappingURL=index.js.map
|
|
16239
|
-
//# sourceMappingURL=index.js.map
|