cc-pulse 1.5.0 → 1.5.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/cli.js +20 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -16,7 +16,7 @@ var __export = (target, all) => {
|
|
|
16
16
|
// package.json
|
|
17
17
|
var package_default = {
|
|
18
18
|
name: "cc-pulse",
|
|
19
|
-
version: "1.5.
|
|
19
|
+
version: "1.5.1",
|
|
20
20
|
description: "A customizable, real-time statusline for Claude Code",
|
|
21
21
|
type: "module",
|
|
22
22
|
bin: {
|
|
@@ -487,6 +487,10 @@ function getHooksSummary() {
|
|
|
487
487
|
mergeHooksFromFile(globalPath, events);
|
|
488
488
|
const projectPath = join2(process.cwd(), ".claude", "settings.json");
|
|
489
489
|
mergeHooksFromFile(projectPath, events);
|
|
490
|
+
for (const [key, detail] of Object.entries(events)) {
|
|
491
|
+
if (detail.count === 0)
|
|
492
|
+
delete events[key];
|
|
493
|
+
}
|
|
490
494
|
let totalBroken = 0;
|
|
491
495
|
for (const detail of Object.values(events)) {
|
|
492
496
|
total += detail.count;
|
|
@@ -498,8 +502,19 @@ function extractHookInfo(command) {
|
|
|
498
502
|
const parts = command.split(/\s+/);
|
|
499
503
|
for (const part of parts) {
|
|
500
504
|
if (part.includes("/")) {
|
|
501
|
-
const cleaned = part.replace(
|
|
502
|
-
|
|
505
|
+
const cleaned = part.replace(/["']/g, "");
|
|
506
|
+
let expanded = cleaned.replace(/\$(\w+)/g, (_, v) => {
|
|
507
|
+
if (v === "CLAUDE_PROJECT_DIR")
|
|
508
|
+
return process.env[v] ?? process.cwd();
|
|
509
|
+
return process.env[v] ?? `$${v}`;
|
|
510
|
+
});
|
|
511
|
+
if (expanded.startsWith("~/")) {
|
|
512
|
+
expanded = join2(homedir3(), expanded.slice(2));
|
|
513
|
+
}
|
|
514
|
+
if (!expanded.startsWith("/")) {
|
|
515
|
+
const projectDir = process.env.CLAUDE_PROJECT_DIR ?? process.cwd();
|
|
516
|
+
expanded = join2(projectDir, expanded);
|
|
517
|
+
}
|
|
503
518
|
const base = expanded.split("/").pop() ?? expanded;
|
|
504
519
|
const name2 = base.replace(/\.[^.]+$/, "");
|
|
505
520
|
const broken = !existsSync2(expanded);
|
|
@@ -566,7 +581,7 @@ import { execSync as execSync2 } from "node:child_process";
|
|
|
566
581
|
import { existsSync as existsSync3, readFileSync as readFileSync3 } from "node:fs";
|
|
567
582
|
import { homedir as homedir4 } from "node:os";
|
|
568
583
|
import { join as join3 } from "node:path";
|
|
569
|
-
var CACHE_TTL2 =
|
|
584
|
+
var CACHE_TTL2 = 1e4;
|
|
570
585
|
function renderMcp(config, theme) {
|
|
571
586
|
if (config.enabled === false) {
|
|
572
587
|
return { text: "" };
|
|
@@ -656,7 +671,7 @@ function getMcpServers() {
|
|
|
656
671
|
try {
|
|
657
672
|
const output = execSync2("claude mcp list", {
|
|
658
673
|
encoding: "utf-8",
|
|
659
|
-
timeout:
|
|
674
|
+
timeout: 8000,
|
|
660
675
|
stdio: ["pipe", "pipe", "ignore"]
|
|
661
676
|
});
|
|
662
677
|
servers = parseMcpOutput(output);
|