diffprism 0.48.0 → 0.48.2

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/bin.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-24B33UN6.js";
6
6
  import {
7
7
  demo
8
- } from "./chunk-SWSRPUXO.js";
8
+ } from "./chunk-7UQM4WBZ.js";
9
9
  import {
10
10
  describeVersion,
11
11
  ensureServer,
@@ -14,7 +14,7 @@ import {
14
14
  readServerFile,
15
15
  startGlobalServer,
16
16
  submitReviewToServer
17
- } from "./chunk-AJGESVAM.js";
17
+ } from "./chunk-EPUCA2N5.js";
18
18
  import {
19
19
  getDiff
20
20
  } from "./chunk-QGWYCEJN.js";
@@ -379,7 +379,7 @@ async function setupInteractive(flags) {
379
379
  }
380
380
  async function runDemo(dev) {
381
381
  console.log("");
382
- const { demo: demo2 } = await import("./demo-7GBBKPPB.js");
382
+ const { demo: demo2 } = await import("./demo-VPKUCZT3.js");
383
383
  await demo2({ dev });
384
384
  }
385
385
  async function setupBatch(flags) {
@@ -826,7 +826,7 @@ async function fetchStatus(httpPort) {
826
826
  return await response.json();
827
827
  }
828
828
  function printStatus(status, httpPort) {
829
- const version = true ? "0.48.0" : "0.0.0-dev";
829
+ const version = true ? "0.48.2" : "0.0.0-dev";
830
830
  console.log(`
831
831
  DiffPrism v${version}
832
832
  `);
@@ -910,11 +910,16 @@ async function preCommitHook(flags = {}) {
910
910
  }
911
911
  const decision = review2?.decision;
912
912
  if (decision === "approved" || decision === "approved_with_comments") {
913
+ const summary = review2?.summary?.trim();
914
+ const comments = review2?.comments ?? [];
915
+ if (summary || comments.length > 0) {
916
+ printFeedback(review2);
917
+ }
913
918
  console.error(`Review: ${decision} \u2014 proceeding.`);
914
919
  process.exit(0);
915
920
  }
916
921
  if (decision === "changes_requested") {
917
- printComments(review2?.comments ?? []);
922
+ printFeedback(review2);
918
923
  fail("Commit blocked: the review requested changes.");
919
924
  return;
920
925
  }
@@ -926,11 +931,24 @@ async function preCommitHook(flags = {}) {
926
931
  `Commit blocked: no review decision was returned (got ${String(decision)}).`
927
932
  );
928
933
  }
929
- function printComments(comments) {
930
- if (comments.length === 0) {
934
+ function printFeedback(review2) {
935
+ const summary = review2?.summary?.trim();
936
+ const comments = review2?.comments ?? [];
937
+ console.error("");
938
+ if (!summary && comments.length === 0) {
939
+ console.error(" The review left no summary and no inline comments.");
940
+ console.error(" Ask what needs changing \u2014 there is nothing here to act on.");
941
+ console.error("");
931
942
  return;
932
943
  }
933
- console.error("");
944
+ if (summary) {
945
+ for (const line of summary.split("\n")) {
946
+ console.error(` ${line}`);
947
+ }
948
+ if (comments.length > 0) {
949
+ console.error("");
950
+ }
951
+ }
934
952
  for (const c of comments) {
935
953
  console.error(` ${c.file}:${c.line} [${c.type}] ${c.body}`);
936
954
  }
@@ -1050,7 +1068,7 @@ function fail(text) {
1050
1068
  var program = new Command();
1051
1069
  program.name("diffprism").description("Local-first code review tool for agent-generated changes").version(
1052
1070
  describeVersion(
1053
- true ? "0.48.0" : "0.0.0-dev"
1071
+ true ? "0.48.2" : "0.0.0-dev"
1054
1072
  )
1055
1073
  );
1056
1074
  program.action(defaultAction);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ensureServer,
3
3
  submitReviewToServer
4
- } from "./chunk-AJGESVAM.js";
4
+ } from "./chunk-EPUCA2N5.js";
5
5
  import {
6
6
  parseDiff
7
7
  } from "./chunk-QGWYCEJN.js";
@@ -273,15 +273,22 @@ import { fileURLToPath as fileURLToPath2 } from "url";
273
273
  function getBuildInfo() {
274
274
  let dir = path3.dirname(fileURLToPath2(import.meta.url));
275
275
  while (dir !== path3.dirname(dir)) {
276
- if (fs3.existsSync(path3.join(dir, "package.json"))) {
277
- if (fs3.existsSync(path3.join(dir, ".git"))) {
278
- return { dev: true, root: dir };
279
- }
276
+ const manifest = path3.join(dir, "package.json");
277
+ if (fs3.existsSync(manifest) && isOwnManifest(manifest)) {
278
+ return fs3.existsSync(path3.join(dir, ".git")) ? { dev: true, root: dir } : { dev: false, root: null };
280
279
  }
281
280
  dir = path3.dirname(dir);
282
281
  }
283
282
  return { dev: false, root: null };
284
283
  }
284
+ function isOwnManifest(manifestPath) {
285
+ try {
286
+ const manifest = JSON.parse(fs3.readFileSync(manifestPath, "utf8"));
287
+ return manifest.name === "diffprism";
288
+ } catch {
289
+ return false;
290
+ }
291
+ }
285
292
  function describeVersion(version) {
286
293
  const info = getBuildInfo();
287
294
  return info.dev ? `${version} (dev build \u2014 ${info.root})` : version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  demo
3
- } from "./chunk-SWSRPUXO.js";
4
- import "./chunk-AJGESVAM.js";
3
+ } from "./chunk-7UQM4WBZ.js";
4
+ import "./chunk-EPUCA2N5.js";
5
5
  import "./chunk-QGWYCEJN.js";
6
6
  import "./chunk-DHCVZGHE.js";
7
7
  import "./chunk-JSBRDJBE.js";
@@ -6,7 +6,7 @@ import {
6
6
  ensureServer,
7
7
  isServerAlive,
8
8
  submitReviewToServer
9
- } from "./chunk-AJGESVAM.js";
9
+ } from "./chunk-EPUCA2N5.js";
10
10
  import {
11
11
  getDiff
12
12
  } from "./chunk-QGWYCEJN.js";
@@ -144,7 +144,7 @@ async function handlePrReview(pr, options) {
144
144
  async function startMcpServer() {
145
145
  const server = new McpServer({
146
146
  name: "diffprism",
147
- version: true ? "0.48.0" : "0.0.0-dev"
147
+ version: true ? "0.48.2" : "0.0.0-dev"
148
148
  });
149
149
  server.tool(
150
150
  "open_review",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diffprism",
3
- "version": "0.48.0",
3
+ "version": "0.48.2",
4
4
  "type": "module",
5
5
  "description": "Local-first code review tool for agent-generated code changes",
6
6
  "bin": {