fix(provider/moonshotai): preserve complete raw usage objects (#19623)
Closes #19619 Stacked on #19613; the base will advance with the Moonshot parity stack. ## Summary - parse Moonshot usage and known token-detail objects with loose schemas - preserve future provider-specific top-level and nested fields in `usage.raw` - keep normalized input, cache, output, and reasoning counts unchanged - cover normal and streaming responses with regression tests ## Verification - `pnpm --filter @ai-sdk/moonshotai test:node` (178 passed) - `pnpm --filter @ai-sdk/moonshotai test:edge` (178 passed) - `pnpm --filter @ai-sdk/moonshotai type-check` - `pnpm type-check:full` - `pnpm check` ## Backports - v6: applicable after this PR merges - v5: not applicable because `LanguageModelV2Usage` has no `raw` field
G
Gregor Martynus committed
87b49a2873fb89378264c3f1ac16dd4b58638182
Parent: 9921a2f
Committed by GitHub <noreply@github.com>
on 8/26/2026, 6:36:58 PM