@askalf/dario 4.8.104 → 4.8.105
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.
|
@@ -37,6 +37,12 @@ interface SummaryShape {
|
|
|
37
37
|
lastUtil5h: number;
|
|
38
38
|
lastUtil7d: number;
|
|
39
39
|
};
|
|
40
|
+
perAccount: Record<string, {
|
|
41
|
+
requests: number;
|
|
42
|
+
currentUtil5h: number;
|
|
43
|
+
currentUtil7d: number;
|
|
44
|
+
lastClaim: string;
|
|
45
|
+
}>;
|
|
40
46
|
}
|
|
41
47
|
export interface AnalyticsState {
|
|
42
48
|
summary: SummaryShape | null;
|
|
@@ -94,14 +94,33 @@ export const AnalyticsTab = {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
// ── Rate-limit ────────────────────────────────────────────
|
|
97
|
+
// Each account hits its OWN 5h/7d windows, so with >1 account an
|
|
98
|
+
// aggregate gauge is misleading (#600) — show one row per account, the
|
|
99
|
+
// bar tracking the binding constraint (max of 5h/7d = closest to a limit).
|
|
97
100
|
lines.push('');
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
const accts = s.perAccount ? Object.entries(s.perAccount) : [];
|
|
102
|
+
if (accts.length > 1) {
|
|
103
|
+
lines.push(' ' + brand('Rate-limit') + dim(' (per account)'));
|
|
104
|
+
const acctBarWidth = Math.max(8, Math.min(20, w - 48));
|
|
105
|
+
for (const [alias, a] of accts.sort((x, y) => y[1].requests - x[1].requests)) {
|
|
106
|
+
const u5 = a.currentUtil5h ?? 0;
|
|
107
|
+
const u7 = a.currentUtil7d ?? 0;
|
|
108
|
+
const peak = Math.max(u5, u7);
|
|
109
|
+
lines.push(' ' + pad(alias, 14) +
|
|
110
|
+
fg(peak >= 0.9 ? 'red' : 'cyan', progressBar(peak, acctBarWidth)) +
|
|
111
|
+
' ' + dim(`5h ${(u5 * 100).toFixed(0)}%`.padEnd(8)) +
|
|
112
|
+
dim(`7d ${(u7 * 100).toFixed(0)}%`));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
lines.push(' ' + brand('Rate-limit'));
|
|
117
|
+
lines.push(' ' + pad('5h', 6) +
|
|
118
|
+
fg('cyan', progressBar(s.utilization.lastUtil5h, barWidth)) +
|
|
119
|
+
' ' + dim(`${(s.utilization.lastUtil5h * 100).toFixed(0)}%`));
|
|
120
|
+
lines.push(' ' + pad('7d', 6) +
|
|
121
|
+
fg('cyan', progressBar(s.utilization.lastUtil7d, barWidth)) +
|
|
122
|
+
' ' + dim(`${(s.utilization.lastUtil7d * 100).toFixed(0)}%`));
|
|
123
|
+
}
|
|
105
124
|
// Overage bucket (v4.1, dario#288). Count of requests that landed in
|
|
106
125
|
// the overage bucket within the rolling window. Empty bar in normal
|
|
107
126
|
// operation; non-zero count renders in red. Hard zero IS the success
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askalf/dario",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.105",
|
|
4
4
|
"description": "Use your Claude Pro/Max subscription in any tool — Cursor, Cline, Aider, the Agent SDK, your scripts — at subscription pricing, not per-token API bills. One local Anthropic + OpenAI-compatible endpoint.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|