claude-usage-limits 1.11.3 → 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
|
+
"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.
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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) {
|
|
@@ -421,13 +431,21 @@ function render(built, options) {
|
|
|
421
431
|
footer.push(colour ? bars.paint(built.note, colour, mode) : bars.dim(built.note, mode));
|
|
422
432
|
}
|
|
423
433
|
if (built.pace && built.pace.runsOut && Number.isFinite(built.pace.headroomMs)) {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
434
|
+
// The longest form that fits: a sentence in a wide pane, a phrase in a
|
|
435
|
+
// narrow one, never a sentence cut off halfway.
|
|
436
|
+
const left = usage.formatDuration(built.pace.headroomMs);
|
|
437
|
+
const turns = Number.isFinite(built.pace.turnsLeft) ? ', about ' + built.pace.turnsLeft + ' turns' : '';
|
|
438
|
+
const forms = [
|
|
439
|
+
'at this pace the ' + built.pace.label + ' window runs out in ' + left + turns,
|
|
440
|
+
'runs out in ' + left + ' at this pace' + turns,
|
|
441
|
+
'runs out in ' + left + ' at this pace',
|
|
442
|
+
'wall in ' + left,
|
|
443
|
+
];
|
|
444
|
+
const text = forms.find((form) => form.length <= real) || forms[forms.length - 1];
|
|
427
445
|
const colour = built.pace.headroomMs < 10 * MINUTE ? bars.THEME.error : built.pace.headroomMs < 30 * MINUTE ? bars.THEME.warning : null;
|
|
428
446
|
footer.push(colour ? bars.paint(text, colour, mode) : bars.dim(text, mode));
|
|
429
447
|
}
|
|
430
|
-
|
|
448
|
+
for (const line of stateLines(built, mode, real)) footer.push(line);
|
|
431
449
|
if (opts.interactive !== false) footer.push(bars.dim('q quit · r refresh', mode));
|
|
432
450
|
|
|
433
451
|
// Full layout first, then without spacers, then without the footer.
|