Repository navigation
feat(prices): add Hydrogen/Fable 5.2 rates, retire Credits and compact catalog - #81
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.<
327A
span class="js-unchanged-suggestion">This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景与问题
上游近期全量上线了
gemini-4-hydrogen、claude-fable-5-2、claude-haiku-5-5、gpt-image-2.6-sunburst、gpt-image-2.6-flare与glm-5.3,原内置价目表尚未收录,且 Antigravity 新增了xhigh思考档位后缀。同时原有的 2,700 余行手写 JSON 价目表维护重复度极高,而仅覆盖部分模型的 Codex 订阅Credits已失去实际参考意义,还会导致仅含美元估值的请求被标为unpriced。主要变更
src/collector/agy.ts补齐gemini-4-hydrogen(含枚举1525..1528及xhigh后缀)、gemini-3.5-flash-lite、gemini-3.8-flash-tiered及相关模型枚举与显示名归一映射。prices/catalog.ts、生成校验脚本scripts/build-prices.ts(bun run prices:build)与上游目录对账脚本scripts/sync-prices.ts(bun run prices:check),生成单一定名内置表prices/meterleaf.json(meterleaf@2026-11-13.1),清理不再引用的历史 JSON 文件。gemini-4-hydrogen、gemini-3.5-flash-lite、claude-fable-5-2(含快速模式)、claude-haiku-5-5(含 API>100K分档)、gpt-image-2.6-sunburst、gpt-image-2.6-flare与glm-5.3官方费率。Credits费率、趋势单位切换项、报表列与详情抽屉行,修正src/server/snapshot.ts请求计价状态判定,同时保持 SQLite 存储层与priceBookSchema兼容现有历史账本。验证结果
bun scripts/build-prices.ts --check与bun run prices:check通过,重构前后 144 条美元规则深等比对一致。bun run typecheck、bun test tests(85 个文件共 628 项测试)、bun run build与 Prettier 检查全部通过。bun run test:browser在桌面端(1440x1000)与移动端(390x844)浅色、深色及减少动态效果模式下全部通过。