diffprism 0.17.0 → 0.17.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/dist/bin.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
startGlobalServer,
|
|
7
7
|
startReview,
|
|
8
8
|
startWatch
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4VXA6GCO.js";
|
|
10
10
|
|
|
11
11
|
// cli/src/index.ts
|
|
12
12
|
import { Command } from "commander";
|
|
@@ -629,7 +629,7 @@ async function serverStop() {
|
|
|
629
629
|
|
|
630
630
|
// cli/src/index.ts
|
|
631
631
|
var program = new Command();
|
|
632
|
-
program.name("diffprism").description("Local-first code review tool for agent-generated changes").version(true ? "0.17.
|
|
632
|
+
program.name("diffprism").description("Local-first code review tool for agent-generated changes").version(true ? "0.17.1" : "0.0.0-dev");
|
|
633
633
|
program.command("review [ref]").description("Open a browser-based diff review").option("--staged", "Review staged changes").option("--unstaged", "Review unstaged changes").option("-t, --title <title>", "Review title").option("--dev", "Use Vite dev server with HMR instead of static files").action(review);
|
|
634
634
|
program.command("start [ref]").description("Set up DiffPrism and start watching for changes").option("--staged", "Watch staged changes").option("--unstaged", "Watch unstaged changes").option("-t, --title <title>", "Review title").option("--interval <ms>", "Poll interval in milliseconds (default: 1000)").option("--dev", "Use Vite dev server with HMR instead of static files").option("--global", "Install skill globally (~/.claude/skills/)").option("--force", "Overwrite existing configuration files").action(start);
|
|
635
635
|
program.command("watch [ref]").description("Start a persistent diff watcher with live-updating browser UI").option("--staged", "Watch staged changes").option("--unstaged", "Watch unstaged changes").option("-t, --title <title>", "Review title").option("--interval <ms>", "Poll interval in milliseconds (default: 1000)").option("--dev", "Use Vite dev server with HMR instead of static files").action(watch);
|
|
@@ -1447,6 +1447,7 @@ import open3 from "open";
|
|
|
1447
1447
|
import { WebSocketServer as WebSocketServer3, WebSocket as WebSocket3 } from "ws";
|
|
1448
1448
|
var sessions2 = /* @__PURE__ */ new Map();
|
|
1449
1449
|
var clientSessions = /* @__PURE__ */ new Map();
|
|
1450
|
+
var reopenBrowserIfNeeded = null;
|
|
1450
1451
|
function toSummary(session) {
|
|
1451
1452
|
const { payload } = session;
|
|
1452
1453
|
const fileCount = payload.diffSet.files.length;
|
|
@@ -1558,6 +1559,7 @@ async function handleApiRequest(req, res) {
|
|
|
1558
1559
|
type: "session:added",
|
|
1559
1560
|
payload: toSummary(session)
|
|
1560
1561
|
});
|
|
1562
|
+
reopenBrowserIfNeeded?.();
|
|
1561
1563
|
jsonResponse(res, 201, { sessionId });
|
|
1562
1564
|
} catch {
|
|
1563
1565
|
jsonResponse(res, 400, { error: "Invalid request body" });
|
|
@@ -1770,6 +1772,18 @@ Waiting for reviews...
|
|
|
1770
1772
|
}
|
|
1771
1773
|
const uiUrl = `http://localhost:${uiPort}?wsPort=${wsPort}&serverMode=true`;
|
|
1772
1774
|
await open3(uiUrl);
|
|
1775
|
+
function hasConnectedClients() {
|
|
1776
|
+
if (!wss) return false;
|
|
1777
|
+
for (const client of wss.clients) {
|
|
1778
|
+
if (client.readyState === WebSocket3.OPEN) return true;
|
|
1779
|
+
}
|
|
1780
|
+
return false;
|
|
1781
|
+
}
|
|
1782
|
+
reopenBrowserIfNeeded = () => {
|
|
1783
|
+
if (!hasConnectedClients()) {
|
|
1784
|
+
open3(uiUrl);
|
|
1785
|
+
}
|
|
1786
|
+
};
|
|
1773
1787
|
async function stop() {
|
|
1774
1788
|
if (wss) {
|
|
1775
1789
|
for (const client of wss.clients) {
|
|
@@ -1780,6 +1794,7 @@ Waiting for reviews...
|
|
|
1780
1794
|
}
|
|
1781
1795
|
clientSessions.clear();
|
|
1782
1796
|
sessions2.clear();
|
|
1797
|
+
reopenBrowserIfNeeded = null;
|
|
1783
1798
|
await new Promise((resolve) => {
|
|
1784
1799
|
httpServer.close(() => resolve());
|
|
1785
1800
|
});
|
package/dist/mcp-server.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
readReviewResult,
|
|
8
8
|
readWatchFile,
|
|
9
9
|
startReview
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4VXA6GCO.js";
|
|
11
11
|
|
|
12
12
|
// packages/mcp-server/src/index.ts
|
|
13
13
|
import fs from "fs";
|
|
@@ -76,7 +76,7 @@ async function reviewViaGlobalServer(serverInfo, diffRef, options) {
|
|
|
76
76
|
async function startMcpServer() {
|
|
77
77
|
const server = new McpServer({
|
|
78
78
|
name: "diffprism",
|
|
79
|
-
version: true ? "0.17.
|
|
79
|
+
version: true ? "0.17.1" : "0.0.0-dev"
|
|
80
80
|
});
|
|
81
81
|
server.tool(
|
|
82
82
|
"open_review",
|