Repository navigation
Conversation
This branch has not been deployed
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.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.
Closes #231
背景
2026-09-22 起 Token Plan 个人版取消 5 小时 / 周限额,usage API 只返回
per1MonthPercentage/per1MonthResetTime。2.2.0 已把字段映射切到月度窗口,但仍是写死字段名;且无数据时--output json返回裸{},下游无法区分「无数据」与正常结果。改动
bl usage token-plan遍历响应中实际存在的per<N><Hour|Day|Week|Month>(Percentage|ResetTime)字段,按时长升序渲染(5-hour quota/1-week quota/Monthly quota…),计量维度再变化时无需改代码。未返回任何窗口时仍渲染月度空态。hasQuotaData: boolean;原有per*字段名保持不变(纯增量,向后兼容)。无数据时输出{"hasQuotaData": false},不再是{}。没有使用unlimited之类的字段,因为 CLI 无法权威判断是否不限量。验证
vp check通过vp test run packages/commands/tests/token-plan-usage.test.ts packages/commands/tests/e2e/usage-token-plan.e2e.test.ts:17/17 通过(新增 5 小时 + 周多窗口、无数据 JSON 用例)pnpm -s bl usage token-plan --output json返回上面的月度结果