mirror of
https://github.com/HeyPuter/puter.git
synced 2026-11-25 23:27:39 +00:00
MeteringService knew about AI: it built the cost-factor facade, resolved the `ai.cost.factor.*` hook and, since the previous commit, offered `reserveAiCredits`. Metering stays agnostic to what it meters, so all of that now lives with the AI drivers in `drivers/util/aiCostFactor.ts`. `withAiCostFactor(metering, events, driver)` returns an `AiMeteringService`: the service with recording scaled by the factor, plus `costFactor` and `reserveAiCredits` for gates. The speech providers take that type. MeteringService itself has no AI methods left. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>