claude-contextline 2.2.0 → 2.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/dist/index.js +28 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -95,26 +95,30 @@ function fg(hex) {
|
|
|
95
95
|
const b = parseInt(hex.slice(5, 7), 16);
|
|
96
96
|
return `\x1B[38;2;${r};${g};${b}m`;
|
|
97
97
|
}
|
|
98
|
-
var
|
|
98
|
+
var NOTHING = {
|
|
99
99
|
dark: {
|
|
100
|
-
|
|
101
|
-
// --
|
|
102
|
-
|
|
103
|
-
// --
|
|
104
|
-
|
|
105
|
-
// --
|
|
106
|
-
|
|
107
|
-
// --
|
|
100
|
+
bar: fg("#ededed"),
|
|
101
|
+
// --h-fg (filled bar + percentage)
|
|
102
|
+
barFull: fg("#d71921"),
|
|
103
|
+
// --h-bad (context ≥90% — interrupt)
|
|
104
|
+
text: fg("#ededed"),
|
|
105
|
+
// --h-fg (model + directory)
|
|
106
|
+
branch: fg("#8a8a8a"),
|
|
107
|
+
// --h-muted (git branch)
|
|
108
|
+
empty: fg("#3a3a3a")
|
|
109
|
+
// --h-border+ (empty bar cells)
|
|
108
110
|
},
|
|
109
111
|
light: {
|
|
110
|
-
|
|
111
|
-
// --h-
|
|
112
|
-
|
|
113
|
-
// --h-bad
|
|
114
|
-
|
|
115
|
-
//
|
|
116
|
-
|
|
117
|
-
// --h-muted (
|
|
112
|
+
bar: fg("#1a1a1a"),
|
|
113
|
+
// --h-fg (light)
|
|
114
|
+
barFull: fg("#c0141b"),
|
|
115
|
+
// --h-bad (light, darkened)
|
|
116
|
+
text: fg("#1a1a1a"),
|
|
117
|
+
// --h-fg (light)
|
|
118
|
+
branch: fg("#666666"),
|
|
119
|
+
// --h-muted (light)
|
|
120
|
+
empty: fg("#cccccc")
|
|
121
|
+
// light seam
|
|
118
122
|
}
|
|
119
123
|
};
|
|
120
124
|
function settingsPath() {
|
|
@@ -130,7 +134,7 @@ function resolvedAppearance() {
|
|
|
130
134
|
}
|
|
131
135
|
}
|
|
132
136
|
function loadLassoTheme() {
|
|
133
|
-
return
|
|
137
|
+
return NOTHING[resolvedAppearance()];
|
|
134
138
|
}
|
|
135
139
|
|
|
136
140
|
// src/renderer.ts
|
|
@@ -139,7 +143,7 @@ var BAR_WIDTH = 10;
|
|
|
139
143
|
var FILLED_CHAR = "\u2588";
|
|
140
144
|
var EMPTY_CHAR = "\u2591";
|
|
141
145
|
function render(envInfo) {
|
|
142
|
-
const {
|
|
146
|
+
const { bar: BAR, barFull: BAR_FULL, text: TEXT, branch: BRANCH, empty: EMPTY } = loadLassoTheme();
|
|
143
147
|
let out = "";
|
|
144
148
|
let modelCol = 0;
|
|
145
149
|
if (envInfo.usedPercentage != null) {
|
|
@@ -152,23 +156,24 @@ function render(envInfo) {
|
|
|
152
156
|
const nEmpty = BAR_WIDTH - nFilled;
|
|
153
157
|
const filled = FILLED_CHAR.repeat(nFilled);
|
|
154
158
|
const empty = EMPTY_CHAR.repeat(nEmpty);
|
|
155
|
-
|
|
159
|
+
const fill = pct >= 90 ? BAR_FULL : BAR;
|
|
160
|
+
out += `${fill}[${filled}${EMPTY}${empty}${fill}] ${pctStr}%`;
|
|
156
161
|
modelCol = 16 + pctStr.length;
|
|
157
162
|
}
|
|
158
163
|
if (out.length > 0) {
|
|
159
164
|
out += " ";
|
|
160
165
|
}
|
|
161
|
-
out += `${
|
|
166
|
+
out += `${TEXT}${envInfo.model}`;
|
|
162
167
|
out += "\n";
|
|
163
168
|
if (envInfo.gitBranch) {
|
|
164
169
|
const branchText = `(${envInfo.gitBranch})`;
|
|
165
|
-
out += `${
|
|
170
|
+
out += `${BRANCH}${branchText}`;
|
|
166
171
|
const gap = Math.max(2, modelCol - branchText.length);
|
|
167
172
|
out += " ".repeat(gap);
|
|
168
173
|
} else {
|
|
169
174
|
out += " ".repeat(modelCol);
|
|
170
175
|
}
|
|
171
|
-
out += `${
|
|
176
|
+
out += `${TEXT}${envInfo.directory}`;
|
|
172
177
|
out += RESET;
|
|
173
178
|
return out;
|
|
174
179
|
}
|