@usagefleet/cli 1.2.178 → 1.2.179
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/claude-limits.js +10 -1
- package/dist/index.js +4 -2
- package/dist/release.js +1 -1
- package/package.json +1 -1
package/dist/claude-limits.js
CHANGED
|
@@ -198,7 +198,16 @@ export function oauthLimitsReport(body) {
|
|
|
198
198
|
if (account.fiveHourPct == null && account.sevenDayPct == null) {
|
|
199
199
|
return null;
|
|
200
200
|
}
|
|
201
|
-
|
|
201
|
+
const report = { ...account, modelLimits: parseOauthUsage(body), source: 'sub' };
|
|
202
|
+
return account.fiveHourPct == null && listsNoSessionLimit(body) ? { ...report, noFiveHourWindow: true } : report;
|
|
203
|
+
}
|
|
204
|
+
// Ultra plans have no 5h window. Max lists a `kind: "session"` entry in limits[];
|
|
205
|
+
// a payload without limits[] says nothing either way.
|
|
206
|
+
function listsNoSessionLimit(body) {
|
|
207
|
+
const limits = body?.limits;
|
|
208
|
+
return (Array.isArray(limits) &&
|
|
209
|
+
limits.length > 0 &&
|
|
210
|
+
!limits.some(l => typeof l === 'object' && l !== null && l.kind === 'session'));
|
|
202
211
|
}
|
|
203
212
|
/**
|
|
204
213
|
* Read the account's real rate-limit utilization.
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,9 @@ function flag(name) {
|
|
|
33
33
|
* Bars are plain characters, so they survive a service log as well as a TTY. */
|
|
34
34
|
function limitsSummary(limits) {
|
|
35
35
|
const models = limits.modelLimits.map(m => ` · ${m.model}(${m.window}) ${bar(m.pct, 6)} ${pct(m.pct)}`).join('');
|
|
36
|
-
|
|
36
|
+
// Ultra plans have no 5h window, so oauth/usage reports none.
|
|
37
|
+
const five = limits.fiveHourPct === null ? '' : `5h ${bar(limits.fiveHourPct)} ${pct(limits.fiveHourPct)} · `;
|
|
38
|
+
return `${five}weekly ${bar(limits.sevenDayPct)} ${pct(limits.sevenDayPct)}${models}`;
|
|
37
39
|
}
|
|
38
40
|
/** Every message the collector, notifier and self-update emit, as a stream
|
|
39
41
|
* line. The level picks the glyph so a problem never reads like a result. */
|
|
@@ -188,7 +190,7 @@ async function cmdStatus() {
|
|
|
188
190
|
? stateLine('ok', 'claude', `${creds.source}${dim(creds.subscriptionType ? ` · ${creds.subscriptionType}` : '')}`)
|
|
189
191
|
: stateLine('warn', 'claude', `no login ${dim('· sign in with `claude` or set ANTHROPIC_API_KEY')}`));
|
|
190
192
|
console.log(limits
|
|
191
|
-
? stateLine(limitHealth(limits.fiveHourPct, limits.sevenDayPct), 'limits',
|
|
193
|
+
? stateLine(limitHealth(limits.fiveHourPct, limits.sevenDayPct), 'limits', `${limitsSummary({ ...limits, modelLimits: [] })} ${dim(ago(limits.at))}`)
|
|
192
194
|
: stateLine('warn', 'limits', `no reading yet ${dim('· run `usagefleet limits`')}`));
|
|
193
195
|
console.log('');
|
|
194
196
|
console.log(row('endpoint', host(ENDPOINT)));
|
package/dist/release.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by .github/workflows/release.yml.
|
|
2
|
-
export const RELEASE_VERSION = "1.2.
|
|
2
|
+
export const RELEASE_VERSION = "1.2.179";
|