# Changelog v0.5.48 - 2026-07-15

### Added
- **Quota column across TUI and Web Dashboard** — users can now see remaining free quota directly in the model table when a provider exposes reliable telemetry. The column shows a percentage for monitorable providers, `N/A` for providers where quota cannot be monitored safely, and `-` when the provider is not configured.
- **Groq, Cerebras, and OpenRouter quota monitoring** — Groq and Cerebras are parsed from official rate-limit response headers, while OpenRouter continues to use its official key endpoint. Cerebras support includes both daily request headers and token-per-minute headers.
- **Shared `fcm-agent-core` package** (`packages/fcm-agent-core/`) — all scan, ranking, cache, daemon, API-key, and provider-descriptor logic now lives in one reusable core consumed by both the Pi and OpenCode adapters. The core emits *structured* progress events (`{ phase, percent, completed, total, activeModels, message }`) and contains **no rendering and no chalk** — each adapter renders its own way. Public API: `scanBestFcmModel`, `directScan`, `rankModels`, `createCacheStore`, `buildPiProviderDescriptor`, `buildOpenCodeProviderDescriptor`, `buildSmartRouterDescriptor`, and more.
- **Canonical `fcm-pi` adapter** (`packages/fcm-pi/`) and **canonical `fcm-opencode` adapter** (`packages/fcm-opencode/`) — the Pi and OpenCode host adapters, now containing only host-specific concerns (Pi status-bar renderer + `~/.pi/agent` disk writer; OpenCode config mutation + toasts + `shell.env`).
- **21 new unit tests** for the core (`test/fcm-agent-core.test.js`): SWE parsing, composite scoring + ranking, context-window parsing and the 16k agent safety floor, base-URL normalization, provider-ID prefixing, the Pi/OpenCode/router descriptor shapes, a **no-API-key-leak assertion** for OpenCode (keys are referenced via `{env:FCM_*_API_KEY}`), and the namespaced cache store (round-trip, TTL expiry, legacy fallback, context re-filtering).
- **Quota parser tests** for Groq and Cerebras header variants, covering request/day and token/minute quota shapes.

### Changed
- **Three-package layout under `packages/`.** The Pi adapter, OpenCode adapter, and shared core are now cleanly separated. Provider config shapes that were previously duplicated (the Pi provider shape existed both in runtime registration and in disk writes) are now centralized in `buildPiProviderDescriptor` / `buildOpenCodeProviderDescriptor`.
- **Cross-tool cache.** Cache is now a shared `createCacheStore({ filePath, legacyPaths, ttlMs })`; the OpenCode adapter falls back to the Pi cache location, so a scan done in one tool benefits the other.
- **Rendering decoupled from scanning.** The direct scanner no longer imports chalk or builds ANSI. The branded `> free-coding-models` Pi footer badge (exact TUI header green/white-on-black) now lives in the Pi renderer (`packages/fcm-pi/lib/pi-progress-renderer.js`), where it belongs.
- **`pi-extension/` and `opencode-plugin/` are now thin compat wrappers** that re-export from `packages/fcm-pi` and `packages/fcm-opencode` respectively, so existing local-path/symlink installs keep loading unchanged. The moved `lib/` code was deleted (now in the core + adapters).
- README updated with the new **Agent extensions architecture** section and corrected package links.
- `pnpm test` now runs `test/fcm-agent-core.test.js` alongside `test/test.js`.
- Provider quota capability metadata now only marks providers as percent-monitorable when they have verified telemetry, preventing misleading quota values for NVIDIA, OpenCode Zen, Routeway, and other unknown providers.

### Fixed
- Eliminates the provider-shape duplication flagged in `.kandown/tasks/t2.md`: Pi runtime registration and `~/.pi/agent/models.json` disk writes now share one descriptor builder, so they can never drift apart.

### Notes
- The adapters remain **BETA** and are still installed via local path / symlink (not via the npm `free-coding-models` package). Local use needs a one-time self-link: `cd packages && mkdir -p node_modules && ln -s ../../ node_modules/free-coding-models` (documented in `packages/fcm-agent-core/README.md`; same trick the legacy `pi-extension/` already used).
- Task `t2` (*« Mutualiser FCM-Pi et créer fcm-opencode »*) is now **Done** — all acceptance criteria and the definition of done are met. Deliberately deferred to v1.1: npm publishing of the sub-packages, OpenCode custom `tool` definitions (v1 uses command hooks), TypeScript build for `fcm-opencode` (kept JS + JSDoc), and unifying `src/core/endpoint-installer.js` onto the shared descriptor builders.
