@kosinal/claude-code-dashboard 0.0.6 → 0.0.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.
Files changed (2) hide show
  1. package/dist/bin.js +54 -5
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -12,7 +12,14 @@ import * as path from "path";
12
12
  var MARKER_QUICK = "__claude_code_dashboard_quick__";
13
13
  var MARKER_INSTALL = "__claude_code_dashboard_install__";
14
14
  var MARKER_LEGACY = "__claude_code_dashboard__";
15
- var HOOK_EVENTS = ["SessionStart", "UserPromptSubmit", "Stop", "SessionEnd"];
15
+ var HOOK_EVENTS = [
16
+ "SessionStart",
17
+ "UserPromptSubmit",
18
+ "Stop",
19
+ "SessionEnd",
20
+ "PermissionRequest",
21
+ "PostToolUse"
22
+ ];
16
23
  function getConfigDir(configDir) {
17
24
  return configDir ?? path.join(os.homedir(), ".claude");
18
25
  }
@@ -603,7 +610,15 @@ function removeLockFile() {
603
610
  import * as http from "http";
604
611
 
605
612
  // src/dashboard.ts
613
+ function getVersion() {
614
+ try {
615
+ return "0.0.8";
616
+ } catch {
617
+ return "dev";
618
+ }
619
+ }
606
620
  function getDashboardHtml() {
621
+ const version = getVersion();
607
622
  return `<!DOCTYPE html>
608
623
  <html lang="en">
609
624
  <head>
@@ -636,6 +651,13 @@ function getDashboardHtml() {
636
651
  color: #f0f6fc;
637
652
  }
638
653
 
654
+ .version {
655
+ font-size: 12px;
656
+ font-weight: 400;
657
+ color: #6e7681;
658
+ margin-left: 8px;
659
+ }
660
+
639
661
  .header-right {
640
662
  display: flex;
641
663
  align-items: center;
@@ -1004,7 +1026,7 @@ function getDashboardHtml() {
1004
1026
  </head>
1005
1027
  <body>
1006
1028
  <header>
1007
- <h1>Claude Code Dashboard</h1>
1029
+ <h1>Claude Code Dashboard <span class="version">v${version}</span></h1>
1008
1030
  <div class="header-right">
1009
1031
  <div class="notification-toggle">
1010
1032
  <label class="toggle-switch">
@@ -1436,7 +1458,13 @@ var EVENT_TO_STATUS = {
1436
1458
  UserPromptSubmit: "running",
1437
1459
  Stop: "done"
1438
1460
  };
1439
- var INTERACTIVE_TOOLS = /* @__PURE__ */ new Set(["ExitPlanMode", "AskUserQuestion"]);
1461
+ var INTERACTIVE_TOOLS = /* @__PURE__ */ new Set([
1462
+ "ExitPlanMode",
1463
+ "AskUserQuestion",
1464
+ "Write",
1465
+ "Edit",
1466
+ "NotebookEdit"
1467
+ ]);
1440
1468
  function createStore() {
1441
1469
  const sessions = /* @__PURE__ */ new Map();
1442
1470
  return {
@@ -1455,6 +1483,14 @@ function createStore() {
1455
1483
  const toolName = typeof payload.tool_name === "string" ? payload.tool_name : "";
1456
1484
  displayEvent = toolName || hook_event_name;
1457
1485
  status = INTERACTIVE_TOOLS.has(toolName) ? "waiting" : "running";
1486
+ } else if (hook_event_name === "PermissionRequest") {
1487
+ const toolName = typeof payload.tool_name === "string" ? payload.tool_name : "";
1488
+ displayEvent = toolName || hook_event_name;
1489
+ status = "waiting";
1490
+ } else if (hook_event_name === "PostToolUse") {
1491
+ const toolName = typeof payload.tool_name === "string" ? payload.tool_name : "";
1492
+ displayEvent = toolName || hook_event_name;
1493
+ status = "running";
1458
1494
  } else {
1459
1495
  const mapped = EVENT_TO_STATUS[hook_event_name];
1460
1496
  if (!mapped) {
@@ -1685,11 +1721,24 @@ async function stopServer() {
1685
1721
  function main() {
1686
1722
  const { port, command, noHooks, noOpen } = parseArgs(process.argv);
1687
1723
  if (command === "install") {
1688
- install(port);
1724
+ (async () => {
1725
+ await stopServer();
1726
+ uninstall();
1727
+ install(port);
1728
+ })().catch((err) => {
1729
+ console.error("Install failed:", err);
1730
+ process.exit(1);
1731
+ });
1689
1732
  return;
1690
1733
  }
1691
1734
  if (command === "uninstall") {
1692
- uninstall();
1735
+ (async () => {
1736
+ await stopServer();
1737
+ uninstall();
1738
+ })().catch((err) => {
1739
+ console.error("Uninstall failed:", err);
1740
+ process.exit(1);
1741
+ });
1693
1742
  return;
1694
1743
  }
1695
1744
  if (command === "stop") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kosinal/claude-code-dashboard",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "type": "module",
5
5
  "description": "Real-time browser dashboard for Claude Code session states",
6
6
  "bin": {