@leo000001/opencode-quota-sidebar 1.13.0 → 1.13.2
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/quota_service.js +5 -6
- package/package.json +1 -1
package/dist/quota_service.js
CHANGED
|
@@ -30,11 +30,8 @@ export function createQuotaService(deps) {
|
|
|
30
30
|
: client.provider.list({
|
|
31
31
|
query: { directory: deps.directory },
|
|
32
32
|
throwOnError: true,
|
|
33
|
-
}))
|
|
34
|
-
|
|
35
|
-
const data = isRecord(response) && isRecord(response.data)
|
|
36
|
-
? response.data
|
|
37
|
-
: undefined;
|
|
33
|
+
})).catch(swallow('getProviderOptionsMap'));
|
|
34
|
+
const data = isRecord(response) && isRecord(response.data) ? response.data : undefined;
|
|
38
35
|
const list = Array.isArray(data?.providers)
|
|
39
36
|
? data.providers
|
|
40
37
|
: Array.isArray(data?.all)
|
|
@@ -66,7 +63,9 @@ export function createQuotaService(deps) {
|
|
|
66
63
|
const isValidQuotaCache = (snapshot) => {
|
|
67
64
|
// Guard against stale RightCode cache entries from pre-daily format.
|
|
68
65
|
if (snapshot.adapterID !== 'rightcode' || snapshot.status !== 'ok')
|
|
69
|
-
return
|
|
66
|
+
return !(snapshot.adapterID === 'anthropic' &&
|
|
67
|
+
snapshot.status === 'unsupported' &&
|
|
68
|
+
snapshot.note === 'oauth quota endpoint is not publicly documented');
|
|
70
69
|
if (!snapshot.windows || snapshot.windows.length === 0)
|
|
71
70
|
return true;
|
|
72
71
|
const primary = snapshot.windows[0];
|