claude-session-viewer 0.3.4 → 0.3.6
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/bin/dev.js +20 -1
- package/dist/client/assets/index-Csvqk3mE.js +70 -0
- package/dist/client/assets/index-DOk7moPK.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/claude/projects/repository.js +1 -1
- package/dist/server/claude/projects/service.js +4 -4
- package/dist/server/claude/sessions/service.js +9 -5
- package/dist/server/routes/sessionWindows.js +127 -0
- package/dist/server/routes/sessions.js +5 -4
- package/dist/server/routes/statistics.js +34 -310
- package/dist/server/statistics/aggregator.js +290 -0
- package/dist/server/statistics/service.js +226 -0
- package/dist/server/statistics/tokenStats.js +66 -0
- package/dist/server/statistics/tokenUsage.js +66 -0
- package/dist/server/statistics/utils.js +33 -0
- package/dist/server/utils/sessionWindows.js +159 -0
- package/package.json +2 -2
- package/dist/client/assets/index-DvK33tag.css +0 -1
- package/dist/client/assets/index-KEbXAXOS.js +0 -69
package/bin/dev.js
CHANGED
|
@@ -42,10 +42,29 @@ setTimeout(async () => {
|
|
|
42
42
|
}, 1000);
|
|
43
43
|
|
|
44
44
|
function shutdown(signal) {
|
|
45
|
+
console.log(`\nShutting down processes (${signal})...`);
|
|
46
|
+
|
|
45
47
|
for (const child of children) {
|
|
46
|
-
|
|
48
|
+
try {
|
|
49
|
+
child.kill(signal);
|
|
50
|
+
} catch (err) {
|
|
51
|
+
// Ignore errors if process is already dead
|
|
52
|
+
}
|
|
47
53
|
}
|
|
54
|
+
|
|
55
|
+
// Force kill after 2 seconds if processes haven't exited
|
|
56
|
+
setTimeout(() => {
|
|
57
|
+
for (const child of children) {
|
|
58
|
+
try {
|
|
59
|
+
child.kill('SIGKILL');
|
|
60
|
+
} catch (err) {
|
|
61
|
+
// Ignore errors
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
process.exit(0);
|
|
65
|
+
}, 2000);
|
|
48
66
|
}
|
|
49
67
|
|
|
50
68
|
process.on("SIGINT", () => shutdown("SIGINT"));
|
|
51
69
|
process.on("SIGTERM", () => shutdown("SIGTERM"));
|
|
70
|
+
process.on("exit", () => shutdown("SIGTERM"));
|