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.
Files changed (2) hide show
  1. package/dist/index.js +28 -23
  2. 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 ONYX = {
98
+ var NOTHING = {
99
99
  dark: {
100
- blue: fg("#7b7fff"),
101
- // --color-onyx-accent (filled bar + directory)
102
- red: fg("#f2545b"),
103
- // --color-onyx-danger (model name)
104
- mauve: fg("#9498ff"),
105
- // --color-onyx-accent-1 (git branch)
106
- overlay0: fg("#3b3f4e")
107
- // --color-onyx-fg-3 (empty bar cells, muted)
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
- blue: fg("#5c61e6"),
111
- // --h-accent (light primary, deeper indigo)
112
- red: fg("#d63d44"),
113
- // --h-bad (darkened danger for light bg)
114
- mauve: fg("#7b7fff"),
115
- // Onyx's lighter indigo, kept distinct from the directory
116
- overlay0: fg("#6b7080")
117
- // --h-muted (--fg-2)
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 ONYX[resolvedAppearance()];
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 { blue: BLUE, red: RED, mauve: MAUVE, overlay0: GRAY } = loadLassoTheme();
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
- out += `${BLUE}[${filled}${GRAY}${empty}${BLUE}] ${pctStr}%`;
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 += `${RED}${envInfo.model}`;
166
+ out += `${TEXT}${envInfo.model}`;
162
167
  out += "\n";
163
168
  if (envInfo.gitBranch) {
164
169
  const branchText = `(${envInfo.gitBranch})`;
165
- out += `${MAUVE}${branchText}`;
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 += `${BLUE}${envInfo.directory}`;
176
+ out += `${TEXT}${envInfo.directory}`;
172
177
  out += RESET;
173
178
  return out;
174
179
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-contextline",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Two-line statusline for Claude Code showing context window usage",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",