claude-usage-limits 1.5.4 → 1.5.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.5.4",
4
+ "version": "1.5.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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-usage-limits",
3
- "version": "1.5.4",
3
+ "version": "1.5.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",
@@ -119,7 +119,6 @@ function aheadOfPace(window, now) {
119
119
  return window.percentUsed - Math.min(100, Math.max(0, elapsed));
120
120
  }
121
121
 
122
- // Not whether to speak, which is always, but how hard to lean on it.
123
122
  // Not whether to speak, which is always, but how hard to lean on it.
124
123
  function pressure(window, now, config, turnsLeft) {
125
124
  if (!window || window.percentUsed === null || window.stale) return 'unknown';
@@ -1214,13 +1214,18 @@ function formatPercent(value) {
1214
1214
 
1215
1215
  function renderForecast(data, turns) {
1216
1216
  const lines = [];
1217
- lines.push('Forecast for ' + turns + ' turns');
1218
- lines.push('');
1219
1217
 
1218
+ // Checked before the heading is built, or a bad argument prints straight
1219
+ // into it: "Forecast for NaN turns".
1220
1220
  if (!Number.isFinite(turns) || turns <= 0) {
1221
+ lines.push('Forecast');
1222
+ lines.push('');
1221
1223
  lines.push(' Give a number of turns, for example --forecast 15.');
1222
1224
  return lines.join('\n');
1223
1225
  }
1226
+
1227
+ lines.push('Forecast for ' + turns + ' turns');
1228
+ lines.push('');
1224
1229
  if (!data.rates) {
1225
1230
  lines.push(' Nothing recent to price this against yet. Do some work in this');
1226
1231
  lines.push(' session first, then ask again.');