agy-statusblocks 0.1.3 → 0.1.4
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 +19 -2
- 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';
|
|
@@ -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 uses the Gemini pool (but not the separate Argon pool)
|
|
107
|
+
if (mName.includes('gemini') && !mName.includes('argon') && bucketPool(key) === 'gemini') {
|
|
98
108
|
return true;
|
|
99
109
|
}
|
|
100
110
|
return false;
|
|
@@ -111,6 +121,13 @@ function extractLimits(data) {
|
|
|
111
121
|
const actB = isActiveModelBucket(keyB, data) ? 1 : 0;
|
|
112
122
|
if (actA !== actB)
|
|
113
123
|
return actB - actA;
|
|
124
|
+
if (actA && actB) {
|
|
125
|
+
// Within the active pool, show the short window (5h) before the weekly one
|
|
126
|
+
const weeklyA = /weekly|7d/i.test(keyA) ? 1 : 0;
|
|
127
|
+
const weeklyB = /weekly|7d/i.test(keyB) ? 1 : 0;
|
|
128
|
+
if (weeklyA !== weeklyB)
|
|
129
|
+
return weeklyA - weeklyB;
|
|
130
|
+
}
|
|
114
131
|
const pctA = typeof a.remaining_fraction === 'number' ? (1 - a.remaining_fraction) * 100 : (a.used_percentage ?? 0);
|
|
115
132
|
const pctB = typeof b.remaining_fraction === 'number' ? (1 - b.remaining_fraction) * 100 : (b.used_percentage ?? 0);
|
|
116
133
|
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.4",
|
|
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": {
|