claude-usage-limits 1.11.4 → 1.11.5

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "usage-limits",
3
3
  "displayName": "Usage Limits",
4
- "version": "1.11.4",
4
+ "version": "1.11.5",
5
5
  "description": "Puts your remaining Claude Code usage limit into Claude's context before every prompt, so it opens with what fits in the budget instead of starting work that gets cut off. Reports headroom as turns rather than percentages, prices a job before you start it, and detects your plan tier.",
6
6
  "author": {
7
7
  "name": "Ridelink",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "usage-limits",
3
- "version": "1.11.4",
3
+ "version": "1.11.5",
4
4
  "description": "Reports how much of your Codex usage limit is left as turns of work rather than a percentage, prices a job before you start it, and counts the other agents sharing the same budget.",
5
5
  "author": {
6
6
  "name": "Ridelink",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-usage-limits",
3
- "version": "1.11.4",
3
+ "version": "1.11.5",
4
4
  "description": "Puts your remaining Claude Code usage limit into Claude's context before every prompt, so it opens with what fits in the budget instead of starting work that gets cut off. Reports headroom as turns rather than percentages, prices a job before you start it, and detects your plan tier.",
5
5
  "keywords": [
6
6
  "claude",
@@ -280,7 +280,8 @@ function fit(text, width) {
280
280
  shown += 1;
281
281
  i += ch.length;
282
282
  }
283
- return out + '\x1b[0m';
283
+ // A reset only where there was colour to reset; plain text stays plain.
284
+ return s.indexOf('\x1b') === -1 ? out : out + '\x1b[0m';
284
285
  }
285
286
 
286
287
  // In a narrow pane the titles are the short ones.
@@ -307,13 +308,22 @@ function since(ms) {
307
308
  return usage.formatDuration(ms);
308
309
  }
309
310
 
310
- function stateLine(built, mode) {
311
+ // The freshness footer as separate bits, so a narrow pane can stack them
312
+ // rather than cut them.
313
+ function stateBits(built) {
311
314
  const bits = [];
312
315
  if (built.state === 'none') bits.push('no reading yet');
313
316
  else if (built.state === 'live') bits.push('live' + (Number.isFinite(built.ageMs) ? ', updated ' + since(built.ageMs) + ' ago' : ''));
314
317
  else bits.push('cached' + (Number.isFinite(built.ageMs) ? ', reading from ' + since(built.ageMs) + ' ago' : ''));
315
318
  if (built.fetch === false) bits.push('network off');
316
- return bars.dim(bits.join(' · '), mode);
319
+ return bits;
320
+ }
321
+
322
+ function stateLines(built, mode, width) {
323
+ const bits = stateBits(built);
324
+ const joined = bits.join(' · ');
325
+ if (joined.length <= width) return [bars.dim(joined, mode)];
326
+ return bits.map((bit) => bars.dim(bit, mode));
317
327
  }
318
328
 
319
329
  function noteColour(built) {
@@ -435,7 +445,7 @@ function render(built, options) {
435
445
  const colour = built.pace.headroomMs < 10 * MINUTE ? bars.THEME.error : built.pace.headroomMs < 30 * MINUTE ? bars.THEME.warning : null;
436
446
  footer.push(colour ? bars.paint(text, colour, mode) : bars.dim(text, mode));
437
447
  }
438
- footer.push(stateLine(built, mode));
448
+ for (const line of stateLines(built, mode, real)) footer.push(line);
439
449
  if (opts.interactive !== false) footer.push(bars.dim('q quit · r refresh', mode));
440
450
 
441
451
  // Full layout first, then without spacers, then without the footer.