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:
Lam Nguyen
2026-05-19 17:29:36 +03:00
committed by GitHub
co-authored by Bohdan Triapitsyn
parent 6970cb45c0
commit 4cfe7c80a3
8 changed files with 274 additions and 3 deletions
+2
View File
@@ -23,6 +23,8 @@ const LOGO_ALIAS = new Map<string, string>([
['evroc-ai', 'evroc'],
['evrocai', 'evroc'],
['ollama-cloud', 'ollama'],
['wafer-ai', 'wafer.ai'],
['wafer', 'wafer.ai'],
]);
const normalizeProviderId = (providerId: string | null | undefined) => {