@expiren/opencode-antigravity-auth 1.6.21 → 1.6.22
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/index.js +17 -3
- package/dist/index.js.map +2 -2
- package/dist/src/plugin/ui/auth-menu.d.ts.map +1 -1
- package/dist/src/plugin/ui/auth-menu.js +13 -1
- package/dist/src/plugin/ui/auth-menu.js.map +1 -1
- package/dist/src/plugin/ui/quota-status.d.ts.map +1 -1
- package/dist/src/plugin/ui/quota-status.js +10 -2
- package/dist/src/plugin/ui/quota-status.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1638,7 +1638,7 @@ function formatQuotaStatusBadge(status) {
|
|
|
1638
1638
|
return `${ANSI.yellow}[WAIT${suffix}]${ANSI.reset}`;
|
|
1639
1639
|
}
|
|
1640
1640
|
case "EXHAUSTED": {
|
|
1641
|
-
const suffix = status.waitMs ? ` resets in ${formatWaitDuration(status.waitMs)}` : "";
|
|
1641
|
+
const suffix = status.waitMs ? ` resets in ${formatWaitDuration(status.waitMs)}` : " resets in ?h";
|
|
1642
1642
|
return `${ANSI.red}[EXHAUSTED${suffix}]${ANSI.reset}`;
|
|
1643
1643
|
}
|
|
1644
1644
|
case "COOLDOWN": {
|
|
@@ -1664,7 +1664,7 @@ function formatQuotaStatusPlain(status) {
|
|
|
1664
1664
|
return `WAIT${suffix}`;
|
|
1665
1665
|
}
|
|
1666
1666
|
case "EXHAUSTED": {
|
|
1667
|
-
const suffix = status.waitMs ? ` resets in ${formatWaitDuration(status.waitMs)}` : "";
|
|
1667
|
+
const suffix = status.waitMs ? ` resets in ${formatWaitDuration(status.waitMs)}` : " resets in ?h";
|
|
1668
1668
|
return `EXHAUSTED${suffix}`;
|
|
1669
1669
|
}
|
|
1670
1670
|
case "COOLDOWN": {
|
|
@@ -1694,9 +1694,15 @@ function formatCachedQuotaWithStatus(cachedQuota) {
|
|
|
1694
1694
|
}
|
|
1695
1695
|
const pct = Math.round(Math.max(0, Math.min(1, value)) * 100);
|
|
1696
1696
|
const status = classifyGroupStatus(cachedQuota[key]);
|
|
1697
|
+
if (status.label === "READY" && pct >= 100) {
|
|
1698
|
+
return [];
|
|
1699
|
+
}
|
|
1697
1700
|
if (status.label === "READY") {
|
|
1698
1701
|
return [`${label} ${pct}%`];
|
|
1699
1702
|
}
|
|
1703
|
+
if (status.label === "EXHAUSTED") {
|
|
1704
|
+
return [`${label} ${formatQuotaStatusPlain(status)}`];
|
|
1705
|
+
}
|
|
1700
1706
|
return [`${label} ${formatQuotaStatusPlain(status)} ${pct}%`];
|
|
1701
1707
|
});
|
|
1702
1708
|
return entries.length > 0 ? entries.join(", ") : void 0;
|
|
@@ -1747,7 +1753,15 @@ async function showAuthMenu(accounts) {
|
|
|
1747
1753
|
{ label: "Configure models in opencode.json", value: { type: "configure-models" }, color: "cyan" },
|
|
1748
1754
|
{ label: "", value: { type: "cancel" }, separator: true },
|
|
1749
1755
|
{ label: "Accounts", value: { type: "cancel" }, kind: "heading" },
|
|
1750
|
-
...accounts.
|
|
1756
|
+
...accounts.slice().sort((a, b) => {
|
|
1757
|
+
const statusOrder = (acc) => {
|
|
1758
|
+
if (acc.isCurrentAccount) return 0;
|
|
1759
|
+
if (acc.status === "active") return 1;
|
|
1760
|
+
if (acc.status === "rate-limited") return 2;
|
|
1761
|
+
return 3;
|
|
1762
|
+
};
|
|
1763
|
+
return statusOrder(a) - statusOrder(b);
|
|
1764
|
+
}).map((account) => {
|
|
1751
1765
|
const statusBadge = getStatusBadge(account.status, account);
|
|
1752
1766
|
const currentBadge = account.isCurrentAccount ? ` ${ANSI.cyan}[current]${ANSI.reset}` : "";
|
|
1753
1767
|
const disabledBadge = account.enabled === false ? ` ${ANSI.red}[disabled]${ANSI.reset}` : "";
|