cc-pulse 1.5.2 → 1.6.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/README.md +1 -2
- package/dist/cli.js +32 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/cc-pulse)
|
|
4
4
|
[](LICENSE)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
See your context usage, cost, MCP health, hooks, skills, and git status — all without leaving [Claude Code](https://docs.anthropic.com/en/docs/claude-code).
|
|
7
7
|
|
|
8
8
|
**Full mode** shows names, groups, and token breakdown:
|
|
9
9
|
|
|
@@ -145,7 +145,6 @@ Colour thresholds: green below 70%, yellow at 70%, orange at 85%, red at 95%.
|
|
|
145
145
|
|--------|--------|
|
|
146
146
|
| `showNames: true` | List each server with its status |
|
|
147
147
|
| `showOnlyProblems: true` | Hide the line when all servers are healthy |
|
|
148
|
-
| `maxDisplay: 4` | Limit servers shown, with "+N more" for the rest |
|
|
149
148
|
|
|
150
149
|
| Icon | Status |
|
|
151
150
|
|------|--------|
|
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.1",
|
|
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";
|
|
@@ -593,7 +616,6 @@ function renderMcp(config, theme) {
|
|
|
593
616
|
disabled: "○",
|
|
594
617
|
error: "▲"
|
|
595
618
|
};
|
|
596
|
-
const maxDisplay = config.maxDisplay ?? 4;
|
|
597
619
|
const servers = getMcpServers();
|
|
598
620
|
const connectedCount = servers.filter((s) => s.status === "connected").length;
|
|
599
621
|
const showOnlyProblems = config.showOnlyProblems ?? false;
|
|
@@ -664,7 +686,7 @@ function getMcpServers() {
|
|
|
664
686
|
servers = state.mcp.servers.map((s) => ({ ...s }));
|
|
665
687
|
} else {
|
|
666
688
|
try {
|
|
667
|
-
const output =
|
|
689
|
+
const output = execSync3("claude mcp list", {
|
|
668
690
|
encoding: "utf-8",
|
|
669
691
|
timeout: 8000,
|
|
670
692
|
stdio: ["pipe", "pipe", "ignore"]
|
|
@@ -964,7 +986,8 @@ function getSkillsSummary() {
|
|
|
964
986
|
const skills = [];
|
|
965
987
|
const userSkillsPath = join4(homedir5(), ".claude", "skills");
|
|
966
988
|
scanSkillsDirectory(userSkillsPath, skills);
|
|
967
|
-
const
|
|
989
|
+
const projectRoot = getProjectRoot() ?? process.cwd();
|
|
990
|
+
const projectSkillsPath = join4(projectRoot, ".claude", "skills");
|
|
968
991
|
scanSkillsDirectory(projectSkillsPath, skills);
|
|
969
992
|
const seen = new Set;
|
|
970
993
|
const deduped = [];
|
|
@@ -991,6 +1014,8 @@ function scanSkillsDirectory(dirPath, skills) {
|
|
|
991
1014
|
for (const entry of entries) {
|
|
992
1015
|
if (!entry.isDirectory())
|
|
993
1016
|
continue;
|
|
1017
|
+
if (!existsSync4(join4(dirPath, entry.name, "SKILL.md")))
|
|
1018
|
+
continue;
|
|
994
1019
|
const skillInfo = validateSkill(dirPath, entry.name);
|
|
995
1020
|
skills.push(skillInfo);
|
|
996
1021
|
}
|
|
@@ -1173,8 +1198,7 @@ var DEFAULT_CONFIG = {
|
|
|
1173
1198
|
showNames: true,
|
|
1174
1199
|
showOnlyProblems: false,
|
|
1175
1200
|
style: "auto",
|
|
1176
|
-
icons: { connected: "✓", disconnected: "✗", disabled: "○", error: "!" }
|
|
1177
|
-
maxDisplay: 4
|
|
1201
|
+
icons: { connected: "✓", disconnected: "✗", disabled: "○", error: "!" }
|
|
1178
1202
|
},
|
|
1179
1203
|
branch: {
|
|
1180
1204
|
enabled: true
|
|
@@ -14902,7 +14926,6 @@ var McpConfigSchema = exports_external.object({
|
|
|
14902
14926
|
disabled: exports_external.string(),
|
|
14903
14927
|
error: exports_external.string()
|
|
14904
14928
|
}).optional(),
|
|
14905
|
-
maxDisplay: exports_external.number().optional(),
|
|
14906
14929
|
showOnlyProblems: exports_external.boolean().optional()
|
|
14907
14930
|
});
|
|
14908
14931
|
var CwdConfigSchema = exports_external.object({
|