diffprism 0.13.7 → 0.13.8
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 +33 -1
- package/dist/mcp-server.js +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -247,6 +247,34 @@ function setupSkill(gitRoot, global, force) {
|
|
|
247
247
|
fs.writeFileSync(filePath, skillContent);
|
|
248
248
|
return { action, filePath };
|
|
249
249
|
}
|
|
250
|
+
function cleanDiffprismHooks(gitRoot) {
|
|
251
|
+
const filePath = path.join(gitRoot, ".claude", "settings.json");
|
|
252
|
+
const existing = readJsonFile(filePath);
|
|
253
|
+
const hooks = existing.hooks;
|
|
254
|
+
if (!hooks) return { removed: 0 };
|
|
255
|
+
const stopHooks = hooks.Stop;
|
|
256
|
+
if (!Array.isArray(stopHooks) || stopHooks.length === 0) {
|
|
257
|
+
return { removed: 0 };
|
|
258
|
+
}
|
|
259
|
+
const filtered = stopHooks.filter((entry) => {
|
|
260
|
+
const innerHooks = entry.hooks;
|
|
261
|
+
if (!Array.isArray(innerHooks)) return true;
|
|
262
|
+
return !innerHooks.some((h) => {
|
|
263
|
+
const cmd = h.command;
|
|
264
|
+
return typeof cmd === "string" && cmd.includes("diffprism") && cmd.includes("notify-stop");
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
const removed = stopHooks.length - filtered.length;
|
|
268
|
+
if (removed > 0) {
|
|
269
|
+
if (filtered.length > 0) {
|
|
270
|
+
hooks.Stop = filtered;
|
|
271
|
+
} else {
|
|
272
|
+
delete hooks.Stop;
|
|
273
|
+
}
|
|
274
|
+
writeJsonFile(filePath, { ...existing, hooks });
|
|
275
|
+
}
|
|
276
|
+
return { removed };
|
|
277
|
+
}
|
|
250
278
|
function setupStopHook(gitRoot, force) {
|
|
251
279
|
const filePath = path.join(gitRoot, ".claude", "settings.json");
|
|
252
280
|
const existing = readJsonFile(filePath);
|
|
@@ -336,6 +364,10 @@ async function setup(flags) {
|
|
|
336
364
|
result[mcp.action === "skipped" ? "skipped" : mcp.action === "created" ? "created" : "updated"].push(mcp.filePath);
|
|
337
365
|
const settings = setupClaudeSettings(gitRoot, force);
|
|
338
366
|
result[settings.action === "skipped" ? "skipped" : settings.action === "created" ? "created" : "updated"].push(settings.filePath);
|
|
367
|
+
const cleaned = cleanDiffprismHooks(gitRoot);
|
|
368
|
+
if (cleaned.removed > 0) {
|
|
369
|
+
console.log(` Cleaned ${cleaned.removed} stale hook(s)`);
|
|
370
|
+
}
|
|
339
371
|
const hook = setupStopHook(gitRoot, force);
|
|
340
372
|
result[hook.action === "skipped" ? "skipped" : hook.action === "created" ? "created" : "updated"].push(hook.filePath);
|
|
341
373
|
const skill = setupSkill(gitRoot, global, force);
|
|
@@ -431,7 +463,7 @@ async function notifyStop() {
|
|
|
431
463
|
|
|
432
464
|
// cli/src/index.ts
|
|
433
465
|
var program = new Command();
|
|
434
|
-
program.name("diffprism").description("Local-first code review tool for agent-generated changes").version(true ? "0.13.
|
|
466
|
+
program.name("diffprism").description("Local-first code review tool for agent-generated changes").version(true ? "0.13.8" : "0.0.0-dev");
|
|
435
467
|
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);
|
|
436
468
|
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);
|
|
437
469
|
program.command("notify-stop").description("Signal the watch server to refresh (used by Claude Code hooks)").action(notifyStop);
|
package/dist/mcp-server.js
CHANGED