feat(quota): add Wafer.ai quota provider (#1312)
* feat(quota): add Wafer.ai quota provider - New provider: wafer.js fetches from https://pass.wafer.ai/v1/inference/quota - Auth: reads wafer/wafer-ai/wafer_ai keys from auth file - Timeout: AbortSignal.timeout(15_000) with timeoutSignal.aborted detection - Response: parses remaining/limit/overage/usedPercent/window_end/plan_tier - valueLabel: planTier + remaining/limit + overage suffix - Window: 5h (18000s) via resolveWindowLabel - Cross-runtime: added to web registry, UI types, VS Code dispatcher * fix(quota): wafer provider fixes — auth alias, decompression, logo - Add 'wafer.ai' auth alias to match actual auth key format - Use 'Accept-Encoding: identity' header to fix Bun fetch decompression issue with Cloudflare-backed responses - Match copilot valueLabel format: 'planTier · X / Y left' - Add wafer logo alias so Providers and Usage pages resolve to the same wafer.ai logo from models.dev * style(quota): fix indentation of timeoutSignal declaration * fix(quota): derive window duration from API instead of hardcoding Compute windowSeconds from window_end - window_start timestamps, with WAFER_WINDOW_SECONDS (5h) as fallback if timestamps are missing. --------- Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
committed by
GitHub
co-authored by
Bohdan Triapitsyn
parent
6970cb45c0
commit
4cfe7c80a3
@@ -20,6 +20,7 @@ import * as zhipuaiCodingPlan from './zhipuai-coding-plan.js';
|
||||
import * as minimaxCodingPlan from './minimax-coding-plan.js';
|
||||
import * as minimaxCnCodingPlan from './minimax-cn-coding-plan.js';
|
||||
import * as ollamaCloud from './ollama-cloud.js';
|
||||
import * as wafer from './wafer.js';
|
||||
|
||||
const registry = {
|
||||
claude: {
|
||||
@@ -99,6 +100,12 @@ const registry = {
|
||||
providerName: ollamaCloud.providerName,
|
||||
isConfigured: ollamaCloud.isConfigured,
|
||||
fetchQuota: ollamaCloud.fetchQuota
|
||||
},
|
||||
wafer: {
|
||||
providerId: wafer.providerId,
|
||||
providerName: wafer.providerName,
|
||||
isConfigured: wafer.isConfigured,
|
||||
fetchQuota: wafer.fetchQuota
|
||||
}
|
||||
};
|
||||
|
||||
@@ -158,4 +165,5 @@ export const fetchNanoGptQuota = nanogpt.fetchQuota;
|
||||
export const fetchMinimaxCodingPlanQuota = minimaxCodingPlan.fetchQuota;
|
||||
export const fetchMinimaxCnCodingPlanQuota = minimaxCnCodingPlan.fetchQuota;
|
||||
export const fetchOllamaCloudQuota = ollamaCloud.fetchQuota;
|
||||
export const fetchWaferQuota = wafer.fetchQuota;
|
||||
export const fetchZhipuaiQuota = zhipuaiCodingPlan.fetchQuota;
|
||||
|
||||
Reference in New Issue
Block a user