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.
Files changed (59) hide show
  1. package/dist/common/helper.cjs +108 -19
  2. package/dist/common/helper.js +108 -19
  3. package/dist/common/types.cjs +0 -2
  4. package/dist/common/types.d.cts +3 -1
  5. package/dist/common/types.d.ts +3 -1
  6. package/dist/common/types.js +0 -2
  7. package/dist/etc/installation-gcloud.cjs +0 -2
  8. package/dist/etc/installation-gcloud.js +0 -2
  9. package/dist/etc/interactive-version/index.cjs +0 -2
  10. package/dist/etc/interactive-version/index.js +0 -2
  11. package/dist/etc/login.cjs +0 -2
  12. package/dist/etc/login.js +0 -2
  13. package/dist/etc/vertex-version/index.cjs +0 -2
  14. package/dist/etc/vertex-version/index.js +0 -2
  15. package/dist/pr-review/claude/claude-commander.cjs +0 -2
  16. package/dist/pr-review/claude/claude-commander.js +0 -2
  17. package/dist/pr-review/claude/installation-claude.cjs +0 -2
  18. package/dist/pr-review/claude/installation-claude.js +0 -2
  19. package/dist/pr-review/codex/codex-commander.cjs +0 -2
  20. package/dist/pr-review/codex/codex-commander.js +0 -2
  21. package/dist/pr-review/codex/installation-codex.cjs +0 -2
  22. package/dist/pr-review/codex/installation-codex.js +0 -2
  23. package/dist/pr-review/gemini/gemini-commander.cjs +0 -2
  24. package/dist/pr-review/gemini/gemini-commander.js +0 -2
  25. package/dist/pr-review/gemini/installation-gemini.cjs +0 -2
  26. package/dist/pr-review/gemini/installation-gemini.js +0 -2
  27. package/dist/pr-review/review-one-by-one.cjs +75 -22
  28. package/dist/pr-review/review-one-by-one.js +75 -22
  29. package/dist/pr-review/review.cjs +109 -20
  30. package/dist/pr-review/review.js +109 -20
  31. package/package.json +1 -1
  32. package/dist/common/helper.cjs.map +0 -1
  33. package/dist/common/helper.js.map +0 -1
  34. package/dist/common/types.cjs.map +0 -1
  35. package/dist/common/types.js.map +0 -1
  36. package/dist/etc/installation-gcloud.cjs.map +0 -1
  37. package/dist/etc/installation-gcloud.js.map +0 -1
  38. package/dist/etc/interactive-version/index.cjs.map +0 -1
  39. package/dist/etc/interactive-version/index.js.map +0 -1
  40. package/dist/etc/login.cjs.map +0 -1
  41. package/dist/etc/login.js.map +0 -1
  42. package/dist/etc/vertex-version/index.cjs.map +0 -1
  43. package/dist/etc/vertex-version/index.js.map +0 -1
  44. package/dist/pr-review/claude/claude-commander.cjs.map +0 -1
  45. package/dist/pr-review/claude/claude-commander.js.map +0 -1
  46. package/dist/pr-review/claude/installation-claude.cjs.map +0 -1
  47. package/dist/pr-review/claude/installation-claude.js.map +0 -1
  48. package/dist/pr-review/codex/codex-commander.cjs.map +0 -1
  49. package/dist/pr-review/codex/codex-commander.js.map +0 -1
  50. package/dist/pr-review/codex/installation-codex.cjs.map +0 -1
  51. package/dist/pr-review/codex/installation-codex.js.map +0 -1
  52. package/dist/pr-review/gemini/gemini-commander.cjs.map +0 -1
  53. package/dist/pr-review/gemini/gemini-commander.js.map +0 -1
  54. package/dist/pr-review/gemini/installation-gemini.cjs.map +0 -1
  55. package/dist/pr-review/gemini/installation-gemini.js.map +0 -1
  56. package/dist/pr-review/review-one-by-one.cjs.map +0 -1
  57. package/dist/pr-review/review-one-by-one.js.map +0 -1
  58. package/dist/pr-review/review.cjs.map +0 -1
  59. package/dist/pr-review/review.js.map +0 -1
@@ -516,6 +516,62 @@ function truncateCommitSubject(subject) {
516
516
  }
517
517
  return `${subject.slice(0, 69)}...`;
518
518
  }
519
+ function formatReviewTargetFileCount(fileCount) {
520
+ return fileCount === 0 ? "\uBCC0\uACBD \uC5C6\uC74C" : `${fileCount}\uAC1C \uD30C\uC77C`;
521
+ }
522
+ function buildReviewTargetSectionTitle(target) {
523
+ return target.kind === "commit" ? `${target.hash} ${target.subject}` : `${target.hash} | ${target.subject}`;
524
+ }
525
+ function buildReviewTargetSummaryLine(target) {
526
+ if (target.kind === "commit") {
527
+ return `- ${target.hash} | ${target.subject} | ${target.author} | ${target.relativeDate}`;
528
+ }
529
+ return `- ${target.hash} | ${target.subject}`;
530
+ }
531
+ function buildReviewTargetDiffArgs(target, filePath) {
532
+ const reviewPathspecArgs = getReviewPathspecArgs();
533
+ if (target.kind === "commit") {
534
+ return filePath ? ["show", "--stat", "--patch", "--format=", target.hash, "--", filePath] : ["show", "--stat", "--patch", "--format=", target.hash, "--", ...reviewPathspecArgs];
535
+ }
536
+ const diffArgs = ["diff"];
537
+ if (target.kind === "staged") {
538
+ diffArgs.push("--cached");
539
+ }
540
+ diffArgs.push("--stat", "--patch", "--");
541
+ return filePath ? [...diffArgs, filePath] : [...diffArgs, ...reviewPathspecArgs];
542
+ }
543
+ function buildReviewTargetFileArgs(target) {
544
+ const reviewPathspecArgs = getReviewPathspecArgs();
545
+ if (target.kind === "commit") {
546
+ return ["show", "--pretty=format:", "--name-only", target.hash, "--", ...reviewPathspecArgs];
547
+ }
548
+ const diffArgs = ["diff"];
549
+ if (target.kind === "staged") {
550
+ diffArgs.push("--cached");
551
+ }
552
+ return [...diffArgs, "--name-only", "--", ...reviewPathspecArgs];
553
+ }
554
+ function getReviewTargetFiles(target) {
555
+ const output = runGitCommand(buildReviewTargetFileArgs(target), {
556
+ allowFailure: true
557
+ });
558
+ return output.split("\n").map((line) => line.trim()).filter(Boolean);
559
+ }
560
+ function createWorkingTreeReviewOption(kind) {
561
+ const files = getReviewTargetFiles({
562
+ hash: kind,
563
+ kind});
564
+ const subject = kind === "unstaged" ? "\uC544\uC9C1 git add \uD558\uC9C0 \uC54A\uC740 \uBCC0\uACBD\uC0AC\uD56D" : "git add \uB41C \uBCC0\uACBD\uC0AC\uD56D";
565
+ return {
566
+ author: "",
567
+ description: `${subject} | ${formatReviewTargetFileCount(files.length)}`,
568
+ hash: kind,
569
+ kind,
570
+ label: kind,
571
+ relativeDate: "",
572
+ subject
573
+ };
574
+ }
519
575
  function getRecentCommitOptions() {
520
576
  const output = runGitCommand(
521
577
  ["log", `-${COMMIT_FETCH_LIMIT}`, "--date=relative", "--pretty=format:%h%x09%an%x09%ar%x09%s"],
@@ -531,62 +587,61 @@ function getRecentCommitOptions() {
531
587
  author,
532
588
  description: `${author} | ${relativeDate}`,
533
589
  hash,
590
+ kind: "commit",
534
591
  label: `${hash} | ${truncateCommitSubject(subject)}`,
535
592
  relativeDate,
536
593
  subject
537
594
  };
538
595
  });
539
596
  }
597
+ function getReviewTargetOptions() {
598
+ return [createWorkingTreeReviewOption("unstaged"), createWorkingTreeReviewOption("staged"), ...getRecentCommitOptions()];
599
+ }
540
600
  function buildSelectedCommitSummary(commits) {
541
- return commits.map((commit) => `- ${commit.hash} | ${commit.subject} | ${commit.author} | ${commit.relativeDate}`).join("\n");
601
+ return commits.map((commit) => buildReviewTargetSummaryLine(commit)).join("\n");
542
602
  }
543
603
  function getReviewPathspecArgs() {
544
604
  const { includePatterns, excludePatterns } = getGitDiffPathspecs();
545
605
  return [...includePatterns, ...excludePatterns];
546
606
  }
547
607
  function buildSelectedCommitDiff(commits) {
548
- const reviewPathspecArgs = getReviewPathspecArgs();
549
608
  const sections = commits.map((commit) => {
550
- const diff = runGitCommand(["show", "--stat", "--patch", "--format=", commit.hash, "--", ...reviewPathspecArgs], {
609
+ const diff = runGitCommand(buildReviewTargetDiffArgs(commit), {
551
610
  allowFailure: true,
552
611
  trimOutput: false
553
612
  }).trim();
554
613
  if (!diff) {
555
614
  return "";
556
615
  }
557
- return [`## ${commit.hash} ${commit.subject}`, diff].join("\n\n");
616
+ return [`## ${buildReviewTargetSectionTitle(commit)}`, diff].join("\n\n");
558
617
  }).filter(Boolean).join("\n\n");
559
618
  if (!sections) {
560
619
  return "";
561
620
  }
562
- return ["# \uC120\uD0DD\uD55C \uCEE4\uBC0B", buildSelectedCommitSummary(commits), "", "# \uB9AC\uBDF0 \uB300\uC0C1 diff", sections].join("\n");
621
+ return ["# \uC120\uD0DD\uD55C \uB9AC\uBDF0 \uB300\uC0C1", buildSelectedCommitSummary(commits), "", "# \uB9AC\uBDF0 \uB300\uC0C1 diff", sections].join("\n");
563
622
  }
564
623
  function getSelectedCommitFiles(commits) {
565
- const reviewPathspecArgs = getReviewPathspecArgs();
566
624
  const files = /* @__PURE__ */ new Set();
567
625
  commits.forEach((commit) => {
568
- const output = runGitCommand(["show", "--pretty=format:", "--name-only", commit.hash, "--", ...reviewPathspecArgs], {
569
- allowFailure: true
570
- });
571
- output.split("\n").map((line) => line.trim()).filter(Boolean).forEach((filePath) => files.add(filePath));
626
+ getReviewTargetFiles(commit).forEach((filePath) => files.add(filePath));
572
627
  });
573
628
  return [...files];
574
629
  }
575
630
  function buildSelectedFileDiff(commits, filePath) {
576
631
  const sections = commits.map((commit) => {
577
- const diff = runGitCommand(["show", "--stat", "--patch", "--format=", commit.hash, "--", filePath], {
632
+ const diff = runGitCommand(buildReviewTargetDiffArgs(commit, filePath), {
578
633
  allowFailure: true,
579
634
  trimOutput: false
580
635
  }).trim();
581
636
  if (!diff) {
582
637
  return "";
583
638
  }
584
- return [`## ${commit.hash} ${commit.subject}`, diff].join("\n\n");
639
+ return [`## ${buildReviewTargetSectionTitle(commit)}`, diff].join("\n\n");
585
640
  }).filter(Boolean).join("\n\n");
586
641
  if (!sections) {
587
642
  return "";
588
643
  }
589
- return ["# \uC120\uD0DD\uD55C \uCEE4\uBC0B", buildSelectedCommitSummary(commits), "", `# \uD30C\uC77C: ${filePath}`, sections].join("\n\n");
644
+ return ["# \uC120\uD0DD\uD55C \uB9AC\uBDF0 \uB300\uC0C1", buildSelectedCommitSummary(commits), "", `# \uD30C\uC77C: ${filePath}`, sections].join("\n\n");
590
645
  }
591
646
  function openReport(reportPath) {
592
647
  const resolvedPath = path__default.default.resolve(reportPath);
@@ -772,13 +827,13 @@ async function showMultiSelect(question, options, windowSize = COMMIT_SELECTION_
772
827
  });
773
828
  }
774
829
  async function selectReviewCommits() {
775
- const commits = getRecentCommitOptions();
830
+ const commits = getReviewTargetOptions();
776
831
  if (commits.length === 0) {
777
- console.log("\u2139\uFE0F \uB9AC\uBDF0\uD560 \uCD5C\uADFC \uCEE4\uBC0B\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
832
+ console.log("\u2139\uFE0F \uB9AC\uBDF0\uD560 \uB300\uC0C1\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
778
833
  return [];
779
834
  }
780
835
  return showMultiSelect(
781
- "\uB9AC\uBDF0\uD560 \uCEE4\uBC0B\uC744 \uC120\uD0DD\uD574\uC8FC\uC138\uC694.",
836
+ "\uB9AC\uBDF0\uD560 \uB300\uC0C1\uC744 \uC120\uD0DD\uD574\uC8FC\uC138\uC694.",
782
837
  commits.map((commit) => ({
783
838
  description: commit.description,
784
839
  label: commit.label,
@@ -1441,8 +1496,8 @@ async function main() {
1441
1496
  trace7("commit-selection:done", `count=${selectedCommits.length}`);
1442
1497
  if (selectedCommits.length === 0) {
1443
1498
  trace7("commit-selection:empty");
1444
- executionTitle = "\uC120\uD0DD\uB41C \uCEE4\uBC0B\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.";
1445
- console.log("\u2139\uFE0F \uC120\uD0DD\uB41C \uCEE4\uBC0B\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
1499
+ executionTitle = "\uC120\uD0DD\uB41C \uB9AC\uBDF0 \uB300\uC0C1\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.";
1500
+ console.log("\u2139\uFE0F \uC120\uD0DD\uB41C \uB9AC\uBDF0 \uB300\uC0C1\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
1446
1501
  deleteTempDiff();
1447
1502
  return;
1448
1503
  }
@@ -1455,8 +1510,8 @@ async function main() {
1455
1510
  console.log(`\u{1F4C2} \uB9AC\uBDF0 \uB300\uC0C1 \uD30C\uC77C(${fileList.length}\uAC1C): ${formatReviewTargetFiles(fileList)}`);
1456
1511
  if (fileList.length === 0) {
1457
1512
  trace7("empty-file-list:exit");
1458
- executionTitle = "\uC120\uD0DD\uD55C \uCEE4\uBC0B\uC5D0\uC11C \uB9AC\uBDF0 \uB300\uC0C1 \uD30C\uC77C \uBCC0\uACBD\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.";
1459
- console.log("\u2139\uFE0F \uC120\uD0DD\uD55C \uCEE4\uBC0B\uC5D0\uC11C \uB9AC\uBDF0 \uB300\uC0C1 \uD30C\uC77C \uBCC0\uACBD\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.");
1513
+ executionTitle = "\uC120\uD0DD\uD55C \uB9AC\uBDF0 \uB300\uC0C1\uC5D0\uC11C \uB9AC\uBDF0\uD560 \uBCC0\uACBD\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.";
1514
+ console.log("\u2139\uFE0F \uC120\uD0DD\uD55C \uB9AC\uBDF0 \uB300\uC0C1\uC5D0\uC11C \uB9AC\uBDF0\uD560 \uBCC0\uACBD\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.");
1460
1515
  deleteTempDiff();
1461
1516
  return;
1462
1517
  }
@@ -1730,5 +1785,3 @@ ${JSON.stringify(
1730
1785
  }
1731
1786
  }
1732
1787
  main();
1733
- //# sourceMappingURL=review-one-by-one.cjs.map
1734
- //# sourceMappingURL=review-one-by-one.cjs.map
@@ -506,6 +506,62 @@ function truncateCommitSubject(subject) {
506
506
  }
507
507
  return `${subject.slice(0, 69)}...`;
508
508
  }
509
+ function formatReviewTargetFileCount(fileCount) {
510
+ return fileCount === 0 ? "\uBCC0\uACBD \uC5C6\uC74C" : `${fileCount}\uAC1C \uD30C\uC77C`;
511
+ }
512
+ function buildReviewTargetSectionTitle(target) {
513
+ return target.kind === "commit" ? `${target.hash} ${target.subject}` : `${target.hash} | ${target.subject}`;
514
+ }
515
+ function buildReviewTargetSummaryLine(target) {
516
+ if (target.kind === "commit") {
517
+ return `- ${target.hash} | ${target.subject} | ${target.author} | ${target.relativeDate}`;
518
+ }
519
+ return `- ${target.hash} | ${target.subject}`;
520
+ }
521
+ function buildReviewTargetDiffArgs(target, filePath) {
522
+ const reviewPathspecArgs = getReviewPathspecArgs();
523
+ if (target.kind === "commit") {
524
+ return filePath ? ["show", "--stat", "--patch", "--format=", target.hash, "--", filePath] : ["show", "--stat", "--patch", "--format=", target.hash, "--", ...reviewPathspecArgs];
525
+ }
526
+ const diffArgs = ["diff"];
527
+ if (target.kind === "staged") {
528
+ diffArgs.push("--cached");
529
+ }
530
+ diffArgs.push("--stat", "--patch", "--");
531
+ return filePath ? [...diffArgs, filePath] : [...diffArgs, ...reviewPathspecArgs];
532
+ }
533
+ function buildReviewTargetFileArgs(target) {
534
+ const reviewPathspecArgs = getReviewPathspecArgs();
535
+ if (target.kind === "commit") {
536
+ return ["show", "--pretty=format:", "--name-only", target.hash, "--", ...reviewPathspecArgs];
537
+ }
538
+ const diffArgs = ["diff"];
539
+ if (target.kind === "staged") {
540
+ diffArgs.push("--cached");
541
+ }
542
+ return [...diffArgs, "--name-only", "--", ...reviewPathspecArgs];
543
+ }
544
+ function getReviewTargetFiles(target) {
545
+ const output = runGitCommand(buildReviewTargetFileArgs(target), {
546
+ allowFailure: true
547
+ });
548
+ return output.split("\n").map((line) => line.trim()).filter(Boolean);
549
+ }
550
+ function createWorkingTreeReviewOption(kind) {
551
+ const files = getReviewTargetFiles({
552
+ hash: kind,
553
+ kind});
554
+ const subject = kind === "unstaged" ? "\uC544\uC9C1 git add \uD558\uC9C0 \uC54A\uC740 \uBCC0\uACBD\uC0AC\uD56D" : "git add \uB41C \uBCC0\uACBD\uC0AC\uD56D";
555
+ return {
556
+ author: "",
557
+ description: `${subject} | ${formatReviewTargetFileCount(files.length)}`,
558
+ hash: kind,
559
+ kind,
560
+ label: kind,
561
+ relativeDate: "",
562
+ subject
563
+ };
564
+ }
509
565
  function getRecentCommitOptions() {
510
566
  const output = runGitCommand(
511
567
  ["log", `-${COMMIT_FETCH_LIMIT}`, "--date=relative", "--pretty=format:%h%x09%an%x09%ar%x09%s"],
@@ -521,62 +577,61 @@ function getRecentCommitOptions() {
521
577
  author,
522
578
  description: `${author} | ${relativeDate}`,
523
579
  hash,
580
+ kind: "commit",
524
581
  label: `${hash} | ${truncateCommitSubject(subject)}`,
525
582
  relativeDate,
526
583
  subject
527
584
  };
528
585
  });
529
586
  }
587
+ function getReviewTargetOptions() {
588
+ return [createWorkingTreeReviewOption("unstaged"), createWorkingTreeReviewOption("staged"), ...getRecentCommitOptions()];
589
+ }
530
590
  function buildSelectedCommitSummary(commits) {
531
- return commits.map((commit) => `- ${commit.hash} | ${commit.subject} | ${commit.author} | ${commit.relativeDate}`).join("\n");
591
+ return commits.map((commit) => buildReviewTargetSummaryLine(commit)).join("\n");
532
592
  }
533
593
  function getReviewPathspecArgs() {
534
594
  const { includePatterns, excludePatterns } = getGitDiffPathspecs();
535
595
  return [...includePatterns, ...excludePatterns];
536
596
  }
537
597
  function buildSelectedCommitDiff(commits) {
538
- const reviewPathspecArgs = getReviewPathspecArgs();
539
598
  const sections = commits.map((commit) => {
540
- const diff = runGitCommand(["show", "--stat", "--patch", "--format=", commit.hash, "--", ...reviewPathspecArgs], {
599
+ const diff = runGitCommand(buildReviewTargetDiffArgs(commit), {
541
600
  allowFailure: true,
542
601
  trimOutput: false
543
602
  }).trim();
544
603
  if (!diff) {
545
604
  return "";
546
605
  }
547
- return [`## ${commit.hash} ${commit.subject}`, diff].join("\n\n");
606
+ return [`## ${buildReviewTargetSectionTitle(commit)}`, diff].join("\n\n");
548
607
  }).filter(Boolean).join("\n\n");
549
608
  if (!sections) {
550
609
  return "";
551
610
  }
552
- return ["# \uC120\uD0DD\uD55C \uCEE4\uBC0B", buildSelectedCommitSummary(commits), "", "# \uB9AC\uBDF0 \uB300\uC0C1 diff", sections].join("\n");
611
+ return ["# \uC120\uD0DD\uD55C \uB9AC\uBDF0 \uB300\uC0C1", buildSelectedCommitSummary(commits), "", "# \uB9AC\uBDF0 \uB300\uC0C1 diff", sections].join("\n");
553
612
  }
554
613
  function getSelectedCommitFiles(commits) {
555
- const reviewPathspecArgs = getReviewPathspecArgs();
556
614
  const files = /* @__PURE__ */ new Set();
557
615
  commits.forEach((commit) => {
558
- const output = runGitCommand(["show", "--pretty=format:", "--name-only", commit.hash, "--", ...reviewPathspecArgs], {
559
- allowFailure: true
560
- });
561
- output.split("\n").map((line) => line.trim()).filter(Boolean).forEach((filePath) => files.add(filePath));
616
+ getReviewTargetFiles(commit).forEach((filePath) => files.add(filePath));
562
617
  });
563
618
  return [...files];
564
619
  }
565
620
  function buildSelectedFileDiff(commits, filePath) {
566
621
  const sections = commits.map((commit) => {
567
- const diff = runGitCommand(["show", "--stat", "--patch", "--format=", commit.hash, "--", filePath], {
622
+ const diff = runGitCommand(buildReviewTargetDiffArgs(commit, filePath), {
568
623
  allowFailure: true,
569
624
  trimOutput: false
570
625
  }).trim();
571
626
  if (!diff) {
572
627
  return "";
573
628
  }
574
- return [`## ${commit.hash} ${commit.subject}`, diff].join("\n\n");
629
+ return [`## ${buildReviewTargetSectionTitle(commit)}`, diff].join("\n\n");
575
630
  }).filter(Boolean).join("\n\n");
576
631
  if (!sections) {
577
632
  return "";
578
633
  }
579
- return ["# \uC120\uD0DD\uD55C \uCEE4\uBC0B", buildSelectedCommitSummary(commits), "", `# \uD30C\uC77C: ${filePath}`, sections].join("\n\n");
634
+ return ["# \uC120\uD0DD\uD55C \uB9AC\uBDF0 \uB300\uC0C1", buildSelectedCommitSummary(commits), "", `# \uD30C\uC77C: ${filePath}`, sections].join("\n\n");
580
635
  }
581
636
  function openReport(reportPath) {
582
637
  const resolvedPath = path.resolve(reportPath);
@@ -762,13 +817,13 @@ async function showMultiSelect(question, options, windowSize = COMMIT_SELECTION_
762
817
  });
763
818
  }
764
819
  async function selectReviewCommits() {
765
- const commits = getRecentCommitOptions();
820
+ const commits = getReviewTargetOptions();
766
821
  if (commits.length === 0) {
767
- console.log("\u2139\uFE0F \uB9AC\uBDF0\uD560 \uCD5C\uADFC \uCEE4\uBC0B\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
822
+ console.log("\u2139\uFE0F \uB9AC\uBDF0\uD560 \uB300\uC0C1\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
768
823
  return [];
769
824
  }
770
825
  return showMultiSelect(
771
- "\uB9AC\uBDF0\uD560 \uCEE4\uBC0B\uC744 \uC120\uD0DD\uD574\uC8FC\uC138\uC694.",
826
+ "\uB9AC\uBDF0\uD560 \uB300\uC0C1\uC744 \uC120\uD0DD\uD574\uC8FC\uC138\uC694.",
772
827
  commits.map((commit) => ({
773
828
  description: commit.description,
774
829
  label: commit.label,
@@ -1431,8 +1486,8 @@ async function main() {
1431
1486
  trace7("commit-selection:done", `count=${selectedCommits.length}`);
1432
1487
  if (selectedCommits.length === 0) {
1433
1488
  trace7("commit-selection:empty");
1434
- executionTitle = "\uC120\uD0DD\uB41C \uCEE4\uBC0B\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.";
1435
- console.log("\u2139\uFE0F \uC120\uD0DD\uB41C \uCEE4\uBC0B\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
1489
+ executionTitle = "\uC120\uD0DD\uB41C \uB9AC\uBDF0 \uB300\uC0C1\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.";
1490
+ console.log("\u2139\uFE0F \uC120\uD0DD\uB41C \uB9AC\uBDF0 \uB300\uC0C1\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
1436
1491
  deleteTempDiff();
1437
1492
  return;
1438
1493
  }
@@ -1445,8 +1500,8 @@ async function main() {
1445
1500
  console.log(`\u{1F4C2} \uB9AC\uBDF0 \uB300\uC0C1 \uD30C\uC77C(${fileList.length}\uAC1C): ${formatReviewTargetFiles(fileList)}`);
1446
1501
  if (fileList.length === 0) {
1447
1502
  trace7("empty-file-list:exit");
1448
- executionTitle = "\uC120\uD0DD\uD55C \uCEE4\uBC0B\uC5D0\uC11C \uB9AC\uBDF0 \uB300\uC0C1 \uD30C\uC77C \uBCC0\uACBD\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.";
1449
- console.log("\u2139\uFE0F \uC120\uD0DD\uD55C \uCEE4\uBC0B\uC5D0\uC11C \uB9AC\uBDF0 \uB300\uC0C1 \uD30C\uC77C \uBCC0\uACBD\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.");
1503
+ executionTitle = "\uC120\uD0DD\uD55C \uB9AC\uBDF0 \uB300\uC0C1\uC5D0\uC11C \uB9AC\uBDF0\uD560 \uBCC0\uACBD\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.";
1504
+ console.log("\u2139\uFE0F \uC120\uD0DD\uD55C \uB9AC\uBDF0 \uB300\uC0C1\uC5D0\uC11C \uB9AC\uBDF0\uD560 \uBCC0\uACBD\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.");
1450
1505
  deleteTempDiff();
1451
1506
  return;
1452
1507
  }
@@ -1720,5 +1775,3 @@ ${JSON.stringify(
1720
1775
  }
1721
1776
  }
1722
1777
  main();
1723
- //# sourceMappingURL=review-one-by-one.js.map
1724
- //# sourceMappingURL=review-one-by-one.js.map
@@ -209,15 +209,51 @@ function runGitCommand(args4, 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
- const child = spawn("/bin/zsh", ["-lc", command], {
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(() => {
@@ -596,6 +632,62 @@ function truncateCommitSubject(subject) {
596
632
  }
597
633
  return `${subject.slice(0, 69)}...`;
598
634
  }
635
+ function formatReviewTargetFileCount(fileCount) {
636
+ return fileCount === 0 ? "\uBCC0\uACBD \uC5C6\uC74C" : `${fileCount}\uAC1C \uD30C\uC77C`;
637
+ }
638
+ function buildReviewTargetSectionTitle(target) {
639
+ return target.kind === "commit" ? `${target.hash} ${target.subject}` : `${target.hash} | ${target.subject}`;
640
+ }
641
+ function buildReviewTargetSummaryLine(target) {
642
+ if (target.kind === "commit") {
643
+ return `- ${target.hash} | ${target.subject} | ${target.author} | ${target.relativeDate}`;
644
+ }
645
+ return `- ${target.hash} | ${target.subject}`;
646
+ }
647
+ function buildReviewTargetDiffArgs(target, filePath) {
648
+ const reviewPathspecArgs = getReviewPathspecArgs();
649
+ if (target.kind === "commit") {
650
+ return ["show", "--stat", "--patch", "--format=", target.hash, "--", ...reviewPathspecArgs];
651
+ }
652
+ const diffArgs = ["diff"];
653
+ if (target.kind === "staged") {
654
+ diffArgs.push("--cached");
655
+ }
656
+ diffArgs.push("--stat", "--patch", "--");
657
+ return [...diffArgs, ...reviewPathspecArgs];
658
+ }
659
+ function buildReviewTargetFileArgs(target) {
660
+ const reviewPathspecArgs = getReviewPathspecArgs();
661
+ if (target.kind === "commit") {
662
+ return ["show", "--pretty=format:", "--name-only", target.hash, "--", ...reviewPathspecArgs];
663
+ }
664
+ const diffArgs = ["diff"];
665
+ if (target.kind === "staged") {
666
+ diffArgs.push("--cached");
667
+ }
668
+ return [...diffArgs, "--name-only", "--", ...reviewPathspecArgs];
669
+ }
670
+ function getReviewTargetFiles(target) {
671
+ const output = runGitCommand(buildReviewTargetFileArgs(target), {
672
+ allowFailure: true
673
+ });
674
+ return output.split("\n").map((line) => line.trim()).filter(Boolean);
675
+ }
676
+ function createWorkingTreeReviewOption(kind) {
677
+ const files = getReviewTargetFiles({
678
+ hash: kind,
679
+ kind});
680
+ const subject = kind === "unstaged" ? "\uC544\uC9C1 git add \uD558\uC9C0 \uC54A\uC740 \uBCC0\uACBD\uC0AC\uD56D" : "git add \uB41C \uBCC0\uACBD\uC0AC\uD56D";
681
+ return {
682
+ author: "",
683
+ description: `${subject} | ${formatReviewTargetFileCount(files.length)}`,
684
+ hash: kind,
685
+ kind,
686
+ label: kind,
687
+ relativeDate: "",
688
+ subject
689
+ };
690
+ }
599
691
  function getRecentCommitOptions() {
600
692
  const output = runGitCommand(
601
693
  ["log", `-${COMMIT_FETCH_LIMIT}`, "--date=relative", "--pretty=format:%h%x09%an%x09%ar%x09%s"],
@@ -611,44 +703,43 @@ function getRecentCommitOptions() {
611
703
  author,
612
704
  description: `${author} | ${relativeDate}`,
613
705
  hash,
706
+ kind: "commit",
614
707
  label: `${hash} | ${truncateCommitSubject(subject)}`,
615
708
  relativeDate,
616
709
  subject
617
710
  };
618
711
  });
619
712
  }
713
+ function getReviewTargetOptions() {
714
+ return [createWorkingTreeReviewOption("unstaged"), createWorkingTreeReviewOption("staged"), ...getRecentCommitOptions()];
715
+ }
620
716
  function buildSelectedCommitSummary(commits) {
621
- return commits.map((commit) => `- ${commit.hash} | ${commit.subject} | ${commit.author} | ${commit.relativeDate}`).join("\n");
717
+ return commits.map((commit) => buildReviewTargetSummaryLine(commit)).join("\n");
622
718
  }
623
719
  function getReviewPathspecArgs() {
624
720
  const { includePatterns, excludePatterns } = getGitDiffPathspecs();
625
721
  return [...includePatterns, ...excludePatterns];
626
722
  }
627
723
  function buildSelectedCommitDiff(commits) {
628
- const reviewPathspecArgs = getReviewPathspecArgs();
629
724
  const sections = commits.map((commit) => {
630
- const diff = runGitCommand(["show", "--stat", "--patch", "--format=", commit.hash, "--", ...reviewPathspecArgs], {
725
+ const diff = runGitCommand(buildReviewTargetDiffArgs(commit), {
631
726
  allowFailure: true,
632
727
  trimOutput: false
633
728
  }).trim();
634
729
  if (!diff) {
635
730
  return "";
636
731
  }
637
- return [`## ${commit.hash} ${commit.subject}`, diff].join("\n\n");
732
+ return [`## ${buildReviewTargetSectionTitle(commit)}`, diff].join("\n\n");
638
733
  }).filter(Boolean).join("\n\n");
639
734
  if (!sections) {
640
735
  return "";
641
736
  }
642
- return ["# \uC120\uD0DD\uD55C \uCEE4\uBC0B", buildSelectedCommitSummary(commits), "", "# \uB9AC\uBDF0 \uB300\uC0C1 diff", sections].join("\n");
737
+ return ["# \uC120\uD0DD\uD55C \uB9AC\uBDF0 \uB300\uC0C1", buildSelectedCommitSummary(commits), "", "# \uB9AC\uBDF0 \uB300\uC0C1 diff", sections].join("\n");
643
738
  }
644
739
  function getSelectedCommitFiles(commits) {
645
- const reviewPathspecArgs = getReviewPathspecArgs();
646
740
  const files = /* @__PURE__ */ new Set();
647
741
  commits.forEach((commit) => {
648
- const output = runGitCommand(["show", "--pretty=format:", "--name-only", commit.hash, "--", ...reviewPathspecArgs], {
649
- allowFailure: true
650
- });
651
- output.split("\n").map((line) => line.trim()).filter(Boolean).forEach((filePath) => files.add(filePath));
742
+ getReviewTargetFiles(commit).forEach((filePath) => files.add(filePath));
652
743
  });
653
744
  return [...files];
654
745
  }
@@ -836,13 +927,13 @@ async function showMultiSelect(question, options, windowSize = COMMIT_SELECTION_
836
927
  });
837
928
  }
838
929
  async function selectReviewCommits() {
839
- const commits = getRecentCommitOptions();
930
+ const commits = getReviewTargetOptions();
840
931
  if (commits.length === 0) {
841
- console.log("\u2139\uFE0F \uB9AC\uBDF0\uD560 \uCD5C\uADFC \uCEE4\uBC0B\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
932
+ console.log("\u2139\uFE0F \uB9AC\uBDF0\uD560 \uB300\uC0C1\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
842
933
  return [];
843
934
  }
844
935
  return showMultiSelect(
845
- "\uB9AC\uBDF0\uD560 \uCEE4\uBC0B\uC744 \uC120\uD0DD\uD574\uC8FC\uC138\uC694.",
936
+ "\uB9AC\uBDF0\uD560 \uB300\uC0C1\uC744 \uC120\uD0DD\uD574\uC8FC\uC138\uC694.",
846
937
  commits.map((commit) => ({
847
938
  description: commit.description,
848
939
  label: commit.label,
@@ -1509,8 +1600,8 @@ async function main() {
1509
1600
  trace7("commit-selection:done", `count=${selectedCommits.length}`);
1510
1601
  if (selectedCommits.length === 0) {
1511
1602
  trace7("commit-selection:empty");
1512
- executionTitle = "\uC120\uD0DD\uB41C \uCEE4\uBC0B\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.";
1513
- console.log("\u2139\uFE0F \uC120\uD0DD\uB41C \uCEE4\uBC0B\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
1603
+ executionTitle = "\uC120\uD0DD\uB41C \uB9AC\uBDF0 \uB300\uC0C1\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.";
1604
+ console.log("\u2139\uFE0F \uC120\uD0DD\uB41C \uB9AC\uBDF0 \uB300\uC0C1\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
1514
1605
  deleteTempDiff();
1515
1606
  return;
1516
1607
  }
@@ -1524,8 +1615,8 @@ async function main() {
1524
1615
  trace7("git-diff:build:done", `length=${diff.length}`);
1525
1616
  if (!diff.trim() && !isTest) {
1526
1617
  trace7("empty-diff:exit");
1527
- executionTitle = "\uC120\uD0DD\uD55C \uCEE4\uBC0B\uC5D0\uC11C \uB9AC\uBDF0 \uB300\uC0C1 \uD30C\uC77C \uBCC0\uACBD\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.";
1528
- console.log("\u2139\uFE0F \uC120\uD0DD\uD55C \uCEE4\uBC0B\uC5D0\uC11C \uB9AC\uBDF0 \uB300\uC0C1 \uD30C\uC77C \uBCC0\uACBD\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.");
1618
+ executionTitle = "\uC120\uD0DD\uD55C \uB9AC\uBDF0 \uB300\uC0C1\uC5D0\uC11C \uB9AC\uBDF0\uD560 \uBCC0\uACBD\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.";
1619
+ console.log("\u2139\uFE0F \uC120\uD0DD\uD55C \uB9AC\uBDF0 \uB300\uC0C1\uC5D0\uC11C \uB9AC\uBDF0\uD560 \uBCC0\uACBD\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.");
1529
1620
  deleteTempDiff();
1530
1621
  return;
1531
1622
  }
@@ -1680,5 +1771,3 @@ ${command}
1680
1771
  }
1681
1772
  }
1682
1773
  main();
1683
- //# sourceMappingURL=review.cjs.map
1684
- //# sourceMappingURL=review.cjs.map