claude-doom-statusbar 0.2.0 → 0.3.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/package.json +1 -1
- package/presets/full.toml +6 -6
- package/src/render.js +2 -1
- package/src/statusline.js +15 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-doom-statusbar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "DOOM-inspired status bar for the Claude Code CLI — a mugshot that tracks session health, plus usage, model, project, system, and a live subagent list.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/presets/full.toml
CHANGED
|
@@ -34,12 +34,12 @@ metric = [
|
|
|
34
34
|
type = "box"
|
|
35
35
|
title = "PROJECT"
|
|
36
36
|
metric = [
|
|
37
|
-
{ id = "
|
|
38
|
-
{ id = "
|
|
39
|
-
{
|
|
40
|
-
{ id = "git.
|
|
41
|
-
{ id = "loc.churn",
|
|
42
|
-
{ id = "pr.state",
|
|
37
|
+
{ id = "session.name", render = "text", icon = "🎮" },
|
|
38
|
+
{ id = "loc.cwd", render = "text", icon = "📁" },
|
|
39
|
+
{ id = "git.branch", render = "text", icon = "🌿" },
|
|
40
|
+
{ id = "git.work", render = "text" }, # ✎ files ⇅ pull/push
|
|
41
|
+
{ id = "loc.churn", render = "text", icon = "📝" },
|
|
42
|
+
{ id = "pr.state", render = "text", icon = "⇧ " },
|
|
43
43
|
]
|
|
44
44
|
|
|
45
45
|
[[segment]]
|
package/src/render.js
CHANGED
|
@@ -33,7 +33,8 @@ export const SAMPLE = {
|
|
|
33
33
|
"usage.reset5h": "2h13m", "usage.reset7d": "3d4h", "sys.session": "5h55m", "loc.churn": "+185 / -62",
|
|
34
34
|
"context.hp": 78, "ratelimit.5h": 64, "ratelimit.7d": 31, "cost.total": "$1.83",
|
|
35
35
|
"git.branch": "main", "git.behind": "↓2", "git.ahead": "↑3", "git.status": "3",
|
|
36
|
-
"
|
|
36
|
+
"git.work": "✎ 3 ⇅ ↓2 ↑3", "session.name": "doom-hud-demo",
|
|
37
|
+
"pr.state": "#1234", "loc.cwd": "claude-doom-statusbar",
|
|
37
38
|
"act.subagents": [["hook events", "2m13s"], ["find configs", "12s"]], "act.agents": "2",
|
|
38
39
|
"act.tasklist": [
|
|
39
40
|
{ mark:"✅", markRgb: OK, text:"scaffold project" },
|
package/src/statusline.js
CHANGED
|
@@ -41,6 +41,10 @@ function git(cwd, ...args) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
// Clip a display label to at most `n` code points, ending with … when truncated,
|
|
45
|
+
// so an oversized repo or branch name can't blow up the PROJECT box width.
|
|
46
|
+
const clip = (s, n) => ([...String(s)].length > n ? [...String(s)].slice(0, n - 1).join("") + "…" : String(s));
|
|
47
|
+
|
|
44
48
|
function _dur(secsF) {
|
|
45
49
|
let secs = Math.max(0, Math.trunc(secsF));
|
|
46
50
|
const d = Math.floor(secs / 86400); secs %= 86400;
|
|
@@ -141,12 +145,15 @@ export function buildValues(data) {
|
|
|
141
145
|
let repoUrl = "";
|
|
142
146
|
if (repo.host && repo.owner && repo.name) repoUrl = `https://${repo.host}/${repo.owner}/${repo.name}`;
|
|
143
147
|
|
|
148
|
+
const sname = data.session_name || data.session_id; // session_name only set via /rename or --name
|
|
149
|
+
if (sname) v["session.name"] = clip(sname, 24);
|
|
150
|
+
|
|
144
151
|
const cwd = data.cwd || (data.workspace || {}).current_dir;
|
|
145
152
|
if (cwd) {
|
|
146
|
-
const name = path.basename(cwd.replace(/[/\\]+$/, "")) || cwd;
|
|
153
|
+
const name = clip(path.basename(cwd.replace(/[/\\]+$/, "")) || cwd, 24);
|
|
147
154
|
try { v["loc.cwd"] = _link(name, pathToFileURL(cwd).href); } catch { v["loc.cwd"] = name; }
|
|
148
155
|
const br = git(cwd, "branch", "--show-current");
|
|
149
|
-
if (br) v["git.branch"] = repoUrl ? _link(
|
|
156
|
+
if (br) { const brLbl = clip(br, 24); v["git.branch"] = repoUrl ? _link(brLbl, `${repoUrl}/tree/${br}`) : brLbl; }
|
|
150
157
|
const lr = git(cwd, "rev-list", "--count", "--left-right", "@{u}...HEAD");
|
|
151
158
|
if (lr && lr.includes("\t")) {
|
|
152
159
|
const [behind, ahead] = lr.split("\t");
|
|
@@ -154,6 +161,12 @@ export function buildValues(data) {
|
|
|
154
161
|
}
|
|
155
162
|
const st = git(cwd, "status", "--porcelain");
|
|
156
163
|
if (st !== null) v["git.status"] = String(st.split("\n").filter((l) => l.trim()).length);
|
|
164
|
+
// Merge changed-file count + pull/push onto one line (icons baked in, like model.mode):
|
|
165
|
+
// "✎ <files> ⇅ ↓<behind> ↑<ahead>" — files first, then pull/push.
|
|
166
|
+
const work = [];
|
|
167
|
+
if (v["git.status"] !== undefined) work.push(`✎ ${v["git.status"]}`);
|
|
168
|
+
if (v["git.behind"] !== undefined) work.push(`⇅ ${v["git.behind"]} ${v["git.ahead"]}`);
|
|
169
|
+
if (work.length) v["git.work"] = work.join(" ");
|
|
157
170
|
}
|
|
158
171
|
|
|
159
172
|
const pr = data.pr || {};
|