agy-statusblocks 0.1.3 → 0.1.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.
- package/dist/segments/usage.js +23 -5
- package/package.json +1 -1
package/dist/segments/usage.js
CHANGED
|
@@ -39,6 +39,9 @@ function inferWindowSuffix(resetSec) {
|
|
|
39
39
|
return '7d';
|
|
40
40
|
return '5h';
|
|
41
41
|
}
|
|
42
|
+
function is3pKey(lower) {
|
|
43
|
+
return lower === '3p' || lower.startsWith('3p-') || lower.startsWith('3p_') || lower.startsWith('3p ');
|
|
44
|
+
}
|
|
42
45
|
function shortenBucketLabel(rawKey, resetSec = 0) {
|
|
43
46
|
const k = rawKey.trim();
|
|
44
47
|
const lower = k.toLowerCase();
|
|
@@ -47,6 +50,9 @@ function shortenBucketLabel(rawKey, resetSec = 0) {
|
|
|
47
50
|
: lower.includes('5h') || lower.includes('5-hour')
|
|
48
51
|
? '5h'
|
|
49
52
|
: inferWindowSuffix(resetSec);
|
|
53
|
+
// "3p-5h" / "3p-weekly": Antigravity's third-party (Claude/GPT) pool
|
|
54
|
+
if (is3pKey(lower))
|
|
55
|
+
return explicitWin ? `claude ${explicitWin}` : 'claude';
|
|
50
56
|
if (lower.includes('claude') && (lower.includes('gpt') || lower.includes('pool') || (!lower.includes('sonnet') && !lower.includes('opus') && !lower.includes('haiku')))) {
|
|
51
57
|
return explicitWin ? `claude ${explicitWin}` : 'claude';
|
|
52
58
|
}
|
|
@@ -75,7 +81,7 @@ function shortenBucketLabel(rawKey, resetSec = 0) {
|
|
|
75
81
|
}
|
|
76
82
|
function bucketPool(key) {
|
|
77
83
|
const k = key.toLowerCase();
|
|
78
|
-
if (k.includes('claude') || k.includes('sonnet') || k.includes('opus') || k.includes('haiku') || k.includes('gpt'))
|
|
84
|
+
if (is3pKey(k) || k.includes('claude') || k.includes('sonnet') || k.includes('opus') || k.includes('haiku') || k.includes('gpt'))
|
|
79
85
|
return 'claude';
|
|
80
86
|
if (k.includes('argon'))
|
|
81
87
|
return 'argon';
|
|
@@ -83,7 +89,7 @@ function bucketPool(key) {
|
|
|
83
89
|
return 'gemini';
|
|
84
90
|
return 'other';
|
|
85
91
|
}
|
|
86
|
-
function isActiveModelBucket(key, data) {
|
|
92
|
+
function isActiveModelBucket(key, data, hasExplicitArgonBucket = false) {
|
|
87
93
|
const k = key.toLowerCase();
|
|
88
94
|
const mName = (data.model?.display_name ?? '').toLowerCase();
|
|
89
95
|
const mId = (data.model?.id ?? '').toLowerCase();
|
|
@@ -94,7 +100,11 @@ function isActiveModelBucket(key, data) {
|
|
|
94
100
|
return true;
|
|
95
101
|
}
|
|
96
102
|
// If active model is Sonnet/Opus and bucket is a shared Claude/GPT pool
|
|
97
|
-
if ((mName.includes('claude') || mName.includes('sonnet') || mName.includes('opus')) && bucketPool(key) === 'claude') {
|
|
103
|
+
if ((mName.includes('claude') || mName.includes('sonnet') || mName.includes('opus') || mName.includes('gpt')) && bucketPool(key) === 'claude') {
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
// Native Gemini model (including Gemini 4 Argon when no dedicated argon bucket exists) uses the Gemini pool
|
|
107
|
+
if (mName.includes('gemini') && (!mName.includes('argon') || !hasExplicitArgonBucket) && bucketPool(key) === 'gemini') {
|
|
98
108
|
return true;
|
|
99
109
|
}
|
|
100
110
|
return false;
|
|
@@ -105,12 +115,20 @@ function extractLimits(data) {
|
|
|
105
115
|
if (data.quota && typeof data.quota === 'object') {
|
|
106
116
|
const entries = Object.entries(data.quota)
|
|
107
117
|
.filter(([, bucket]) => bucket && typeof bucket === 'object' && !bucket.disabled);
|
|
118
|
+
const hasExplicitArgonBucket = entries.some(([k]) => bucketPool(k) === 'argon');
|
|
108
119
|
// Sort active model's bucket first, then prefer showing distinct pools (Gemini/Argon + Claude), then by highest utilization
|
|
109
120
|
entries.sort(([keyA, a], [keyB, b]) => {
|
|
110
|
-
const actA = isActiveModelBucket(keyA, data) ? 1 : 0;
|
|
111
|
-
const actB = isActiveModelBucket(keyB, data) ? 1 : 0;
|
|
121
|
+
const actA = isActiveModelBucket(keyA, data, hasExplicitArgonBucket) ? 1 : 0;
|
|
122
|
+
const actB = isActiveModelBucket(keyB, data, hasExplicitArgonBucket) ? 1 : 0;
|
|
112
123
|
if (actA !== actB)
|
|
113
124
|
return actB - actA;
|
|
125
|
+
if (actA && actB) {
|
|
126
|
+
// Within the active pool, show the short window (5h) before the weekly one
|
|
127
|
+
const weeklyA = /weekly|7d/i.test(keyA) ? 1 : 0;
|
|
128
|
+
const weeklyB = /weekly|7d/i.test(keyB) ? 1 : 0;
|
|
129
|
+
if (weeklyA !== weeklyB)
|
|
130
|
+
return weeklyA - weeklyB;
|
|
131
|
+
}
|
|
114
132
|
const pctA = typeof a.remaining_fraction === 'number' ? (1 - a.remaining_fraction) * 100 : (a.used_percentage ?? 0);
|
|
115
133
|
const pctB = typeof b.remaining_fraction === 'number' ? (1 - b.remaining_fraction) * 100 : (b.used_percentage ?? 0);
|
|
116
134
|
return pctB - pctA;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agy-statusblocks",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Opinionated, adaptive block-based status line for Antigravity CLI (agy) with bin-packing layout, rate limit tracking, and live agent telemetry",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|