@kosinal/claude-code-dashboard 0.0.7 → 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.
- package/dist/bin.js +47 -5
- 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 = [
|
|
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">
|
|
@@ -1439,7 +1461,6 @@ var EVENT_TO_STATUS = {
|
|
|
1439
1461
|
var INTERACTIVE_TOOLS = /* @__PURE__ */ new Set([
|
|
1440
1462
|
"ExitPlanMode",
|
|
1441
1463
|
"AskUserQuestion",
|
|
1442
|
-
"Bash",
|
|
1443
1464
|
"Write",
|
|
1444
1465
|
"Edit",
|
|
1445
1466
|
"NotebookEdit"
|
|
@@ -1462,6 +1483,14 @@ function createStore() {
|
|
|
1462
1483
|
const toolName = typeof payload.tool_name === "string" ? payload.tool_name : "";
|
|
1463
1484
|
displayEvent = toolName || hook_event_name;
|
|
1464
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";
|
|
1465
1494
|
} else {
|
|
1466
1495
|
const mapped = EVENT_TO_STATUS[hook_event_name];
|
|
1467
1496
|
if (!mapped) {
|
|
@@ -1692,11 +1721,24 @@ async function stopServer() {
|
|
|
1692
1721
|
function main() {
|
|
1693
1722
|
const { port, command, noHooks, noOpen } = parseArgs(process.argv);
|
|
1694
1723
|
if (command === "install") {
|
|
1695
|
-
|
|
1724
|
+
(async () => {
|
|
1725
|
+
await stopServer();
|
|
1726
|
+
uninstall();
|
|
1727
|
+
install(port);
|
|
1728
|
+
})().catch((err) => {
|
|
1729
|
+
console.error("Install failed:", err);
|
|
1730
|
+
process.exit(1);
|
|
1731
|
+
});
|
|
1696
1732
|
return;
|
|
1697
1733
|
}
|
|
1698
1734
|
if (command === "uninstall") {
|
|
1699
|
-
|
|
1735
|
+
(async () => {
|
|
1736
|
+
await stopServer();
|
|
1737
|
+
uninstall();
|
|
1738
|
+
})().catch((err) => {
|
|
1739
|
+
console.error("Uninstall failed:", err);
|
|
1740
|
+
process.exit(1);
|
|
1741
|
+
});
|
|
1700
1742
|
return;
|
|
1701
1743
|
}
|
|
1702
1744
|
if (command === "stop") {
|