diffprism 0.48.1 → 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 +24 -6
- package/dist/mcp-server.js +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -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.
|
|
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
|
-
|
|
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
|
|
930
|
-
|
|
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
|
-
|
|
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.
|
|
1071
|
+
true ? "0.48.2" : "0.0.0-dev"
|
|
1054
1072
|
)
|
|
1055
1073
|
);
|
|
1056
1074
|
program.action(defaultAction);
|
package/dist/mcp-server.js
CHANGED
|
@@ -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.
|
|
147
|
+
version: true ? "0.48.2" : "0.0.0-dev"
|
|
148
148
|
});
|
|
149
149
|
server.tool(
|
|
150
150
|
"open_review",
|