diffprism 0.40.0 → 0.41.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
@@ -11,14 +11,14 @@ import {
11
11
  } from "./chunk-6J6PSBL2.js";
12
12
  import {
13
13
  demo
14
- } from "./chunk-FCDO5LRP.js";
14
+ } from "./chunk-HEJVY4S7.js";
15
15
  import {
16
16
  ensureServer,
17
17
  isServerAlive,
18
18
  readServerFile,
19
19
  startGlobalServer,
20
20
  submitReviewToServer
21
- } from "./chunk-2HMWCMPU.js";
21
+ } from "./chunk-7UMTB6LW.js";
22
22
  import "./chunk-QGWYCEJN.js";
23
23
  import "./chunk-DHCVZGHE.js";
24
24
  import "./chunk-JSBRDJBE.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-75VOJNCC.js");
382
+ const { demo: demo2 } = await import("./demo-UIN5MTWR.js");
383
383
  await demo2({ dev });
384
384
  }
385
385
  async function setupBatch(flags) {
@@ -806,9 +806,64 @@ async function serverStop() {
806
806
  }
807
807
  }
808
808
 
809
+ // cli/src/commands/default.ts
810
+ import open from "open";
811
+ function formatUptime(seconds) {
812
+ if (seconds < 60) return `${Math.floor(seconds)}s`;
813
+ if (seconds < 3600) return `${Math.floor(seconds / 60)}m ${Math.floor(seconds % 60)}s`;
814
+ const hours = Math.floor(seconds / 3600);
815
+ const mins = Math.floor(seconds % 3600 / 60);
816
+ return `${hours}h ${mins}m`;
817
+ }
818
+ async function fetchStatus(httpPort) {
819
+ const response = await fetch(`http://localhost:${httpPort}/api/status`, {
820
+ signal: AbortSignal.timeout(2e3)
821
+ });
822
+ return await response.json();
823
+ }
824
+ function printStatus(status, httpPort) {
825
+ const version = true ? "0.41.1" : "0.0.0-dev";
826
+ console.log(`
827
+ DiffPrism v${version}
828
+ `);
829
+ console.log(` Server: running (PID ${status.pid}, uptime ${formatUptime(status.uptime)})`);
830
+ if (status.uiUrl) {
831
+ console.log(` Dashboard: ${status.uiUrl.split("?")[0]}`);
832
+ } else {
833
+ console.log(` API: http://localhost:${httpPort}`);
834
+ }
835
+ console.log(` Sessions: ${status.sessions} active`);
836
+ console.log();
837
+ console.log(` Quick start:`);
838
+ console.log(` diffprism review Review local changes`);
839
+ console.log(` diffprism review --staged Review staged changes`);
840
+ console.log(` diffprism setup Set up Claude Code integration`);
841
+ console.log(` diffprism --help Show all commands`);
842
+ console.log();
843
+ }
844
+ async function defaultAction() {
845
+ let info = await isServerAlive();
846
+ if (!info) {
847
+ console.log("Starting DiffPrism...");
848
+ info = await ensureServer();
849
+ }
850
+ try {
851
+ const status = await fetchStatus(info.httpPort);
852
+ printStatus(status, info.httpPort);
853
+ if (status.uiUrl) {
854
+ await open(status.uiUrl);
855
+ }
856
+ } catch (err) {
857
+ const message = err instanceof Error ? err.message : String(err);
858
+ console.error(`Error fetching server status: ${message}`);
859
+ process.exit(1);
860
+ }
861
+ }
862
+
809
863
  // cli/src/index.ts
810
864
  var program = new Command();
811
- program.name("diffprism").description("Local-first code review tool for agent-generated changes").version(true ? "0.40.0" : "0.0.0-dev");
865
+ program.name("diffprism").description("Local-first code review tool for agent-generated changes").version(true ? "0.41.1" : "0.0.0-dev");
866
+ program.action(defaultAction);
812
867
  program.command("demo").description("Open a sample review to see DiffPrism in action").option("--dev", "Use Vite dev server").action(demo);
813
868
  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);
814
869
  program.command("review-pr <pr>", { hidden: true }).action((pr, flags) => review(pr, flags));
@@ -482,6 +482,7 @@ var clientSessions = /* @__PURE__ */ new Map();
482
482
  var sessionWatchers = /* @__PURE__ */ new Map();
483
483
  var serverPollInterval = 2e3;
484
484
  var reopenBrowserIfNeeded = null;
485
+ var serverUiUrl = null;
485
486
  function toSummary(session) {
486
487
  const { payload } = session;
487
488
  const fileCount = payload.diffSet.files.length;
@@ -684,7 +685,8 @@ async function handleApiRequest(req, res) {
684
685
  running: true,
685
686
  pid: process.pid,
686
687
  sessions: sessions.size,
687
- uptime: process.uptime()
688
+ uptime: process.uptime(),
689
+ uiUrl: serverUiUrl
688
690
  });
689
691
  return true;
690
692
  }
@@ -1243,6 +1245,7 @@ Waiting for reviews...
1243
1245
  `);
1244
1246
  }
1245
1247
  const uiUrl = `http://localhost:${uiPort}?wsPort=${wsPort}&httpPort=${httpPort}&serverMode=true`;
1248
+ serverUiUrl = uiUrl;
1246
1249
  if (openBrowser) {
1247
1250
  await open(uiUrl);
1248
1251
  }
@@ -1264,6 +1267,7 @@ Waiting for reviews...
1264
1267
  clientSessions.clear();
1265
1268
  sessions.clear();
1266
1269
  reopenBrowserIfNeeded = null;
1270
+ serverUiUrl = null;
1267
1271
  await new Promise((resolve) => {
1268
1272
  httpServer.close(() => resolve());
1269
1273
  });
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ensureServer,
3
3
  submitReviewToServer
4
- } from "./chunk-2HMWCMPU.js";
4
+ } from "./chunk-7UMTB6LW.js";
5
5
  import {
6
6
  parseDiff
7
7
  } from "./chunk-QGWYCEJN.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  demo
3
- } from "./chunk-FCDO5LRP.js";
4
- import "./chunk-2HMWCMPU.js";
3
+ } from "./chunk-HEJVY4S7.js";
4
+ import "./chunk-7UMTB6LW.js";
5
5
  import "./chunk-QGWYCEJN.js";
6
6
  import "./chunk-DHCVZGHE.js";
7
7
  import "./chunk-JSBRDJBE.js";
@@ -12,7 +12,7 @@ import {
12
12
  ensureServer,
13
13
  isServerAlive,
14
14
  submitReviewToServer
15
- } from "./chunk-2HMWCMPU.js";
15
+ } from "./chunk-7UMTB6LW.js";
16
16
  import {
17
17
  getDiff
18
18
  } from "./chunk-QGWYCEJN.js";
@@ -152,7 +152,7 @@ async function handlePrReview(pr, options) {
152
152
  async function startMcpServer() {
153
153
  const server = new McpServer({
154
154
  name: "diffprism",
155
- version: true ? "0.40.0" : "0.0.0-dev"
155
+ version: true ? "0.41.1" : "0.0.0-dev"
156
156
  });
157
157
  server.tool(
158
158
  "open_review",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diffprism",
3
- "version": "0.40.0",
3
+ "version": "0.41.1",
4
4
  "type": "module",
5
5
  "description": "Local-first code review tool for agent-generated code changes",
6
6
  "bin": {