cc-pulse 1.5.1 → 1.6.0
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 +30 -11
- 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.
|
|
19
|
+
version: "1.6.0",
|
|
20
20
|
description: "A customizable, real-time statusline for Claude Code",
|
|
21
21
|
type: "module",
|
|
22
22
|
bin: {
|
|
@@ -428,6 +428,26 @@ function getGitInfo() {
|
|
|
428
428
|
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
|
|
429
429
|
import { homedir as homedir3 } from "node:os";
|
|
430
430
|
import { join as join2 } from "node:path";
|
|
431
|
+
|
|
432
|
+
// src/utils.ts
|
|
433
|
+
import { execSync as execSync2 } from "node:child_process";
|
|
434
|
+
var cachedProjectRoot;
|
|
435
|
+
function getProjectRoot() {
|
|
436
|
+
if (cachedProjectRoot !== undefined)
|
|
437
|
+
return cachedProjectRoot;
|
|
438
|
+
try {
|
|
439
|
+
cachedProjectRoot = execSync2("git rev-parse --show-toplevel", {
|
|
440
|
+
encoding: "utf-8",
|
|
441
|
+
timeout: 2000,
|
|
442
|
+
stdio: ["pipe", "pipe", "ignore"]
|
|
443
|
+
}).trim();
|
|
444
|
+
} catch {
|
|
445
|
+
cachedProjectRoot = null;
|
|
446
|
+
}
|
|
447
|
+
return cachedProjectRoot;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// src/components/hooks.ts
|
|
431
451
|
var EVENT_LABELS = {
|
|
432
452
|
PreToolUse: "Pre",
|
|
433
453
|
PostToolUse: "Post",
|
|
@@ -485,8 +505,11 @@ function getHooksSummary() {
|
|
|
485
505
|
let total = 0;
|
|
486
506
|
const globalPath = join2(homedir3(), ".claude", "settings.json");
|
|
487
507
|
mergeHooksFromFile(globalPath, events);
|
|
488
|
-
const
|
|
508
|
+
const projectRoot = getProjectRoot() ?? process.cwd();
|
|
509
|
+
const projectPath = join2(projectRoot, ".claude", "settings.json");
|
|
489
510
|
mergeHooksFromFile(projectPath, events);
|
|
511
|
+
const localPath = join2(projectRoot, ".claude", "settings.local.json");
|
|
512
|
+
mergeHooksFromFile(localPath, events);
|
|
490
513
|
for (const [key, detail] of Object.entries(events)) {
|
|
491
514
|
if (detail.count === 0)
|
|
492
515
|
delete events[key];
|
|
@@ -577,7 +600,7 @@ function renderLinesChanged(input, config, theme) {
|
|
|
577
600
|
return { text: parts.join(" ") };
|
|
578
601
|
}
|
|
579
602
|
// src/components/mcp.ts
|
|
580
|
-
import { execSync as
|
|
603
|
+
import { execSync as execSync3 } from "node:child_process";
|
|
581
604
|
import { existsSync as existsSync3, readFileSync as readFileSync3 } from "node:fs";
|
|
582
605
|
import { homedir as homedir4 } from "node:os";
|
|
583
606
|
import { join as join3 } from "node:path";
|
|
@@ -624,9 +647,7 @@ function renderMcp(config, theme) {
|
|
|
624
647
|
const text2 = `${theme.sky}${label} ${theme.overlay0}0${theme.reset}`;
|
|
625
648
|
return { text: text2, action: "/mcp" };
|
|
626
649
|
}
|
|
627
|
-
const
|
|
628
|
-
const remaining = servers.length - maxDisplay;
|
|
629
|
-
const serverItems = displayServers.map((server) => {
|
|
650
|
+
const serverItems = servers.map((server) => {
|
|
630
651
|
let icon;
|
|
631
652
|
let color;
|
|
632
653
|
switch (server.status) {
|
|
@@ -648,9 +669,6 @@ function renderMcp(config, theme) {
|
|
|
648
669
|
}
|
|
649
670
|
return `${color}${server.name} ${icon}${theme.reset}`;
|
|
650
671
|
});
|
|
651
|
-
if (remaining > 0) {
|
|
652
|
-
serverItems.push(`${theme.sky}+${remaining} more${theme.reset}`);
|
|
653
|
-
}
|
|
654
672
|
const countStr = `${connectedCount}/${servers.length}`;
|
|
655
673
|
const header = `${theme.sky}${label} ${theme.green}${countStr}${theme.reset}:`;
|
|
656
674
|
if (config.showNames === false) {
|
|
@@ -669,7 +687,7 @@ function getMcpServers() {
|
|
|
669
687
|
servers = state.mcp.servers.map((s) => ({ ...s }));
|
|
670
688
|
} else {
|
|
671
689
|
try {
|
|
672
|
-
const output =
|
|
690
|
+
const output = execSync3("claude mcp list", {
|
|
673
691
|
encoding: "utf-8",
|
|
674
692
|
timeout: 8000,
|
|
675
693
|
stdio: ["pipe", "pipe", "ignore"]
|
|
@@ -969,7 +987,8 @@ function getSkillsSummary() {
|
|
|
969
987
|
const skills = [];
|
|
970
988
|
const userSkillsPath = join4(homedir5(), ".claude", "skills");
|
|
971
989
|
scanSkillsDirectory(userSkillsPath, skills);
|
|
972
|
-
const
|
|
990
|
+
const projectRoot = getProjectRoot() ?? process.cwd();
|
|
991
|
+
const projectSkillsPath = join4(projectRoot, ".claude", "skills");
|
|
973
992
|
scanSkillsDirectory(projectSkillsPath, skills);
|
|
974
993
|
const seen = new Set;
|
|
975
994
|
const deduped = [];
|