@usagefleet/cli 1.2.182 → 1.2.183

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.
@@ -198,9 +198,31 @@ export function oauthLimitsReport(body) {
198
198
  if (account.fiveHourPct == null && account.sevenDayPct == null) {
199
199
  return null;
200
200
  }
201
- const report = { ...account, modelLimits: parseOauthUsage(body), source: 'sub' };
201
+ const surfaces = parseSurfaces(body);
202
+ const report = {
203
+ ...account,
204
+ modelLimits: parseOauthUsage(body),
205
+ source: 'sub',
206
+ ...(surfaces.length > 0 && { surfaces }),
207
+ };
202
208
  return account.fiveHourPct == null && listsNoSessionLimit(body) ? { ...report, noFiveHourWindow: true } : report;
203
209
  }
210
+ export function parseSurfaces(body) {
211
+ const rows = body?.seven_day_breakdown?.rows;
212
+ if (!Array.isArray(rows)) {
213
+ return [];
214
+ }
215
+ const out = [];
216
+ for (const row of rows) {
217
+ const pct = typeof row?.percent === 'number' ? clampPct(row.percent) : null;
218
+ if (typeof row?.key === 'string' && row.key !== '' && pct !== null) {
219
+ const label = typeof row.display_name === 'string' && row.display_name !== '' ? row.display_name : row.key;
220
+ // Cut to the server's ceilings: an over-long row would get the whole limits post rejected.
221
+ out.push({ key: row.key.slice(0, 64), label: label.slice(0, 64), pct });
222
+ }
223
+ }
224
+ return out.slice(0, 16);
225
+ }
204
226
  // Ultra plans have no 5h window. Max lists a `kind: "session"` entry in limits[];
205
227
  // a payload without limits[] says nothing either way.
206
228
  function listsNoSessionLimit(body) {
package/dist/release.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by .github/workflows/release.yml.
2
- export const RELEASE_VERSION = "1.2.182";
2
+ export const RELEASE_VERSION = "1.2.183";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usagefleet/cli",
3
- "version": "1.2.182",
3
+ "version": "1.2.183",
4
4
  "description": "Tails Claude Code, Claude Desktop, and pi agent JSONL logs and reports token usage to a UsageFleet server.",
5
5
  "keywords": [
6
6
  "claude",