claudeline 1.4.1 → 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/.claude-plugin/plugin.json +1 -1
- package/dist/index.js +39 -10
- package/package.json +8 -4
package/dist/index.js
CHANGED
|
@@ -166,7 +166,7 @@ function listComponents() {
|
|
|
166
166
|
{
|
|
167
167
|
name: "Claude/Session",
|
|
168
168
|
prefix: "claude",
|
|
169
|
-
items: ["model", "model-id", "version", "session", "session-full", "style"]
|
|
169
|
+
items: ["model", "model-id", "model-letter", "effort", "version", "session", "session-full", "style"]
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
172
|
name: "Context Window",
|
|
@@ -486,7 +486,7 @@ var THEMES = {
|
|
|
486
486
|
nerd: "emoji:node env:node-short sep:dot emoji:folder fs:dir sep:dot emoji:branch git:branch git:status",
|
|
487
487
|
compact: "claude:model sep:slash fs:dir sep:slash git:branch",
|
|
488
488
|
colorful: "bold:magenta:claude:model sep:arrow cyan:fs:dir sep:arrow green:git:branch yellow:git:status sep:arrow blue:ctx:percent",
|
|
489
|
-
luca: "bold:magenta:claude:model
|
|
489
|
+
luca: "bold:magenta:claude:model if:effort(dim:sep:middot text:\u{F09D1} claude:effort) dim:sep:middot cyan:nerd:repo cyan:git:repo sep:none text:: sep:none green:git:branch if:subdir(sep:none white:text:/ sep:none white:fs:relative) if:dirty(dim:sep:middot git:dirty) dim:sep:middot white:account:email sep:newline bold:white:usage:5h-bar:8 usage:5h (usage:5h-pace) dim:usage:5h-reset dim:sep:middot bold:white:usage:week-bar:8 usage:week (usage:week-pace) dim:usage:week-reset dim:sep:middot white:cost:total"
|
|
490
490
|
};
|
|
491
491
|
function getTheme(name) {
|
|
492
492
|
return THEMES[name] || null;
|
|
@@ -604,8 +604,9 @@ var SAMPLE_DATA = {
|
|
|
604
604
|
transcript_path: "/tmp/transcript.json",
|
|
605
605
|
cwd: "/Users/demo/projects/myapp",
|
|
606
606
|
model: {
|
|
607
|
-
id: "claude-opus-4-
|
|
608
|
-
display_name: "Opus"
|
|
607
|
+
id: "claude-opus-4-6",
|
|
608
|
+
display_name: "Opus",
|
|
609
|
+
reasoning_effort: "high"
|
|
609
610
|
},
|
|
610
611
|
workspace: {
|
|
611
612
|
current_dir: "/Users/demo/projects/myapp",
|
|
@@ -655,6 +656,7 @@ var SEPARATORS = {
|
|
|
655
656
|
chevron: " \u203A ",
|
|
656
657
|
"chevron-left": " \u2039 ",
|
|
657
658
|
dot: " \u2022 ",
|
|
659
|
+
middot: " \xB7 ",
|
|
658
660
|
dash: " - ",
|
|
659
661
|
slash: " / ",
|
|
660
662
|
backslash: " \\ ",
|
|
@@ -668,8 +670,8 @@ var SEPARATORS = {
|
|
|
668
670
|
diamond: " \u25C7 ",
|
|
669
671
|
star: " \u2605 ",
|
|
670
672
|
// Line break
|
|
671
|
-
newline: "\n",
|
|
672
|
-
br: "\n",
|
|
673
|
+
newline: "\x1B[0m\n\x1B[0m",
|
|
674
|
+
br: "\x1B[0m\n\x1B[0m",
|
|
673
675
|
// Powerline-style
|
|
674
676
|
powerline: "",
|
|
675
677
|
"powerline-left": "",
|
|
@@ -1126,7 +1128,7 @@ function applyStyles(text, styles, noColor) {
|
|
|
1126
1128
|
if (codes.length === 0) return text;
|
|
1127
1129
|
return `\x1B[${codes.join(";")}m${text}\x1B[${RESET}m`;
|
|
1128
1130
|
}
|
|
1129
|
-
function evaluateClaudeComponent(key, data) {
|
|
1131
|
+
function evaluateClaudeComponent(key, data, noColor = false) {
|
|
1130
1132
|
switch (key) {
|
|
1131
1133
|
case "model":
|
|
1132
1134
|
return data.model?.display_name || "Claude";
|
|
@@ -1140,6 +1142,24 @@ function evaluateClaudeComponent(key, data) {
|
|
|
1140
1142
|
return (data.session_id || "").slice(0, 8);
|
|
1141
1143
|
case "session-full":
|
|
1142
1144
|
return data.session_id || "";
|
|
1145
|
+
case "effort": {
|
|
1146
|
+
try {
|
|
1147
|
+
const settingsPath = path3.join(os2.homedir(), ".claude", "settings.json");
|
|
1148
|
+
const settings = JSON.parse(fs3.readFileSync(settingsPath, "utf8"));
|
|
1149
|
+
const effort = settings.effortLevel || "";
|
|
1150
|
+
if (!effort || noColor) return effort;
|
|
1151
|
+
const r = `\x1B[${RESET}m`;
|
|
1152
|
+
const colors = {
|
|
1153
|
+
low: COLORS.green,
|
|
1154
|
+
medium: COLORS.yellow,
|
|
1155
|
+
high: COLORS.red
|
|
1156
|
+
};
|
|
1157
|
+
const code = colors[effort] || "";
|
|
1158
|
+
return code ? `\x1B[${code}m${effort}${r}` : effort;
|
|
1159
|
+
} catch {
|
|
1160
|
+
return "";
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1143
1163
|
case "style":
|
|
1144
1164
|
return data.output_style?.name || "default";
|
|
1145
1165
|
default:
|
|
@@ -1475,6 +1495,15 @@ function evaluateCondition(condition) {
|
|
|
1475
1495
|
return fs3.existsSync("Cargo.toml");
|
|
1476
1496
|
case "go":
|
|
1477
1497
|
return fs3.existsSync("go.mod");
|
|
1498
|
+
case "effort": {
|
|
1499
|
+
try {
|
|
1500
|
+
const settingsPath = path3.join(os2.homedir(), ".claude", "settings.json");
|
|
1501
|
+
const settings = JSON.parse(fs3.readFileSync(settingsPath, "utf8"));
|
|
1502
|
+
return !!settings.effortLevel;
|
|
1503
|
+
} catch {
|
|
1504
|
+
return false;
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1478
1507
|
default:
|
|
1479
1508
|
return true;
|
|
1480
1509
|
}
|
|
@@ -1483,7 +1512,7 @@ function evaluateComponent(comp, data, options) {
|
|
|
1483
1512
|
let result = "";
|
|
1484
1513
|
switch (comp.type) {
|
|
1485
1514
|
case "claude":
|
|
1486
|
-
result = evaluateClaudeComponent(comp.key, data);
|
|
1515
|
+
result = evaluateClaudeComponent(comp.key, data, options.noColor);
|
|
1487
1516
|
break;
|
|
1488
1517
|
case "fs":
|
|
1489
1518
|
result = evaluateFsComponent(comp.key, data);
|
|
@@ -1566,11 +1595,11 @@ function evaluateFormat(format, data, options = {}) {
|
|
|
1566
1595
|
};
|
|
1567
1596
|
const components = parseFormat(format);
|
|
1568
1597
|
const result = evaluateComponents(components, data, opts);
|
|
1569
|
-
return opts.noColor ? result : result + `\x1B[0m`;
|
|
1598
|
+
return opts.noColor ? result : `\x1B[0m` + result + `\x1B[0m`;
|
|
1570
1599
|
}
|
|
1571
1600
|
|
|
1572
1601
|
// src/index.ts
|
|
1573
|
-
var VERSION = "1.
|
|
1602
|
+
var VERSION = "1.5.1";
|
|
1574
1603
|
async function readStdin() {
|
|
1575
1604
|
return new Promise((resolve, reject) => {
|
|
1576
1605
|
let input = "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudeline",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Customizable status line generator for Claude Code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
".claude-plugin"
|
|
13
13
|
],
|
|
14
14
|
"scripts": {
|
|
15
|
-
"build": "tsup
|
|
16
|
-
"dev": "tsup
|
|
17
|
-
"prepublishOnly": "
|
|
15
|
+
"build": "tsup",
|
|
16
|
+
"dev": "tsup --watch",
|
|
17
|
+
"prepublishOnly": "bun run build"
|
|
18
18
|
},
|
|
19
19
|
"keywords": [
|
|
20
20
|
"claude",
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
],
|
|
27
27
|
"author": "Luca Silverentand",
|
|
28
28
|
"license": "MIT",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/lucasilverentand/claudeline"
|
|
32
|
+
},
|
|
29
33
|
"devDependencies": {
|
|
30
34
|
"@types/node": "^20.11.0",
|
|
31
35
|
"tsup": "^8.0.1",
|