claudeline 1.6.0 → 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/dist/index.js +22 -22
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -747,9 +747,9 @@ function calculatePace(window, windowDurationMs) {
|
|
|
747
747
|
return { target, delta };
|
|
748
748
|
}
|
|
749
749
|
function paceColor(delta) {
|
|
750
|
-
if (delta > 10) return "\x1B[33m";
|
|
751
|
-
if (delta < -10) return "\x1B[36m";
|
|
752
|
-
return "\x1B[32m";
|
|
750
|
+
if (delta > 10) return "\x1B[0;33m";
|
|
751
|
+
if (delta < -10) return "\x1B[0;36m";
|
|
752
|
+
return "\x1B[0;32m";
|
|
753
753
|
}
|
|
754
754
|
function formatPaceIcon(delta, noColor) {
|
|
755
755
|
const icon = delta > 10 ? "\uF0E7" : delta < -10 ? "\uF017" : "\uF00C";
|
|
@@ -860,19 +860,19 @@ function evaluateUsageComponent(key, args, noColor = false) {
|
|
|
860
860
|
case "5h-icon": {
|
|
861
861
|
const pct = data.five_hour.utilization;
|
|
862
862
|
const icon = "\uF111";
|
|
863
|
-
if (pct < 50) return `\x1B[32m${icon}\x1B[0m`;
|
|
864
|
-
if (pct < 75) return `\x1B[33m${icon}\x1B[0m`;
|
|
865
|
-
if (pct < 90) return `\x1B[31m${icon}\x1B[0m`;
|
|
866
|
-
return `\x1B[1;31m${icon}\x1B[0m`;
|
|
863
|
+
if (pct < 50) return `\x1B[0;32m${icon}\x1B[0m`;
|
|
864
|
+
if (pct < 75) return `\x1B[0;33m${icon}\x1B[0m`;
|
|
865
|
+
if (pct < 90) return `\x1B[0;31m${icon}\x1B[0m`;
|
|
866
|
+
return `\x1B[0;1;31m${icon}\x1B[0m`;
|
|
867
867
|
}
|
|
868
868
|
case "week-icon":
|
|
869
869
|
case "7d-icon": {
|
|
870
870
|
const pct = data.seven_day.utilization;
|
|
871
871
|
const icon = "\uF111";
|
|
872
|
-
if (pct < 50) return `\x1B[32m${icon}\x1B[0m`;
|
|
873
|
-
if (pct < 75) return `\x1B[33m${icon}\x1B[0m`;
|
|
874
|
-
if (pct < 90) return `\x1B[31m${icon}\x1B[0m`;
|
|
875
|
-
return `\x1B[1;31m${icon}\x1B[0m`;
|
|
872
|
+
if (pct < 50) return `\x1B[0;32m${icon}\x1B[0m`;
|
|
873
|
+
if (pct < 75) return `\x1B[0;33m${icon}\x1B[0m`;
|
|
874
|
+
if (pct < 90) return `\x1B[0;31m${icon}\x1B[0m`;
|
|
875
|
+
return `\x1B[0;1;31m${icon}\x1B[0m`;
|
|
876
876
|
}
|
|
877
877
|
case "5h-target": {
|
|
878
878
|
const { target } = calculatePace(data.five_hour, FIVE_HOUR_MS);
|
|
@@ -1060,7 +1060,7 @@ function applyStyles(text, styles, noColor) {
|
|
|
1060
1060
|
if (noColor || styles.length === 0 || !text) return text;
|
|
1061
1061
|
const codes = styles.map((s) => COLORS[s]).filter(Boolean);
|
|
1062
1062
|
if (codes.length === 0) return text;
|
|
1063
|
-
return `\x1B[
|
|
1063
|
+
return `\x1B[0;${codes.join(";")}m${text}\x1B[${RESET}m`;
|
|
1064
1064
|
}
|
|
1065
1065
|
function evaluateClaudeComponent(key, data, noColor = false) {
|
|
1066
1066
|
switch (key) {
|
|
@@ -1089,7 +1089,7 @@ function evaluateClaudeComponent(key, data, noColor = false) {
|
|
|
1089
1089
|
high: COLORS.red
|
|
1090
1090
|
};
|
|
1091
1091
|
const code = colors[effort] || "";
|
|
1092
|
-
return code ? `\x1B[
|
|
1092
|
+
return code ? `\x1B[0;${code}m${effort}${r}` : effort;
|
|
1093
1093
|
} catch {
|
|
1094
1094
|
return "";
|
|
1095
1095
|
}
|
|
@@ -1195,9 +1195,9 @@ function evaluateGitComponent(key, noColor = false) {
|
|
|
1195
1195
|
if (modified > 0) parts.push("~" + modified);
|
|
1196
1196
|
} else {
|
|
1197
1197
|
const r = `\x1B[${RESET}m`;
|
|
1198
|
-
if (staged > 0) parts.push(`\x1B[
|
|
1199
|
-
if (untracked > 0) parts.push(`\x1B[
|
|
1200
|
-
if (modified > 0) parts.push(`\x1B[
|
|
1198
|
+
if (staged > 0) parts.push(`\x1B[0;${COLORS.green}m+${staged}${r}`);
|
|
1199
|
+
if (untracked > 0) parts.push(`\x1B[0;${COLORS.red}m-${untracked}${r}`);
|
|
1200
|
+
if (modified > 0) parts.push(`\x1B[0;${COLORS.yellow}m~${modified}${r}`);
|
|
1201
1201
|
}
|
|
1202
1202
|
return parts.join(" ");
|
|
1203
1203
|
}
|
|
@@ -1253,10 +1253,10 @@ function evaluateContextComponent(key, data, args) {
|
|
|
1253
1253
|
case "icon": {
|
|
1254
1254
|
const pct = ctx?.used_percentage || 0;
|
|
1255
1255
|
const icon = getNerdIcon("circle");
|
|
1256
|
-
if (pct < 50) return `\x1B[
|
|
1257
|
-
if (pct < 75) return `\x1B[
|
|
1258
|
-
if (pct < 90) return `\x1B[
|
|
1259
|
-
return `\x1B[
|
|
1256
|
+
if (pct < 50) return `\x1B[0;${COLORS.green}m${icon}\x1B[${RESET}m`;
|
|
1257
|
+
if (pct < 75) return `\x1B[0;${COLORS.yellow}m${icon}\x1B[${RESET}m`;
|
|
1258
|
+
if (pct < 90) return `\x1B[0;${COLORS.red}m${icon}\x1B[${RESET}m`;
|
|
1259
|
+
return `\x1B[0;${COLORS.red};${COLORS.bold}m${icon}\x1B[${RESET}m`;
|
|
1260
1260
|
}
|
|
1261
1261
|
case "used-tokens": {
|
|
1262
1262
|
const used = (ctx?.total_input_tokens || 0) + (ctx?.total_output_tokens || 0);
|
|
@@ -1522,11 +1522,11 @@ function evaluateFormat(format, data, options = {}) {
|
|
|
1522
1522
|
};
|
|
1523
1523
|
const components = parseFormat(format);
|
|
1524
1524
|
const result = evaluateComponents(components, data, opts);
|
|
1525
|
-
return opts.noColor ? result :
|
|
1525
|
+
return opts.noColor ? result : result + `\x1B[0m`;
|
|
1526
1526
|
}
|
|
1527
1527
|
|
|
1528
1528
|
// src/index.ts
|
|
1529
|
-
var VERSION = "1.6.
|
|
1529
|
+
var VERSION = "1.6.1";
|
|
1530
1530
|
async function readStdin() {
|
|
1531
1531
|
return new Promise((resolve, reject) => {
|
|
1532
1532
|
let input = "";
|