@klitchevo/code-council 0.1.4 → 0.2.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.
@@ -800,6 +800,30 @@ var gitReviewSchemaObj = z.object({
800
800
  output_format: z.enum(["markdown", "json", "html", "pr-comments"]).optional().describe("Output format for the review (default: markdown)")
801
801
  });
802
802
  var gitReviewSchema = gitReviewSchemaObj.shape;
803
+ function getBaseRef() {
804
+ const githubBaseRef = process.env.GITHUB_BASE_REF;
805
+ if (githubBaseRef) {
806
+ logger.debug("Using GITHUB_BASE_REF", { ref: githubBaseRef });
807
+ return `origin/${githubBaseRef}`;
808
+ }
809
+ try {
810
+ execSync("git rev-parse --verify main", {
811
+ encoding: "utf-8",
812
+ stdio: "pipe"
813
+ });
814
+ return "main";
815
+ } catch {
816
+ try {
817
+ execSync("git rev-parse --verify origin/main", {
818
+ encoding: "utf-8",
819
+ stdio: "pipe"
820
+ });
821
+ return "origin/main";
822
+ } catch {
823
+ return "main";
824
+ }
825
+ }
826
+ }
803
827
  function getGitDiff(reviewType = "staged", commitHash) {
804
828
  try {
805
829
  let command;
@@ -810,9 +834,11 @@ function getGitDiff(reviewType = "staged", commitHash) {
810
834
  case "unstaged":
811
835
  command = "git diff";
812
836
  break;
813
- case "diff":
814
- command = "git diff main..HEAD";
837
+ case "diff": {
838
+ const baseRef = getBaseRef();
839
+ command = `git diff ${baseRef}..HEAD`;
815
840
  break;
841
+ }
816
842
  case "commit":
817
843
  if (!commitHash) {
818
844
  throw new Error(
@@ -2191,4 +2217,4 @@ export {
2191
2217
  gitReviewSchema,
2192
2218
  handleGitReview
2193
2219
  };
2194
- //# sourceMappingURL=chunk-GKJH5C6Z.js.map
2220
+ //# sourceMappingURL=chunk-KO6UIMSL.js.map
@@ -5,7 +5,7 @@ import {
5
5
  formatForHostExtraction,
6
6
  handleGitReview,
7
7
  initializeConfig
8
- } from "./chunk-GKJH5C6Z.js";
8
+ } from "./chunk-KO6UIMSL.js";
9
9
  import "./chunk-IVKLQD6M.js";
10
10
  import "./chunk-SYMFCPGM.js";
11
11
  import {
@@ -1044,4 +1044,4 @@ export {
1044
1044
  processResult,
1045
1045
  runCli
1046
1046
  };
1047
- //# sourceMappingURL=cli-GQR62DBS.js.map
1047
+ //# sourceMappingURL=cli-M7YIR4XR.js.map
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  handleGitReview,
19
19
  initializeConfig,
20
20
  logger
21
- } from "./chunk-GKJH5C6Z.js";
21
+ } from "./chunk-KO6UIMSL.js";
22
22
  import "./chunk-IVKLQD6M.js";
23
23
  import "./chunk-SYMFCPGM.js";
24
24
  import {
@@ -1906,7 +1906,7 @@ ${r.review}
1906
1906
  var args = process.argv.slice(2);
1907
1907
  var command = args[0];
1908
1908
  if (command === "review" || command === "setup") {
1909
- import("./cli-GQR62DBS.js").then(async ({ processResult, runCli }) => {
1909
+ import("./cli-M7YIR4XR.js").then(async ({ processResult, runCli }) => {
1910
1910
  try {
1911
1911
  const result = await runCli(process.argv);
1912
1912
  if (result) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klitchevo/code-council",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "Multi-model AI code review server using OpenRouter - get diverse perspectives from multiple LLMs in parallel",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",