diffprism 1.4.0 → 1.4.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/README.md
CHANGED
|
@@ -113,7 +113,7 @@ DiffPrism also works for reviewing local agent-generated changes:
|
|
|
113
113
|
```bash
|
|
114
114
|
diffprism review # Review all changes (staged + unstaged)
|
|
115
115
|
diffprism review --staged # Staged changes only
|
|
116
|
-
diffprism review HEAD~3
|
|
116
|
+
diffprism review HEAD~3..HEAD # Last 3 commits
|
|
117
117
|
diffprism review main..feature # Branch diff
|
|
118
118
|
```
|
|
119
119
|
|
|
@@ -181,6 +181,7 @@ skill tells them so.
|
|
|
181
181
|
## CLI Reference
|
|
182
182
|
|
|
183
183
|
```bash
|
|
184
|
+
diffprism demo # Open a sample review
|
|
184
185
|
diffprism review <ref> # Open a review (PR URL, git ref, or flags)
|
|
185
186
|
diffprism setup # Configure Claude Code integration
|
|
186
187
|
diffprism setup --global # Global setup (no git repo needed)
|
|
@@ -189,10 +190,12 @@ diffprism server status # Check server status
|
|
|
189
190
|
diffprism server stop # Stop the server
|
|
190
191
|
diffprism hook install # Gate commits on a review
|
|
191
192
|
diffprism hook uninstall # Remove the gate
|
|
193
|
+
diffprism hook pre-commit # Run the gate (what the installed hook calls)
|
|
192
194
|
diffprism reply --session <id> <annotation-id> "…" # Answer a reviewer's question, as the agent
|
|
193
195
|
diffprism feedback # Share feedback as a prefilled GitHub issue
|
|
194
196
|
diffprism feedback --bug # Report a bug, including the last error
|
|
195
197
|
diffprism teardown # Remove configuration
|
|
198
|
+
diffprism serve # Run the MCP server over stdio (your MCP client launches this)
|
|
196
199
|
```
|
|
197
200
|
|
|
198
201
|
## Feedback
|
|
@@ -215,6 +218,7 @@ cd diffprism
|
|
|
215
218
|
pnpm install
|
|
216
219
|
pnpm test
|
|
217
220
|
pnpm run build
|
|
221
|
+
pnpm docs:check # Fail if docs disagree with the code (runs in CI)
|
|
218
222
|
pnpm cli review --staged # Run CLI from source
|
|
219
223
|
```
|
|
220
224
|
|
package/dist/bin.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-RFDSC6MC.js";
|
|
6
6
|
import {
|
|
7
7
|
demo
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GF455BBV.js";
|
|
9
9
|
import {
|
|
10
10
|
COMMIT_GATE_DIFF_REF,
|
|
11
11
|
DEFAULT_DIFF_REF,
|
|
@@ -26,14 +26,14 @@ import {
|
|
|
26
26
|
recordError,
|
|
27
27
|
startGlobalServer,
|
|
28
28
|
submitReviewToServer
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-YGUHES4P.js";
|
|
30
30
|
import {
|
|
31
31
|
getDiff
|
|
32
32
|
} from "./chunk-GGK6TIQZ.js";
|
|
33
33
|
import "./chunk-DHCVZGHE.js";
|
|
34
34
|
import "./chunk-JSBRDJBE.js";
|
|
35
35
|
|
|
36
|
-
// cli/src/
|
|
36
|
+
// cli/src/program.ts
|
|
37
37
|
import { Command } from "commander";
|
|
38
38
|
|
|
39
39
|
// cli/src/commands/hook.ts
|
|
@@ -721,7 +721,7 @@ async function setupInteractive(flags) {
|
|
|
721
721
|
}
|
|
722
722
|
async function runDemo(dev) {
|
|
723
723
|
console.log("");
|
|
724
|
-
const { demo: demo2 } = await import("./demo-
|
|
724
|
+
const { demo: demo2 } = await import("./demo-F47GIDSV.js");
|
|
725
725
|
await demo2({ dev });
|
|
726
726
|
}
|
|
727
727
|
async function setupBatch(flags) {
|
|
@@ -1218,33 +1218,38 @@ ${url}`
|
|
|
1218
1218
|
}
|
|
1219
1219
|
}
|
|
1220
1220
|
|
|
1221
|
+
// cli/src/program.ts
|
|
1222
|
+
function createProgram() {
|
|
1223
|
+
const program = new Command();
|
|
1224
|
+
program.name("diffprism").description("Local-first code review tool for agent-generated changes").version(describeVersion(currentVersion()));
|
|
1225
|
+
program.action(defaultAction);
|
|
1226
|
+
program.command("demo").description("Open a sample review to see DiffPrism in action").option("--dev", "Use Vite dev server").action(demo);
|
|
1227
|
+
program.command("review [ref]").description("Open a browser-based diff review (local git ref or GitHub PR ref like owner/repo#123)").option("--staged", "Review staged changes").option("--unstaged", "Review unstaged changes").option("-t, --title <title>", "Review title").option("--reasoning <text>", "Agent reasoning about the changes").option("--dev", "Use Vite dev server with HMR instead of static files").option("--post-to-github", "Automatically post review back to GitHub without prompting").action(review);
|
|
1228
|
+
program.command("review-pr <pr>", { hidden: true }).action((pr, flags) => review(pr, flags));
|
|
1229
|
+
const hookCmd = program.command("hook").description("Git hook integration \u2014 gate commits on a human review");
|
|
1230
|
+
hookCmd.command("pre-commit").description("Run the review gate for the staged changes (called from a git hook)").option("--min-lines <n>", "Staged lines required to trigger a review (default: 120)").option("--dev", "Use Vite dev server").action((flags) => {
|
|
1231
|
+
void preCommitHook(flags);
|
|
1232
|
+
});
|
|
1233
|
+
hookCmd.command("install").description("Add the diffprism gate to this repo's pre-commit hook").action(() => {
|
|
1234
|
+
installHook();
|
|
1235
|
+
});
|
|
1236
|
+
hookCmd.command("uninstall").description("Remove the diffprism gate from this repo's pre-commit hook").action(() => {
|
|
1237
|
+
uninstallHook();
|
|
1238
|
+
});
|
|
1239
|
+
program.command("feedback").description("Open a prefilled GitHub issue to share feedback or report a bug \u2014 you review it before anything is sent").option("--bug", "Report a bug, including the last error DiffPrism hit").option("-m, --message <text>", "Start the issue with this text").option("--print", "Print the issue URL instead of opening a browser").action((flags) => feedback(flags));
|
|
1240
|
+
program.command("reply <annotation-id> <message...>").description("Answer a reviewer's question on an open review, as the agent").requiredOption("--session <id>", "The review the question is on").option("--agent <name>", "Name shown on the reply", "agent").action((annotationId, message2, flags) => reply(annotationId, message2, flags));
|
|
1241
|
+
program.command("serve").description("Start the MCP server for Claude Code integration").action(serve);
|
|
1242
|
+
program.command("setup").description("Configure DiffPrism for Claude Code integration").option("--global", "Configure globally (skill + permissions, no git repo required)").option("--force", "Overwrite existing configuration files").option("--dev", "Use Vite dev server").option("--no-demo", "Skip the demo review after setup").action((flags) => {
|
|
1243
|
+
setup(flags);
|
|
1244
|
+
});
|
|
1245
|
+
program.command("teardown").description("Remove DiffPrism configuration from the current project").option("--global", "Remove global configuration (skill + permissions at ~/.claude/)").option("-q, --quiet", "Suppress output").action((flags) => {
|
|
1246
|
+
teardown(flags);
|
|
1247
|
+
});
|
|
1248
|
+
const serverCmd = program.command("server").description("Start the global DiffPrism server for multi-session reviews").option("-p, --port <port>", "HTTP API port (default: 24680)").option("--ws-port <port>", "WebSocket port (default: 24681)").option("--dev", "Use Vite dev server with HMR instead of static files").option("--background", "Start server as a background daemon").option("--_daemon", "Internal: run as spawned daemon (do not use directly)").action(server);
|
|
1249
|
+
serverCmd.command("status").description("Check if the global server is running and list active sessions").action(serverStatus);
|
|
1250
|
+
serverCmd.command("stop").description("Stop the running global server").action(serverStop);
|
|
1251
|
+
return program;
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1221
1254
|
// cli/src/index.ts
|
|
1222
|
-
|
|
1223
|
-
program.name("diffprism").description("Local-first code review tool for agent-generated changes").version(describeVersion(currentVersion()));
|
|
1224
|
-
program.action(defaultAction);
|
|
1225
|
-
program.command("demo").description("Open a sample review to see DiffPrism in action").option("--dev", "Use Vite dev server").action(demo);
|
|
1226
|
-
program.command("review [ref]").description("Open a browser-based diff review (local git ref or GitHub PR ref like owner/repo#123)").option("--staged", "Review staged changes").option("--unstaged", "Review unstaged changes").option("-t, --title <title>", "Review title").option("--reasoning <text>", "Agent reasoning about the changes").option("--dev", "Use Vite dev server with HMR instead of static files").option("--post-to-github", "Automatically post review back to GitHub without prompting").action(review);
|
|
1227
|
-
program.command("review-pr <pr>", { hidden: true }).action((pr, flags) => review(pr, flags));
|
|
1228
|
-
var hookCmd = program.command("hook").description("Git hook integration \u2014 gate commits on a human review");
|
|
1229
|
-
hookCmd.command("pre-commit").description("Run the review gate for the staged changes (called from a git hook)").option("--min-lines <n>", "Staged lines required to trigger a review (default: 120)").option("--dev", "Use Vite dev server").action((flags) => {
|
|
1230
|
-
void preCommitHook(flags);
|
|
1231
|
-
});
|
|
1232
|
-
hookCmd.command("install").description("Add the diffprism gate to this repo's pre-commit hook").action(() => {
|
|
1233
|
-
installHook();
|
|
1234
|
-
});
|
|
1235
|
-
hookCmd.command("uninstall").description("Remove the diffprism gate from this repo's pre-commit hook").action(() => {
|
|
1236
|
-
uninstallHook();
|
|
1237
|
-
});
|
|
1238
|
-
program.command("feedback").description("Open a prefilled GitHub issue to share feedback or report a bug \u2014 you review it before anything is sent").option("--bug", "Report a bug, including the last error DiffPrism hit").option("-m, --message <text>", "Start the issue with this text").option("--print", "Print the issue URL instead of opening a browser").action((flags) => feedback(flags));
|
|
1239
|
-
program.command("reply <annotation-id> <message...>").description("Answer a reviewer's question on an open review, as the agent").requiredOption("--session <id>", "The review the question is on").option("--agent <name>", "Name shown on the reply", "agent").action((annotationId, message2, flags) => reply(annotationId, message2, flags));
|
|
1240
|
-
program.command("serve").description("Start the MCP server for Claude Code integration").action(serve);
|
|
1241
|
-
program.command("setup").description("Configure DiffPrism for Claude Code integration").option("--global", "Configure globally (skill + permissions, no git repo required)").option("--force", "Overwrite existing configuration files").option("--dev", "Use Vite dev server").option("--no-demo", "Skip the demo review after setup").action((flags) => {
|
|
1242
|
-
setup(flags);
|
|
1243
|
-
});
|
|
1244
|
-
program.command("teardown").description("Remove DiffPrism configuration from the current project").option("--global", "Remove global configuration (skill + permissions at ~/.claude/)").option("-q, --quiet", "Suppress output").action((flags) => {
|
|
1245
|
-
teardown(flags);
|
|
1246
|
-
});
|
|
1247
|
-
var serverCmd = program.command("server").description("Start the global DiffPrism server for multi-session reviews").option("-p, --port <port>", "HTTP API port (default: 24680)").option("--ws-port <port>", "WebSocket port (default: 24681)").option("--dev", "Use Vite dev server with HMR instead of static files").option("--background", "Start server as a background daemon").option("--_daemon", "Internal: run as spawned daemon (do not use directly)").action(server);
|
|
1248
|
-
serverCmd.command("status").description("Check if the global server is running and list active sessions").action(serverStatus);
|
|
1249
|
-
serverCmd.command("stop").description("Stop the running global server").action(serverStop);
|
|
1250
|
-
program.parse();
|
|
1255
|
+
createProgram().parse();
|
|
@@ -96,12 +96,22 @@ function pickedUpByAgent(annotation, agentReadAt) {
|
|
|
96
96
|
return agentReadAt !== void 0 && agentReadAt > lastMessageAt(annotation);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
// packages/core/src/diff-scope.ts
|
|
100
|
+
var DEFAULT_DIFF_REF = "working-copy";
|
|
101
|
+
var COMMIT_GATE_DIFF_REF = "staged";
|
|
102
|
+
var DIFF_REF_DESCRIPTION = 'Which changes to review. "working-copy" (the default): everything not yet committed, staged and unstaged shown as separate groups. "staged": only what the next commit would contain. "unstaged": only edits not yet staged. Or a ref range such as "HEAD~3..HEAD" or "main..feature".';
|
|
103
|
+
|
|
104
|
+
// packages/core/src/feedback.ts
|
|
105
|
+
import fs3 from "fs";
|
|
106
|
+
import os2 from "os";
|
|
107
|
+
import path3 from "path";
|
|
108
|
+
|
|
99
109
|
// packages/core/src/build-info.ts
|
|
100
110
|
import fs2 from "fs";
|
|
101
111
|
import path2 from "path";
|
|
102
112
|
import { fileURLToPath } from "url";
|
|
103
113
|
function builtAt() {
|
|
104
|
-
return true ?
|
|
114
|
+
return true ? 1789619886717 : null;
|
|
105
115
|
}
|
|
106
116
|
function getBuildInfo() {
|
|
107
117
|
let dir = path2.dirname(fileURLToPath(import.meta.url));
|
|
@@ -127,19 +137,11 @@ function describeVersion(version) {
|
|
|
127
137
|
return info.dev ? `${version} (dev build \u2014 ${info.root})` : version;
|
|
128
138
|
}
|
|
129
139
|
|
|
130
|
-
// packages/core/src/diff-scope.ts
|
|
131
|
-
var DEFAULT_DIFF_REF = "working-copy";
|
|
132
|
-
var COMMIT_GATE_DIFF_REF = "staged";
|
|
133
|
-
var DIFF_REF_DESCRIPTION = 'Which changes to review. "working-copy" (the default): everything not yet committed, staged and unstaged shown as separate groups. "staged": only what the next commit would contain. "unstaged": only edits not yet staged. Or a ref range such as "HEAD~3..HEAD" or "main..feature".';
|
|
134
|
-
|
|
135
140
|
// packages/core/src/feedback.ts
|
|
136
|
-
import fs3 from "fs";
|
|
137
|
-
import os2 from "os";
|
|
138
|
-
import path3 from "path";
|
|
139
141
|
var ISSUES_NEW_URL = "https://github.com/CodeJonesW/diffprism/issues/new";
|
|
140
142
|
var MAX_ERROR_CHARS = 1500;
|
|
141
143
|
function currentVersion() {
|
|
142
|
-
return true ? "1.4.
|
|
144
|
+
return true ? "1.4.1" : "0.0.0-dev";
|
|
143
145
|
}
|
|
144
146
|
function describeEnvironment() {
|
|
145
147
|
return {
|
package/dist/mcp-server.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
recordError,
|
|
15
15
|
submitReviewToServer,
|
|
16
16
|
waitForDecision
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-YGUHES4P.js";
|
|
18
18
|
import {
|
|
19
19
|
getDiff
|
|
20
20
|
} from "./chunk-GGK6TIQZ.js";
|
|
@@ -124,7 +124,7 @@ var annotationSchema = z.object({
|
|
|
124
124
|
"other"
|
|
125
125
|
]).optional().describe("Category of the finding (defaults to 'other')")
|
|
126
126
|
});
|
|
127
|
-
|
|
127
|
+
function createMcpServer() {
|
|
128
128
|
const server = new McpServer({
|
|
129
129
|
name: "diffprism",
|
|
130
130
|
version: currentVersion()
|
|
@@ -568,11 +568,16 @@ ${available.join("\n")}`);
|
|
|
568
568
|
});
|
|
569
569
|
})
|
|
570
570
|
);
|
|
571
|
+
return server;
|
|
572
|
+
}
|
|
573
|
+
async function startMcpServer() {
|
|
574
|
+
const server = createMcpServer();
|
|
571
575
|
const transport = new StdioServerTransport();
|
|
572
576
|
await server.connect(transport);
|
|
573
577
|
}
|
|
574
578
|
export {
|
|
575
579
|
DEFAULT_WAIT_MS,
|
|
580
|
+
createMcpServer,
|
|
576
581
|
resolveTarget,
|
|
577
582
|
startMcpServer
|
|
578
583
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "diffprism",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local-first code review tool for agent-generated code changes",
|
|
6
6
|
"bin": {
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"dev": "pnpm -r run dev",
|
|
17
17
|
"lint": "pnpm -r run lint",
|
|
18
18
|
"test": "pnpm -r run test",
|
|
19
|
+
"docs:check": "pnpm -F diffprism-cli docs:check",
|
|
19
20
|
"cli": "pnpm -F @diffprism/ui build && tsx cli/src/index.ts",
|
|
20
21
|
"prepublishOnly": "pnpm run build"
|
|
21
22
|
},
|